Skip to content

A ML-based project that classifies fruits as fresh or rotten using image inputs. Built with TensorFlow/Keras(CNN model) and trained on a dataset of fresh and rotten fruits, the model achieves over 95% accuracy by recognizing key visual patterns like color, texture, and surface changes.

Notifications You must be signed in to change notification settings

Renu-code123/Fruit-freshness-Detection-using-Machine-Learning

Repository files navigation

Fruit-freshness-Detection-using-Machine-Learning

This project presents a deep learning-based solution to classify fruits as fresh or rotten using Convolutional Neural Networks (CNNs). The aim is to build an intelligent system that can identify the freshness of fruits based on image inputs.


📌 Project Overview:


  1. Built a CNN model using TensorFlow and Keras for binary classification.

2 . Trained the model on a dataset containing images of various fruits categorized as fresh or rotten


3 . Used Roboflow for image preprocessing, augmentation, and dataset pipeline generation.


🧠 Tech Stack

  1. Python 2.TensorFlow & Keras 3.NumPy
  2. Matplotlib
  3. VS Code (Development Environment)
  4. Streamlit (for web demo deployment)

📂 Dataset Collected and prepared using Roboflow.

Includes labeled images for:

Fresh Apple / Rotten Apple

Fresh Banana / Rotten Banana

Fresh Orange / Rotten Orange


CNN tasks:

  1. Upload raw images
  2. Apply augmentation techniques 3 . Export dataset in TensorFlow-compatible format

🧪 Model Architecture

Input Layer: Resized fruit images to 224x224

Convolutional Layers:

3 convolutional layers with MaxPooling

Flatten Layer

Dense Layer with Dropout (for regularization)

Output Layer: Softmax activation for multi-class classification


Model Parameters:

Loss Function: categorical_crossentropy

Optimizer: Adam

Evaluation Metric: Accuracy


✅ Results:

Achieved >90% accuracy on the validation dataset.

Accurately classifies images into fresh or rotten categories across all fruit types.

About

A ML-based project that classifies fruits as fresh or rotten using image inputs. Built with TensorFlow/Keras(CNN model) and trained on a dataset of fresh and rotten fruits, the model achieves over 95% accuracy by recognizing key visual patterns like color, texture, and surface changes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages