Skip to content

Payal-mak/Fruit-Ripeness-Detection_ML

Repository files navigation

Fruit Ripeness Detection Using Machine Learning

Streamlit App

A lightweight, accurate fruit ripeness classifier that distinguishes between unripe, ripe, and rotten fruits using only traditional machine learning techniques and hand-crafted features.

🚀 Project Highlights

  • 99.14% Test Accuracy using LightGBM (best model)
  • Real-time predictions on fruit photo (Apple, Banana, Orange)
  • Interactive web demo built with Streamlit

📊 Results Summary

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 🏆

🛠️ Methodology

1. Dataset

2. Feature Engineering (Classical Approach)

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

3. Models Evaluated

  • K-Nearest Neighbors (KNN)
  • Support Vector Machines (SVM - RBF & Poly)
  • Decision Tree
  • Random Forest
  • AdaBoost
  • XGBoost
  • LightGBM
  • Logistic Regression (Multinomial)

4. Deployment

Interactive web app built with Streamlit:

  • Upload any fruit photo
  • Real-time feature extraction and prediction
  • Displays class (Unripe/Ripe/Rotten) with confidence score

🚀 Live Demo

Try the deployed app here:
Fruit-Ripeness.streamlit.app

Run the Streamlit App

streamlit run app.py

About

A Fruit Ripeness Detection project that uses machine learning algorithms to identify the ripeness level of fruits from images. Built using Kaggle Dataset, it classifies fruits into stages like unripe, ripe, and overripe to help automate quality assessment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors