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.
- [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]
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.
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:
- MambaCoral-DiffDet Augmented Dataset
- We also provide 5 coral videos as part of the dataset. You can access and download them via the following Google Drive.
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 |
---|---|---|---|
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
This work builds upon the SCoralDet dataset and research, extending the capabilities of coral detection models by introducing advanced techniques and enhanced architectures.
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.
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.
You only need to import the .json file we provide and download the corresponding model weights to generate your own coral images.
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
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
To train the model from scratch or continue training, execute the following command:
python distill.py
After the training process is complete, validate the modelβs performance with the following command to check its accuracy and effectiveness:
python val.py
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!
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},
}
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
We welcome contributions to improve this dataset and code! Feel free to:
- Report issues or bugs.
- Submit pull requests for any enhancements.
- Email us directly at [luzhaoxuan@smail.fjut.edu.cn].
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.