Coffee Leaf Disease Detection — YOLOv12
ONNX exports from the MCA-IV thesis Comparative Analysis of YOLOv12 Model for
Coffee Leaf Disease Detection (S vs L) by Niroj Magar.
Intended for in-browser inference via ONNX Runtime Web — the models run on
the viewer's device, with no inference server.
Classes
Index order is significant and must be preserved by any consumer:
| Index | Class |
|---|
| 0 | rust |
| 1 | miner |
| 2 | phoma |
| 3 | cercospora |
| 4 | healthy |
Files
| File | Size | Parameters |
|---|
yolov12s.onnx | 37.3 MB | 9.23 M |
yolov12l.onnx | 105.9 MB | 26.34 M |
Specification
- Input
1x3x640x640, output (1, 9, 8400) = 4 box coords + 5 class scores
- Static batch size 1
- Exported with
opset=13, simplify=True, fp32
- Not int8 quantized — quantization corrupts output under WebGPU
Post-processing is not included in the graph: consumers must apply the
confidence filter, per-class NMS, and letterbox inversion themselves.
Results (from the thesis)
| Model | mAP50 | mAP50-95 | F1 | FPS (T4) |
|---|
| YOLOv12-s | 0.702 | 0.482 | 0.688 | 44.4 |
| YOLOv12-l | 0.682 | 0.465 | 0.660 | 28.9 |
YOLOv12-s outperforms YOLOv12-l on this dataset while being roughly 3x faster —
the larger model overfits limited, class-imbalanced data.
Datasets
BRACOL, RoCoLe, and a context-specific field-collected dataset (Letang);
5,992 images combined. Rust-heavy class imbalance is a documented limitation.
Limitations
- Trained on a rust-heavy, imbalanced dataset; per-class mAP50-95 for diseases
ranges 0.29-0.40, while
healthy reaches 0.96 and inflates the overall figure
- Not validated for coffee varieties or growing conditions outside the source datasets