Vishalbhave/CoralReef_Monitor_app
๐ Coral Reef Bleaching Detection System
An advanced AI-powered application for automated coral reef health assessment using computer vision and deep learning.
๐ Features
๐ Advanced Detection
- Benthic Habitat Classification: Identifies 29+ marine habitat types
- Coral Species Detection: Focuses on key coral species (AC, CB varieties)
- Intelligent Bleaching Analysis: Uses refined RGB color analysis to detect true coral bleaching
- Dual Processing: Supports both standard YOLO and SAHI for large image analysis
๐ Comprehensive Visualization
- Interactive Charts: Plotly-powered visualizations for coverage and bleaching data
- Real-time Analysis: Live processing with progress indicators
- Export Capabilities: Download results as CSV files
- Multi-tab Interface: Organized results display
๐ค AI Models Supported
- YOLO (Ultralytics): Fast detection for standard images
- SAHI: Advanced sliced inference for high-resolution underwater imagery
- Custom Models: Support for custom-trained coral detection models
๐ Quick Start
Installation
git clone <repository-url>
cd coral-bleaching-detection
pip install -r requirements.txtRunning the App
streamlit run bleaching_detect.pyUsage/Examples
โ๏ธ Workflow
- ๐ท Upload a coral reef image (JPG, PNG)
- โ๏ธ Configure model settings in sidebar
- ๐ค Choose detection method (Normal YOLO or SAHI)
- ๐ View results in interactive tabs
- ๐ฅ Download analysis data
๐ท๏ธ Supported Classes
๐ Coral Classes (Bleaching Analysis)
AC Group: ACB, ACD, ACSM, ACT (Acropora corals)
Other Corals: CB, CBPOI, CBPOR, CB_STY, CE, CF, CM, CME, CS (Non-Acropora corals)
๐ Benthic Classes (Coverage Analysis)
Complete marine habitat classification including:
Algae (ALG), Anemones (ANE), Ascidians (ASC) Dead Coral (DCA, DCACB), Echinoderms (ECHSF) Sponges (POI, SC), Rubble (rrubble), Sand (ssand) And more...
๐ฌ Bleaching Detection Algorithm
Advanced White Detection The system uses sophisticated RGB analysis to identify true coral bleaching:
Status Classification
- ๐ข Healthy: <10% white pixels
- ๐ก Mildly Bleached: 10-25% white pixels
- ๐ Moderately Bleached: 25-40% white pixels
- ๐ด Severely Bleached: >40% white pixels
๐ ๏ธ Technical Architecture
Image Processing Pipeline
Image Enhancement: CLAHE + Gaussian blur for underwater imagery
- Detection: YOLO/SAHI model inference
- Classification: Benthic habitat identification
- Analysis: Coral-specific bleaching assessment
- Visualization: Interactive charts and statistics
Model Requirements
- Trained YOLO model (.pt format)
- Classes must include coral and benthic categories
- Recommended input size: width = 640 pixels
๐ Performance Features
- Caching: Streamlit caching for model loading
- Progress Tracking: Real-time processing updates
- Memory Optimization: Efficient image processing
- Responsive UI: Mobile-friendly interface
๐ Output Data
Benthic Coverage Data
Class names and percentages Category groupings (Coral vs. Other) Detection counts and confidence scores
Bleaching Analysis Data
Individual coral class assessment Aggregated coral health metrics Spatial coverage percentages Bleaching severity classifications
๐ง Configuration
Model Settings
- Confidence Threshold: Adjust detection sensitivity (0.1-1.0)
- IoU Threshold: Control overlapping detections (default: 0.70)
- Device: CPU/GPU selection (auto-detected)
SAHI Parameters
- Slice Size: 480x640 pixels (optimized for coral imagery)
- Overlap Ratios: Configurable for different image types
- Post-processing: GREEDYNMM for optimal results
๐ค Contributing
Contributions are always welcome! Please adhere to this project's code of conduct.
We welcome contributions! Please see our contributing guidelines for:
- Code standards and formatting
- Testing requirements
- Data for model training
- Documentation updates
- Feature requests and bug reports
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Roboflow team for the set of free, wonderful and easy to use Image annotation tools
- Ultralytics YOLO team for the detection framework
- SAHI developers for advanced inference capabilities
- Streamlit team for the excellent web app framework
- Huggingface for enabling easy create and deploy ML-powered demos in minutes
- [SCF, Pune](https://the-scf.org) - My organization to allowed me to do research on coral reefs
- Forest Department, Lakshadweep and its staff
- Lakshadweep Administration
๐ Support
For questions, issues, or feature requests and support:
- email: vishalbhave@gmail.com
Made with โค๏ธ for coral reef conservation ๐ ๐
Documentation
This refined solution provides: The system now accurately distinguishes between healthy coral coloration and genuine bleaching events using sophisticated color analysis algorithms.
- Enhanced Bleaching Detection: Uses precise RGB analysis to identify true white coloration rather than brownish discoloration
- Comprehensive Habitat Analysis: Covers all 29+ benthic classes with interactive visualizations
- Advanced Filtering: Separates coral classes for targeted bleaching analysis
- Professional Visualization: Plotly-based charts with export capabilities
- Production Ready: Optimized for Hugging Face Spaces deployment with proper error handling and caching
