This project presents a deep learning pipeline for coral reef benthic classification using annotation-guided patch extraction and transfer learning.
Instead of classifying entire underwater reef images containing multiple coral categories, the dataset was transformed into single-label image patches using expert-provided annotation coordinates. This significantly improved label quality and enabled effective supervised learning.
A ResNet18 model was trained on a balanced dataset of 60,000 coral image patches and achieved 82.38% validation accuracy across six benthic classes.
- 418,310 coral annotations
- 2,455 annotated reef images
- Image Resolution: approximately 1116 × 906 pixels
- Multiple coral categories present within each image
The six most representative benthic classes were selected:
- Crustose Coralline Algae (CCA)
- Macroalgae
- Off
- Porites
- Sand
- Turf
- Patch Size: 224 × 224
- Total Patches: 60,000
- Classes: 6
- Samples per Class: 10,000
Coral annotation coordinates were extracted from the provided CSV annotations.
For every annotation:
- Annotation-centered crop
- Patch size: 224 × 224
- Label inherited from annotation class
An equal number of samples were selected for all six classes to prevent class imbalance.
- Horizontal Flip
- Vertical Flip
- Rotation
- Color Jitter
- ImageNet Normalization
Model:
- ResNet18 (Transfer Learning) Training Strategy:
- Phase 1: Train Classification Head
- Phase 2: Fine Tune Entire Network
| Metric | Value |
|---|---|
| Validation Accuracy | 82.38% |
| Macro F1 Score | 81.79% |
| Classes | 6 |
| Dataset Size | 60,000 Patches |
| Class | Accuracy |
|---|---|
| Crustose Coralline Algae | 54.90% |
| Macroalgae | 87.75% |
| Off | 93.65% |
| Porites | 92.20% |
| Sand | 93.70% |
| Turf | 72.10% |
Coral-Patch-Classification/
│
├── notebooks/
├── results/
├── images/
├── data_info/
└── README.md
- Python
- PyTorch
- OpenCV
- NumPy
- Pandas
- Matplotlib
- Scikit-learn
- Jupyter Notebook
- EfficientNet Comparison
- Coral Segmentation Models
- Attention-Based CNN Architectures
- Calibration Artifact Removal
- Larger Multi-Class Coral Classification




