Insect pests pose a significant threat to agricultural productivity, making early and accurate identification essential for effective pest management. This study proposes a novel deep learning-based classification framework for multi-class pest recognition from field images. The proposed approach enhances discriminative region representation by integrating a patch embedding module, a Vision Transformer backbone, and a learnable spatial attention mask. This hybrid design enables the model to focus on critical visual cues without requiring segmentation-based preprocessing. The attention mask, learned via convolutional layers, is pooled and directly applied to Transformer-encoded patch tokens to refine spatial feature emphasis. Positional embeddings are further employed to preserve spatial context within the tokenized image representation. Experimental evaluations conducted on publicly available pest datasets with 5, 9, and 12 classes demonstrate the effectiveness and robustness of the proposed framework. The model achieves accuracies of 99.67%, 99.52%, and 97.00% on the Pest5, Pest9, and Pest12 datasets, respectively, indicating strong generalization across varying classification complexities. To enhance model transparency and reliability, visual interpretability is provided through Grad-CAM and attention heatmap visualizations that reveal the model’s focus regions. Additionally, t-SNE-based feature visualization illustrates clear separability in the learned embedding space. The proposed framework shows strong potential for practical deployment in smart agriculture and precision pest monitoring systems.
Pest Recognition Vision Transformer Learnable Attention Class-Aware Feature Learning Explainable AI Smart Agriculture
| Primary Language | English |
|---|---|
| Subjects | Evolutionary Computation |
| Journal Section | Research Article |
| Authors | |
| Submission Date | July 10, 2025 |
| Acceptance Date | December 31, 2025 |
| Publication Date | March 24, 2026 |
| DOI | https://doi.org/10.15832/ankutbd.1739676 |
| IZ | https://izlik.org/JA39KB82EA |
| Published in Issue | Year 2026 Volume: 32 Issue: 2 |
Journal of Agricultural Sciences is published as open access journal. All articles are published under the terms of the Creative Commons Attribution License (CC BY).