Method of Peanut Pod Quality Detection Based on Improved ResNet
Abstract
:1. Introduction
- We established a low-cost data acquisition system that captured RGB images through industrial cameras. Also, we established a standardized peanut pod quality dataset, including six categories: normal, insect pest, mildew, single fruit, damaged, and sprouted;
- A peanut pod quality detection model PQDA was established to solve the basic problems at present. The algorithm had the characteristics of high accuracy, fast detection, and small model size;
- The model was evaluated by a self-established peanut pod database, and the generalization experiment was carried out. We verified the generalization ability of the model and provided a reference for the precise grading of other agricultural products.
2. Materials and Methods
2.1. Materials
2.1.1. Dataset Acquisition
2.1.2. Data Augmentation
2.2. Methods
2.2.1. Introduction to ResNet18
2.2.2. KRS-ResNet18 Design
2.2.3. CSP-ResNet18 Design
2.2.4. CBAM-ResNet18 Design
2.2.5. PQDA Module Design
2.3. Evaluation Indexes
2.4. Experimental Environment and Parameter Settings
3. Results
3.1. Performance Comparison between Different Networks
3.2. Optimization Effect of Improved Model
3.2.1. CBAM-ResNet18
3.2.2. KRS-ResNet18
3.2.3. CSP-ResNet18
3.3. Effect of the PQDA Model
3.4. Model and Algorithm Test
4. Generalization Experiments
5. Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Wang, Y.; Lyu, J.; Chen, D. Performance assessment of peanut production in China. Acta Agric. Scand. Sect. B—Soil Plant Sci. 2021, 72, 176–188. [Google Scholar] [CrossRef]
- Reddy, K.R.N.; Salleh, B.; Saad, B.; Abbas, H.K.; Abel, C.A.; Shier, W.T. An overview of mycotoxin contamination in foods and its implications for human health. Toxin Rev. 2010, 29, 3–26. [Google Scholar] [CrossRef]
- Patel, K.K.; Kar, A.; Jha, S.N.; Khan, M.A. Machine vision system: A tool for quality inspection of food and agricultural products. J. Food Sci. Technol. 2012, 49, 123–141. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Chen, Y.; Wu, Q. Grape leaf disease identification with sparse data via generative adversarial networks and convolutional neural networks. Precis. Agric. 2022, 24, 235–253. [Google Scholar] [CrossRef]
- Li, D.; Wang, R.; Xie, C.; Liu, L.; Zhang, J.; Li, R.; Wang, F.; Zhou, M.; Liu, W. A Recognition Method for Rice Plant Diseases and Pests Video Detection Based on Deep Convolutional Neural Network. Sensors 2020, 20, 578. [Google Scholar] [CrossRef] [Green Version]
- Saeed, A.; Abdel-Aziz, A.A.; Mossad, A.; Abdelhamid, M.A.; Alkhaled, A.Y.; Mayhoub, M. Smart Detection of Tomato Leaf Diseases Using Transfer Learning-Based Convolutional Neural Networks. Agriculture 2023, 13, 139. [Google Scholar] [CrossRef]
- Shin, J.; Chang, Y.K.; Heung, B.; Nguyen-Quang, T.; Price, G.W.; Al-Mallahi, A. A deep learning approach for RGB image-based powdery mildew disease detection on strawberry leaves. Comput. Electron. Agric. 2021, 183, 106042. [Google Scholar] [CrossRef]
- Yu, H.; Cheng, X.; Li, Z.; Cai, Q.; Bi, C. Disease Recognition of Apple Leaf Using Lightweight Multi-Scale Network with ECANet. Comput. Model. Eng. Sci. 2022, 132, 711–738. [Google Scholar] [CrossRef]
- Mahmudul Hasan, A.S.M.; Sohel, F.; Diepeveen, D.; Laga, H.; Jones, M.G.K.; Cammarano, D. Weed recognition using deep learning techniques on class-imbalanced imagery. Crop Pasture Sci. 2022, 74, 628–644. [Google Scholar] [CrossRef]
- Fazel-Niari, Z.; Afkari-Sayyah, A.H.; Abbaspour-Gilandeh, Y.; Herrera-Miranda, I.; Hernández-Hernández, J.L.; Hernández-Hernández, M. Quality Assessment of Components of Wheat Seed Using Different Classifications Models. Appl. Sci. 2022, 12, 4133. [Google Scholar] [CrossRef]
- Xie, W.; Wei, S.; Zheng, Z.; Jiang, Y.; Yang, D. Recognition of Defective Carrots Based on Deep Learning and Transfer Learning. Food Bioprocess Technol. 2021, 14, 1361–1374. [Google Scholar] [CrossRef]
- Xu, P.; Tan, Q.; Zhang, Y.; Zha, X.; Yang, S.; Yang, R. Research on Maize Seed Classification and Recognition Based on Machine Vision and Deep Learning. Agriculture 2022, 12, 232. [Google Scholar] [CrossRef]
- Zhu, S.; Zhou, L.; Gao, P.; Bao, Y.; He, Y.; Feng, L. Near-Infrared Hyperspectral Imaging Combined with Deep Learning to Identify Cotton Seed Varieties. Molecules 2019, 24, 3268. [Google Scholar] [CrossRef] [Green Version]
- Guzman, E.; Baeten, V.; Pierna, J.A.; Garcia-Mesa, J.A. Determination of the olive maturity index of intact fruits using image analysis. J. Food Sci. Technol. 2015, 52, 1462–1470. [Google Scholar] [CrossRef] [Green Version]
- Wang, Z.; Underwood, J.; Walsh, K.B. Machine vision assessment of mango orchard flowering. Comput. Electron. Agric. 2018, 151, 501–511. [Google Scholar] [CrossRef]
- Yarak, K.; Witayangkurn, A.; Kritiyutanont, K.; Arunplod, C.; Shibasaki, R. Oil Palm Tree Detection and Health Classification on High-Resolution Imagery Using Deep Learning. Agriculture 2021, 11, 183. [Google Scholar] [CrossRef]
- Meng, Y.; Yuan, W.; Aktilek, E.U.; Zhong, Z.; Wang, Y.; Gao, R.; Su, Z. Fine hyperspectral classification of rice varieties based on self-attention mechanism. Ecol. Inform. 2023, 75, 102035. [Google Scholar] [CrossRef]
- Yuan, P.; Qian, S.; Zhai, Z.; FernanMartinez, J.; Xu, H. Study of chrysanthemum image phenotype on-line classification based on transfer learning and bilinear convolutional neural network. Comput. Electron. Agric. 2022, 194, 106679. [Google Scholar] [CrossRef]
- Bhupendra; Moses, K.; Miglani, A.; Kankar, P.K. Deep CNN-based damage classification of milled rice grains using a high-magnification image dataset. Comput. Electron. Agric. 2022, 195, 106811. [Google Scholar] [CrossRef]
- Dogan, M.; Taspinar, Y.S.; Cinar, I.; Kursun, R.; Ozkan, I.A.; Koklu, M. Dry bean cultivars classification using deep cnn features and salp swarm algorithm based extreme learning machine. Comput. Electron. Agric. 2023, 204, 107575. [Google Scholar] [CrossRef]
- Zhao, S.; Liu, J.; Wu, S. Multiple disease detection method for greenhouse-cultivated strawberry based on multiscale feature fusion Faster R_CNN. Comput. Electron. Agric. 2022, 199, 107176. [Google Scholar] [CrossRef]
- Huang, Z.; Wang, R.; Cao, Y.; Zheng, S.; Teng, Y.; Wang, F.; Wang, L.; Du, J. Deep learning based soybean seed classification. Comput. Electron. Agric. 2022, 202, 107393. [Google Scholar] [CrossRef]
- Wang, Z.; Ling, Y.; Wang, X.; Meng, D.; Nie, L.; An, G.; Wang, X. An improved Faster R-CNN model for multi-object tomato maturity detection in complex scenarios. Ecol. Inform. 2022, 72, 101886. [Google Scholar] [CrossRef]
- Jia, W.; Tian, Y.; Luo, R.; Zhang, Z.; Lian, J.; Zheng, Y. Detection and segmentation of overlapped fruits based on optimized mask R-CNN application in apple harvesting robot. Comput. Electron. Agric. 2020, 172, 105380. [Google Scholar] [CrossRef]
- Zhang, J.; Ma, Q.; Cui, X.; Guo, H.; Wang, K.; Zhu, D. High-throughput corn ear screening method based on two-pathway convolutional neural network. Comput. Electron. Agric. 2020, 175, 105525. [Google Scholar] [CrossRef]
- Yang, X.; Gao, S.; Sun, Q.; Gu, X.; Chen, T.; Zhou, J.; Pan, Y. Classification of Maize Lodging Extents Using Deep Learning Algorithms by UAV-Based RGB and Multispectral Images. Agriculture 2022, 12, 970. [Google Scholar] [CrossRef]
- Adige, S.; Kurban, R.; Durmuş, A.; Karaköse, E. Classification of apple images using support vector machines and deep residual networks. Neural Comput. Appl. 2023, 35, 12073–12087. [Google Scholar] [CrossRef]
- Phan, Q.H.; Nguyen, V.T.; Lien, C.H.; Duong, T.P.; Hou, M.T.; Le, N.B. Classification of Tomato Fruit Using Yolov5 and Convolutional Neural Network Models. Plants 2023, 12, 790. [Google Scholar] [CrossRef]
- Amatya, S.; Karkee, M.; Gongal, A.; Zhang, Q.; Whiting, M.D. Detection of cherry tree branches with full foliage in planar architecture for automated sweet-cherry harvesting. Biosyst. Eng. 2016, 146, 3–15. [Google Scholar] [CrossRef] [Green Version]
- Gao, H.; Zhen, T.; Li, Z. Detection of Wheat Unsound Kernels Based on Improved ResNet. IEEE Access 2022, 10, 20092–20101. [Google Scholar] [CrossRef]
- Ye, W.; Yan, T.; Zhang, C.; Duan, L.; Chen, W.; Song, H.; Zhang, Y.; Xu, W.; Gao, P. Detection of Pesticide Residue Level in Grape Using Hyperspectral Imaging with Machine Learning. Foods 2022, 11, 1609. [Google Scholar] [CrossRef]
- Jin, B.; Zhang, C.; Jia, L.; Tang, Q.; Gao, L.; Zhao, G.; Qi, H. Identification of Rice Seed Varieties Based on Near-Infrared Hyperspectral Imaging Technology Combined with Deep Learning. ACS Omega 2022, 7, 4735–4749. [Google Scholar] [CrossRef]
- Fang, J.; Jiang, H.; Zhang, S.; Sun, L.; Hu, X.; Liu, J.; Gong, M.; Liu, H.; Fu, Y. BAF-Net: Bidirectional attention fusion network via CNN and transformers for the pepper leaf segmentation. Front. Plant Sci. 2023, 14, 1123410. [Google Scholar] [CrossRef]
- Xiao, L.; Pan, Z.; Du, X.; Chen, W.; Qu, W.; Bai, Y.; Xu, T. Weighted skip-connection feature fusion: A method for augmenting UAV oriented rice panicle image segmentation. Comput. Electron. Agric. 2023, 207, 107754. [Google Scholar] [CrossRef]
- Zhang, S.; Zhang, C. Modified U-Net for plant diseased leaf image segmentation. Comput. Electron. Agric. 2023, 204, 107511. [Google Scholar] [CrossRef]
- Zhou, J.; Lu, X.; Yang, R.; Wang, Y.; Chen, H.; Shen, J.; Chen, M.; Zhou, Z.; Liu, F. Developing thermal infrared de-ghost and multi-level nested conglutinated segmentation algorithm for detection of rice seed setting rate. Comput. Electron. Agric. 2023, 207, 107725. [Google Scholar] [CrossRef]
- Zhou, J.; Zeng, S.; Chen, Y.; Kang, Z.; Li, H.; Sheng, Z. A Method of Polished Rice Image Segmentation Based on YO-LACTS for Quality Detection. Agriculture 2023, 13, 182. [Google Scholar] [CrossRef]
- Zou, Z.; Wang, L.; Chen, J.; Long, T.; Wu, Q.; Zhou, M. Research on peanut variety classification based on hyperspectral image. Food Sci. Technol. 2022, 42, e18522. [Google Scholar] [CrossRef]
- Zhang, S.; Zhang, Q.; Li, K. Detection of peanut kernel quality based on machine vision and adaptive convolution neural network. Trans. Chin. Soc. Agric. Eng. 2020, 36, 269–277. [Google Scholar] [CrossRef]
- Ni, J.; Yang, H.; Li, J.; Han, Z. Variety Identification of Peanut Pod Based on Improved AlexNet. J. Peanut Sci. 2021, 50, 14–22. [Google Scholar] [CrossRef]
- Yang, H.; Ni, J.; Gao, J.; Han, Z.; Luan, T. A novel method for peanut variety identification and classification by Improved VGG16. Sci. Rep. 2021, 11, 15756. [Google Scholar] [CrossRef] [PubMed]
- Zhang, R.; Li, Z.; Hao, J.; Sun, L.; Li, H.; Han, P. Image recognition of peanut pod grades based on transfer learning with convolutional neural network. Trans. Chin. Soc. Agric. Eng. 2020, 36, 171–180. [Google Scholar] [CrossRef]
- Deng, L.; Han, Z. Image features and DUS testing traits for peanut pod variety identification and pedigree analysis. J. Sci. Food Agric. 2019, 99, 2572–2578. [Google Scholar] [CrossRef] [PubMed]
- 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 (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Ma, R.; Wang, J.; Zhao, W.; Guo, H.; Dai, D.; Yun, Y.; Li, L.; Hao, F.; Bai, J.; Ma, D. Identification of Maize Seed Varieties Using MobileNetV2 with Improved Attention Mechanism CBAM. Agriculture 2022, 13, 11. [Google Scholar] [CrossRef]
Category | Total | Training Set | Test Set |
---|---|---|---|
normal | 828 | 745 | 83 |
insect pest | 630 | 567 | 68 |
sprouted | 654 | 588 | 66 |
mildew | 618 | 556 | 62 |
damaged | 669 | 602 | 67 |
single fruit | 681 | 612 | 69 |
total | 4080 | 3670 | 410 |
Training Layer | Output Size | Training Layer | Output Size |
---|---|---|---|
Convolution | 64 × 112 × 112 | Conv4_1 | 256 × 14 × 14 |
MaxPool | 64 × 56 × 56 | Conv4_1 | 256 × 14 × 14 |
Conv2_1 | 64 × 56 × 56 | Conv5_1 | 512 × 7 × 7 |
Conv2_1 | 64 × 56 × 56 | Conv5_1 | 512 × 7 × 7 |
Conv3_1 | 128 × 28 × 28 | AvgPool | 512 × 1 × 1 |
Conv3_1 | 128 × 28 × 28 | Fc | 6 |
Model | Accuracy | Recall | Precision | F1 Score | Avg_Loss | Parameter Size |
---|---|---|---|---|---|---|
ResNet18 | 97.8% | 97.7% | 97.9% | 97.8% | 0.0356 | 42.65 MB |
Alexnet | 93.4% | 93.2% | 93.9% | 93.4% | 0.0095 | 217.55 MB |
Vgg16 | 94.1% | 93.8% | 94.5% | 94.0% | 0.0150 | 512.26 MB |
Model | Accuracy | Recall | Precision | F1-Score | Avg_Loss | Parameter Size |
---|---|---|---|---|---|---|
ResNet18 | 97.8% | 97.7% | 97.9% | 97.8% | 0.0356 | 42.65 MB |
CBAM-ResNet18 | 98.7% | 98.8% | 98.7% | 98.8% | 0.0333 | 43.33 MB |
KRS-ResNet18 | 94.9% | 94.9% | 95.0% | 94.8% | 0.0349 | 24.04 MB |
CSP-ResNet18 | 99.0% | 99.0% | 99.1% | 99.1% | 0.0036 | 50.56 MB |
PQDA | 98.0% | 98.1% | 98.1% | 98.0% | 0.000854 | 32.63 MB |
Peanut Variety | Accuracy | Recall | Precision | F1-Score |
---|---|---|---|---|
Qinghua 6 | 89.6% | 89.6% | 89.9% | 89.5% |
Tianfu 11 | 90.0% | 90.2% | 89.9% | 90.0% |
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
Yang, L.; Wang, C.; Yu, J.; Xu, N.; Wang, D. Method of Peanut Pod Quality Detection Based on Improved ResNet. Agriculture 2023, 13, 1352. https://doi.org/10.3390/agriculture13071352
Yang L, Wang C, Yu J, Xu N, Wang D. Method of Peanut Pod Quality Detection Based on Improved ResNet. Agriculture. 2023; 13(7):1352. https://doi.org/10.3390/agriculture13071352
Chicago/Turabian StyleYang, Lili, Changlong Wang, Jianfeng Yu, Nan Xu, and Dongwei Wang. 2023. "Method of Peanut Pod Quality Detection Based on Improved ResNet" Agriculture 13, no. 7: 1352. https://doi.org/10.3390/agriculture13071352