Behind the Paper

An interpretable vision transformer framework for joint wheat leaf disease classification and pesticide recommendation

I am pleased to share my open-access research on an interpretable Vision Transformer for joint wheat leaf disease classification and pesticide recommendation, integrating Grad-CAM explainability for transparent precision-agriculture decision support

From Wheat Leaf Images to Smarter Disease Management

Wheat diseases can seriously affect crop productivity and create challenges for farmers who need to identify diseases quickly and decide on appropriate treatments. With the growing use of artificial intelligence (AI) in agriculture, image-based disease detection offers a promising way to support faster and more informed decision-making. Our study explored how AI could be used not only to identify wheat leaf diseases, but also to provide pesticide recommendations within the same framework.

The study introduces a multi-task Vision Transformer (ViT) framework designed to perform two related tasks: wheat leaf disease classification and pesticide recommendation. By combining these tasks, the goal was to move beyond simply recognizing a disease and toward providing more actionable information that could support precision agriculture.

How did we conduct the study?

We used 10,720 wheat leaf images from three publicly available datasets. To improve the diversity of the training data and help the model learn from different variations in leaf appearance, we applied image augmentation techniques. After augmentation, the dataset increased to 11,408 images.

The core of our approach was a Vision Transformer (ViT). Unlike traditional convolutional neural networks, Vision Transformers use an attention mechanism to learn relationships between different parts of an image. This makes them particularly interesting for agricultural images, where disease symptoms may appear in different regions of a leaf.

We also incorporated Explainable AI (XAI) into the framework using Grad-CAM. A major challenge with AI-based agricultural systems is that a model may provide a prediction without clearly showing why it made that prediction. Grad-CAM helps address this issue by highlighting the areas of an image that contributed most strongly to the model's decision. In our case, this allows us to visualize disease-relevant regions of wheat leaves and provides greater transparency in the prediction process.

We compared the proposed framework with established deep-learning models, including ResNet50 and EfficientNet, to evaluate its performance and understand the potential benefits of the transformer-based approach.

What did we find?

The results were encouraging. The proposed framework achieved 92% ± 0.01 accuracy using the original images. After applying data augmentation, the accuracy increased to 94% ± 0.01.

These results suggest that expanding the diversity of the training images can help improve the model's ability to recognize wheat leaf diseases. The comparison with ResNet50 and EfficientNet also demonstrated the potential of combining transformer-based learning with multi-task prediction.

However, accuracy was not the only important consideration in this research. For agricultural applications, it is also important to understand how an AI system reaches its predictions. The Grad-CAM visualizations provide an additional layer of information by showing disease-relevant regions of the leaf. This can make the system's predictions easier to interpret and potentially more useful for researchers and agricultural practitioners.

Why does this research matter?

The motivation behind this work is to contribute to the development of AI-assisted precision agriculture. A system that can identify wheat diseases and provide treatment-related recommendations could potentially help users make faster and more informed decisions.

There is still considerable work needed before such systems can be used reliably in real-world agricultural environments. Models need to be evaluated on images collected under different field conditions, including variations in lighting, backgrounds, disease severity, and wheat varieties. Nevertheless, our findings demonstrate the potential of combining Vision Transformers, multi-task learning, and Explainable AI in a single framework.

For us, an important lesson from this research is that developing an effective AI model is not only about achieving high accuracy. It is also about making the predictions understandable and ensuring that the technology can ultimately provide useful information to the people who may rely on it.

One of the interesting aspects of this work was preparing the image data and developing a model that could learn from different visual patterns associated with wheat diseases. Agricultural images can vary considerably because of differences in disease appearance, image quality, lighting, and leaf conditions. This made data preparation and augmentation an important part of the study. We also explored different deep-learning approaches to understand how the proposed Vision Transformer compared with established architectures such as ResNet50 and EfficientNet. Integrating Grad-CAM added another important dimension to the research, because it allowed us to look beyond the final prediction and examine which regions of the wheat leaf influenced the model's decision. This process helped us better understand the model's behaviour and reinforced the importance of combining performance with interpretability when developing AI systems for agriculture.

DOI: 10.1007/s44163-026-01896-8