YOLOv8 Tomato Ripeness Detector
YOLOv8n model fine-tuned for real-time tomato ripeness detection in greenhouse environments. Detects and classifies tomatoes into three ripeness stages with 3D localisation via Intel RealSense D435.
Model Description
- Architecture: YOLOv8n (nano)
- Task: Object detection
- Input: 640×640 RGB image
- Classes: 3 (unripe, semi-ripe, fully ripe)
- Training epochs: 80
- Framework: Ultralytics
Classes
| ID | Class | Description |
|---|---|---|
| 0 | Unripe | Green tomato, not ready for harvest |
| 1 | Semi-ripe | Partially ripe tomato |
| 2 | Fully ripe | Red tomato, ready for harvest |
Performance
| Model | Epochs | Precision | Recall | mAP50 | mAP50-95 |
|---|---|---|---|---|---|
| YOLOv8n | 80 | 0.817 | 0.771 | 0.843 | 0.693 |
| YOLOv8s | 80 | 0.825 | 0.796 | 0.850 | 0.710 |
The nano model was selected for deployment due to its speed advantage with negligible accuracy trade-off.
Files
| File | Description |
|---|---|
model_hub_n.pt |
PyTorch model |
model_hub_n_int8_openvino_model/ |
OpenVINO INT8 quantised model |
Usage
from ultralytics import YOLO
model = YOLO("model_hub_n.pt")
results = model.track("image.jpg", conf=0.85)
With Intel RealSense D435 and full 3D localisation, see the GitHub repository.
Training Data
Custom dataset built from three public greenhouse tomato image sources, unified and preprocessed via Roboflow:
- Multi-source images covering different ripeness stages and lighting conditions
- Manual bounding box annotation per ripeness class
- Data augmentation: flipping, rotation, brightness adjustment, mosaic
- Training / validation / test split
OpenVINO Optimisation
An INT8 quantised version is available for optimised CPU inference using OpenVINO. Export from the PyTorch model:
model = YOLO("model_hub_n.pt")
model.export(format="openvino", int8=True)
License
MIT License
- Downloads last month
- 57
Evaluation results
- Precisionself-reported0.817
- Recallself-reported0.771
- mAP50self-reported0.843
- mAP50-95self-reported0.693