APHS-YOLO: A Lightweight Model for Real-Time Detection and Classification of Stropharia Rugoso-Annulata
Abstract
:1. Introduction
2. Materials and Methods
2.1. Dataset Acquisition and Image Enhancement
2.2. The Network Structure of APHS-YOLO
2.2.1. CSPPC (Integration of Cross-Stage Partial Networks and Partial Convolution) Lightweight Module
2.2.2. Arbitrary Kernel Convolution (AKConv) Lightweight Module
2.2.3. High-Level Screening Feature Pyramid Networks (HSFPNs)
2.3. Attention Mechanism
2.3.1. Cascaded Group Attention (CGA) Module
2.3.2. ACmix (Integration of Self-Attention and Convolution) Module
2.4. Evaluation Metrics
3. Experiment
3.1. Experiment Environment Setting
3.2. Model Selection
3.3. Knowledge Distillation Experiment
4. Results and Discussion
4.1. Ablation Experiments
4.2. Model Training with Feature Distillation
4.3. Visualization of Detection Results
4.4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Appendix A
References
- Verma, S.K.; Dutta, M. Mushroom classification using ANN and ANFIS algorithm. IOSR J. Eng. 2018, 8, 94–100. [Google Scholar]
- Yin, H.; Yi, W.; Hu, D. Computer vision and machine learning applied in the mushroom industry: A critical review. Comput. Electron. Agric. 2022, 198, 107015. [Google Scholar] [CrossRef]
- Chen, D.; Yan, K.; Xiong, J.; Liu, S.; Hu, D.; Gan, H. Workpiece surface defect detection method based on improved YOLOv4. Comput. Appl. 2022, 42, 94–99. [Google Scholar]
- Wang, F.; Feng, W.; Zheng, J.; Sun, J.; Niu, L.; Chen, Z.; Zhang, X.; Wang, L. Design and test of online automatic grading system for Agaricus bisporus mushroom based on machine vision. J. Agric. Eng. 2018, 34, 256–263. [Google Scholar]
- Chen, H.H.; Ting, C.H. The development of a machine vision system for shiitake grading. J. Food Qual. 2004, 27, 352–365. [Google Scholar] [CrossRef]
- Huang, X.-B.; Suo, J.-P.; Chen, C.-Y.; Du, Q.-L.; Shen, J.-Y.; Zhou, J.-L. Initial studies on a novel filtering-type intra-vas device in male dogs. Contraception 2010, 81, 350–354. [Google Scholar] [CrossRef] [PubMed]
- Liu, Q.; Fang, M.; Li, Y.; Gao, M. Deep learning based research on quality classification of shiitake mushrooms. LWT 2022, 168, 113902. [Google Scholar] [CrossRef]
- Zuo, Y.; Zhao, M.; Wu, S.; Li, Y. Experimental study on quality grading of Stropharia rugoso-annulata based on improved MobileViT model. Exp. Technol. Manag. 2023, 40, 81–90. [Google Scholar] [CrossRef]
- Chen, J.; Kao, S.H.; He, H.; Zhuo, W.; Wen, S.; Lee, C.H.; Chan, S.H.G. Run, Don’t Walk: Chasing Higher FLOPS for Faster Neural Networks. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 12021–12031. [Google Scholar] [CrossRef]
- Zhang, X.; Song, Y.; Song, T.; Yang, D.; Ye, Y.; Zhou, J.; Zhang, L. AKConv: Convolutional Kernel with Arbitrary Sampled Shapes and Arbitrary Number of Parameters. arXiv 2023, arXiv:2311.11587. [Google Scholar]
- Chen, Y.; Zhang, C.; Chen, B.; Huang, Y.; Sun, Y.; Wang, C.; Fu, X.; Dai, Y.; Qin, F.; Peng, Y.; et al. Accurate leukocyte detection based on deformable-DETR and multi-level feature fusion for aiding diagnosis of blood diseases. Comput. Biol. Med. 2024, 170, 107917. [Google Scholar] [CrossRef] [PubMed]
- Liu, X.; Peng, H.; Zheng, N.; Yang, Y.; Hu, H.; Yuan, Y. EfficientViT: Memory Efficient Vision Transformer with Cascaded Group Attention. In Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 14420–14430. [Google Scholar]
- Pan, X.; Ge, C.; Lu, R.; Song, S.; Chen, G.; Huang, Z.; Huang, G. On the Integration of Self-Attention and Convolution. In Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 18–24 June 2022; pp. 805–815. [Google Scholar]
- Everingham, M.; Van Gool, L.; Williams, C.K.I.; Winn, J.; Zisserman, A. The Pascal Visual Object Classes (VOC) Challenge. Int. J. Comput. Vis. 2010, 88, 303–338. [Google Scholar] [CrossRef]
- Lin, T.; Maire, M.; Belongie, S.J.; Hays, J.; Perona, P.; Ramanan, D.; Dollár, P.; Zitnick, C.L. Microsoft COCO: Common Objects in Context. In Proceedings of the European Conference on Computer Vision, Zurich, Switzerland, 6–12 September 2014. [Google Scholar]
- Gou, J.; Yu, B.; Maybank, S.J.; Tao, D. Knowledge Distillation: A Survey. Int. J. Comput. Vis. 2020, 129, 1789–1819. [Google Scholar] [CrossRef]
- Hinton, G.; Vinyals, O.; Dean, J. Distilling the Knowledge in a Neural Network. arXiv 2015, arXiv:1503.02531. [Google Scholar]
Season | Spring | Autumn | |
---|---|---|---|
Indicators | |||
0.0 < RDHP ≤ 2.5 0.0 < RLDS ≤ 3.0 | First Grade | ||
2.5 < RDHP ≤ 4.0 3.0 < RLDS ≤ 4.5 | Second Grade | ||
4.0 < RDHP 4.5 < RLDS | Third Grade |
Original | Enhanced | |
---|---|---|
Number of train sets | 1317 | 5268 |
Number of test sets | 209 | 836 |
Number of valid sets | 209 | 836 |
Hyperparameter | Configuration |
---|---|
Optimizer | SGD |
Batch Size | 32 |
Epoch | 150 |
Image Size | 640 × 640 |
Learning Rate | 0.01 |
Workers | 8 |
Model | Depth | Width | Parameters (M) | GFLOPs | FPS | p | mAP 0.5:0.95 | Size (MB) |
---|---|---|---|---|---|---|---|---|
YOLOv8n | 0.33 | 0.25 | 3.2 | 8.1 | 188.0 | 0.985 | 0.955 | 6.3 |
YOLOv8s | 0.50 | 0.50 | 11.2 | 28.6 | 165.9 | 0.994 | 0.972 | 21.5 |
YOLOv8m | 0.67 | 0.75 | 25.9 | 78.9 | 134.5 | 0.991 | 0.971 | 49.6 |
YOLOv8l | 1.00 | 1.00 | 43.7 | 165.2 | 109 | 0.989 | 0.971 | 83.6 |
YOLOv8x | 1.00 | 1.25 | 68.2 | 257.8 | 104.3 | 0.993 | 0.972 | 130.4 |
YOLOv8n | HSFPN | CSPPC | AKConv | Parameters (M) | GFLOPs | FPS | p | mAP@ 0.5:0.95 | Size (MB) |
---|---|---|---|---|---|---|---|---|---|
√ | × | × | × | 3.2 | 8.1 | 188.0 | 0.985 | 0.955 | 6.3 MB |
√ | √ | × | × | 1.9 | 6.9 | 175.4 | 0.972 | 0.946 | 4.1 MB |
√ | √ | √ | × | 1.4 | 5.3 | 196.4 | 0.978 | 0.924 | 3.1 MB |
√ | √ | √ | √ | 1.2 | 4.8 | 112.7 | 0.976 | 0.922 | 2.7 MB |
YOLOv8s | HSFPN | CSPPC | CGAttention | ACmix | p | R | mAP@0.5 | mAP @0.5:0.95 |
---|---|---|---|---|---|---|---|---|
√ | √ | √ | × | × | 0.972 | 0.984 | 0.994 | 0.946 |
√ | √ | √ | √ | × | 0.985 | 0.99 | 0.994 | 0.958 |
√ | √ | √ | √ | √ | 0.991 | 0.982 | 0.995 | 0.946 |
Model | Parameters (M) | GFLOPs | FPS | p | mAP@ 0.5:0.95 | Size (MB) |
---|---|---|---|---|---|---|
Student model | 1.2 | 4.8 | 112.7 | 0.976 | 0.922 | 2.7 MB |
Teacher model | 12.1 | 29.8 | 49.1 | 0.994 | 0.963 | 24.9 MB |
Knowledge distillation model | 1.19 | 4.5 | 112.9 | 0.980 | 0.931 | 2.6 MB |
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
Liu, R.-M.; Su, W.-H. APHS-YOLO: A Lightweight Model for Real-Time Detection and Classification of Stropharia Rugoso-Annulata. Foods 2024, 13, 1710. https://doi.org/10.3390/foods13111710
Liu R-M, Su W-H. APHS-YOLO: A Lightweight Model for Real-Time Detection and Classification of Stropharia Rugoso-Annulata. Foods. 2024; 13(11):1710. https://doi.org/10.3390/foods13111710
Chicago/Turabian StyleLiu, Ren-Ming, and Wen-Hao Su. 2024. "APHS-YOLO: A Lightweight Model for Real-Time Detection and Classification of Stropharia Rugoso-Annulata" Foods 13, no. 11: 1710. https://doi.org/10.3390/foods13111710
APA StyleLiu, R.-M., & Su, W.-H. (2024). APHS-YOLO: A Lightweight Model for Real-Time Detection and Classification of Stropharia Rugoso-Annulata. Foods, 13(11), 1710. https://doi.org/10.3390/foods13111710