A Machine Learning-based Fruit Freshness Detection system that classifies fruit images as Fresh or Rotten using handcrafted image features and multiple machine learning algorithms. The project compares model performance, automatically selects the best model, and provides predictions through a Streamlit web application.
- Image preprocessing and handcrafted feature extraction
- Multiple Machine Learning algorithms
- Random Forest
- Decision Tree
- Logistic Regression
- Model comparison
- Automatic best model selection
- Confusion Matrix visualization
- Performance evaluation
- Streamlit web application
- Best model saved for deployment
- Python
- OpenCV
- NumPy
- Pandas
- Scikit-learn
- Matplotlib
- Streamlit
- Joblib
Fruit_Freshness_ML_v2/
│
├── dataset/
├── features/
├── model/
│ └── best_model.pkl
├── screenshots/
├── utils/
├── app.py
├── feature_extraction.py
├── train_model.py
├── requirements.txt
├── comparison_results.csv
├── model_comparison.png
├── random_forest_confusion_matrix.png
├── decision_tree_confusion_matrix.png
├── logistic_regression_confusion_matrix.png
└── README.md
The following algorithms were trained and evaluated:
- Random Forest
- Decision Tree
- Logistic Regression
| Algorithm | Accuracy |
|---|---|
| Random Forest | 87.72% |
| Decision Tree | 81.58% |
| Logistic Regression | 73.68% |
Random Forest
Accuracy: 87.72%
- Accuracy
- Precision
- Recall
- F1-Score
- Classification Report
- Confusion Matrix
Run the application using:
streamlit run app.pyor
python -m streamlit run app.pypip install -r requirements.txtpython train_model.pyAyesha Shafique
GitHub: https://github.com/ayeshacs7
This project is developed for educational and portfolio purposes.



