How likhitha-poojary/vegetable-chemical-detection works
This repository is a produce-freshness classification and sorting project, with image-only and image-plus-sensor model workflows. The live workflow captures produce on camera, classifies it with a TFLite model, and actuates a conveyor rejection gate for confident rotten predictions. Training and evaluation are separate workflows. The README is empty; several scripts are represented only by their filenames, so their internal behavior and wiring are not inferred.
Main entry points: split_dataset Image splits · vegetable_classifier_mobilenetv2.keras MobileNetV2 model · collect_real_dataset.py Capture labeled samples · vegetable_classifier.tflite TFLite classifier
Components 19
Data collection
- Public images
public_dataset - Capture labeled samples
collect_real_dataset.py - Split image dataset
split_dataset.py - Image splits
split_dataset - Generate sensor records
generate_multimodal_dataset.py - Multimodal records
multimodal_records
Model development
- Train image classifier
train_model.py - Train sensor fusion
train_multimodal_fusion.py - MobileNetV2 model
models/vegetable_classifier_mobilenetv2.keras - Convert to TFLite
convert_tflite.py - TFLite classifier
models/vegetable_classifier.tflite
Classification
- Classify image
predict.py - Evaluate classifier
evaluate_and_plot.py - Benchmark latency
benchmark_latency.py
Sorting hardware
- Live sorting pipeline
main_sorting_pipeline.py
Other components
- Operator
- Camera
- Physical sensors
- Conveyor and gate
Connections 21
- Operator → Capture labeled samples: selects samples
- Camera → Capture labeled samples: provides frames
- Physical sensors → Capture labeled samples: provides readings
- Capture labeled samples → Train sensor fusion: writes CSV for
- Public images → Split image dataset: source images
- Split image dataset → Image splits: writes splits
- Image splits → Train image classifier: training data
- Image splits → Generate sensor records: image inputs
- Generate sensor records → Multimodal records: writes records
- Multimodal records → Train sensor fusion: records data
- Train image classifier → MobileNetV2 model: saves model
- MobileNetV2 model → Classify image: loads model
- MobileNetV2 model → Evaluate classifier: loads model
- Image splits → Evaluate classifier: test images
- MobileNetV2 model → Convert to TFLite: conversion input
- Convert to TFLite → TFLite classifier: produces model
- Camera → Live sorting pipeline: streams frames
- TFLite classifier → Live sorting pipeline: loads model
- Live sorting pipeline → Conveyor and gate: controls gate
- TFLite classifier → Benchmark latency: loads model
- Image splits → Benchmark latency: test images