🗡️ This project is a Freshness Detector built using TensorFlow Lite, which classifies fruits and vegetables as either fresh or stale. The model is trained to identify six types of items in both fresh and stale states.
The model supports the following classes:
-
Fresh Items:
- fresh_apple
- fresh_banana
- fresh_bitter_gourd
- fresh_capsicum
- fresh_orange
- fresh_tomato
-
Stale Items:
- stale_apple
- stale_banana
- stale_bitter_gourd
- stale_capsicum
- stale_orange
- stale_tomato
This project uses TensorFlow Lite to build a machine learning model for mobile or edge devices, which can detect the freshness of specific fruits and vegetables based on visual input. The classifier can distinguish between fresh and stale states of apples, bananas, bitter gourds, capsicums, oranges, and tomatoes.
- Real-time Detection: Use the trained model to detect and classify the freshness of items through images.
- Optimized for Mobile: TensorFlow Lite allows this model to run efficiently on mobile and embedded devices.
- Scalability: The model can be extended to include more fruits or vegetables by retraining with additional data.
- Data Preparation: Images of fresh and stale fruits/vegetables are used to train the model. Each image is labeled with one of the 12 classes listed above.
- Model Training: The TensorFlow model is trained and then converted to a TensorFlow Lite format for optimized deployment on mobile devices.
- Inference: Given an image, the model classifies it into one of the 12 categories (fresh or stale).
-
Clone the repository:
git clone https://github.com/yourusername/freshness-detector.git
-
Use the trained model for inference on new images of fruits and vegetables to determine if they are fresh or stale.
The model was trained using TensorFlow and later converted to TensorFlow Lite format for mobile deployment:
tflite_convert --output_file=model.tflite --graph_def_file=model.pb