A lightweight, accurate fruit ripeness classifier that distinguishes between unripe, ripe, and rotten fruits using only traditional machine learning techniques and hand-crafted features.
- 99.14% Test Accuracy using LightGBM (best model)
- Real-time predictions on fruit photo (Apple, Banana, Orange)
- Interactive web demo built with Streamlit
| Rank | Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|---|
| 1 | LightGBM | 99.14% | 99.15% | 99.14% | 99.15% |
| 2 | XGBoost | 99.09% | 99.09% | 99.09% | 99.09% |
| 3 | Random Forest | 98.32% | 98.32% | 98.32% | 98.31% |
| 4 | Decision Tree | 90.69% | 90.66% | 90.69% | 90.66% |
| 5 | KNN | 86.79% | 86.84% | 86.79% | 86.75% |
Best Model: LightGBM with 99.14% accuracy 🏆
- Source: Kaggle - Fruit Ripeness: Unripe, Ripe and Rotten
- Classes:
unripe,ripe,rotten(apples, bananas, oranges, etc.) - Thousands of images in train/test splits
Hand-crafted features extracted from each image:
- Color Features:
- Statistics (mean, std, percentiles) in HSV channels
- Normalized histograms in HSV and RGB (32 bins each)
- Texture Features:
- Uniform Local Binary Patterns (LBP) histogram
- Total: ~300–400 highly discriminative features per image
- K-Nearest Neighbors (KNN)
- Support Vector Machines (SVM - RBF & Poly)
- Decision Tree
- Random Forest
- AdaBoost
- XGBoost
- LightGBM
- Logistic Regression (Multinomial)
Interactive web app built with Streamlit:
- Upload any fruit photo
- Real-time feature extraction and prediction
- Displays class (Unripe/Ripe/Rotten) with confidence score
Try the deployed app here:
Fruit-Ripeness.streamlit.app
streamlit run app.py