This project was built as part of Flipkart Grid 4.0, focusing on detecting the freshness of fruits, vegetables, and leaves using computer vision and image processing techniques. The goal was to develop a system that could assess freshness levels based on visual cues like color, texture, and spoilage patterns.
- Freshness Detection: Classifies produce into five categories: 100% fresh, 75% fresh, 50% fresh, 25% fresh, and rotten.
- Computer Vision-Based Analysis: Uses OpenCV for real-time feature extraction and classification.
- Custom Dataset: Built a dataset of real images since publicly available datasets were not suitable for real-world application.
- Dynamic Spoilage Criteria: Applied different freshness assessment rules based on fruit and vegetable-specific spoilage patterns.
- Scalability: Designed the system to allow further integration with real-time market APIs for better accuracy.
- Languages: Python
- Libraries: OpenCV, NumPy, Pandas, Matplotlib
- Computer Vision
- Frameworks: Streamlit (for UI visualization)
- Image Preprocessing: Converts images to grayscale and applies edge detection to highlight spoilage features.
- Feature Extraction: Identifies spoilage based on visual cues like color fading, texture changes, and mold formation.
- Freshness Classification: Uses predefined thresholds for different produce types to determine freshness.
- User Interface: Displays classification results via a simple Streamlit web app.
- Successfully classified freshness levels with high accuracy on real-world test data.
The model was trained and tested on the following:
Fruits: 🍌 Banana
Vegetables: 🫑 Capsicum, 🥦 Broccoli, 🥬 Cauliflower
Leaves: 🌿 Pudina (Mint)
- Custom feature engineering was key to improving real-world classification accuracy.
- Rule-based classification worked better than deep learning models due to limited real-world training data.
- AI in grocery supply chains can help reduce food waste and improve inventory management.
Checkout the demo video here: Freshness Detection Demo
