Classification of Cassava Leaf Disease Based on a Non-Balanced Dataset Using Transformer-Embedded ResNet
Abstract
:1. Introduction
- In the cassava leaf disease detection task, transformer structure is introduced for the first time to pay attention to the global information and prevent the model from overfitting to the local background noise regions, and a new convolution network model (T-RNet) integrating the advantages of ResNet and transformer is proposed, which can extract more discriminative features. Experimental results for performance tests show that the proposed model has better classification performance than the popular commonly used CNN model;
- A new loss function (FAMP-softmax) is proposed to solve the problem of class non-balance in cassava leaf disease datasets. According to the accuracy and F1-score, the FAMP-Softmax performance is better than cross-entropy and focal loss function based on Resnet-50 and T-RNet;
- The interpretability of CNN feature extraction method for cassava leaf disease classification is discussed by using Grad_CAM attentional map and T-SNE visualization technology.
2. Related Work
2.1. Attention Mechanism and Transformer
2.2. Classification Loss Function
3. Proposed Methods
3.1. The General Architecture of T-RNet
3.2. Focal Angular Margin Penalty Softmax Loss
4. Experiments and Analyses
4.1. Datasets
4.2. Evaluation Metrics
4.3. Experimental Environment
4.4. Experimental Verification
4.5. Visualization Analysis
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Moses, E.; Asafu-Agyei, J.; Adubofour, K.; Adusei, A. Guide to Identification and Control of Cassava Diseases. 2008. Available online: https://www.isppweb.org/foodsecurity_casava_diseases.asp (accessed on 18 July 2022).
- Chikoti, P.C.; Mulenga, R.M.; Tembo, M.; Sseruwagi, P. Cassava mosaic disease: A review of a threat to cassava production in Zambia. J. Plant Pathol. 2019, 101, 467–477. [Google Scholar] [CrossRef] [PubMed]
- Ufuan Achidi, A.; Ajayi, O.A.; Bokanga, M.; Maziya-Dixon, B. The use of cassava leaves as food in Africa. Ecol. Food Nutr. 2005, 44, 423–435. [Google Scholar] [CrossRef]
- Oyewola, D.O.; Dada, E.G.; Misra, S.; Damaševičius, R. Detecting cassava mosaic disease using a deep residual convolutional neural network with distinct block processing. PeerJ Comput. Sci. 2021, 7, e352. [Google Scholar] [CrossRef] [PubMed]
- Camargo, A.; Smith, J.S. An image-processing based algorithm to automatically identify plant disease visual symptoms. Biosyst. Eng. 2009, 102, 9–21. [Google Scholar] [CrossRef]
- Meunkaewjinda, A.; Kumsawat, P.; Attakitmongcol, K.; Srikaew, A. Grape leaf disease detection from color imagery using hybrid intelligent system. In Proceedings of the 2008 5th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology, Piscataway, NJ, USA, 16–18 October 2008; pp. 513–516. [Google Scholar]
- Bracino, A.A.; Concepcion, R.S.; Bedruz, R.A.; Dadios, E.P.; Vicerra, R. Development of a Hybrid Machine Learning Model for Apple (Malus domestica) Health Detection and Disease Classification. In Proceedings of the 2020 IEEE 12th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Manila, Philippines, 3–7 December 2020; pp. 1–6. [Google Scholar]
- Pravin Kumar, S.K.; Sumithra, M.G.; Saranya, N. Particle Swarm Optimization(PSO) with fuzzy c means (PSO-FCM)–based segmentation and machine learning classifier for leaf diseases prediction. Concurr. Comput. Pract. Exp. 2021, 33, e5312. [Google Scholar]
- Acar, E.; Ertugrul, O.F.; Aldemir, E. Automatic identification of cassava leaf diseases utilizing morphological hidden patterns and multi-feature textures with a distributed structure-based classification approach. J. Plant Dis. Prot. 2022, 129, 605–621. [Google Scholar] [CrossRef]
- Abayomi-Alli, O.O.; Damaševičius, R.; Misra, S.; Maskeliūnas, R. Cassava disease recognition from low-quality images using enhanced data augmentation model and deep learning. Expert Syst. 2021, 38, e12746. [Google Scholar] [CrossRef]
- Ramcharan, A.; Baranowski, K.; McCloskey, P.; Ahmed, B.; Legg, J.; Hughes, D.P. Deep learning for image-based cassava disease detection. Front. Plant Sci. 2017, 8, 1852. [Google Scholar] [CrossRef] [PubMed]
- Sambasivam, G.; Opiyo, G.D. A predictive machine learning application in agriculture: Cassava disease detection and classification with imbalanced dataset using convolutional neural networks. Egypt. Inform. J. 2021, 22, 27–34. [Google Scholar] [CrossRef]
- Sangbamrung, I.; Praneetpholkrang, P.; Kanjanawattana, S. A novel automatic method for cassava disease classification using deep learning. J. Adv. Inf. Technol. 2020, 11, 241–248. [Google Scholar] [CrossRef]
- Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2818–2826. [Google Scholar]
- Ferentinos, K.P. Deep learning models for plant disease detection and diagnosis. Comput. Electron. Agric. 2018, 145, 311–318. [Google Scholar] [CrossRef]
- Ayu, H.R.; Surtono, A.; Apriyanto, D.K. Deep learning for detection cassava leaf disease. J. Phys. Conf. Ser. 2021, 1751, 012072. [Google Scholar] [CrossRef]
- Bi, C.; Wang, J.; Duan, Y.; Fu, B.; Kang, J.R.; Shi, Y. MobileNet Based Apple Leaf Diseases Identification. Mobile. Netw. Appl. 2022, 27, 172–180. [Google Scholar] [CrossRef]
- Zhong, Y.; Zhao, M. Research on deep learning in apple leaf disease recognition. Comput. Electron. Agric. 2020, 168, 105146. [Google Scholar] [CrossRef]
- Bansal, P.; Kumar, R.; Kumar, S. Disease Detection in Apple Leaves Using Deep Convolutional Neural Network. Agriculture 2021, 11, 617. [Google Scholar] [CrossRef]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the 2017 IEEE International conference on Computer Vision, Honolulu, HI, USA, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
- Deng, J.; Guo, J.; Xue, N.; Zafeiriou, S. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 4690–4699. [Google Scholar]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 11534–11542. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. CBAM: Convolutional block attention module. In Proceedings of the 15th European Conference on Computer Vision, Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Greff, K.; Srivastava, R.K.; Koutník, 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]
- Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; Sutskever, I. Language models are unsupervised multitask learners. OpenAI Blog. 2019, 1, 9. [Google Scholar]
- Srinivas, A.; Lin, T.Y.; Parmar, N.; Shlens, J.; Abbeel, P.; Vaswani, A. Bottleneck transformers for visual recognition. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 16519–16529. [Google Scholar]
- Carion, N.; Massa, F.; Synnaeve, G.; Usunier, N.; Kirillov, A.; Zagoruyko, S. End-to-end object detection with transformers. In Proceedings of the 16th European Conference on Computer Vision, Glasgow, UK, 23–28 August 2020; pp. 213–229. [Google Scholar]
- Sun, C.; Myers, A.; Vondrick, C.; Murphy, K.; Schmid, C. VideoBERT: A joint model for video and language representation learning. In Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 7464–7473. [Google Scholar]
- Lu, J.; Batra, D.; Parikh, D.; Lee, S. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019; pp. 13–23. [Google Scholar]
- Liu, W.; Wen, Y.; Yu, Z.; Yang, M. Large-margin softmax loss for convolutional neural networks. In Proceedings of the 33rd International Conference on Machine Learning, New York, NY, USA, 19–24 June 2016; pp. 507–516. [Google Scholar]
- Wang, H.; Wang, Y.; Zhou, Z.; Ji, X.; Gong, D.; Zhou, J. CosFace: Large margin cosine loss for deep face recognition. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 5265–5274. [Google Scholar]
- Wang, F.; Cheng, J.; Liu, W.; Liu, H. Additive margin softmax for face verification. IEEE Signal Process. Lett. 2018, 25, 926–930. [Google Scholar] [CrossRef] [Green Version]
- Hermans, A.; Beyer, L.; Leibe, B. In Defense of the Triplet Loss for Person Reidentification. arXiv 2017, arXiv:1703.07737. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K.Q. Densely connected convolutional networks. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 22–29 October 2017; pp. 2261–2269. [Google Scholar]
- Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 22–29 October 2017; pp. 1800–1807. [Google Scholar]
- Chen, H.; Wang, Y.; Guo, T.; Xu, C.; Deng, Y.; Liu, Z. Pretrained image processing transformer. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 12299–12310. [Google Scholar]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual explanations from deep networks via gradient-based localization. In Proceedings of the 2017 IEEE International Conference on Computer Vision, Honolulu, HI, USA, 22–29 October 2017; pp. 618–626. [Google Scholar]
- Van der Maaten, L.; Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res. 2008, 9, 2579–2605. [Google Scholar]
Category | Label |
---|---|
CBB (Cassava Bacterial Blight) | 0 |
CBSD (Cassava Brown Streak Disease) | 1 |
CGM (Cassava Green Mottle) | 2 |
CMD (Cassava Mosaic Disease) | 3 |
Healthy leaf | 4 |
CBB | CBSD | CGM | CMD | Healthy | Total | |
---|---|---|---|---|---|---|
Training | 869 | 1751 | 1909 | 10,527 | 2061 | 17,117 |
Testing | 218 | 438 | 477 | 2631 | 516 | 4280 |
Total | 1087 | 2189 | 2386 | 13,158 | 2577 | 21,397 |
CBB | CBSD | CGM | CMD | Healthy | ACC | Par. * | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Model | P | R | F | P | R | F | P | R | F | P | R | F | P | R | F | ||
Xception | 62.9 | 65.1 | 63.9 | 83.6 | 80.6 | 82.0 | 84.5 | 74.2 | 79.0 | 95.1 | 96.2 | 95.6 | 70.8 | 76.0 | 73.3 | 88.07 | 21 |
VGG16 | 66.2 | 64.7 | 65.4 | 80.8 | 81.9 | 81.4 | 82.2 | 79.4 | 80.8 | 95.1 | 96.5 | 95.8 | 75.1 | 71.5 | 73.3 | 88.50 | 134 |
Inception-v3 | 62.3 | 66.0 | 64.1 | 86.7 | 78.7 | 82.5 | 81.6 | 77.3 | 79.4 | 94.8 | 95.8 | 95.3 | 71.8 | 75.0 | 73.4 | 87.99 | 22 |
ResNet-50 | 70.8 | 60.5 | 65.3 | 86.9 | 80.3 | 83.5 | 85.8 | 74.0 | 79.5 | 93.5 | 97.6 | 95.4 | 75.0 | 77.7 | 76.3 | 88.93 | 25 |
DenseNet-121 | 65.1 | 70.1 | 67.5 | 88.0 | 75.3 | 81.1 | 81.0 | 80.7 | 80.8 | 94.5 | 96.7 | 95.6 | 74.6 | 72.8 | 73.7 | 88.50 | 27.2 |
T-RNet | 68.3 | 69.2 | 68.8 | 87.4 | 81.1 | 84.1 | 86.1 | 80.7 | 83.3 | 95.6 | 97.8 | 96.7 | 79.9 | 79.6 | 79.7 | 90.63 | 14 |
T-RNet * | 72.5 | 74.8 | 73.6 | 84.8 | 85.6 | 85.2 | 88.6 | 82.8 | 85.6 | 96.3 | 97.0 | 96.7 | 80.0 | 80.5 | 80.2 | 91.12 | 14 |
Model | Type | Precision | Recall | F1-Score |
---|---|---|---|---|
Xception | Macro | 79.4 | 78.4 | 78.7 |
Weighted | 88.2 | 88.0 | 88.0 | |
VGG16 | Macro | 79.9 | 78.8 | 79.3 |
Weighted | 88.3 | 88.5 | 88.4 | |
Inception-v3 | Macro | 79.4 | 78.6 | 78.9 |
Weighted | 88.1 | 88.0 | 88.0 | |
ResNet-50 | Macro | 82.4 | 78.0 | 80.0 |
Weighted | 88.6 | 88.9 | 88.7 | |
DenseNet-121 | Macro | 80.7 | 79.2 | 79.8 |
Weighted | 88.4 | 88.5 | 88.4 | |
T-RNet | Macro | 83.5 | 81.7 | 82.5 |
Weighted | 90.5 | 90.6 | 90.5 | |
T-RNet * | Macro | 84.3 | 84.1 | 84.2 |
Weighted | 91.1 | 91.1 | 91.1 |
(a) The improvement of accuracy, F1-score (Macro avg), and F1-score (Weighted avg) of ResNet. | ||||||
Method | Accuracy (%) | ▲ (%) | F (Macro avg) (%) | ▲ (%) | F (Weighted avg) (%) | ▲ (%) |
ResNet + Cross | 88.93 | - | 80.01 | - | 88.73 | - |
ResNet + Focal | 89.30 | 0.37 ↑ | 80.83 | 0.82 ↑ | 89.34 | 0.61 ↑ |
ResNet + FAMP | 89.81 | 0.88 ↑ | 81.23 | 1.22 ↑ | 89.76 | 1.03 ↑ |
(b) The improvement of accuracy, F1-score (Macro avg), and F1-score (Weighted avg) of T-RNet. | ||||||
Method | Accuracy (%) | ▲ (%) | F (Macro avg) (%) | ▲ (%) | F (Weighted avg) (%) | ▲ (%) |
T-RNet + Cross | 90.63 | - | 83.18 | - | 90.59 | - |
T-RNet + Focal | 90.79 | 0.16 ↑ | 83.17 | 0.01 ↓ | 90.79 | 0.20 ↑ |
T-RNet + FAMP | 91.12 | 0.49 ↑ | 84.26 | 1.08 ↑ | 91.12 | 0.33 ↑ |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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
Zhong, Y.; Huang, B.; Tang, C. Classification of Cassava Leaf Disease Based on a Non-Balanced Dataset Using Transformer-Embedded ResNet. Agriculture 2022, 12, 1360. https://doi.org/10.3390/agriculture12091360
Zhong Y, Huang B, Tang C. Classification of Cassava Leaf Disease Based on a Non-Balanced Dataset Using Transformer-Embedded ResNet. Agriculture. 2022; 12(9):1360. https://doi.org/10.3390/agriculture12091360
Chicago/Turabian StyleZhong, Yiwei, Baojin Huang, and Chaowei Tang. 2022. "Classification of Cassava Leaf Disease Based on a Non-Balanced Dataset Using Transformer-Embedded ResNet" Agriculture 12, no. 9: 1360. https://doi.org/10.3390/agriculture12091360