Optimization of Deep Learning Model Based on Attention-Guided PCA Dimensionality Reduction
Abstract
1. Introduction
- Proposed the AG-PCA feature optimization module: Quantifies the discriminative value of features through attention weights and dynamically adjusts the selection priority of PCA principal components, retaining key relevant features while performing dimensionality reduction.
- Embedded a spatial attention mechanism in residual blocks: Enhances the feature representation of disease regions and suppresses background redundancy, providing high-quality input for the AG-PCA module and achieving collaborative optimization.
- Conducted experiments on the AppleLeaf9 dataset: The dataset contains 10,211 images covering 9 categories of apple leaf diseases; results show that the improved model achieves a recognition accuracy of 93.69%, significantly outperforming the baseline model.
- Validated the core role of the AG-PCA module through ablation experiments: Demonstrates that its combination with the spatial attention mechanism brings more significant performance gains.
2. Materials and Methods
2.1. Experimental Data Preparation
2.2. Model Establishment
2.3. Attention-Guided PCA Downsampling Module
Theoretical Analysis and Comparison
2.4. Feature Enhancement Mechanisms
2.4.1. Alpha Dropout for Regularization
2.4.2. Local Feature Refinement with Batch Normalization
2.4.3. Spatial Attention Mechanism
2.4.4. Self-Normalizing Nonlinear Transformation
2.4.5. Residual Connection for Feature Fusion
3. Experimental Preparation Phase
3.1. Dataset Construction and Data Augmentation
Dataset Details
3.2. Training Configurations and Parameter Settings
3.2.1. Model and Optimizer
3.2.2. Training Process Control
4. Experiments and Results
4.1. Data Augmentation
4.2. Training and Testing Experiments
4.3. Cross-Dataset Validation
4.4. Comprehensive Evaluation of Classification Performance
4.5. Statistical Analysis
4.6. Ablation Experiments
4.7. Comparative Experiment and Analysis
5. Analysis and Discussion
5.1. Comparing RGB Features
5.2. Attention Analysis of Disease Regions in Complex Backgrounds
5.3. Discussion
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Alston, J.M.; Pardey, P.G. Agriculture in the Global Economy. J. Econ. Perspect. 2014, 28, 121–146. [Google Scholar] [CrossRef]
- Li, L.; Zhang, S.; Wang, B. Plant Disease Detection and Classification by Deep Learning—A Review. IEEE Access 2021, 9, 56683–56698. [Google Scholar] [CrossRef]
- Dawod, R.G.; Dobre, C. Upper and Lower Leaf Side Detection with Machine Learning Methods. Sensors 2022, 22, 2696. [Google Scholar] [CrossRef]
- Ji, X.; Xue, J.; Shi, J.; Wang, W.; Zhang, X.; Wang, Z.; Lu, W.; Liu, J.; Fu, Y.V.; Xu, N. Noninvasive Raman Spectroscopy for the Detection of Rice Bacterial Leaf Blight and Bacterial Leaf Streak. Talanta 2025, 282, 126962. [Google Scholar] [CrossRef]
- Jiang, X.; Wang, J.; Xie, K.; Cui, C.; Du, A.; Shi, X.; Yang, W.; Zhai, R. PlantCaFo: An Efficient Few-Shot Plant Disease Recognition Method Based on Foundation Models. Plant Phenomics 2025, 7, 100024. [Google Scholar] [CrossRef]
- Peng, D.; Li, W.; Zhao, H.; Zhou, G.; Cai, C. Recognition of Tomato Leaf Diseases Based on DIMPCNET. Agronomy 2023, 13, 1812. [Google Scholar] [CrossRef]
- Krishna, M.S.; Machado, P.; Otuka, R.I.; Yahaya, S.W.; Neves dos Santos, F.; Ihianle, I.K. Plant Leaf Disease Detection Using Deep Learning: A Multi-Dataset Approach. J 2025, 8, 4. [Google Scholar] [CrossRef]
- Ali, M.U.; Khalid, M.; Farrash, M.; Lahza, H.F.M.; Zafar, A.; Kim, S.-H. AppleLeafNet: A Lightweight and Efficient Deep Learning Framework for Diagnosing Apple Leaf Diseases. Front. Plant Sci. 2024, 15, 1502314. [Google Scholar] [CrossRef]
- Bi, Z.; Ma, F.; Guan, J.; Wu, J.; Li, J.; Li, F.; Li, Y.; Liu, Z. Apple Leaf Disease Severity Grading Based on Deep Learning and the DRL-Watershed Algorithm. Sci. Rep. 2025, 15, 30071. [Google Scholar] [CrossRef]
- Gao, L.; Zhao, X.; Yue, X.; Yue, Y.; Wang, X.; Wu, H.; Zhang, X. A Lightweight YOLOv8 Model for Apple Leaf Disease Detection. Appl. Sci. 2024, 14, 6710. [Google Scholar] [CrossRef]
- Ahmed, M.R.; Ashrafi, A.F.; Ahmed, R.U.; Ahmed, T. MCFFA-Net: Multi-Contextual Feature Fusion and Attention Guided Network for Apple Foliar Disease Classification. In Proceedings of the 25th International Conference on Computer and Information Technology (ICCIT), Dhaka, Bangladesh, 17 December 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 757–762. [Google Scholar] [CrossRef]
- Sundhar, S.; Sharma, R.; Maheshwari, P.; Kumar, S.R.; Kumar, T.S. Enhancing Leaf Disease Classification Using GAT-GCN Hybrid Model. arXiv 2025, arXiv:2504.04764. [Google Scholar] [CrossRef] [PubMed]
- Doutoum, A.S.; Tugrul, B. A Systematic Review of Deep Learning Techniques for Apple Leaf Diseases Classification and Detection. Peerj Comput. Sci. 2025, 11, e2655. [Google Scholar] [CrossRef]
- Zhao, J.; Xu, L.; Ma, Z.; Li, J.; Wang, X.; Liu, Y.; Du, X. A Review of Plant Leaf Disease Identification by Deep Learning Algorithms. Front. Plant Sci. 2025, 16, 1637241. [Google Scholar] [CrossRef]
- Zhou, J.; Li, J.; Wang, C.; Wu, H.; Zhao, C.; Wang, Q. A Vegetable Disease Recognition Model for Complex Background Based on Region Proposal and Progressive Learning. Comput. Electron. Agric. 2021, 184, 106101. [Google Scholar] [CrossRef]
- Ashurov, A.Y.; Al-Gaashani, M.S.A.M.; Samee, N.A.; Alkanhel, R.; Atteia, G.; Abdallah, H.A.; Muthanna, M.S.A. Enhancing Plant Disease Detection through Deep Learning: A Depthwise CNN with Squeeze and Excitation Integration and Residual Skip Connections. Front. Plant Sci. 2025, 15, 1505857. [Google Scholar] [CrossRef]
- Ametefe, D.S.; Sarnin, S.S.; Ali, D.M.; Caliskan, A.; Caliskan, I.T.; Aliu, A.A.; John, D. Enhancing Leaf Disease Detection Accuracy through Synergistic Integration of Deep Transfer Learning and Multimodal Techniques. Inf. Process. Agric. 2024, 12, 279–299. [Google Scholar] [CrossRef]
- Wu, P.; Liu, J.; Jiang, M.; Zhang, L.; Ding, S.; Zhang, K. Tea Leaf Disease Recognition Using Attention Convolutional Neural Network and Handcrafted Features. Crop Prot. 2025, 190, 107118. [Google Scholar] [CrossRef]
- Umamageswari, A.; Deepa, S.; Raja, K. An Enhanced Approach for Leaf Disease Identification and Classification Using Deep Learning Techniques. Meas. Sens. 2022, 24, 100568. [Google Scholar] [CrossRef]
- Wang, Z.; Cui, W.; Huang, C.; Zhou, Y.; Zhao, Z.; Yue, Y.; Dong, X.; Lv, C. Framework for Apple Phenotype Feature Extraction Using Instance Segmentation and Edge Attention Mechanism. Agriculture 2025, 15, 305. [Google Scholar] [CrossRef]
- Dubey, S.R.; Jalal, A. Detection and Classification of Apple Fruit Diseases Using Complete Local Binary Patterns. In Proceedings of the 3rd International Conference on Computer and Communication Technology (ICCCT), Allahabad, India, 23–25 November 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 346–351. [Google Scholar] [CrossRef]
- González, E.; Sutton, T.B.; Correll, J.C. Clarification of the Etiology of Glomerella Leaf Spot and Bitter Rot of Apple Caused by Colletotrichum spp. Based on Morphology and Genetic, Molecular, and Pathogenicity Tests. Phytopathology 2006, 96, 982–992. [Google Scholar] [CrossRef]
- Sharma, R.; Singh, A. VGG16 Feature Selection Using PCA-Big Bang Big Algorithm. J. Intell. Fuzzy Syst. 2023, 45, 1437–1451. [Google Scholar] [CrossRef]
- Yang, Q.; Duan, S.; Wang, L. Efficient Identification of Apple Leaf Diseases in the Wild Using Convolutional Neural Networks. Agronomy 2022, 12, 2784. [Google Scholar] [CrossRef]
- Chen, X.; Cai, C.; He, X.; Mei, D. Hybrid Deep Learning Model for Vegetable Price Forecasting Based on Principal Component Analysis and Attention Mechanism. Phys. Scr. 2024, 99, 125017. [Google Scholar] [CrossRef]
- Fang, T.; Zhang, J.; Qi, D.; Gao, M. BLSENet: A Novel Lightweight Bilinear Convolutional Neural Network Based on Attention Mechanism and Feature Fusion Strategy for Apple Leaf Disease Classification. J. Food Qual. 2024, 2024, 5561625. [Google Scholar] [CrossRef]
- Zhang, C.; Zhang, S.; Yang, J.; Shi, Y.; Chen, J. Apple Leaf Disease Identification Using Genetic Algorithm and Correlation Based Feature Selection Method. Int. J. Agric. Biol. Eng. 2017, 10, 74–83. [Google Scholar] [CrossRef]
- Jin, D.; Yin, H.; Gu, Y.H. Shuffle-PG: Lightweight Feature Extraction Model for Retrieving Images of Plant Diseases and Pests with Deep Metric Learning. Alex. Eng. J. 2025, 113, 138–149. [Google Scholar] [CrossRef]
- Liu, J.; Wang, X. Plant Diseases and Pests Detection Based on Deep Learning: A Review. Plant Methods 2021, 17, 22. [Google Scholar] [CrossRef]
- Singh, S.; Gupta, S.; Tanta, A.; Gupta, R. Extraction of Multiple Diseases in Apple Leaf Using Machine Learning. Int. J. Image Graph. 2021, online. [Google Scholar] [CrossRef]
- Zhu, R.; Zou, H.; Li, Z.; Ni, R. Apple-Net: A Model Based on Improved YOLOv5 to Detect the Apple Leaf Diseases. Plants 2023, 12, 169. [Google Scholar] [CrossRef]
- Singh, V.; Chug, A.; Singh, A.P. Classification of Beans Leaf Diseases Using Fine Tuned CNN Model. Procedia Comput. Sci. 2023, 218, 348–356. [Google Scholar] [CrossRef]
- Jiang, X.; Ding, R.; Hu, H.; Wang, T.; Liu, X.; Shi, J. Image Classification of Leaf Diseases Based on Transfer Learning. In Proceedings of the 7th International Conference on Computer and Communications (ICCC), Chengdu, China, 10–13 December 2021; pp. 821–825. [Google Scholar] [CrossRef]
- Jiang, P.; Chen, Y.; Liu, B.; He, D.; Liang, C. Real-Time Detection of Apple Leaf Diseases Using Deep Learning Approach Based on Improved Convolutional Neural Networks. IEEE Access 2019, 7, 59069–59080. [Google Scholar] [CrossRef]
- Zhang, X.; Zhou, X.; Lin, M.; Sun, J. ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 6848–6856. [Google Scholar] [CrossRef]
- Ding, J.; Zhang, C.; Cheng, X.; Yue, Y.; Fan, G.; Wu, Y.; Zhang, Y. Method for Classifying Apple Leaf Diseases Based on Dual Attention and Multi-Scale Feature Extraction. Agriculture 2023, 13, 940. [Google Scholar] [CrossRef]
- Sun, Y.; Ning, L.; Zhao, B.; Yan, J. Tomato Leaf Disease Classification by Combining EfficientNetv2 and a Swin Transformer. Appl. Sci. 2024, 14, 7472. [Google Scholar] [CrossRef]










| Class Label | Disease Type | Number of Samples |
|---|---|---|
| 0 | Alternaria leaf spot | 292 |
| 1 | Brown spot | 288 |
| 2 | Frogeye leaf spot | 2227 |
| 3 | Grey spot | 238 |
| 4 | Health | 362 |
| 5 | Mosaic | 260 |
| 6 | Powdery mildew | 829 |
| 7 | Rust | 1928 |
| 8 | Scab | 3787 |
| Model Architecture | FLOPs (G) | Latency (ms) | Memory Usage (GB) |
|---|---|---|---|
| ResNet18 (Baseline) | 1.8 | 1.433 | 2.348 |
| ResNet18-AttentionPCA | 2.9 | 4.600 | 2.348 |
| Experiment | ResNet18 (Baseline) | ResNet18-AttentionPCA |
|---|---|---|
| 1 | 90.02 | 93.58 |
| 2 | 90.45 | 93.72 |
| 3 | 90.11 | 93.81 |
| 4 | 90.31 | 93.64 |
| 5 | 90.21 | 93.67 |
| Model Variant | Accuracy (%) | Improvement (%) |
|---|---|---|
| ResNet18 baseline | 90.18 | - |
| ResNet18 + PCA downsampling | 91.25 | 1.07 |
| ResNet18 + spatial attention | 90.72 | 0.54 |
| ResNet18-AttentionPCA | 93.69 | 3.51 |
| Model | Accuracy (%) |
|---|---|
| INAR-SSD (SSD with inception module and rainbow concatenation) [34] | 78.80 |
| ShuffleNet [35] | 84.36 |
| ConvNeXt [36] | 86.70 |
| ResNet50 [36] | 86.38 |
| Swin Transformer [37] | 91.06 |
| MGA-YOLO [31] | 91.25 |
| EfficientNet-V2 [37] | 92.47 |
| ResNet18-AttentionPCA | 93.69 |
| Leaf Disease | Red Channel | Green Channel | Blue Channel |
|---|---|---|---|
| Grey spot | 0.249 | 0.219 | 0.210 |
| Mosaic | 0.203 | 0.282 | 0.201 |
| Brown spot | 0.256 | 0.290 | 0.290 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Xu, K.; Yu, J.; Zhu, F.; Li, Z.; Li, X. Optimization of Deep Learning Model Based on Attention-Guided PCA Dimensionality Reduction. Horticulturae 2025, 11, 1346. https://doi.org/10.3390/horticulturae11111346
Xu K, Yu J, Zhu F, Li Z, Li X. Optimization of Deep Learning Model Based on Attention-Guided PCA Dimensionality Reduction. Horticulturae. 2025; 11(11):1346. https://doi.org/10.3390/horticulturae11111346
Chicago/Turabian StyleXu, Kangkai, Jinpeng Yu, Fenghua Zhu, Zheng Li, and Xiaowei Li. 2025. "Optimization of Deep Learning Model Based on Attention-Guided PCA Dimensionality Reduction" Horticulturae 11, no. 11: 1346. https://doi.org/10.3390/horticulturae11111346
APA StyleXu, K., Yu, J., Zhu, F., Li, Z., & Li, X. (2025). Optimization of Deep Learning Model Based on Attention-Guided PCA Dimensionality Reduction. Horticulturae, 11(11), 1346. https://doi.org/10.3390/horticulturae11111346

