This project focuses on classifying coral images into two categories: healthy corals and bleached corals. Various machine learning models are trained after extensive preprocessing and augmentation to improve classification performance.
The dataset includes coral images categorized into:
healthy_corals/bleached_corals/
Images are resized, preprocessed, and augmented to create a robust training set.
To run this project, make sure the following Python libraries are installed:
pip install numpy pandas matplotlib seaborn scikit-learn opencv-python Pillow tqdm
Each image undergoes the following preprocessing steps:
- π Resizing: All images resized to 64Γ64 pixels for consistency and reduced computation.
- π Duplicate Removal: Duplicate files detected and deleted to avoid bias.
- π Augmentation: Applied transformations like mirroring and rotation to increase dataset diversity.
- π Grayscale Conversion: Reduced color complexity to focus on structure.
- ποΈ Contrast & Brightness Adjustment: Enhanced visibility and balance across images.
We trained and optimized the following models using GridSearchCV:
- β Support Vector Machine (SVM)
- β Random Forest
- β K-Nearest Neighbors (KNN)
- β Logistic Regression
The models were evaluated on:
- Accuracy
- Precision
- Recall
- F1 Score
- Confusion Matrix
Each modelβs performance (including accuracy and precision) is printed during execution.
You can use this information to compare models and select the best one for your coral classification task.
The best-performing model can be selected based on validation scores and metric comparisons.
β Proper image preprocessing and augmentation significantly improved the model's ability to distinguish between healthy and bleached coral.