CoolFace
Apppublic

Vishalbhave/CoralReef_Monitor_app

sourceHugging Facemitupdated 28d agoView on Hugging Face
0likes
App README

๐Ÿ  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

bash
git clone <repository-url>
cd coral-bleaching-detection
pip install -r requirements.txt

Running the App

bash
streamlit run bleaching_detect.py

Usage/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.

  1. 1.Enhanced Bleaching Detection: Uses precise RGB analysis to identify true white coloration rather than brownish discoloration
  2. 2.Comprehensive Habitat Analysis: Covers all 29+ benthic classes with interactive visualizations
  3. 3.Advanced Filtering: Separates coral classes for targeted bleaching analysis
  4. 4.Professional Visualization: Plotly-based charts with export capabilities
  5. 5.Production Ready: Optimized for Hugging Face Spaces deployment with proper error handling and caching