Enhancing agricultural image analysis through deep learning-based crop classification under field variability with biotic-stress cues
Feeding a rapidly growing global population demands reliable and scalable solutions for crop monitoring under diverse field conditions. Recent advances in deep learning have shown strong potential for agricultural image analysis; however, many existing studies on crop identification still struggle in deployment-like imagery due to background clutter, illumination variation, growth-stage changes, and strong class imbalance. In real field captures, images may also contain visible pest pressure or disease symptoms. In this work, such biotic-stress cues are treated as uncontrolled nuisance variability (not separate labels) while the learning target remains crop identity. We study a challenging long-tailed 15-class crop recognition setting and present an attention-augmented convolutional neural network based on a ResNet-50 backbone. A lightweight channel-attention module is inserted as a single late-stage refinement step immediately before global average pooling, enabling a controlled evaluation of performance gains to channel-wise feature recalibration rather than uncontrolled architectural complexity. The framework is evaluated on a curated dataset of 30,204 agricultural red green blue (RGB) images captured under heterogeneous visual conditions (class counts range from 200 to 14,632). To reflect the difficulty of long tailed recognition, we report both prevalence-weighted and class-balanced metrics (macro summaries and balanced accuracy). Under a fixed protocol and held-out test set, the attention-enhanced model outperforms a standard ResNet-50 baseline, achieving 98.38% accuracy with weighted precision/recall/F1 of 0.97/0.98/0.97, while maintaining strong class-balanced performance (macro Precision/Recall/F1 of 0.94/0.95/0.94; balanced accuracy 0.95). These results indicate that lightweight attention can improve robustness for crop classification under realistic field variability and severe imbalance. This enhances the practical decision-support systems for sustainable agriculture.
Authors
- Hassan Tariq (ORCID: https://orcid.org/0000-0002-9822-9756)
- Imran Mumtaz (ORCID: https://orcid.org/0000-0003-4294-2971)
- Muhammad Kashif (ORCID: https://orcid.org/0000-0002-9874-0992)
- Muhammad Majid
Institutions
- University of Faisalabad (PK)
- University of Agriculture Faisalabad (PK)
Publication Details
- Journal
- PeerJ Computer Science
- Published
- 2026-09-21
- DOI
- https://doi.org/10.7717/peerj-cs.4081
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00