All projects
Research / Case study

Rice Disease Classification

A computer-vision competition study comparing pretrained image models, augmentation, and fold-based prediction for identifying disease in rice plants.

  • Computer Vision
  • Agriculture
  • Deep Learning
  • Competition

Recognizing disease from rice images

The Microsoft Rice Disease Classification Challenge asked participants to identify disease types in images of rice grown in Egypt. The task distinguishes rice blast, brown spot, and healthy plants. It offered a practical setting for studying how pretrained vision models adapt to an agricultural image dataset.

I developed two notebook approaches: one using fastai for rapid model experiments, and another using PyTorch Lightning for more explicit control over training and fold-based prediction. Both follow the path from image metadata and labels through training to submission files.

Comparing model families

The fastai approach uses RGB images resized for pretrained networks. It explores ConvNeXt, a vision transformer, and a Swin transformer through the timm model library. Each backbone is connected to a classifier for the competition classes, with preprocessing matched to the selected model.

Training includes image augmentation, while test-time augmentation combines predictions from transformed views of an image. The notebook sets up stratified data partitions to retain class representation in validation. The recorded fastai training loops use a selected fold, so this part of the work is best understood as model comparison rather than a full cross-validation ensemble.

A second training workflow

The Lightning implementation separates image loading, model definition, training configuration, and prediction. It trains a ConvNeXt-based classifier across stratified folds and combines fold predictions for the submission. This makes the relationship between training partitions and the final output easier to follow.

I also explored adding RGN imagery alongside RGB. That extension remained experimental; the documented training run uses RGB. Keeping that distinction clear matters because the presence of a multimodal architecture in a notebook does not by itself demonstrate a useful improvement.

What the work produced

The result is a pair of competition notebooks showing two ways to organize transfer learning for the same classification problem. They include data preparation, training configuration, checkpoint loading, prediction, and the final class-probability export.

The comparison made preprocessing and evaluation choices as visible as the model name. Image size, normalization, augmentation, the selected validation fold, and how predictions are combined all affect the experiment being measured. Those choices are part of the model, even when they sit outside the neural network definition.

The source notebooks preserve the competition work. This is an image-classification study; a field application would require its own data collection and evaluation.

Keep exploring