Deep Learning for Disease Resistance Classification using Drone Imagery of Corn
Project Overview
Corn breeders currently rely on slow, subjective visual scoring to assess foliage disease resistance across
thousands of plots. This project reframes disease assessment as a supervised regression task: training a deep
neural network to predict Southern Leaf Blight (SLB) severity directly from drone-collected RGB images. The
challenge lies in designing a system that generalizes across seasons and field conditions while managing large,
noisy, and imbalanced real-world data.
Data
The dataset is composed of approximately 10,000 images of the plants and associated foliage health scores
on a scale of 1 (highly diseased) to 9 (no disease) with 0.5 size increments. Disease severity scores were
collected by PhD students and researchers in plant pathology over two years.
Numerous CNN models were trained and tested to evaluate custom model architectures as well as off the
shelf model implementations including EfficientNetv2 and ResNet. Custom models were implemented in PyTorch
and using Optuna and MLFlow we were able to train and test numerous variations of convolutional and fully
connected layers, adjusting both the depth and width of the models. Initial training struggled to learn the
data effectively with accuracy remaining below 40%. Deeper evaluation of the images used for training led us
to suspect that the models were having difficulty identifying and focusing on appropriate corn foliage and
disease features and were not able to filter out and ignore the other non-relevant features in the images like
non-corn vegetation, soil and shadows.
To augment our training images, we decided to segment the images to filter out the non-relevant features and
allow the models train on images that were segmented and filtered to focus on the corn foliage using
Facebook's Segment Anything Model 2. These images show an example of the original image, image mask and
filtered image transition used to augment the training images.
Model Implementation
The project is framed as a supervised regression task — predicting a continuous SLB severity score (0–9 in
0.5 increments) from a single drone-collected RGB image. Models are evaluated on MAE, R², and
snap-score accuracy (prediction rounded to nearest valid label). Data was split 70% training / 15%
validation / 15% test.
A baseline custom 2-layer CNN with Adam optimizer and MSE regression loss established a starting
point (MAE 1.17, R² 0.18). Custom feature engineering — adding an edge map channel and a
"brown-surrounded-by-green" pixel mask — improved the baseline to R² 0.245 by directing the
network toward disease-relevant regions.
Using state of art pre-built CNNs produced a major performance jump. EfficientNet V2 Small and Large were trained
on the dataset, and a pre-trained Vision Transformer (ViT) was evaluated both as-is and with a novel
directed attention mechanism — a custom loss term that penalizes attention weights misaligned with
the brown-leaf disease mask, encouraging the model to focus on lesion regions. Grad-CAM
visualizations confirmed the model was attending to disease-relevant areas.
Best model results (EfficientNet V2 Small):
- MAE: 0.52 — comparable to inter-rater variability between human scorers
- R²: 0.78
- Snap-score (+/- 0.5) accuracy: 82%
Model comparison:
- Baseline CNN: MAE 1.17 · R² 0.38 · Accuracy 43%
- EfficientNet V2 Small: MAE 0.52 · R² 0.78 · Accuracy 82% ✓ Best
- EfficientNet V2 Large: MAE 0.56 · R² 0.76 · Accuracy 71%
- ViT + Attention: MAE 0.53 · R² 0.73 · Accuracy 74%
Tech Stack
- PyTorch — primary deep learning framework; supports CUDA, Apple MPS, and CPU training
- torchvision — EfficientNet V2 and ViT pre-trained model weights
- scikit-learn — evaluation metrics: confusion matrix, classification report, precision/recall/F1
- NumPy & Pandas — numerical computation and data handling
- Pillow — image loading and preprocessing
- Matplotlib — training curves, confusion matrices, and Grad-CAM visualizations
- SciPy — Spearman correlation and statistical analysis
- JupyterLab — development and experiment environment