Aphid-ResNetSwin: An Image Recognition Method with Improved Attention Mechanism for Graded Identification of Myzus persicae
Simple Summary
Abstract
1. Introduction
- In this study, a dual-branch hybrid neural network architecture is designed, which fuses the local feature extraction capability of InceptionResNet-V2 with the global modeling capability of Swin Transformer.
- The recognition performance of the model is enhanced by incorporating a global channel-spatial attention module (GCSA) at the end of each branch.
- The proposed Aphid-ResNetSwin model achieves accurate identification of M. persicae infestation severity and outperforms human-based recognition in terms of accuracy.
2. Materials and Methods
2.1. Field Collection
2.2. Image Preprocessing
2.3. Image Recognition Model Architecture
2.4. Optimization of Aphid Recognition Model with GCSA Module
2.5. Model Validation
2.6. Model Testing Statistical Analysis
3. Results
3.1. The Effect of Image Augmentation
3.2. Identify Model Performance
3.3. Ablation Experiments on the Model
3.4. Comparison of Recognition Results of Different Models
3.5. Model Field Validation
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Xiong, B.; Li, D.L.; Zhang, Q.; Desneux, N.; Luo, C.; Hu, Z.Q. Image detection model construction of Apolygus lucorum and Empoasca spp. based on improved YOLOv5. Pest Manag. Sci. 2024, 80, 2577–2586. [Google Scholar] [CrossRef] [PubMed]
- Reganold, J.P.; Wachter, J.M. Organic agriculture in the twenty-first century. Nat. Plants 2016, 2, 15221. [Google Scholar] [CrossRef] [PubMed]
- Bai, L.G.; Huang, X.J.; Dashzebeg, G.; Ariunaa, M.; Yin, S.; Bao, Y.H.; Gang, B.; Siqin, T.; Altanchimeg, D.; Enkhnasan, D. Potential of unmanned aerial vehicle red-green-blue images for detecting needle pests: A case study with Erannis jacobsoni djak (lepidoptera, geometridae). Insects 2024, 15, 172. [Google Scholar] [CrossRef] [PubMed]
- Hu, G.S.; Wu, H.Y.; Zhang, Y.; Wan, M.Z. A low shot learning method for tea leaf’s disease identification. Comput. Electron. Agric. 2019, 163, 104852. [Google Scholar] [CrossRef]
- Mittal, M.; Gupta, V.; Aamash, M.; Upadhyay, T. Machine learning for pest detection and infestation prediction: A comprehensive review. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2024, 14, e1551. [Google Scholar] [CrossRef]
- Nguenha, N.; Cunguara, B.; Bialous, S.; Drope, J.; Lencucha, R. An overview of the policy and market landscape of tobacco production and control in Mozambique. Int. J. Environ. Res. Public Health 2021, 18, 343. [Google Scholar] [CrossRef] [PubMed]
- Sun, J.Z.; Ran, Y.O.; Mark, G.; Jin, Y.B.; Ding, W. Effects of tobacco intercropping on the spatial relationship between natural enemies and pests and economic efficiency. Sci. Rep. 2025, 15, 28368. [Google Scholar] [CrossRef] [PubMed]
- Lin, J.W.; Chen, Y.; Pan, R.Y.; Cao, T.B.; Cai, J.T.; Yu, D. Camffnet: A novel convolutional neural network model for tobacco disease image recognition. Comput. Electron. Agric. 2022, 202, 107390. [Google Scholar] [CrossRef]
- Züst, T.; Agrawal, A.A. Mechanisms and evolution of plant resistance to aphids. Nat. Plants 2016, 2, 15206. [Google Scholar] [CrossRef] [PubMed]
- Eigenbrode, S.D.; Bosque-Pérez, N.A.; Davis, T.S. Insect-borne plant pathogens and their vectors: Ecology, evolution, and complex interactions. Ann. Rev. Entomol. 2018, 63, 169–191. [Google Scholar] [CrossRef] [PubMed]
- Li, Z.L.; He, Y.Q.; Yao, M.S.; Lu, C.H.; Zhao, R.N.; Li, H.J.; Chen, W.L. Effects of temperature on the adaptation of Myzus persicae (Sulzer) (hemiptera: Aphididae) to tobacco plants infected with potato virus Y. Crop Prot. 2025, 191, 107137. [Google Scholar] [CrossRef]
- Lee, S.; Kim, H.; Cho, B.-K. Deep Learning-Based Image Classification for Major Mosquito Species Inhabiting Korea. Insects 2023, 14, 526. [Google Scholar] [CrossRef] [PubMed]
- Lin, S.; Xiu, Y.C.; Kong, J.L.; Yang, C.C.; Zhao, C.J. An effective pyramid neural network based on graph-related attentions structure for fine-grained disease and pest identification in intelligent agriculture. Agriculture 2023, 13, 567. [Google Scholar] [CrossRef]
- Lv, P.; Xu, H.; Zhang, Y.; Zhang, Q.; Pan, Q.; Qin, Y.; Chen, Y.; Cao, D.; Wang, J.; Zhang, M.; et al. An Improved Multi-Scale Feature Extraction Network for Rice Disease and Pest Recognition. Insects 2024, 15, 827. [Google Scholar] [CrossRef] [PubMed]
- Wu, L.; Jinma, Y.; Wang, X.Y.; Yang, F.; Xu, F.; Cui, X.H. Amur tiger individual identification based on the improved InceptionResNetv2. Animals 2024, 14, 2312. [Google Scholar] [CrossRef] [PubMed]
- Mesías-Ruiz, G.A.; Borra-Serrano, I.; Peña, J.M.; Castro, A.I.; Fernández-Quintanilla, C.; Dorado, J. Weed species classification with UAV imagery and standard CNN models: Assessing the frontiers of training and inference phases. Crop Prot. 2024, 182, 106721. [Google Scholar] [CrossRef]
- Li, X.Y.; Wang, L.X.; Miao, H.; Zhang, S.W. Aphid recognition and counting based on an improved yolov5 algorithm in a climate chamber environment. Insects 2023, 14, 839. [Google Scholar] [CrossRef] [PubMed]
- Xu, X.; Shi, J.; Chen, Y.Q.; He, Q.; Liu, L.L.; Sun, T. Research on machine vision and deep learning based recognition of cotton seedling aphid infestation level. Front. Plant Sci. 2023, 14, 1200901. [Google Scholar] [CrossRef] [PubMed]
- Wen, J.; Yang, S.; Li, W.; Cheng, S. GCSA-SegFormer: Transformer-Based Segmentation for Liver Tumor Pathological Images. Bioengineering 2025, 6, 611. [Google Scholar] [CrossRef] [PubMed]
- Han, B.J.; Hu, M. The facial expression data enhancement method induced by improved StarGAN V2. Symmetry 2023, 15, 956. [Google Scholar] [CrossRef]
- Creswell, A.; White, T.; Dumoulin, V.; Arulkumaran, K.; Sengupta, B.; Bharath, A.A. Generative adversarial networks an overview. IEEE Signal Process. Mag. 2018, 35, 53–65. [Google Scholar] [CrossRef]
- Karam, C.; Awad, M.; Abou, J.Y.; Ezzeddine, N.; Fardoun, A. Gan-based semi-automated augmentation online tool for agricultural pest detection: A case study on whiteflies. Front. Plant Sci. 2022, 13, 813050. [Google Scholar] [CrossRef] [PubMed]
- Soundararajan, S.; Shirley, C.P.; Mallala, B.; Padmanaban, K. Cloud-powered efficiency: A mobile application for agricultural pest identification using cycle-consistent generative adversarial networks. Environ. Dev. Sustain. 2025, 1, 28. [Google Scholar] [CrossRef]
- Hu, K.; Liu, Y.M.; Nie, J.W.; Zheng, X.Y.; Zhang, W.; Liu, Y.; Xie, T.Q. Rice pest identification based on multi-scale double-branch gan-resnet. Front. Plant Sci. 2023, 14, 1167121. [Google Scholar] [CrossRef] [PubMed]
- Rhoda, M.; Mazarura, U.; Peter, C.; Susan, D. The response of the red morph of the Tobacco aphid, Myzus persicae nicotianae, to insecticides applied under laboratory and field conditions. Asian J. Agric. Rural Dev. 2013, 3, 141–147. [Google Scholar]
- Lottes, P.; Behley, J.; Milioto, A.; Stachniss, C. Fully convolutional networks with sequential information for robust crop and weed detection in precision farming. IEEE Robot. Autom. Lett. 2018, 3, 2870–2877. [Google Scholar] [CrossRef]
- Tran, N.T.; Tran, V.H.; Nguyen, N.B.; Nguyen, T.K.; Cheung, N.M. On data augmentation for gan training. IEEE Trans. Image Process. 2021, 30, 1882–1897. [Google Scholar] [CrossRef] [PubMed]
- Ren, S.Q.; He, K.M.; Girshick, R.; Sun, J. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Wang, J.K.; He, X.H.; Faming, S.; Lu, G.L.; Cong, H.; Jiang, Q.Y. A real-time bridge crack detection method based on an improved Inception-ResNet-V2 structure. IEEE Access 2021, 9, 93209–93223. [Google Scholar] [CrossRef]
- Yang, K.; Wang, S.X.; Dai, J.C.; Qin, X.Q.; Niu, K.; Zhang, P. SwinJSCC: Taming Swin Transformer for deep joint source-channel coding. IEEE Trans. Cogn. Commun. Netw. 2025, 11, 90–104. [Google Scholar] [CrossRef]
- Chen, W.T.; Ouyang, S.B.; Tong, W.; Li, X.J.; Zheng, X.W.; Wang, L.Z. GCSA-Net: A global context spatial attention deep learning network for remote sensing scene classification. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 1150–1162. [Google Scholar] [CrossRef]
- Cicchetti, D.V. Guidelines, criteria, and rules of thumb for evaluating normed and standardized assessment instruments in psychology. Psychol. Assess. 1994, 6, 284–290. [Google Scholar] [CrossRef]
- Chakraborty, T.; Reddy, K.; Naik, S.M.; Panja, M.; Manvitha, B. Ten years of generative adversarial nets (gans): A survey of the state-of-the-art. Mach. Learn. Sci. Technol. 2024, 5, 011001. [Google Scholar] [CrossRef]
- Clabaut, É.; Bouffard, J.; Savage, J. Combining Object Detection, Super-Resolution GANs and Transformers to Facilitate Tick Identification Workflow from Crowdsourced Images on the eTick Platform. Insects 2025, 16, 813. [Google Scholar] [CrossRef] [PubMed]
- Wang, W.; Zhang, M.W.; Wu, Z.W.; Zhu, P.T.; Li, Y. SCGAN: Semi-centralized generative adversarial network for image generation in distributed scenes. Inf. Fusion 2024, 112, 102556. [Google Scholar] [CrossRef]
- Faisal, H.M.; Aqib, M.; Mahmood, K.; Safran, M.; Alfarhood, S.; Ashraf, I. A customized convolutional neural network-based approach for weeds identification in cotton crops. Front. Plant Sci. 2025, 15, 1435301. [Google Scholar] [CrossRef] [PubMed]
- Wang, Y.C.; Yi, C.C.; Huang, T.; Liu, J. Research on intelligent recognition for plant pests and diseases based on improved YOLOv8 model. Appl. Sci. 2024, 14, 5353. [Google Scholar] [CrossRef]
- Rosado, L.; Faria, P.; Gonçalves, J.; Silva, E.; Vasconcelos, A.; Braga, C. Eyesontraps: Ai-powered mobile-based solution for pest monitoring in viticulture. Sustainability 2022, 14, 9729. [Google Scholar] [CrossRef]








| Growth Stage | Duration (Days) | Number of Effective Leaves |
|---|---|---|
| Establishment Stage | 7 | 6–10 |
| Root Elongation Stage | 25–30 | 10–15 |
| Rapid Growth Stage | 25–30 | 13–18 |
| Maturity Stage | 50 | 18–22 |
| Item | Specification |
|---|---|
| Operating System | Windows 11 (64-bit) |
| Deep Learning Framework | PyTorch 2.5 (Open-source) |
| System Memory (RAM) | 32 GB |
| Processor (CPU) | 13th Generation Intel® CoreTM i7-13900H @ 2.60 GHz |
| Graphics Card (GPU) | NVIDIA RTX 4060 Ti |
| Key Features | GPU acceleration enabled; Dynamic neural network support |
| Model/Parametric | Average Training Loss | Average Training Accuracy | Average Testing Loss | Average Testing Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|---|
| InceptionResNetV2 | 0.5778 | 0.8034 | 0.8097 | 0.7678 | 0.7704 | 0.7653 | 0.7678 |
| Aphid-ResNetSwin | 0.1751 | 0.9014 | 0.2604 | 0.8911 | 0.8865 | 0.8937 | 0.8901 |
| Hyperparameter | Value | Setting Details |
|---|---|---|
| Input resolution | 299 × 299 | Original tobacco leaf RGB image |
| Preprocessing | Resize(224) + Normalize | Mean = [0.485, 0.456, 0.406], Std = [0.229, 0.224, 0.225] |
| Batch size | 16 | - |
| Initial learning rate | 1 × 10−3 | Cosine annealing decay to 1 × 10−6 |
| Training epochs | 100 | Early stopping with patience = 10 |
| Optimizer | Adam | β1 = 0.9, β2 = 0.999, weight_decay = 5 × 10−4 |
| Loss function | Cross-Entropy |
| Model Configuration | Data Augmentation | Model Architecture | Attention Mechanism | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) |
|---|---|---|---|---|---|---|---|
| Baseline (InceptionResNetV2) | - | InceptionResNetV2 | - | 73.11 | 77.04 | 76.53 | 76.78 |
| Baseline + Improved Data Augmentation | (GAN) | InceptionResNetV2 | - | 78.56 | 81.32 | 80.95 | 81.13 |
| Baseline + Architecture | - | Aphid-ResNetSwin | - | 84.23 | 85.17 | 84.89 | 85.03 |
| Baseline + Attention Mechanism | - | InceptionResNetV2 | GCSA Mechanism | 80.12 | 82.45 | 82.11 | 82.28 |
| Aphid-ResNetSwin | (GAN) | Aphid-ResNetSwin | GCSA Mechanism | 89.11 | 88.65 | 89.37 | 89.01 |
| Baseline + Improved Architecture + Attention Mechanism | - | Aphid-ResNetSwin | GCSA Mechanism | 86.79 | 87.23 | 86.98 | 87.10 |
| Baseline + Improved Data Augmentation + Attention Mechanism | (GAN) | InceptionResNetV2 | GCSA Mechanism | 82.45 | 83.87 | 83.52 | 83.69 |
| Model/Parametric | Average Training Loss | Average Training Accuracy | Average Testing Loss | Average Testing Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|---|
| ResNet-152 | 0.8216 | 0.7416 | 0.9357 | 0.7218 | 0.7159 | 0.7224 | 0.7191 |
| EfficienNetV2 | 0.8598 | 0.7286 | 1.0587 | 0.7204 | 0.7158 | 0.7143 | 0.7150 |
| MobileNetV3 | 0.7437 | 0.7524 | 0.9327 | 0.7328 | 0.7405 | 0.7357 | 0.7381 |
| InceptionResNetV2 | 0.5778 | 0.8034 | 0.8097 | 0.7678 | 0.7704 | 0.7653 | 0.7678 |
| Vision Transformer | 0.2836 | 0.8257 | 0.3618 | 0.8106 | 0.8195 | 0.8142 | 0.8168 |
| SwinTransformer | 0.2218 | 0.8439 | 0.2983 | 0.8257 | 0.8304 | 0.8322 | 0.8313 |
| Aphid-ResNetSwin | 0.1751 | 0.9014 | 0.2604 | 0.8911 | 0.8865 | 0.8937 | 0.8901 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Luo, J.; Sun, J.; Hao, X.; Liu, H.; Lv, F.; Ding, W. Aphid-ResNetSwin: An Image Recognition Method with Improved Attention Mechanism for Graded Identification of Myzus persicae. Insects 2026, 17, 305. https://doi.org/10.3390/insects17030305
Luo J, Sun J, Hao X, Liu H, Lv F, Ding W. Aphid-ResNetSwin: An Image Recognition Method with Improved Attention Mechanism for Graded Identification of Myzus persicae. Insects. 2026; 17(3):305. https://doi.org/10.3390/insects17030305
Chicago/Turabian StyleLuo, Jinzhou, Jiazhao Sun, Xiaoli Hao, Heng Liu, Fajin Lv, and Wei Ding. 2026. "Aphid-ResNetSwin: An Image Recognition Method with Improved Attention Mechanism for Graded Identification of Myzus persicae" Insects 17, no. 3: 305. https://doi.org/10.3390/insects17030305
APA StyleLuo, J., Sun, J., Hao, X., Liu, H., Lv, F., & Ding, W. (2026). Aphid-ResNetSwin: An Image Recognition Method with Improved Attention Mechanism for Graded Identification of Myzus persicae. Insects, 17(3), 305. https://doi.org/10.3390/insects17030305

