SA-SRYOLOv8: A Research on Star Anise Variety Recognition Based on a Lightweight Cascaded Neural Network and Diversified Fusion Dataset
Abstract
:1. Introduction
2. Materials and Methods
2.1. Experimental Setup
2.2. Image Data Collection
Image Acquisition
2.3. Image Preprocessing
2.3.1. Non-Similar Image Selection
2.3.2. Image Enhancement
2.3.3. Dataset Production
2.4. Construction of the Model Structure
2.4.1. YOLOv8 Primary Object Recognition Network and Improvements
2.4.2. Front-End SRGAN Network
2.5. Dataset Training Environment
2.6. Model Comparison and Evaluation
2.6.1. Comparison of Object Detection Models
2.6.2. Evaluation Indicators
3. Results and Discussion
3.1. Primary Recognition Network Model Training and Test Evaluation
3.1.1. Performance Comparison of YOLOv8 Models with Different Versions and Image Sets
3.1.2. Analysis of Network Training Based on Different YOLOv8s Optimization Strategies
3.1.3. Network Performance Evaluation Based on Different YOLOv8s Optimization Strategies
3.1.4. Comparison with Other Deep Learning Detection Models
3.2. Comparison of the Model’s Performance before and after Improvement
3.3. Discussion
3.3.1. Detection Results for Blurry Images
3.3.2. Three-Dimensional Comparison of Model Performance
3.3.3. Comparison with Related Studies
4. Conclusions
- (1)
- To enable category detection of star anise across various environments, an enhanced YOLOv8 network model was developed. This study compared image enhancement training, two-round optimization, and extended training methods, concluding that the lightweight model with extended training delivered the best performance. To evaluate the model’s real-time detection performance for star anise categories, ablation experiments were conducted under the same experimental environment and test-set conditions. The experimental results demonstrated that the cascade model improved mAP by 0.81%, reduced computation by 6.574 M, and decreased model size by 3.8 MB compared to the original YOLOv8 model. The proposed cascade model achieved higher recognition accuracy, smaller model size, and better overall performance.
- (2)
- To address the issue of blurry images, this study employed a lightweight cascaded neural network by introducing a front-end SRGAN super-resolution generative adversarial network to assist the subsequent YOLOv8 model in its predictions. Before the blurry images are input into the primary recognition network, the images are enlarged and their resolution is enhanced, ensuring accurate recognition by the subsequent primary recognition network and mitigating the information loss issue present in the original YOLOv8 when processing blurry images. Similarly, the integration of the front-end network effectively resolved misidentification issues caused by low mAP recognition accuracy for Dahong and Jiaohua varieties due to image blurriness, enhancing the recognition accuracy of similar categories that are easily confused. The comparison of actual detection results indicates that the cascade model not only delivered superior detection outcomes but also exhibited a broader receptive field, establishing it as an effective approach for real-time detection of star anise categories across various environments.
- (3)
- Additionally, this study optimized the model’s performance by expanding the diversified fusion dataset, improving its applicability on edge devices, and offering a more reliable and efficient solution for detecting other small agricultural products. Implementing this system on mobile devices for image processing offers significant potential, particularly for the detection of star anise varieties on mobile platforms. This will open up practical applications for the developed system in star anise variety detection, especially in complex environments such as fields or markets, enabling convenient and efficient classification of varieties.
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Jahanbakhshi, A.; Abbaspour-Gilandeh, Y.; Heidarbeigi, K.; Momeny, M. Detection of Fraud in Ginger Powder Using an Automatic Sorting System Based on Image Processing Technique and Deep Learning. Comput. Biol. Med. 2021, 136, 104764. [Google Scholar] [CrossRef] [PubMed]
- Zou, Q.; Huang, Y.; Zhang, W.; Lu, C.; Yuan, J. A Comprehensive Review of the Pharmacology, Chemistry, Traditional Uses and Quality Control of Star Anise (Illicium verum Hook. F.): An Aromatic Medicinal Plant. Molecules 2023, 28, 7378. [Google Scholar] [PubMed]
- Sharafan, M.; Jafernik, K.; Ekiert, H.; Kubica, P.; Kocjan, R.; Blicharska, E.; Szopa, A. Illicium verum (Star Anise) and Trans-Anethole as Valuable Raw Materials for Medicinal and Cosmetic Applications. Molecules 2022, 27, 650. [Google Scholar] [CrossRef] [PubMed]
- He, Z.; Huan, J.; Ye, M.; Liang, D.; Wu, Y.; Li, W.; Gong, X.; Jiang, L. Based on Citespace Insights into Illicium verum Hook. F. Current Hotspots and Emerging Trends and China Resources Distribution. Foods 2024, 13, 1510. [Google Scholar] [PubMed]
- Patrício, D.I.; Rieder, R. Computer Vision and Artificial Intelligence in Precision Agriculture for Grain Crops: A Systematic Review. Comput. Electron. Agric. 2018, 153, 69–81. [Google Scholar] [CrossRef]
- Lv, X.; Zhang, X.; Gao, H.; He, T.; Lv, Z.; Zhangzhong, L. When Crops Meet Machine Vision: A Review and Development Framework for a Low-Cost Nondestructive Online Monitoring Technology in Agricultural Production. Agric. Commun. 2024, 2, 100029. [Google Scholar] [CrossRef]
- An, M.; Cao, C.; Wu, Z.; Luo, K. Detection Method for Walnut Shell-Kernel Separation Accuracy Based on near-Infrared Spectroscopy. Sensors 2022, 22, 8301. [Google Scholar] [CrossRef]
- Zhu, Y.; Fan, S.; Zuo, M.; Zhang, B.; Zhu, Q.; Kong, J. Discrimination of New and Aged Seeds Based on on-Line near-Infrared Spectroscopy Technology Combined with Machine Learning. Foods 2024, 13, 1570. [Google Scholar] [CrossRef]
- Xu, J.; Xu, D.; Bai, X.; Yang, R.; Cao, J. Non-Destructive Detection of Moldy Walnuts Based on Hyperspectral Imaging Technology. Molecules 2022, 27, 6776. [Google Scholar] [CrossRef]
- Santos Pereira, F.L.; Barbon, S.; Valous, N.A.; Barbin, D.F. Predicting the Ripening of Papaya Fruit with Digital Imaging and Random Forests. Comput. Electron. Agric. 2018, 145, 76–82. [Google Scholar] [CrossRef]
- Li, Z.; Wang, D.; Zhu, T.; Tao, Y.; Ni, C. Review of Deep Learning-Based Methods for Non-Destructive Evaluation of Agricultural Products. Biosyst. Eng. 2024, 245, 56–83. [Google Scholar] [CrossRef]
- Rehman, T.U.; Mahmud, M.S.; Chang, Y.K.; Jin, J.; Shin, J. Current and Future Applications of Statistical Machine Learning Algorithms for Agricultural Machine Vision Systems. Comput. Electron. Agric. 2019, 156, 585–605. [Google Scholar] [CrossRef]
- Xiong, H.; Xiao, Y.; Zhao, H.; Xuan, K.; Zhao, Y.; Li, J. Ad-Yolov5: An Object Detection Approach for Key Parts of Sika Deer Based on Deep Learning. Comput. Electron. Agric. 2024, 217, 108610. [Google Scholar] [CrossRef]
- Zhu, L.; Spachos, P.; Pensini, E.; Plataniotis, K.N. Deep Learning and Machine Vision for Food Processing: A Survey. Curr. Res. Food Sci. 2021, 4, 233–249. [Google Scholar] [CrossRef]
- Duan, X.; Lin, Y.; Li, L.; Zhang, F.; Li, S.; Liao, Y. Hierarchical Detection of Gastrodia Elata Based on Improved Yolox. Agronomy 2023, 13, 1477. [Google Scholar] [CrossRef]
- Wang, D.; Dai, D.; Zheng, J.; Li, L.; Kang, H.; Zheng, X. Wt-Yolom: An Improved Target Detection Model Based on Yolov4 for Endogenous Impurity in Walnuts. Agronomy 2023, 13, 1462. [Google Scholar] [CrossRef]
- Xue, Q.; Miao, P.; Miao, K.; Yu, Y.; Li, Z. An Online Automatic Sorting System for Defective Ginseng Radix Et Rhizoma Rubra Using Deep Learning. Chin. Herb. Med. 2023, 15, 447–456. [Google Scholar] [CrossRef]
- Wang, F.; Lv, C.; Dong, L.; Li, X.; Guo, P.; Zhao, B. Development of Effective Model for Non-Destructive Detection of Defective Kiwifruit Based on Graded Lines. Front. Plant Sci. 2023, 14, 1170221. [Google Scholar] [CrossRef]
- Yang, G.; Wang, J.; Nie, Z.; Yang, H.; Yu, S. A Lightweight Yolov8 Tomato Detection Algorithm Combining Feature Enhancement and Attention. Agronomy 2023, 13, 1824. [Google Scholar] [CrossRef]
- Liu, Z.; Wang, L.; Liu, Z.; Wang, X.; Hu, C.; Xing, J. Detection of Cotton Seed Damage Based on Improved Yolov5. Processes 2023, 11, 2682. [Google Scholar] [CrossRef]
- Xie, S.; Sun, H. Tea-Yolov8s: A Tea Bud Detection Model Based on Deep Learning and Computer Vision. Sensors 2023, 23, 6576. [Google Scholar] [CrossRef] [PubMed]
- Zhao, Y.; Lin, C.; Wu, N.; Xu, X. Apeiou Integration for Enhanced Yolov7: Achieving Efficient Plant Disease Detection. Agriculture 2024, 14, 820. [Google Scholar] [CrossRef]
- Badgujar, C.M.; Poulose, A.; Gan, H. Agricultural Object Detection with You Only Look Once (Yolo) Algorithm: A Bibliometric and Systematic Literature Review. Comput. Electron. Agric. 2024, 223, 109090. [Google Scholar] [CrossRef]
- GB/T 7652—2016; Star Anise. Standardization Administration of the People’s Republic of China: Beijing, China, 2016.
- Zhang, S.; Wang, D.; Yu, C. Apple Leaf Disease Recognition Method Based on Siamese Dilated Inception Network with Less Training Samples. Comput. Electron. Agric. 2023, 213, 108188. [Google Scholar] [CrossRef]
- Salari, A.; Djavadifar, A.; Liu, X.; Najjaran, H. Object Recognition Datasets and Challenges: A Review. Neurocomputing 2022, 495, 129–152. [Google Scholar] [CrossRef]
- Hussain, M. Yolo-V1 to Yolo-V8, the Rise of Yolo and Its Complementary Nature toward Digital Manufacturing and Industrial Defect Detection. Machines 2023, 11, 677. [Google Scholar] [CrossRef]
- Yang, W.; Wu, J.; Zhang, J.; Gao, K.; Du, R.; Wu, Z.; Firkat, E.; Li, D. Deformable Convolution and Coordinate Attention for Fast Cattle Detection. Comput. Electron. Agric. 2023, 211, 108006. [Google Scholar] [CrossRef]
- Hao, F.; Zhang, T.; He, G.; Dou, R.; Meng, C. Casnli-Yolo: Construction Site Multi-Target Detection Method Based on Improved Yolov5s. Meas. Sci. Technol. 2024, 35, 085202. [Google Scholar] [CrossRef]
- Cao, Y.; Pang, D.; Zhao, Q.; Yan, Y.; Jiang, Y.; Tian, C.; Wang, F.; Li, J. Improved Yolov8-Gd Deep Learning Model for Defect Detection in Electroluminescence Images of Solar Photovoltaic Modules. Eng. Appl. Artif. Intell. 2024, 131, 107866. [Google Scholar] [CrossRef]
- Song, J.; Yi, H.; Xu, W.; Li, X.; Li, B.; Liu, Y. Esrgan-Dp: Enhanced Super-Resolution Generative Adversarial Network with Adaptive Dual Perceptual Loss. Heliyon 2023, 9, e15134. [Google Scholar] [CrossRef]
- Wang, X.; Yu, K.; Wu, S.; Gu, J.; Liu, Y.; Dong, C.; Qiao, Y.; Loy, C.C. Esrgan: Enhanced Super-Resolution Generative Adversarial Networks. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, Munich, Germany, 8–14 September 2018; pp. 63–79. [Google Scholar]
- Chen, S.; Dai, D.; Zheng, J.; Kang, H.; Wang, D.; Zheng, X.; Gu, X.; Mo, J.; Luo, Z. Intelligent Grading Method for Walnut Kernels Based on Deep Learning and Physiological Indicators. Front. Nutr. 2023, 9, 1075781. [Google Scholar] [CrossRef] [PubMed]
- Deng, R.; Cheng, W.; Liu, H.; Hou, D.; Zhong, X.; Huang, Z.; Xie, B.; Yin, N. Automatic Identification of Sea Rice Grains in Complex Field Environment Based on Deep Learning. Agriculture 2024, 14, 1135. [Google Scholar] [CrossRef]
- Zhang, F.; Lv, Z.; Zhang, H.; Guo, J.; Wang, J.; Lu, T.; Zhangzhong, L. Verification of Improved Yolox Model in Detection of Greenhouse Crop Organs: Considering Tomato as Example. Comput. Electron. Agric. 2023, 205, 107582. [Google Scholar] [CrossRef]
- Ma, X.; Li, Y.; Wan, L.; Xu, Z.; Song, J.; Huang, J. Classification of Seed Corn Ears Based on Custom Lightweight Convolutional Neural Network and Improved Training Strategies. Eng. Appl. Artif. Intell. 2023, 120, 105936. [Google Scholar] [CrossRef]
- Li, H.; Hao, Y.; Wu, W.; Tu, K.; Xu, Y.; Zhang, H.; Mao, Y.; Sun, Q. Rapid Detection of Turtle Cracks in Corn Seed Based on Reflected and Transmitted Images Combined with Deep Learning Method. Microchem. J. 2024, 201, 110698. [Google Scholar] [CrossRef]
- Yang, S.; Xing, Z.; Wang, H.; Dong, X.; Gao, X.; Liu, Z.; Zhang, X.; Li, S.; Zhao, Y. Maize-Yolo: A New High-Precision and Real-Time Method for Maize Pest Detection. Insects 2023, 14, 278. [Google Scholar] [CrossRef]
- Li, X.; Wu, J.; Bai, T.; Wu, C.; He, Y.; Huang, J.; Li, X.; Shi, Z.; Hou, K. Variety Classification and Identification of Jujube Based on near-Infrared Spectroscopy and 1d-Cnn. Comput. Electron. Agric. 2024, 223, 109122. [Google Scholar] [CrossRef]
Data | I | II | III | IV | V |
---|---|---|---|---|---|
Dahong | 3285 | 247 | 534 | 2223 | 6042 |
Jiaohua | 2716 | 307 | 534 | 2763 | 6013 |
Ganzhi | 3179 | 260 | 508 | 2340 | 6027 |
Buhege | 2073 | 381 | 507 | 3429 | 6009 |
Total | 11,253 | 1195 | 2083 | 10,755 | 24,091 |
Diversified Fusion Dataset | Total | Training Set | Verification Set | Test Set |
---|---|---|---|---|
Turntable images | 10,000 | 8000 | 1000 | 1000 |
High-resolution Camera images | 2000 | 1600 | 200 | 200 |
Enhancement images | 6000 | 4800 | 600 | 600 |
Open data | 1800 | — | — | — |
Configuration | Value |
---|---|
CPU | Intel Core i7 |
GPU | NVIDIA GeForce GTX 4070Ti |
Accelerated environment | CUDA11.7 |
Deep learning framework | Pytorch1.8 |
Operating system | Windows 10 |
Models | mAP/% | dahong/% | jiaohua/% | ganzhi/% | buhege/% | FPS | Parameters/M | Model Size/MB |
---|---|---|---|---|---|---|---|---|
Ori-YOLOv8s | 90.61 | 84.24 | 78.26 | 99.96 | 100 | 106 | 11.137 | 21.3 |
En-YOLOv8s | 93.77 | 88.48 | 87.06 | 99.53 | 100 | 110 | 11.137 | 21.3 |
En-YOLOv8m | 93.88 | 88.52 | 87.58 | 99.42 | 100 | 92 | 25.859 | 49.7 |
En-YOLOv8l | 94.12 | 89.21 | 87.67 | 99.61 | 100 | 63 | 43.633 | 83.7 |
Training Methods | mAP/% | dahong/% | jiaohua/% | ganzhi/% | buhege/% | Training Loss | Value Loss |
---|---|---|---|---|---|---|---|
Enhanced Training | 93.77 | 88.48 | 87.06 | 99.53 | 100 | 1.544 | 1.456 |
Two-round Training | 95.13 | 90.91 | 90.03 | 99.48 | 100 | 1.517 | 1.441 |
Extended Training | 95.56 | 91.90 | 91.29 | 99.28 | 99.79 | 1.454 | 1.401 |
Improved Extended Training | 96.28 | 93.35 | 92.28 | 99.48 | 100 | 1.337 | 1.321 |
Models | P/% | R/% | F1/% | mAP/% | Parameters /M | FPS | Model Size/MB |
---|---|---|---|---|---|---|---|
SSD-VGG | 85.62 | 92.89 | 89.00 | 94.10 | 24.013 | 130 | 92.1 |
SSD-Mobilenetv2 | 84.75 | 82.01 | 83.50 | 88.95 | 3.941 | 175 | 15.8 |
Faster R-CNN | 83.58 | 94.08 | 88.25 | 94.56 | 136.750 | 28 | 108 |
YOLOv3 | 86.00 | 90.17 | 82.67 | 87.80 | 61.540 | 97 | 235 |
YOLOv4 | 76.45 | 80.71 | 78.75 | 76.67 | 63.954 | 65 | 244 |
YOLOv4-Mobilenetv2 | 82.16 | 83.23 | 82.50 | 84.56 | 12.283 | 90 | 51.1 |
YOLOv5s | 84.99 | 83.34 | 84.25 | 85.52 | 7.072 | 103 | 27.1 |
YOLOXs | 87.56 | 89.02 | 88.25 | 93.21 | 8.939 | 110 | 34.6 |
YOLOv7 | 90.56 | 91.12 | 89.75 | 94.31 | 37.211 | 73 | 142 |
YOLOv8s | 94.17 | 94.46 | 93.67 | 95.56 | 11.137 | 121 | 21.3 |
Imp-YOLOv8 | 95.13 | 95.27 | 95.26 | 96.28 | 3.012 | 155 | 11.6 |
SA-SRYOLOv8 | 95.28 | 95.56 | 95.51 | 96.37 | 4.563 | 146 | 17.5 |
Objects | Key Feature | Methods | mAP/% | Accuracy/% | Year |
---|---|---|---|---|---|
Walnut meat [33] | Grade one, two, three, and four | ResNet152V2-SA-SE | 92.2 | — | 2023 |
Sea rice grains [34] | Grain in different situations | Sea Grain Detection Model | 90.1 | — | 2024 |
Greenhouse tomato [35] | Tomatog, tomator, flower | YOLOX (improved training strategies) | 86.19 | — | 2023 |
Ear of corn seed [36] | Normal ear and abnormal ear | Cornet (improved training strategies) | — | 98.56 | 2023 |
Corn seed crack [37] | Single crack, double crack, and crack | SACNSVN | — | 82.6 | 2024 |
Maize [38] | Different maize pest | Maize-YOLO | 76.3 | — | 2023 |
Jujube [39] | Smaller, average, larger, and morphologically unique Jujube | D-CNN | — | 98.98 | 2024 |
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. |
© 2024 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
Chen, H.; Zhang, F.; Guo, C.; Yi, J.; Ma, X. SA-SRYOLOv8: A Research on Star Anise Variety Recognition Based on a Lightweight Cascaded Neural Network and Diversified Fusion Dataset. Agronomy 2024, 14, 2211. https://doi.org/10.3390/agronomy14102211
Chen H, Zhang F, Guo C, Yi J, Ma X. SA-SRYOLOv8: A Research on Star Anise Variety Recognition Based on a Lightweight Cascaded Neural Network and Diversified Fusion Dataset. Agronomy. 2024; 14(10):2211. https://doi.org/10.3390/agronomy14102211
Chicago/Turabian StyleChen, Haosong, Fujie Zhang, Chaofan Guo, Junjie Yi, and Xiangkai Ma. 2024. "SA-SRYOLOv8: A Research on Star Anise Variety Recognition Based on a Lightweight Cascaded Neural Network and Diversified Fusion Dataset" Agronomy 14, no. 10: 2211. https://doi.org/10.3390/agronomy14102211
APA StyleChen, H., Zhang, F., Guo, C., Yi, J., & Ma, X. (2024). SA-SRYOLOv8: A Research on Star Anise Variety Recognition Based on a Lightweight Cascaded Neural Network and Diversified Fusion Dataset. Agronomy, 14(10), 2211. https://doi.org/10.3390/agronomy14102211