Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated Potato Leaf Disease Detection: A Comparative Study of YOLO26 and RT-DETR

Systematic evaluation of convolutional (YOLO26) and transformer-based (RT-DETR) object detection architectures
for automated identification of potato leaf diseases.

Official code repository for the paper: Automated Potato Leaf Disease Detection: A Comparative Study of YOLO26 and RT-DETR — [under review]


Abstract

This paper presents a systematic evaluation of YOLO26 convolutional neural networks and RT-DETR transformer-based architectures for automated detection of potato leaf diseases. Sixteen experimental configurations are evaluated on a dataset of 12,852 annotated images covering four categories: Alternaria solani, Phytophthora infestans (Lancha), Septoria sp., and healthy leaf (Sana). The best-performing model — YOLO26-N trained with an amplified bounding-box regression loss weight (BoxGain, box=15.0) at 1024 × 1024 px — achieves 98.9% mAP@50 and 98.1% mAP@50-95 on an independent test set of 306 images, outperforming the RT-DETR-L transformer baseline by +2.6 pp mAP@50 while requiring 29× fewer parameters (2.37 M vs 68 M). A resolution ablation study reveals that BoxGain induces catastrophic overfitting at 640 px (55.3% test mAP@50) due to coordinate memorisation under a sparse anchor grid, establishing 1024 px as the minimum viable resolution for this strategy. EigenCAM heatmaps confirm the model attends to disease lesion texture rather than background or leaf borders.


Overview

This study presents a deep learning pipeline for automated detection and classification of potato leaf diseases. Sixteen training configurations are evaluated across the YOLO26 convolutional family and the RT-DETR transformer architecture on a dataset of 12,852 annotated images, covering four categories: Alternaria solani, Phytophthora infestans (Lancha), Septoria sp., and healthy leaf (Sana).


Key Results

Model Architecture Params mAP@50 mAP@50-95 Precision Recall Size
Exp 12 · YOLO26-N Convolutional 2.37 M 98.9% 98.1% 97.0% 95.7% 5.2 MB
Exp 06 · RT-DETR-L Transformer 68 M 96.3% 95.8% 96.8% 97.7% 131 MB

Exp 12 (YOLO26-N) establishes a Pareto-optimal efficiency–accuracy trade-off: it outperforms the RT-DETR-L transformer baseline by +2.6 pp mAP@50 and +2.3 pp mAP@50-95 while requiring 29× fewer parameters. Inference latency: 5.84 ms per image (RTX 4070 Ti).

Note on scale: YOLO26-N (Nano, 2.37 M params) is compared against RT-DETR-L (Large, 68 M params) — the only RT-DETR variant with official Ultralytics pre-trained weights. The result is presented as an efficiency finding: a lightweight convolutional model outperforms a heavy transformer backbone on this agricultural detection task.

Visual Inference Gallery — Exp 12 · Test Set

Qualitative detection results — YOLO26-N BoxGain on the potato leaf test set, grouped by class
Qualitative detection results of Exp 12 (YOLO26-N, BoxGain) on the held-out test set. Rows group panels by ground-truth class — (a–e) Alternaria solani, (f–j) Phytophthora infestans, (k–o) healthy leaves, (p–t) Septoria sp. — with five seeded samples per class (seed=42) inferred at the training resolution (imgsz=1024, conf=0.25, iou=0.45). Labels show the predicted class code and confidence; colours are fixed per class (Okabe–Ito, colour-blind safe). Every drawn detection is logged to docs/figures/inference_gallery_v2_detections.csv.

Regenerating the gallery
# Figure above (journal layout, MDPI 17.5 cm full-page width)
python src/paper_gallery.py --web-png --web-png-max-width 1600
#   -> docs/figures/inference_gallery_v2.png   600 DPI master
#   -> docs/figures/inference_gallery_v2.pdf   vector, Arial embedded
#   -> docs/figures/inference_gallery_v2.svg
#   -> docs/figures/inference_gallery_v2_web.png   lightweight copy (shown above)

# Denser 4x5 mosaic variant
python src/inference_gallery.py --web-png

The image above is the downscaled web copy; the 600 DPI master and the vector PDF/SVG are the submission artefacts. Both scripts run real inference with the Exp 12 checkpoint — no detection is invented, repositioned, or filtered by confidence.

Per-Class Performance — Exp 12 · Test Set

Class Description Precision Recall F1 mAP@50 mAP@50-95
Alternaria Necrotic lesions — Alternaria solani 100.0% 96.7% 98.3% 99.4% 99.0%
Lancha Late blight — Phytophthora infestans 99.0% 94.8% 96.8% 99.2% 96.9%
Sana Healthy leaf 97.3% 95.0% 96.1% 98.9% 98.6%
Septoria Leaf spot — Septoria sp. 91.7% 96.4% 93.9% 98.1% 97.7%

Approach

Training Environment

Hardware configuration
Parameter Value
GPU NVIDIA GeForce RTX 4070 Ti (12 GB VRAM)
CUDA 12.1
Training time (Exp 12) 14h 19m 11s
Batch size 4
Input resolution 1024 × 1024 px

Best Model — Exp 12 · YOLO26-N · BoxGain (box=15.0)

The winning strategy — Geometric Box Precision — doubles the bounding-box regression loss weight (box=15.0 vs default 7.5), forcing the network to prioritise precise lesion localisation over classification confidence.

Full training configuration
from ultralytics import YOLO

model = YOLO("yolo26n.pt")
model.train(
    data="datasets/data.yaml",   # Relative path for reproducibility
    epochs=300,
    imgsz=1024,
    batch=4,

    # --- Optimizer & Learning Rate ---
    optimizer="AdamW",
    lr0=0.001,
    weight_decay=0.0005,
    warmup_epochs=3.0,
    cos_lr=True,
    label_smoothing=0.0,
    patience=50,

    # --- Geometric Box Precision (BoxGain Strategy) ---
    box=15.0,                    # Penalised at 2x the default weight
    cls=0.5,                     # Classification loss weight

    # --- Clean Augmentation Regime (FitWhite) ---
    mixup=0.0,
    copy_paste=0.0,
    mosaic=1.0,
)

Explainability — EigenCAM

EigenCAM heatmaps confirm the model attends to disease lesion texture rather than leaf borders or background. The backbone SPPF layer (model.model[9]) is used as the CAM target: BoxGain causes neck layers to specialise in edge detection, making backbone layers the correct locus for semantic disease features.


Ablation Study — Resolution Sensitivity of BoxGain

Experiment Resolution Anchors mAP@50 mAP@50-95 Verdict
Exp 12 1024 px 21,504 98.9% 98.1% Optimal
Exp 14 800 px 13,125 98.4% 74.3% Degraded localisation
Exp 15 640 px 8,400 55.3% 39.4% Catastrophic failure

The BoxGain strategy exhibits a two-stage degradation under reduced resolution:

  • 800 px (Exp 14): mAP@50 holds (98.4%) but mAP@50-95 collapses to 74.3% (−23.8 pp). The model recovers object-level detections but loses fine-grained boundary precision under stricter IoU thresholds.
  • 640 px (Exp 15): total failure across both metrics. With only 8,400 anchor positions (vs 21,504 at 1024 px), the optimiser memorises validation bounding-box coordinates instead of learning transferable spatial features — producing 99.3% validation mAP@50 at epoch 68 yet only 55.3% on the test set (−44 pp gap).

Scientific conclusion: BoxGain requires ≥1024 px to maintain both mAP@50 and mAP@50-95. This establishes a reproducible resolution threshold for amplified box-regression loss, relevant to any detection task involving small, irregular targets.


Dataset

Split Images Role
Train 12,240 Model optimisation
Validation 306 Hyperparameter selection
Test 306 Final independent evaluation

Published dataset: Cuaycal Tirira, D. E. (2026). Annotated Dataset for Potato Foliar Disease and Healthy Leaf Detection. Zenodo. https://doi.org/10.5281/zenodo.20247346 · CC BY 4.0 · YOLO annotation format


Notebook Pipeline

# Notebook Purpose
00 00_gpu_setup_test.ipynb Hardware verification
01 01_dataset_download.ipynb Dataset acquisition
02 02_model_training.ipynb Training — all 16 experiments
03 03_results_evaluation.ipynb Metrics and convergence analysis
04 04_best_model_report.ipynb Official test report — Exp 12
05 05_xai_eigencam.ipynb EigenCAM explainability
06 06_dataset_verification_eda.ipynb Dataset integrity and EDA
07 07_test_set_comparison.ipynb Cross-model test evaluation
08 08_visual_inference.ipynb Visual inference gallery
09 09_deployment_export.ipynb TFLite export
10 10_paper_graphics_generation.ipynb Publication figures

Installation

git clone https://github.com/DiegoCuaycal/potato-leaf-vision.git
cd potato-leaf-vision

python -m venv .venv
.venv\Scripts\activate

pip install -r requirements.txt

Citation

If you use this code or dataset in your research, please cite:

@article{cuaycaltirira2026potato,
  title   = {Automated Potato Leaf Disease Detection: A Comparative Study of YOLO26 and RT-DETR},
  author  = {Cuaycal Tirira, Diego Ernesto},
  journal = {[Journal name — to be updated upon acceptance]},
  year    = {2026},
  note    = {Code: https://github.com/DiegoCuaycal/potato-leaf-vision},
  doi     = {[to be assigned]}
}

Dataset citation:

@dataset{cuaycaltirira2026dataset,
  title     = {Annotated Dataset for Potato Foliar Disease and Healthy Leaf Detection},
  author    = {Cuaycal Tirira, Diego Ernesto},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.20247346},
  url       = {https://doi.org/10.5281/zenodo.20247346},
  license   = {CC BY 4.0}
}

References

Primary Architecture & Methods

  • Sapkota, R., Cheppally, R.H., Sharda, A., & Karkee, M. (2025). YOLO26: Key Architectural Enhancements and Performance Benchmarking for Real-Time Object Detection. arXiv:2509.25164
  • Zhao, Y. et al. (2023). DETRs Beat YOLOs on Real-time Object Detection. arXiv:2304.08069
  • Wang, C. et al. (2024). YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information. arXiv:2402.13616
  • Muhammad, M.B. & Yeasin, M. (2020). Eigen-CAM: Class Activation Map using Principal Components. IJCNN 2020. arXiv:2008.00299
  • Vaswani, A. et al. (2017). Attention is All You Need. NeurIPS 2017. arXiv:1706.03762
  • Zhou, B. et al. (2016). Learning Deep Features for Discriminative Localization. CVPR 2016. arXiv:1512.04150

Dataset

Related Work

  • Kaur, P. et al. (2025). Leveraging YOLO deep learning models to enhance plant disease identification. Scientific Reports, 15. DOI:10.1038/s41598-025-92143-0
  • Sapkota, R. et al. (2025). YOLO-based deep learning framework for real-time multi-class plant health monitoring in precision agriculture. Scientific Reports, 15. DOI:10.1038/s41598-025-29132-w

Author

Diego Cuaycal
Software Engineer · Computer Vision & Deep Learning

 

About

Advanced object detection system for potato foliar disease identification (Septoria, Early Blight, Late Blight, and Healthy leaves) using YOLO26, RT-DETR, and XAI.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages