Automated banana ripeness detection combining CNN and color analysis for real-time assessment.
Determines banana ripeness objectively to reduce food waste and improve purchasing decisions.
Key Features:
- CNN binary classification (Ripe/Unripe)
- HSV color analysis for ripeness percentage (0-100%)
- Five-stage maturity assessment
- Real-time webcam processing
- Integrated predictions using confidence-weighted logic
git clone https://github.com/jennyjtang/banana_classification
cd banana_classification
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txtDownload the Ripe–Unripe Banana Dataset from this link
Place images in:
data_banana/
├── train/images/
├── val/images/
└── test/images/
Train the model:
python main.pyRun the live classification:
python live_classify.pybanana_classification/
├── src/
│ ├── cnn.py
│ ├── dataset.py
│ └── train.py
├── main.py
├── live_classify.py
├── color_analyzer.py
└── data_banana/
- Testing 4 Different CNN Models (custom vs Pretrained, Regularized + Dropout vs Un-optimized)
View comparison of models in ipynb file:
CNN.Exploration.ipynb- CNN Accuracy:
- Integrated system combines CNN + color analysis for fine-grained ripeness assessment
System detecting a banana with ripeness assessment showing ripeness classification (ripe), ripeness bucket (30-50%), and color distribution.
- I to toggle modes
- Q to quit
- Nora Amer
- Jen (Jenny) Tang
Rahman, M. M., & Al Faisal, S. M. (2021). Ripe–unripe banana dataset Data set.
AI tools (Claude) were used for conceptual understanding, debugging assistance, and implementation feedback. All core design decisions and experimental work were conducted by the project team.