HMFN-FSL: Heterogeneous Metric Fusion Network-Based Few-Shot Learning for Crop Disease Recognition
Abstract
:1. Introduction
- (1)
- A CBAM attention module was embedded in the feature network for few-shot learning to focus on important lesion feature regions to improve the generalization ability of the network.
- (2)
- Optimization of the pre-training strategy of the feature extraction network for metric learning to improve the generalization ability of the feature encoder.
- (3)
- A Heterogeneous Metrics Fusion Network (HMFN-FSL) was constructed to improve the prediction performance and reliability.
- (4)
- Extensive experiments were conducted on crop leaf disease datasets in laboratory scenes and field scenes to validate the superiority of the model and to provide a feasible solution for the recognition of crop leaf diseases for few-shot learning in the field.
2. Materials and Methods
2.1. Dataset
2.2. Problem Formulation
2.2.1. Support Set and Query Set
2.2.2. N-Way K-Shot
2.3. Preparatory
2.3.1. Metric Learning
- Prototypical Network
- Matching Network
- DeepEMD
2.3.2. CBAM (Convolutional Block Attention Module)
- Channel Attention Module
- Spatial Attention Module
- CBAM
2.3.3. Stacking Framework
2.4. The Architecture of HMFN-FSL
2.4.1. The Meta-Learning Framework of HMFN-FSL
2.4.2. Feasibility of Loss-DM
2.4.3. Algorithm of HMFN-FSL
Algorithm 1 The algorithm of HMFN-FSL |
Input: dataloader, n_way, n_shot, n_query, task_per_batch |
Output: avg_acc, avg_loss |
for i in epoch: train: for j in batch: task = task(dataloader, n_way,n_shot, n_query, task_per_batch) |
X10…X1n = fθ1(task.x_shot) X1 = mean(X10…X1n) y1 = fθ1(task.x_query) X20…X2n = fθ2(task.x_shot) X2 = mean(X20…X2n) y2 = fθ2(task.x_query) X30…X3n = fθ3(task.x_shot) X3 = mean(X30…X3n) y3 = fθ3(task.x_query) Logits_Proto = classifer(Proto_distance(x1, y3)) Logits_Matching = classifer(Matching_distance(x2, y3)) Logits_EMD = classifer(EMD_distance(x3, y3)) Total_Logits = HMFN-FSLθ4(Logits_Proto, Logits_Matching, Logits_EMD) Loss = cross_entropy(Total_Logits, task.label) acc = compute (Total_Logits, task.label) Loss.backward() end for Validation: val Compute: avg_acc, avg_loss end for Return: avg_acc, avg_loss |
3. Results
3.1. Data Setting
3.2. Training Strategy and Hyperparameters
3.3. CBAM Effectiveness
3.3.1. The Performance of Base Learners with CBAM
3.3.2. Base Learner Training Loss Curve
3.4. The Impact of Training Strategy
3.5. The Performance of HMFN-FSL
3.5.1. Comparison with the Baseline Method
3.5.2. Ablation Analysis
3.5.3. K-Fold Cross-Validation
3.6. Comparison with Related Models
3.7. Cross-Domain and Field Scenes
4. Discussion
4.1. The Impact of Way and Shot
4.2. Limitations and Future Work
5. Conclusions
- (1)
- The impact of CBAM on the performance of base learner experiments shows that fusing the CBAM module into the feature extraction network of the base learner can significantly improve the feature extraction capability of the model. Compared to the base learner, the average accuracy of the embedded CBAM model increased by 2.14%.
- (2)
- Compared to other base learners, the HMFN-FSL proposed in this study has higher accuracy and robustness. On 5way-1shot, the proposed model improves the accuracy of DeepEMD by 7.43% over the best base learners. The experimental results show that HMFN-FSL is effective for few-shot crop leaf disease recognition. Moreover, this study compares with state-of-the-art algorithms [32,33,36,42,46], and the model achieves the best performance. In addition, by changing the way and shot parameter configurations of the learning process, some key features affecting the classification accuracy were revealed. Overall, the model accuracy of the model increased as the number of shots increased, while the accuracy decreased as the number of ways increased.
- (3)
- Cross-domain experiments of the model show that HMFN-FSL trained using the no-disease domain achieves 79.52% and 92.30% accuracy on the 5way-1shot and 5way-5shot tasks in the laboratory scenes, respectively. Moreover, it still shows high recognition accuracy on the complex scene dataset. The average recognition accuracy of the model reaches 73.80% and 85.86% on the 5way-1shot and 5way-5shot tasks, respectively. These results further demonstrate that the HMFN-FSL proposed in this study can be adapted to few-shot recognition in laboratory and field scenes.
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Oerke, E.C.; Dehne, H.W. Safeguarding production—Losses in major crops and the role of crop protection. Crop Prot. 2004, 23, 275–285. [Google Scholar] [CrossRef]
- Strange, R.N.; Scott, P.R. Plant disease: A threat to global food security. Annu. Rev. Phytopathol. 2005, 43, 83–116. [Google Scholar] [CrossRef] [PubMed]
- Lu, Y.; Yi, S.; Zeng, N.; Liu, Y.; Zhang, Y. Identification of rice diseases using deep convolutional neural networks. Neurocomputing 2017, 267, 378–384. [Google Scholar] [CrossRef]
- Fuentes, A.; Yoon, S.; Kim, S.C.; Park, D.S. A Robust Deep-Learning-Based Detector for Real-Time Tomato Plant Diseases and Pests Recognition. Sensors 2017, 17, 2022. [Google Scholar] [CrossRef] [PubMed]
- Ma, J.; Du, K.; Zheng, F.; Zhang, L.; Gong, Z.; Sun, Z. A recognition method for cucumber diseases using leaf symptom images based on deep convolutional neural network. Comput. Electron. Agric. 2018, 154, 18–24. [Google Scholar] [CrossRef]
- Long, M.; Ouyang, C.; Liu, H.; Fu, Q. Oil tea disease image recognition based on convolutional neural network and transfer learning. Trans. Chin. Soc. Agric. Eng. 2018, 34, 196–201. [Google Scholar] [CrossRef]
- Zhang, X.; Qiao, Y.; Meng, F.; Fan, C.; Zhang, M. Identification of Maize Leaf Diseases Using Improved Deep Convolutional Neural Networks. IEEE Access 2018, 6, 30370–30377. [Google Scholar] [CrossRef]
- Dhiman, P.; Kaur, A.; Balasaraswathi, V.R.; Gulzar, Y.; Alwan, A.A.; Hamid, Y. Image Acquisition, Preprocessing and Classification of Citrus Fruit Diseases: A Systematic Literature Review. Sustainability 2023, 15, 9643. [Google Scholar] [CrossRef]
- Gulzar, Y.; Ünal, Z.; Aktas, H.; Mir, M.S. Harnessing the Power of Transfer Learning in Sunflower Disease Detection: A Comparative Study. Agriculture 2023, 13, 1479. [Google Scholar] [CrossRef]
- 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, 6. [Google Scholar] [CrossRef]
- Chen, Y.P.; Pan, J.C.; Wu, Q.F. Apple leaf disease identification via improved CycleGAN and convolutional neural network. Soft Comput. 2023, 27, 9773–9786. [Google Scholar] [CrossRef]
- Cap, Q.H.; Uga, H.; Kagiwada, S.; Iyatomi, H. LeafGAN: An Effective Data Augmentation Method for Practical Plant Disease Diagnosis. IEEE Trans. Autom. Sci. Eng. 2022, 19, 1258–1267. [Google Scholar] [CrossRef]
- Gulzar, Y.; Hamid, Y.; Soomro, A.B.; Alwan, A.A.; Journaux, L. A Convolution Neural Network-Based Seed Classification System. Symmetry 2020, 12, 18. [Google Scholar] [CrossRef]
- Mamat, N.; Othman, M.F.; Abdulghafor, R.; Alwan, A.A.; Gulzar, Y. Enhancing Image Annotation Technique of Fruit Classification Using a Deep Learning Approach. Sustainability 2023, 15, 901. [Google Scholar] [CrossRef]
- Zhang, G.; Li, Z.; Liu, H.; Liu, W.; Long, C.; Huang, C. Based on improved DenseNet and A Transfer Learning Model for Identifying Lotus Leaf Diseases and Pests. Trans. Chin. Soc. Agric. Eng. 2023, 39, 188–196. [Google Scholar] [CrossRef]
- Li, Z.; Xu, J. Small sample recognition method of tea disease based on improved DenseNet. Trans. Chin. Soc. Agric. Eng. 2022, 38, 182–190. [Google Scholar] [CrossRef]
- Yang, M.; Zhang, Y. Corn disease recognition based on the Convolutional Neural Network with a small sampling size. Chin. J. Eco-Agric. 2020, 28, 1924–1931. [Google Scholar] [CrossRef]
- Gulzar, Y. Fruit Image Classification Model Based on MobileNetV2 with Deep Transfer Learning Technique. Sustainability 2023, 15, 1906. [Google Scholar] [CrossRef]
- Mensink, T.; Verbeek, J.; Perronnin, F.; Csurka, G. Distance-Based Image Classification: Generalizing to New Classes at Near-Zero Cost. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 2624–2637. [Google Scholar] [CrossRef]
- Pan, S.J.; Yang, Q.A. A Survey on Transfer Learning. IEEE Trans. Knowl. Data Eng. 2010, 22, 1345–1359. [Google Scholar] [CrossRef]
- Xiao, W.; Quan, F. Research on plant disease identification based on few-shot learning. J. Chin. Agric. Mech. 2021, 42, 138–143. [Google Scholar]
- Lin, H.; Tse, R.; Tang, S.K.; Qiang, Z.P.; Pau, G. Few-shot learning approach with multi-scale feature fusion and attention for plant disease recognition. Front. Plant Sci. 2022, 13, 907916. [Google Scholar] [CrossRef] [PubMed]
- Yang, J.C.; Guo, X.L.; Li, Y.; Marinello, F.; Ercisli, S.; Zhang, Z. A survey of few-shot learning in smart agriculture: Developments, applications, and challenges. Plant Methods 2022, 18, 12. [Google Scholar] [CrossRef] [PubMed]
- Woo, S.; Park, J. CBAM: Convolutional Block Attention Module. arXiv 2018, arXiv:1807.06521v2. [Google Scholar]
- Russakovsky, O.; Deng, J.; Su, H.; Krause, J.; Satheesh, S.; Ma, S.; Huang, Z.H.; Karpathy, A.; Khosla, A.; Bernstein, M.; et al. ImageNet Large Scale Visual Recognition Challenge. Int. J. Comput. Vis. 2015, 115, 211–252. [Google Scholar] [CrossRef]
- Hughes, D.; Salathé, M. An open access repository of images on plant health to enable the development of mobile disease diagnostics. arXiv 2015, arXiv:1511.08060. [Google Scholar]
- Gui, P.H.; Dang, W.J.; Zhu, F.Y.; Zhao, Q.J. Towards automatic field plant disease recognition. Comput. Electron. Agric. 2021, 191, 10. [Google Scholar] [CrossRef]
- Sun, J.Q.; Cao, W.; Fu, X.; Ochi, S.; Yamanaka, T. Few-shot learning for plant disease recognition: A review. Agron. J. 2023, 13, 28. [Google Scholar] [CrossRef]
- Abade, A.; Ferreira, P.A.; Vidal, F.D. Plant diseases recognition on images using convolutional neural networks: A systematic review. Comput. Electron. Agric. 2021, 185, 31. [Google Scholar] [CrossRef]
- Wang, X.T.; Cao, W.Q. GACN: Generative Adversarial Classified Network for Balancing Plant Disease Dataset and Plant Disease Recognition. Sensors 2023, 23, 6844. [Google Scholar] [CrossRef]
- Ghofrani, A.; Toroghi, R.M. Knowledge distillation in plant disease recognition. Neural Comput. Appl. 2022, 34, 14287–14296. [Google Scholar] [CrossRef]
- Snell, J.; Swersky, K. Prototypical Networks for Few-shot Learning. arXiv 2017, arXiv:1703.05175v2. [Google Scholar]
- Vinyals, O.; Blundell, C. Matching Networks for One Shot Learning. arXiv 2017, arXiv:1606.04080v2. [Google Scholar]
- Greff, K.; Srivastava, R.K.; Koutnik, J.; Steunebrink, B.R.; Schmidhuber, J. LSTM: A Search Space Odyssey. IEEE Trans. Neural Netw. Learn. Syst. 2017, 28, 2222–2232. [Google Scholar] [CrossRef] [PubMed]
- Barratt, S. On the differentiability of the solution to convex optimization problems. arXiv 2018, arXiv:1804.05098. [Google Scholar]
- Zhang, C.; Cai, Y. DeepEMD: Differentiable Earth Mover’s Distance for Few-Shot Learning. arXiv 2023, arXiv:2003.06777v5. [Google Scholar] [CrossRef] [PubMed]
- Chen, X.H.; Ji, A.M.; Cheng, G. A Novel Deep Feature Learning Method Based on the Fused-Stacked AEs for Planetary Gear Fault Diagnosis. Energies 2019, 12, 4522. [Google Scholar] [CrossRef]
- Sivari, E.; Bostanci, E.; Guzel, M.S.; Acici, K.; Asuroglu, T.; Ayyildiz, T.E. A New Approach for Gastrointestinal Tract Findings Detection and Classification: Deep Learning-Based Hybrid Stacking Ensemble Models. Diagnostics 2023, 13, 720. [Google Scholar] [CrossRef]
- Zhong, G.Q.; Zhang, K.; Wei, H.X.; Zheng, Y.C.; Dong, J.Y. Marginal Deep Architecture: Stacking Feature Learning Modules to Build Deep Learning Models. IEEE Access 2019, 7, 30220–30233. [Google Scholar] [CrossRef]
- Wu, W.; Jing, X.Y.; Du, W.C.; Chen, G.L. Learning dynamics of gradient descent optimization in deep neural networks. Sci. China-Inf. Sci. 2021, 64, 15. [Google Scholar] [CrossRef]
- Lee, D.G.; Jung, Y. Tutorial and applications of convolutional neural network models in image classification. J. Korean Data Inf. Sci. Sociaty 2022, 33, 533–549. [Google Scholar] [CrossRef]
- Finn, C.; Abbeel, P. Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. arXiv 2017, arXiv:1703.03400v3. [Google Scholar]
- Xu, H.H.; Li, W.; Cai, Z.P. Analysis on methods to effectively improve transfer learning performance. Theor. Comput. Sci. 2023, 940, 90–107. [Google Scholar] [CrossRef]
- Zhuang, F.Z.; Qi, Z.Y.; Duan, K.Y.; Xi, D.B.; Zhu, Y.C.; Zhu, H.S.; Xiong, H.; He, Q. A Comprehensive Survey on Transfer Learning. Proc. IEEE 2021, 109, 43–76. [Google Scholar] [CrossRef]
- Lu, J.; Behbood, V.; Hao, P.; Zuo, H.; Xue, S.; Zhang, G.Q. Transfer learning using computational intelligence: A survey. Knowl. -Based Syst. 2015, 80, 14–23. [Google Scholar] [CrossRef]
- Hu, H.; Zhan, D.-C. Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Wei, X.S.; Song, Y.Z.; Mac Aodha, O.; Wu, J.X.; Peng, Y.X.; Tang, J.H.; Yang, J.; Belongie, S. Fine-Grained Image Analysis with Deep Learning: A Survey. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 44, 8927–8948. [Google Scholar] [CrossRef] [PubMed]
- Liu, J.; Wang, X.W. Plant diseases and pests detection based on deep learning: A review. Plant Methods 2021, 17, 18. [Google Scholar] [CrossRef]
Species | Class Numbers | Class Name | Number of PV | Number of Field-PV |
---|---|---|---|---|
Apple | 4 | Apple scab, black rot, cedar, healthy | 3174 | 72 |
Blueberry | 1 | Healthy | 1502 | 12 |
cherry | 2 | Healthy, powdery mildew | 1905 | 20 |
corn | 4 | Gray leaf spot, common gray leaf spot, common | 3852 | 82 |
Grape | 4 | Black rot, black measles, healthy, leaf blight | 3862 | 52 |
Orange | 1 | Haunglongbing | 5507 | 33 |
Peach | 2 | Bacterial spot, healthy | 2657 | 31 |
Pepper | 2 | Bacterial spot, healthy | 2473 | 21 |
Potato | 3 | Early blight, healthy, late blight | 2152 | 36 |
Raspberry | 1 | Healthy | 371 | 8 |
Soybean | 1 | Healthy | 5089 | 23 |
Squash | 1 | Powdery mildew | 1835 | 25 |
Strawberry | 2 | Healthy, leaf scorch | 1565 | 80 |
Tomato | 10 | Bacterial spot, early blight, Healthy, late blight, leaf mold, septoria leaf spot, spider | 18,159 | 169 |
ID | Encoder | Method | 5way-1shot (Acc (%)) | 5way-1shot (95% MSE) |
---|---|---|---|---|
E1 | ResNet | Prototypical Net | 72.21 | 0.12 |
E2 | CBAM-ResNet | Prototypical Net | 74.55 | 0.05 |
E3 | ResNet | Matching Net | 72.51 | 0.10 |
E4 | CBAM-ResNet | Matching Net | 74.61 | 0.12 |
E5 | ResNet | DeepEMD | 76.34 | 0.10 |
E6 | CBAM-ResNet | DeepEMD | 78.22 | 0.07 |
ID | Training Stage | Method | 5way-1shot (Acc (%)) | 5way-1shot (95% MSE) |
---|---|---|---|---|
F1 | S2 | Prototypical Net | 75.34 | 0.11 |
F2 | S3 | Prototypical Net | 74.55 | 0.05 |
F3 | S2 | Matching Net | 75.26 | 0.10 |
F4 | S3 | Matching Net | 74.61 | 0.12 |
F5 | S2 | DeepEMD | 83.77 | 0.13 |
F6 | S3 | DeepEMD | 78.22 | 0.07 |
ID | Method | 5way-1shot (Acc (%)) | 5way-1shot (95% MSE) |
---|---|---|---|
G1 | Prototypical Net | 75.34 | 0.11 |
G2 | Matching Net | 75.26 | 0.10 |
G3 | DeepEMD | 83.77 | 0.13 |
G4 | HMFN-FSL | 91.20 | 0.13 |
Pre-Train on Mini-Imagenet | CBAM | 5way-1shot | 5way-5shot | ||
---|---|---|---|---|---|
Acc (%) | 95% MSE | Acc (%) | 95% MSE | ||
86.37 | 0.13 | 96.06 | 0.05 | ||
√ | 89.64 | 0.13 | 97.04 | 0.05 | |
√ | 87.83 | 0.12 | 96.33 | 0.07 | |
√ | √ | 91.20 | 0.13 | 98.29 | 0.03 |
Fold ID | Method | 5way-1shot (Acc (%)) | 5way-5shot (Acc (%)) |
---|---|---|---|
Fold A | HMFN-FSL | 91.17 | 98.29 |
Fold B | HMFN-FSL | 90.64 | 97.07 |
Fold C | HMFN-FSL | 91.15 | 98.09 |
Fold D | HMFN-FSL | 91.79 | 98.97 |
Fold E | HMFN-FSL | 91.23 | 98.36 |
AVG | HMFN-FSL | 91.20 | 98.17 |
ID | Method | 5way-1shot | 5way-5shot | ||
---|---|---|---|---|---|
Acc (%) | 95% MSE | Acc (%) | 95% MSE | ||
A1 | Prototypical Net | 72.21 | 0.12 | 91.26 | 0.13 |
A2 | Matching Net | 72.51 | 0.10 | 89.47 | 0.14 |
A3 | DeepEMD | 76.34 | 0.10 | 94.33 | 0.07 |
A4 | FEAT | 75.25 | 0.03 | 92.01 | 0.03 |
A5 | MAML | 63.25 | 0.16 | 82.17 | 0.07 |
A6 | HMFN-FSL | 91.20 | 0.13 | 98.29 | 0.03 |
ID | Training Stage | 5way-1shot | 5way-5shot | ||
---|---|---|---|---|---|
Acc (%) | 95% MSE | Acc (%) | 95% MSE | ||
H1 | S1 | 79.52 | 0.14 | 92.30 | 0.12 |
H2 | S2 | 91.20 | 0.13 | 98.29 | 0.03 |
H3 | S4 | 73.60 | 0.11 | 85.86 | 0.11 |
H4 | S5 | 76.80 | 0.11 | 88.49 | 0.10 |
H5 | S6 | 44.38 | 0.22 | 58.13 | 0.08 |
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. |
© 2023 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
Yan, W.; Feng, Q.; Yang, S.; Zhang, J.; Yang, W. HMFN-FSL: Heterogeneous Metric Fusion Network-Based Few-Shot Learning for Crop Disease Recognition. Agronomy 2023, 13, 2876. https://doi.org/10.3390/agronomy13122876
Yan W, Feng Q, Yang S, Zhang J, Yang W. HMFN-FSL: Heterogeneous Metric Fusion Network-Based Few-Shot Learning for Crop Disease Recognition. Agronomy. 2023; 13(12):2876. https://doi.org/10.3390/agronomy13122876
Chicago/Turabian StyleYan, Wenbo, Quan Feng, Sen Yang, Jianhua Zhang, and Wanxia Yang. 2023. "HMFN-FSL: Heterogeneous Metric Fusion Network-Based Few-Shot Learning for Crop Disease Recognition" Agronomy 13, no. 12: 2876. https://doi.org/10.3390/agronomy13122876
APA StyleYan, W., Feng, Q., Yang, S., Zhang, J., & Yang, W. (2023). HMFN-FSL: Heterogeneous Metric Fusion Network-Based Few-Shot Learning for Crop Disease Recognition. Agronomy, 13(12), 2876. https://doi.org/10.3390/agronomy13122876