Influence of Hyperparameters in Deep Learning Models for Coffee Rust Detection
<p>Schematic representation of transfer learning. Typically, dataset B is much smaller than dataset A. The classifier block contains new fully-connected (FC) layers and the output of the model.</p> "> Figure 2
<p>Proposed methodology for quantitative evaluation of coffee rust detection models using transfer learning.</p> "> Figure 3
<p>Different levels of coffee rust severity. The higher the level, the more the coffee leaf is affected by coffee rust. Level 1 implies that between 1% to 5% of the leaf has rust, level 2 means that between 6% to 20% of the leaf is affected, level 3 has an affectation between 21% to 50% of the leaf, while level 4 implies that more than 50% of the leaf has rust.</p> "> Figure 4
<p>Summary of evaluation results by pre-trained model used as a backbone, in terms of F1-score. Points marked with + represent outliers beyond the first and third quartiles.</p> "> Figure 5
<p>Summary of evaluation results by optimizer, in terms of F1-score.</p> "> Figure 6
<p>Evaluation results for VGG19 model by learning rate and Optimizer, in terms of F1-score.</p> "> Figure 7
<p>Summary of evaluation results by learning rate and model type, in terms of F1-score.</p> "> Figure 8
<p>Summary of evaluation results by the number of neurons in the last FC layer (except the output layer), in terms of F1-score.</p> "> Figure 9
<p>Summary of evaluation results by the last layer transfered, in terms of F1-score.</p> "> Figure 10
<p>Confusion matrices of the models obtained from DenseNet201, Xception, MobileNetV2, Inception, VGG19 and InceptionResNetV2, by transfer learning. Multi-class classification with 0: Healthy, 1: Other, and 2: Rust. The darker the grid, the greater the number of cases located in that condition.</p> ">
Abstract
:1. Introduction
- We propose a methodology for model-centric deep learning projects that allows hierarchization of hyperparameters and selection of the most appropriate values for the performance of crop disease detection models.
- This methodology was applied to the problem of rust detection in coffee crops and allowed to rank five types of hyperparameters (type of network, depth, number of neurons in the FC layer, optimizer and learning rate), as well as to identify values that allow to improve classifier performance.
- With this methodology, it was possible to improve the F1-score of the classifier from 18.4% to 92.71%, without making any adjustments to the image set.
2. Preliminary Concepts
2.1. Convolutional Neural Networks
2.2. Transfer Learning
3. Methodology
3.1. Collection and Preparation of the Dataset
- Apply crop to have a single leaf per image.
- Remove background that does not belong to the white background or natural environment of the leaf.
- Discard images that contain rust along with other diseases on the same leaf.
- Enlarge the image to fit the coffee leaf.
3.2. Hyperparameter Selection
3.3. Modelling
3.4. Evaluation
4. Results
4.1. Evaluation by Pre-Trained Model Used as Backbone
4.2. Evaluation by the Optimizer
4.3. Evaluation by the Learning Rate (LR)
4.4. Evaluation by the Neurons in FC Layers
4.5. Evaluation by the Network Depth
4.6. Comparison between the Best Models by Pre-Trained Network
5. Discussion
6. Conclusions
7. Future Work
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Donatelli, M.; Magarey, R.D.; Bregaglio, S.; Willocquet, L.; Whish, J.P.; Savary, S. Modelling the impacts of pests and diseases on agricultural systems. Agric. Syst. 2017, 155, 213–224. [Google Scholar] [CrossRef] [PubMed]
- Raza, A.; Razzaq, A.; Mehmood, S.S.; Zou, X.; Zhang, X.; Lv, Y.; Xu, J. Impact of climate change on crops adaptation and strategies to tackle its outcome: A review. Plants 2019, 8, 34. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Bai, X.; Cao, Z.; Zhao, L.; Zhang, J.; Lv, C.; Li, C.; Xie, J. Rice heading stage automatic observation by multi-classifier cascade based rice spike detection method. Agric. For. Meteorol. 2018, 259, 260–270. [Google Scholar] [CrossRef]
- Liakos, K.G.; Busato, P.; Moshou, D.; Pearson, S.; Bochtis, D. Machine learning in agriculture: A review. Sensors 2018, 18, 2674. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Iqbal, Z.; Khan, M.A.; Sharif, M.; Shah, J.H.; ur Rehman, M.H.; Javed, K. An automated detection and classification of citrus plant diseases using image processing techniques: A review. Comput. Electron. Agric. 2018, 153, 12–32. [Google Scholar] [CrossRef]
- Barbedo, J.G.A. A review on the main challenges in automatic plant disease identification based on visible range images. Biosyst. Eng. 2016, 144, 52–60. [Google Scholar] [CrossRef]
- Barbedo, J.G. Factors influencing the use of deep learning for plant disease recognition. Biosyst. Eng. 2018, 172, 84–91. [Google Scholar] [CrossRef]
- Mohanty, S.P.; Hughes, D.P.; Salathé, M. Using deep learning for image-based plant disease detection. Front. Plant Sci. 2016, 7, 1419. [Google Scholar] [CrossRef] [Green Version]
- Ng, A. Machine Learning Yearning. 2017. Available online: http://www.mlyearning.org/ (accessed on 15 February 2023).
- Barbedo, J.G.A.; Koenigkan, L.V.; Halfeld-Vieira, B.A.; Costa, R.V.; Nechet, K.L.; Godoy, C.V.; Junior, M.L.; Patricio, F.R.A.; Talamini, V.; Chitarra, L.G.; et al. Annotated plant pathology databases for image-based detection and recognition of diseases. IEEE Lat. Am. Trans. 2018, 16, 1749–1757. [Google Scholar] [CrossRef] [Green Version]
- Barbedo, J.G.A. Impact of dataset size and variety on the effectiveness of deep learning and transfer learning for plant disease classification. Comput. Electron. Agric. 2018, 153, 46–53. [Google Scholar] [CrossRef]
- Chen, J.; Chen, J.; Zhang, D.; Sun, Y.; Nanehkaran, Y.A. Using deep transfer learning for image-based plant disease identification. Comput. Electron. Agric. 2020, 173, 105393. [Google Scholar] [CrossRef]
- Esgario, J.G.; Krohling, R.A.; Ventura, J.A. Deep learning for classification and severity estimation of coffee leaf biotic stress. Comput. Electron. Agric. 2020, 169, 105162. [Google Scholar] [CrossRef] [Green Version]
- Manso, G.L.; Knidel, H.; Krohling, R.A.; Ventura, J.A. A smartphone application to detection and classification of coffee leaf miner and coffee leaf rust. arXiv 2019, arXiv:1904.00742. [Google Scholar]
- Yebasse, M.; Shimelis, B.; Warku, H.; Ko, J.; Cheoi, K.J. Coffee disease visualization and classification. Plants 2021, 10, 1257. [Google Scholar] [CrossRef]
- Martinez, F.; Montiel, H.; Martinez, F. A machine learning model for the diagnosis of coffee diseases. Int. J. Adv. Comput. Sci. Appl. 2022, 13, 968–974. [Google Scholar] [CrossRef]
- Esgario, J.G.; de Castro, P.B.; Tassis, L.M.; Krohling, R.A. An app to assist farmers in the identification of diseases and pests of coffee leaves using deep learning. Inf. Process. Agric. 2022, 9, 38–47. [Google Scholar] [CrossRef]
- Montalbo, F.J.P.; Hernandez, A.A. An Optimized Classification Model for Coffea Liberica Disease using Deep Convolutional Neural Networks. In Proceedings of the 2020 16th IEEE International Colloquium on Signal Processing & Its Applications (CSPA), Langkawi, Malaysia, 28–29 February 2020; pp. 213–218. [Google Scholar]
- Aufar, Y.; Kaloka, T.P. Robusta coffee leaf diseases detection based on MobileNetV2 model. Int. J. Electr. Comput. Eng. 2022, 12, 6675. [Google Scholar] [CrossRef]
- Sorte, L.X.B.; Ferraz, C.T.; Fambrini, F.; dos Reis Goulart, R.; Saito, J.H. Coffee leaf disease recognition based on deep learning and texture attributes. Procedia Comput. Sci. 2019, 159, 135–144. [Google Scholar] [CrossRef]
- Montalbo, F.J.P.; Hernandez, A.A. Classifying Barako coffee leaf diseases using deep convolutional models. Int. J. Adv. Intell. Inform. 2020, 6, 197–209. [Google Scholar] [CrossRef]
- Charu, C.A. Neural Networks and Deep Learning: A Textbook; Springer: Cham, Switzerland, 2018. [Google Scholar]
- Sameen, M.I.; Pradhan, B. Landslide detection using residual networks and the fusion of spectral and topographic information. IEEE Access 2019, 7, 114363–114373. [Google Scholar] [CrossRef]
- Verdhan, V. Computer Vision Using Deep Learning; Apress: Berkeley, CA, USA, 2021. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 1–9. [Google Scholar]
- Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2818–2826. [Google Scholar]
- Sifre, L.; Mallat, S. Rigid-motion scattering for texture classification. arXiv 2014, arXiv:1403.1687. [Google Scholar]
- Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 1251–1258. [Google Scholar]
- Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K.Q. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 4700–4708. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 4510–4520. [Google Scholar]
- Tan, M.; Le, Q. Efficientnet: Rethinking model scaling for convolutional neural networks. In Proceedings of the International Conference on Machine Learning, PMLR 2019, Long Beach, CA, USA, 9–15 June 2019; pp. 6105–6114. [Google Scholar]
- Szegedy, C.; Ioffe, S.; Vanhoucke, V.; Alemi, A.A. Inception-v4, inception-resnet and the impact of residual connections on learning. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2017. [Google Scholar]
- Pachón, C.G.; Ballesteros, D.M.; Renza, D. Fake banknote recognition using deep learning. Appl. Sci. 2021, 11, 1281. [Google Scholar] [CrossRef]
- Ulloa, C.; Ballesteros, D.M.; Renza, D. Video forensics: Identifying colorized images using deep learning. Appl. Sci. 2021, 11, 476. [Google Scholar] [CrossRef]
- Umair, M.; Khan, M.S.; Ahmed, F.; Baothman, F.; Alqahtani, F.; Alian, M.; Ahmad, J. Detection of COVID-19 Using Transfer Learning and Grad-CAM Visualization on Indigenously Collected X-ray Dataset. Sensors 2021, 21, 5813. [Google Scholar] [CrossRef]
- Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Li, F.-F. Imagenet: A large-scale hierarchical image database. In Proceedings of the 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; pp. 248–255. [Google Scholar]
- Parraga-Alava, J.; Cusme, K.; Loor, A.; Santander, E. RoCoLe: A robusta coffee leaf images dataset for evaluation of machine learning based methods in plant diseases recognition. Data Brief 2019, 25, 104414. [Google Scholar] [CrossRef]
- Krohling, R.A.; Esgario, J.; Ventura, J.A. BRACOL—A Brazilian Arabica Coffee Leaf images dataset to identification and quantification of coffee diseases and pests. Mendeley Data 2019, 1. [Google Scholar] [CrossRef]
- Brito Silva, L.; Cavalcante Carneiro, A.L.; Silveira Almeida Renaud Faulin, M. Rust (Hemileia vastatrix) and Leaf Miner (Leucoptera coffeella) in Coffee Crop (Coffea arabica). Mendeley Data 2020, 4. [Google Scholar] [CrossRef]
- Godbole, V.; Dahl, G.E.; Gilmer, J.; Shallue, C.J.; Nado, Z. Deep Learning Tuning Playbook. 2023. Available online: https://github.com/google-research/tuning_playbook (accessed on 15 March 2023).
- Tassis, L.M.; de Souza, J.E.T.; Krohling, R.A. A deep learning approach combining instance and semantic segmentation to identify diseases and pests of coffee leaves from in-field images. Comput. Electron. Agric. 2021, 186, 106191. [Google Scholar] [CrossRef]
Pre-Trained Model | Authors | Default Input Size | No. of Layers (FC Included) | No. of Parameters |
---|---|---|---|---|
VGG19 [25] | (Simonyan, 2014) | 19 | 143,667,240 | |
ResNet50 [26] | (He, 2016) | 224 × 224 | 152 | 25,636,712 |
InceptionV3 [28] | (Szegedy C. V., 2016) | 299 × 299 | 159 | 23,851,784 |
Xception [30] | (Chollet, 2017) | 299 × 299 | 126 | 22,910,480 |
MobileNetV2 [32] | (Sandler, 2018) | 224 × 224 | 88 | 3,538,984 |
DenseNet201 [31] | (Huang, 2017) | 224 × 224 | 201 | 20,242,984 |
EfficientNetB5 [33] | (Tan, 2019) | 456 × 456 | 30,562,527 | |
InceptionResNetV2 [34] | (Szegedy C. I., 2016) | 299 × 299 | 572 | 55,873,736 |
Dataset | Healthy | Rust | Other |
---|---|---|---|
Bracol [40] | 272 | 272 | 751 |
RoCoLe [39] | 789 | 602 | 167 |
D&P [41] | 0 | 285 | 257 |
Digipathos [10] | 4 | 49 | 139 |
Licole [21] | 621 | 515 | 614 |
Total | 1686 | 1723 | 1928 |
Classes | Training | Validation | Testing |
---|---|---|---|
Healthy | 1378 | 146 | 162 |
Other | 1378 | 176 | 202 |
Rust | 1566 | 159 | 170 |
Total | 4322 | 481 | 534 |
Type | Hyperparameter | Number of Options | Values |
---|---|---|---|
Architecture | Pre-trained model | 8 | VGG19, ResNet50, InceptionV3 InceptionResNetV2, MobileNetV2 DenseNet201, EfficientNetB5, Xception |
Network Depth | 4 | L1 (deeper), L2, L3, L4 (shallower) | |
Neurons (FC layer) | 3 | 256, 512 and 1024 | |
Training | Optimizer | 3 | SGD, Nadam, RMSprop |
Learning Rate (LR) | 3 | , , |
Pre-Trained Model | Learning Rate | Neurons | Optimizer | P | R | F1 | Acc |
---|---|---|---|---|---|---|---|
DenseNet201 | 256 | Nadam | 94.60 | 94.80 | 94.70 | 94.80 | |
InceptionV3 | 256 | RMSprop | 94.10 | 94.30 | 94.20 | 94.20 | |
Xception | 256 | RMSprop | 93.20 | 93.20 | 93.20 | 93.30 | |
MobileNetV2 | 256 | RMSprop | 91.50 | 91.80 | 91.60 | 91.60 | |
VGG19 | 256 | Nadam | 88.90 | 89.00 | 88.90 | 89.10 | |
InceptionResNetV2 | 256 | RMSprop | 88.57 | 88.77 | 88.59 | 88.58 |
Architecture | Last Layer | Time (s/epoch) | Avg ms/Step | Size (MB) | Param Num |
---|---|---|---|---|---|
Densenet201 | conv5_block31_concat | 112 | 93.2 | 219.1 | 30,112,963 |
Inceptionv3 | mixed6 | 329 | 135.5 | 263.9 | 26,494,243 |
Xception | block13_sepconv1_act | 398 | 310.0 | 378.7 | 40,899,419 |
MobileNetv2 | block_14_add | 30 | 25.9 | 16.9 | 2,066,755 |
VGG19 | block4_pool | 82 | 90.0 | 269 | 29,461,571 |
InceptionResnetv2 | block8_8_mixed | 177 | 59.3 | 199 | 47,164,995 |
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
Chavarro, A.F.; Renza, D.; Ballesteros, D.M. Influence of Hyperparameters in Deep Learning Models for Coffee Rust Detection. Appl. Sci. 2023, 13, 4565. https://doi.org/10.3390/app13074565
Chavarro AF, Renza D, Ballesteros DM. Influence of Hyperparameters in Deep Learning Models for Coffee Rust Detection. Applied Sciences. 2023; 13(7):4565. https://doi.org/10.3390/app13074565
Chicago/Turabian StyleChavarro, Adrian F., Diego Renza, and Dora M. Ballesteros. 2023. "Influence of Hyperparameters in Deep Learning Models for Coffee Rust Detection" Applied Sciences 13, no. 7: 4565. https://doi.org/10.3390/app13074565
APA StyleChavarro, A. F., Renza, D., & Ballesteros, D. M. (2023). Influence of Hyperparameters in Deep Learning Models for Coffee Rust Detection. Applied Sciences, 13(7), 4565. https://doi.org/10.3390/app13074565