Skip to content

RDXiaoLu/MambaCoral-DiffDet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

A Diffusion Model and Knowledge Distillation Framework for Robust Coral Detection in Complex Underwater Environments

Dataset Download License Hugging Face Model
PWC


πŸ“ Project Overview

MambaCoral-DiffDet (MMCD) is a robust diffusion model and knowledge distillation framework designed for coral detection in complex underwater environments. It enhances coral recognition accuracy and efficiency by incorporating state-of-the-art generative models. The code for MambaCoral-DiffDet will be made publicly available once our paper is accepted.


πŸ“… Recent Updates

  • [2025/03/20]: We have fully open-sourced the code for the MCDD framework. We welcome everyone to try and apply it to their own research! 😊
  • [2025/03/18]: We are excited to have achieved state-of-the-art performance on the SCoralDet dataset. πŸŽ‰
  • [2025/03/15]: We have added 5 coral videos to enrich the dataset and provide additional resources for your research Google Drive.
  • [2025/03/11]: Integrated the DGM(Diffusion Model-Driven Data Generation Module) ComfyUI workflow as a .json file along with the visual representation of the workflow for easier implementation!
  • [2024/11/20]: We've opened up our dataset! [MCDD-Dataset]

πŸ“‚ Dataset Information

Original Dataset

The original dataset used in this project is available at the following link:

This dataset contains images from six coral species: Euphylliaancora, Favosites, Platygyra, Sarcophyton, Sinularia, and Wavinghand, collected from the Coral Germplasm Conservation and Breeding Center at Hainan Tropical Ocean University.

Augmented Dataset

Using the MambaCoral-DiffDet model's DGM structure, we have created an augmented dataset. The dataset now contains 1,204 images, representing an 86% increase in image quantity while using only 18% of the original images. This augmentation helps improve the robustness of coral detection models by providing a more diverse set of training images.

You can download the augmented dataset here:


Dataset Preview

To showcase the diversity of generated images, here are multiple augmented versions of the same coral species generated by the DGM (Data Generation Module).

Original Image Generated Image 1 Generated Image 2 Generated Image 3
Original Euphylliaancora Augmented Euphylliaancora Augmented Euphylliaancora Augmented Euphylliaancora
Original Platygyra Augmented Platygyra Augmented Platygyra Augmented Platygyra
Original Sarcophyton Augmented Sarcophyton Augmented Sarcophyton Augmented Sarcophyton
Original Wavinghand Augmented Wavinghand Augmented Wavinghand Augmented Wavinghand
Original Favosites Augmented Favosites Augmented Favosites Augmented Favosites

πŸ”— Connection with SCoralDet

This work builds upon the SCoralDet dataset and research, extending the capabilities of coral detection models by introducing advanced techniques and enhanced architectures.


πŸ“Š Performance Comparison of MambaCoral-DiffDet (MCDD) with SOTA Models

The table below shows a comparison of MambaCoral-DiffDet (MCDD) against state-of-the-art (SOTA) models, demonstrating its improved performance in terms of mAP, precision, recall, and computational efficiency.

Model mAP50 mAP(50-95) Precision Recall Parameters (M) GFLOPs
MambaYOLO 0.801 0.52 0.848 0.723 6.0 13.6
RT-DETR 0.816 0.546 0.881 0.770 42.0 129.6
YOLOv8 0.790 0.503 0.782 0.738 3.0 8.1
YOLOv9 0.788 0.521 0.875 0.681 2.0 7.6
YOLOv10 0.797 0.512 0.800 0.743 2.3 6.5
YOLOv11 0.799 0.518 0.847 0.735 2.6 6.3
MCDD (Ours) 0.843 0.566 0.876 0.750 6.5 13.6

Table: Comparison of MambaCoral-DiffDet (MCDD) with state-of-the-art performance models.


πŸ› οΈ How to use DGM

First make sure you can run ComfyUI, If not, complete the following steps:

git clone https://github.com/comfyanonymous/ComfyUI

In order to facilitate the use of academic workers and researchers, we used ComfyUI to build the DGM workflow. We provided the configuration file DGM_cfg.json, and its parameters and configuration are shown in the figure DGM_cfg.

DGM_cfg

You only need to import the .json file we provide and download the corresponding model weights to generate your own coral images.

βš™οΈ How to Use MambaCoral-DiffDet

1. Environment Setup

To begin, clone the repository to your local machine:

git clone https://github.com/RDXiaolu/MambaCoral-DiffDet.git  
cd MambaCoral-DiffDet  

Next, create a virtual environment to manage dependencies:

conda create -n MCDD python=3.9
conda activate MCDD

Now, install PyTorch along with its associated libraries. The following command installs the specific versions required for this project:

pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu121

Finally, install all other necessary dependencies listed in the requirements.txt file:

pip install -r requirements.txt

2. Inference

To perform inference using the model, run the following command. Make sure you have downloaded the necessary model weights prior to running this:

python detect.py

3. Training the Model

To train the model from scratch or continue training, execute the following command:

python distill.py

4. Model Validation

After the training process is complete, validate the model’s performance with the following command to check its accuracy and effectiveness:

python val.py

5. Model Heatmap Generation

Once training is finished, you can generate heatmaps to visualize the model's outputs and understand its predictions better. Use the following command:

python heatmap.py

If you have any questions, need further clarifications, or require assistance, please don’t hesitate to ask!

πŸ” Citation

If you find our work useful, please consider citing us or giving us a star ⭐.

@ARTICLE{lu2024scoraldet,  
         author={Lu, Zhaoxuan and Liao, Lyuchao and Xie, Xingang and Yuan, Hui},  
         title={SCoralDet: Efficient real-time underwater soft coral detection with YOLO},  
         journal={Ecological Informatics},  
         year={2024},  
         artnum={102937},  
         issn={1574-9541},  
         doi={10.1016/j.ecoinf.2024.102937},  
}  

🎯 Applications

This dataset and the MambaCoral-DiffDet framework can be used for :

  • Coral species detection and classification
  • Object detection in underwater environments
  • Data augmentation using diffusion models
  • Knowledge distillation for marine biology applications

✨ Contributions & πŸ“¬ Contact Us

We welcome contributions to improve this dataset and code! Feel free to:


πŸ™ Acknowledgments

We would like to express our gratitude to Ultralytics for their outstanding contributions to the field of computer vision and deep learning, which have greatly influenced our work.

Additionally, we want to thank Roboflow and their dataset available at Roboflow Universe - Coral-lwptl. Their resources have been invaluable in helping us develop and improve our model.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •