Novel transformer models for wheat disease classification with explainable insights
摘要
Wheat is one of the most critical staple crops globally and its productivity is severely threatened by various foliar diseases. These diseases leading to substantial economic and food security challenges. Accurate and early automated wheat disease classification is vital for reducing yield losses and improving agricultural productivity. This paper introduces a novel hybrid transformer model named Hybrid Attention Transformer Network (HAT-Net) designed for robust wheat disease classification. HAT-Net integrates the features of Swin Transformer and DeiT (Data-efficient Image Transformer) through a fully connected fusion layer. A cosine annealing scheduler is employed to enhance convergence and mitigate overfitting. The proposed model achieved 99.2% accuracy and 97.79% under cross-validation which outperforms existing transformer-based architectures. Two additional models, the Wheat-based Swin Transformer Network (W-STNet) and the Wheat-based Data Efficient Network (W-DENet) were developed. They achieved 96.72% and 97.3% accuracy under cross validation, respectively. This indicates that W-STNet trained approximately 25.3% faster than W-DENet and 41.4% faster than HAT-Net. To enhance transparency and trust in model decisions, three explainability techniques include LIME, Grad-CAM (for visualizing class-discriminative regions), and TorchVision’s activation maps (for hierarchical feature analysis) are applied. These methods collectively validate that our models focus on biologically relevant disease patterns, bridging the gap between high performance and actionable agricultural insights. Compared with prior work (93.72% accuracy), HAT-Net achieved superior performance, efficiency, and transparency demonstrates the potential of hybrid transformers for reliable and scalable crop disease diagnosis. Transformers deliver higher accuracy, faster training, and more efficient feature learning, outperforming CNNs in both performance and real-world agricultural deployment.