Light-FC-YOLO: A Lightweight Method for Flower Counting Based on Enhanced Feature Fusion with a New Efficient Detection Head
Abstract
:1. Introduction
- (1)
- A method proposed for accurately counting high-density flowers in complex backgrounds.
- (2)
- The integration of the C2f module with the Ghost module has resulted in a reduction in both the parameter and the size of the model. This combination has effectively streamlined the model, making it more efficient for practical applications.
- (3)
- A new efficient detection head has been proposed, which enhances the model’s ability to express complex functions and improves the feature extraction capabilities for the target. This advancement contributes to the overall performance and accuracy of the model.
- (4)
- The introduction of the LSKA attention mechanism in the feature extraction module has amplified the role of shallow shape encoding information of the target within the network. This enhancement facilitates the fusion of spatial information across different scales, thereby improving the model’s adaptability and performance.
- (5)
- The incorporation of the SIoU loss function has enhanced the detection performance of the model and accelerated the convergence speed during training. This improvement has made the model more efficient and effective in its operations.
2. Materials and Methods
2.1. Flower Datasets
2.1.1. Data Acquisition
2.1.2. Data Labeling
2.1.3. Data Augmentation
2.2. Light-FC-YOLO
2.3. C2f_GhostNet
2.4. Efficient Detection Head
2.5. SPPF_LSKA Module
2.6. SIoU Loss Function
2.7. Evaluation Metrics
3. Results
3.1. Implementation Details
3.2. Analysis of Lightweighting Results
3.3. Analysis of Detection and Counting Results
3.3.1. Ablation Experiments
3.3.2. Comparison of Detection Performance of Lightweight Models
3.3.3. Comparison of Counting Performance of Lightweight Models
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- De, L.Y.; Zhi, B.L.; Wang, H. Analysis of market demand of urban flower industry. North. Hortic. 2022, 13, 134–140. [Google Scholar]
- Chun, Q.C.; Lin, L.; Zhen, Y.T. Development status and countermeasures of Wenzhou flower market. Agric. Sci. Technol. Newsl. 2023, 15–16+117. [Google Scholar]
- Ya, D.C.; Xin, L.C.; Hong, Y. Practical Exploration of Informatization Technology in Flower Industry. Agric. Eng. Technol. 2022, 42, 20–21. [Google Scholar] [CrossRef]
- Chlingaryan, A.; Sukkarieh, S.; Whelan, B. Machine learning approaches for crop yield prediction and nitrogen status estimation in precision agriculture: A review. Comput. Electron. Agric. 2018, 151, 61–69. [Google Scholar] [CrossRef]
- Sethy, P.K.; Routray, B.; Behera, S.K. Detection and counting of marigold flower using image processing technique. In Advances in Computer, Communication and Control: Proceedings of ETES 2018; Springer: Singapore, 2019; pp. 87–93. [Google Scholar]
- Li, C.; Song, Z.; Wang, Y.; Zhang, Y. Research on bud counting of cut lily flowers based on machine vision. Multimed. Tools Appl. 2023, 82, 2709–2730. [Google Scholar] [CrossRef]
- Huang, Y.; Qian, Y.; Wei, H.; Lu, Y.; Ling, B.; Qin, Y. A survey of deep learning-based object detection methods in crop counting. Comput. Electron. Agric. 2023, 215, 108425. [Google Scholar] [CrossRef]
- Sun, L.; Yao, J.; Cao, H.; Chen, H.; Teng, G. Improved YOLOv5 Network for Detection of Peach Blossom Quantity. Agriculture 2024, 14, 126. [Google Scholar] [CrossRef]
- Wang, D.; He, D. Channel pruned YOLO V5s-based deep learning approach for rapid and accurate apple fruitlet detection before fruit thinning. Biosyst. Eng. 2021, 210, 271–281. [Google Scholar] [CrossRef]
- Xiao, J.; Zhao, T.; Yao, Y.; Yu, Q.; Chen, Y. Context Augmentation and Feature Refinement Network for Tiny Object Detection. 2021. Available online: https://openreview.net/forum?id=q2ZaVU6bEsT (accessed on 12 June 2024).
- Xu, B.; Liang, H.; Liang, R.; Chen, P. Locate globally, segment locally: A progressive architecture with knowledge review network for salient object detection. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtual, 2–9 February 2021; Volume 35, pp. 3004–3012. [Google Scholar]
- Zhao, Z.; Wang, J.; Liu, Y. User electricity behavior analysis based on K-means plus clustering algorithm. In Proceedings of the 2017 International Conference on Computer Technology, Electronics and Communication (ICCTEC), Dalian, China, 19–21 December 2017; pp. 484–487. [Google Scholar]
- Lin, P.; Lee, W.S.; Chen, Y.M.; Peres, N.; Fraisse, C. A deep-level region-based visual representation architecture for detecting strawberry flowers in an outdoor field. Precis. Agric. 2020, 21, 387–402. [Google Scholar] [CrossRef]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
- Petti, D.; Li, C. Weakly-supervised learning to automatically count cotton flowers from aerial imagery. Comput. Electron. Agric. 2022, 194, 106734. [Google Scholar] [CrossRef]
- Carbonneau, M.A.; Cheplygina, V.; Granger, E.; Gagnon, G. Multiple instance learning: A survey of problem characteristics and applications. Pattern Recognit. 2018, 77, 329–353. [Google Scholar] [CrossRef]
- Tamrakar, N.; Karki, S.; Kang, M.Y.; Deb, N.C.; Arulmozhi, E.; Kang, D.Y.; Kook, J.; Kim, H.T. Lightweight Improved YOLOv5s-CGhostnet for Detection of Strawberry Maturity Levels and Counting. AgriEngineering 2024, 6, 962–978. [Google Scholar] [CrossRef]
- Han, K.; Wang, Y.; Tian, Q.; Guo, J.; Xu, C.; Xu, C. Ghostnet: More features from cheap operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 1580–1589. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Li, S.; Tao, T.; Zhang, Y.; Li, M.; Qu, H. YOLO v7-CS: A YOLO v7-Based Model for Lightweight Bayberry Target Detection Count. Agronomy 2023, 13, 2952. [Google Scholar] [CrossRef]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
- Tong, Z.; Chen, Y.; Xu, Z.; Yu, R. Wise-IoU: Bounding box regression loss with dynamic focusing mechanism. arXiv 2023, arXiv:2301.10051. [Google Scholar]
- Chen, J.; Hu, X.; Lu, J.; Chen, Y.; Huang, X. Efficient and Lightweight Automatic Wheat Counting Method with Observation-Centric SORT for Real-Time Unmanned Aerial Vehicle Surveillance. Agriculture 2023, 13, 2110. [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 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 12021–12031. [Google Scholar]
- Dai, J.; Qi, H.; Xiong, Y.; Li, Y.; Zhang, G.; Hu, H.; Wei, Y. Deformable convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 764–773. [Google Scholar]
- Zhu, L.; Wang, X.; Ke, Z.; Zhang, W.; Lau, R.W. Biformer: Vision transformer with bi-level routing attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 10323–10333. [Google Scholar]
- Farjon, G.; Krikeb, O.; Hillel, A.B.; Alchanatis, V. Detection and counting of flowers on apple trees for better chemical thinning decisions. Precis. Agric. 2020, 21, 503–521. [Google Scholar] [CrossRef]
- Bai, Y.; Yu, J.; Yang, S.; Ning, J. An improved YOLO algorithm for detecting flowers and fruits on strawberry seedlings. Biosyst. Eng. 2024, 237, 1–12. [Google Scholar] [CrossRef]
- Available online: https://www.kaggle.com/datasets/alxmamaev/flowers-recognition (accessed on 12 June 2024).
- Available online: https://www.robots.ox.ac.uk/~vgg/data/flowers/102 (accessed on 12 June 2024).
- Howard, A.; Sandler, M.; Chu, G.; Chen, L.C.; Chen, B.; Tan, M.; Adam, H. Searching for mobilenetv3. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27–28 October 2019; pp. 1314–1324. [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]
- Song, G.; Liu, Y.; Wang, X. Revisiting the sibling head in object detector. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 11563–11572. [Google Scholar]
- Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLO (Version 8.0.0) [Computer Software]. 2023. Available online: https://github.com/ultralytics/ultralytics (accessed on 12 June 2024).
- Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. Yolox: Exceeding yolo series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef]
- Lau, K.W.; Po, L.M.; Rehman, Y.A.U. Large separable kernel attention: Rethinking the large kernel attention design in cnn. Expert Syst. Appl. 2024, 236, 121352. [Google Scholar] [CrossRef]
- Zheng, Z.; Wang, P.; Ren, D.; Liu, W.; Ye, R.; Hu, Q.; Zuo, W. Enhancing geometric factors in model learning and inference for object detection and instance segmentation. IEEE Trans. Cybern. 2021, 52, 8574–8586. [Google Scholar] [CrossRef]
- Gevorgyan, Z. SIoU loss: More powerful learning for bounding box regression. arXiv 2022, arXiv:2205.12740. [Google Scholar]
- 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 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 14420–14430. [Google Scholar]
- Zhao, Y.; Lv, W.; Xu, S.; Wei, J.; Wang, G.; Dang, Q.; Chen, J. Detrs beat yolos on real-time object detection. arXiv 2023, arXiv:2304.08069. [Google Scholar]
- Li, H.; Li, J.; Wei, H.; Liu, Z.; Zhan, Z.; Ren, Q. Slim-neck by GSConv: A better design paradigm of detector architectures for autonomous vehicles. arXiv 2022, arXiv:2206.02424. [Google Scholar]
- Yu, J.; Zhang, W. Face mask wearing detection algorithm based on improved YOLO-v4. Sensors 2021, 21, 3263. [Google Scholar] [CrossRef] [PubMed]
- Xie, Z.; Hu, Y. Multi-target recognition system of flowers based on YOLOv4. J. Nanjing Agric. Univ. 2022, 45, 818–827. [Google Scholar]
Dataset | Flower Type | Number of Images | Number of Flower Images with Different Levels of Densities | Total Images | Total Number of Targets | ||
---|---|---|---|---|---|---|---|
Low Density | Medium Density | High Density | |||||
Flowers Recognition | Daisy | 541 | 805 | 1007 | 889 | 2701 | 7653 |
Dandelion | 544 | ||||||
Rose | 503 | ||||||
Sunflower | 632 | ||||||
Tulip | 481 | ||||||
Oxford 102 | Daisy | 120 | 160 | 201 | 156 | 517 | 1464 |
Dandelion | 117 | ||||||
Rose | 171 | ||||||
Sunflower | 63 | ||||||
Tulip | 46 | ||||||
Donghu flower | Daisy | 103 | 121 | 151 | 160 | 432 | 1224 |
Dandelion | 40 | ||||||
Rose | 105 | ||||||
Sunflower | 44 | ||||||
Tulip | 140 |
Project | Detail |
---|---|
CPU | AMD Ryzen 7800H (AMD, Santa Clara, CA, USA) |
GPU | GeForce RTX 3060 6G (NVIDIA, Santa Clara, CA, USA) |
RAM | 16 GB |
Operating system | 64-bit Windows 11 |
PyTorch | 1.11.0 |
CUDA | CUDA 11.3 |
Python | 3.9 |
Models | Recall/% | mAP/% | mAP50:95% | FPS |
---|---|---|---|---|
YOLOv8s | 81.1% | 87.0% | 73.7% | 90.2 |
EfficientVIT_YOLOv8s | 76.9% | 85.2% | 71.0% | 33.2 |
FasterNet_YOLOv8s | 81.5% | 85.9% | 71.4% | 75.2 |
Ghost_YOLOv8s | 82.1% | 86.2% | 73.5% | 76.8 |
HGNetV2_YOLOv8s | 76.9% | 86.2% | 72.9% | 86.8 |
Slimneck_YOLOv8s | 80.6% | 87.2% | 74.3% | 75.3 |
Models | GFLOPS | Parameters/M | Model Size/MB |
---|---|---|---|
YOLOv8s | 28.4 | 11.13 | 22.5 |
EfficientVIT_YOLOv8s | 20.4 | 8.38 | 17.5 |
FasterNet_YOLOv8s | 21.7 | 8.61 | 17.5 |
Ghost_YOLOv8s | 16.1 | 5.92 | 12.2 |
HGNetV2_YOLOv8s | 23.3 | 8.47 | 17.3 |
Slimneck_YOLOv8s | 25.1 | 10.27 | 20.9 |
Improvement Points | Recall/% | mAP50% | mAP50:95% | FPS | ||
---|---|---|---|---|---|---|
Efficient Head | SPPF_LSKA | SIoU | ||||
82.1% | 86.2% | 73.5% | 76.8 | |||
✓ | 82.0% | 86.5% | 73.8% | 94.7 | ||
✓ | 78.9% | 86.6% | 73.9% | 86.3 | ||
✓ | 79.8% | 86.3% | 73.5% | 84.3 | ||
✓ | ✓ | ✓ | 82.5% | 87.8% | 73.6% | 93.1 |
Improvement Points | GFLOPs | Parameters/M | Model Size/MB | ||
---|---|---|---|---|---|
Efficient Head | SPPF_LSKA | SIoU | |||
16.1 | 5.92 | 12.2 | |||
✓ | 17.5 | 9.06 | 16.5 | ||
✓ | 16.9 | 6.99 | 14.4 | ||
✓ | 16.4 | 5.92 | 12.2 | ||
✓ | ✓ | ✓ | 17.3 | 10.1 | 16.6 |
Model | Recall/% | mAP50% | FPS | GFLOPs | Parameters/M | Model Size/MB |
---|---|---|---|---|---|---|
YOLOv4-tiny | 80.3% | 85.1% | 61.2 | 8.7 | 7.14 | 14.2 |
Ghost-YOLOv5s | 82.3% | 85.8% | 67.5 | 10.1 | 5.92 | 12.7 |
YOLOv5s | 80.5% | 86.3% | 82.7 | 23.7 | 9.11 | 18.5 |
YOLOv7-tiny | 81.9% | 86.0% | 74.6 | 13.2 | 6.02 | 11.3 |
YOLOv8s | 81.1% | 87.0% | 85.9 | 28.4 | 11.1 | 22.8 |
Light-FC-YOLO | 82.5% | 87.8% | 93.1 | 17.3 | 10.1 | 16.6 |
Model | R2 | MAE | MAPE | RMSE |
---|---|---|---|---|
YOLOv4-tiny | 0.9389 | 5.97 | 13.05% | 11.43 |
Ghost-YOLOv5s | 0.9508 | 4.81 | 10.78% | 8.82 |
YOLOv5s | 0.9482 | 5.54 | 12.57% | 10.93 |
YOLOv7-tiny | 0.9447 | 5.64 | 12.25% | 10.71 |
YOLOv8s | 0.9490 | 5.33 | 11.97% | 9.82 |
Light-FC-YOLO | 0.9577 | 4.53 | 10.62% | 8.69 |
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
Yi, X.; Chen, H.; Wu, P.; Wang, G.; Mo, L.; Wu, B.; Yi, Y.; Fu, X.; Qian, P. Light-FC-YOLO: A Lightweight Method for Flower Counting Based on Enhanced Feature Fusion with a New Efficient Detection Head. Agronomy 2024, 14, 1285. https://doi.org/10.3390/agronomy14061285
Yi X, Chen H, Wu P, Wang G, Mo L, Wu B, Yi Y, Fu X, Qian P. Light-FC-YOLO: A Lightweight Method for Flower Counting Based on Enhanced Feature Fusion with a New Efficient Detection Head. Agronomy. 2024; 14(6):1285. https://doi.org/10.3390/agronomy14061285
Chicago/Turabian StyleYi, Xiaomei, Hanyu Chen, Peng Wu, Guoying Wang, Lufeng Mo, Bowei Wu, Yutong Yi, Xinyun Fu, and Pengxiang Qian. 2024. "Light-FC-YOLO: A Lightweight Method for Flower Counting Based on Enhanced Feature Fusion with a New Efficient Detection Head" Agronomy 14, no. 6: 1285. https://doi.org/10.3390/agronomy14061285
APA StyleYi, X., Chen, H., Wu, P., Wang, G., Mo, L., Wu, B., Yi, Y., Fu, X., & Qian, P. (2024). Light-FC-YOLO: A Lightweight Method for Flower Counting Based on Enhanced Feature Fusion with a New Efficient Detection Head. Agronomy, 14(6), 1285. https://doi.org/10.3390/agronomy14061285