Tomato Ripeness Detection: YOLOv11m
YOLOv11m fine-tuned to detect and classify tomatoes into three ripeness stages (unripe, semiripe, ripe) in real field images. Developed for the minor project Automatic Detection and Identification of Tomato Ripeness Stages Using YOLOv11 (Everest Engineering College, Pokhara University, 2026). The lighter companion model is YOLOv11s: kapilbelbase/tomato-ripeness-yolov11s.
Classes
| ID | Class | Description |
|---|---|---|
| 0 | unripe | Predominantly green |
| 1 | semiripe | Mixture of green, yellow, orange or pink |
| 2 | ripe | Fully red |
Results
Unseen data (test set, 87 images)
| Precision | Recall | F1 | mAP@0.5 | mAP@0.5:0.95 |
|---|---|---|---|---|
| 0.8233 | 0.6836 | 0.7469 | 0.8012 | 0.6577 |
Per class (test set):
| Class | Precision | Recall | mAP@0.5 | mAP@0.5:0.95 |
|---|---|---|---|---|
| unripe | 0.818 | 0.740 | 0.818 | 0.625 |
| semiripe | 0.882 | 0.504 | 0.726 | 0.613 |
| ripe | 0.770 | 0.807 | 0.860 | 0.735 |
Best F1 on the F1-confidence curve: 0.739 at confidence 0.56 (unripe 0.786 at 0.56, semiripe 0.682 at 0.27, ripe 0.796 at 0.59).
Seen data
| Precision | Recall | F1 | mAP@0.5 | mAP@0.5:0.95 |
|---|---|---|---|---|
| 0.8847 | 0.8449 | 0.8643 | 0.9050 | 0.7677 |
Efficiency (Tesla T4, 640×640)
| Inference | FPS | GFLOPs | Parameters |
|---|---|---|---|
| 32.35 ms/image | 30.9 | 67.66 | 20,032,345 |
Comparison with YOLOv11s (same dataset and hyperparameters)
| Model | mAP@0.5 | mAP@0.5:0.95 | Precision | Recall | GFLOPs | Params |
|---|---|---|---|---|---|---|
| YOLOv11s | 0.7960 | 0.6598 | 0.7868 | 0.7071 | 21.31 | 9.41M |
| YOLOv11m | 0.8012 | 0.6577 | 0.8233 | 0.6836 | 67.66 | 20.03M |
YOLOv11m gives the highest precision but only marginal accuracy gains over YOLOv11s at about 3× the compute. YOLOv11s is the better choice for edge deployment.
Usage
pip install ultralytics huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights = hf_hub_download("kapilbelbase/tomato-ripeness-yolov11m", "best.pt")
model = YOLO(weights)
results = model("tomato.jpg", conf=0.56, imgsz=640)
results[0].show()
A confidence threshold of 0.56 maximises F1 on this model. Lower it (e.g., 0.25) to detect more tomatoes, especially semiripe.
Training details
| Setting | Value |
|---|---|
| Base weights | yolo11m.pt (COCO pretrained) |
| Dataset | kapilbelbase/tomato-ripeness-yolo |
| Training images | 6,242 (567 originals + augmentation) |
| Validation / test images | 160 / 87 (not augmented) |
| Epochs | 100 max, early stopping (patience 20), stopped at about epoch 35 |
| Image size / batch | 640 × 640 / 16 |
| Optimizer | AdamW, lr0 = 0.001, lrf = 0.01, cosine schedule |
| Weight decay / warmup | 0.001 / 3 epochs |
| Hardware | Google Colab, Tesla T4 |
| Ultralytics version | <ULTRALYTICS_VERSION> |
Intended use
Research and education on ripeness detection in tomato crops; a baseline for precision-agriculture and edge-deployment studies.
Limitations
- Trained on about 800 original images from one location (Dadhikot, Bhaktapur, Nepal); may not generalise to other varieties, regions or seasons.
- The semiripe class is the weakest (test recall 0.504) because its colours overlap with unripe and ripe; about 30% of semiripe tomatoes are predicted as ripe.
- Green leaves are occasionally detected as unripe tomatoes.
- Not tested on edge hardware or live video in the field.
- Does not cover diseased, damaged or deformed fruit.
License
Model weights and code: AGPL-3.0 (inherited from Ultralytics YOLO). The dataset is released separately under CC BY 4.0.
Citation
@misc{tomato_ripeness_yolov11m_2026,
title = {Automatic Detection and Identification of Tomato Ripeness Stages Using YOLOv11},
author = {G.C., Aayush Bikram and Adhikari, Abishek and Belbase, Kapil Dev and Joshi, Rajendra Prasad},
year = {2026},
note = {Minor project, Everest Engineering College, Pokhara University},
url = {https://huggingface.co/kapilbelbase/tomato-ripeness-yolov11m}
}
Acknowledgements
Supervisor: Er. Anil Thapa. Thanks to the farmers and residents of Dadhikot, Bhaktapur for field access.