This project presents an end-to-end system for detecting whether a fruit is fresh or rotten using image-based classification, integrated into a real-time Android application.
The project focuses on building a practical system that combines data collection, model development, and deployment into a usable application. The objective is not only to develop a classification model but also to ensure that it works reliably under real-world conditions.
The application allows users to capture or upload images of fruits and receive classification results directly on a mobile device.
Manual inspection of fruit quality is often time-consuming, subjective, and inconsistent. This project aims to develop an automated system that can assist in identifying fruit quality using image data, with a focus on usability and efficiency.
The system follows a complete pipeline:
-
Data Collection A self-curated dataset was created by collecting fruit images from local markets under varying lighting conditions, backgrounds, and stages of decay.
-
Data Preprocessing Images were resized, normalized, and augmented using techniques such as rotation, scaling, and flipping to improve generalization.
-
Model Development A Convolutional Neural Network (CNN) was implemented using TensorFlow and Keras to extract features and perform classification.
-
Model Optimization The trained model was converted into TensorFlow Lite format to enable efficient deployment on mobile devices.
-
Mobile Application An Android application was developed using Java to integrate the model and perform real-time inference.
- Real-time image capture using the device camera
- Support for image upload from gallery
- On-device inference using TensorFlow Lite
- Fast and lightweight execution
- Simple and user-friendly interface
- Languages: Python, Java
- Frameworks: TensorFlow, Keras, TensorFlow Lite
- Tools: Android Studio
- Domain: Computer Vision, Mobile Systems
- Model Type: Convolutional Neural Network (CNN)
- Input Size: 128 × 128
- Training Accuracy: ~95%
- Validation Accuracy: ~92%
- Evaluation Metrics: Accuracy, F1-score
- The user captures or uploads an image.
- The image is preprocessed within the application.
- The TensorFlow Lite model performs inference on the device.
- The output is displayed as either "Fresh" or "Rotten" along with a confidence score.
The system performs well on both controlled and real-world inputs. It demonstrates good generalization across different lighting conditions and backgrounds, with minor limitations in visually ambiguous cases.
- Performance may degrade under extreme lighting conditions
- Difficulty handling multiple fruits in a single image
- Classification is based only on visible features
- Support for multiple fruit detection in a single frame
- Expansion to additional fruit categories
- Integration with cloud-based models for improved accuracy
- Extension to supply chain or quality monitoring systems
Devashish Dixit B.Tech Computer Science
This project was developed as part of a final-year undergraduate project, with a focus on building a complete and deployable system rather than only a standalone model.