# Research on Cone Bucket Detection Algorithm Based on Improved YOLOv5s

^{*}

## Abstract

**:**

## 1. Introduction

## 2. YOLOv5s Network Structure

## 3. Coordinate Attention

#### 3.1. Coordinate Information Embedding

#### 3.2. Coordinate Attention Generation

_{1}, and a nonlinear activation function, δ, to encode the spatial information both horizontally and vertically. So:

^{h}and z

^{w}are the outputs of the coordinate information embedding process in the vertical and horizontal directions, respectively. After splicing, f is split along the vertical and horizontal directions, respectively, to determine f

^{h}and f

^{w}. Then, f

^{h}and f

^{w}are transformed into feature maps with the same number of channels as the input, X, using two 1×1 convolution operations, F

_{h}and F

_{w}, respectively, and, finally, their nonlinearity is increased using the sigmoid function, which is δ:

^{h}and g

^{w}are the weights generated by coordinate attention, which acts on the input, X, and can be written as:

## 4. Modifying the Color Space Transformation Module

## 5. Normalized Gaussian Wasserstein Distance

_{x}, and μ

_{y}, where μ

_{x}represents the length of the x-axis, and μ

_{y}represents the length of the y-axis, as in:

**x**and

**μ**denote the vectors of coordinates (x, y) and means, respectively, and

**∑**denotes the covariance matrix of the Gaussian distribution. When

**x**and

**u**satisfy Equation (10), this ellipse is the isodensity contour line of a 2D Gaussian distribution.

**μ**,

**∑**), where:

**μ**= N(

_{1}**m**,

_{1}**∑**) and

_{1}**μ**= N(

_{2}**m**,

_{2}**∑**), the second-order Wasserstein distance between them is defined as:

_{2}_{a}and N

_{b,}modeled by the bounding box, A = (cx

_{a},cy

_{a},w

_{a},h

_{a}) and B = (cx

_{b},cy

_{b},w

_{b},h

_{b}), the above equation can be simplified as:

_{p}, represents the Gaussian distribution of the anticipated boxes, whereas N

_{g}represents the Gaussian distribution of the real boxes.

## 6. Monocular Camera Distance Measurement

#### 6.1. Internal Reference Calibration

_{x}and f

_{y}, respectively:

#### 6.2. Monocular Camera Distance Measurement

## 7. Experimental Verification

#### 7.1. Dataset and Experimental Environments

#### 7.2. Experimental Methods

#### 7.3. Experimental Evaluation Indicators

_{in}, C

_{out}, K

_{h}, and K

_{w}stand for the number of input channels, the number of output channels, the height, h, of the convolution kernel, and its width, w, respectively.

#### 7.4. Ablation Experiment

#### 7.5. Coordinate Attention Comparison

#### 7.6. Small Target Detection Experiment

#### 7.7. Monocular Camera Distance Measuring Experiment

## 8. Discussion

## 9. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Terven, J.; Cordova-Esparza, D. A comprehensive review of YOLO: From YOLOv1 to YOLOv8 and beyond. arXiv
**2023**, arXiv:2304.00501. [Google Scholar] - Jiao, L.; Zhang, F.; Liu, F.; Yang, S.; Li, L.; Feng, Z.; Qu, R. A Survey of Deep Learning-Based Object Detection. IEEE Access
**2019**, 7, 128837–128868. [Google Scholar] [CrossRef] - Nepal, U.; Eslamiat, H. Comparing YOLOv3, YOLOv4 and YOLOv5 for Autonomous Landing Spot Detection in Faulty UAVs. Sensors
**2022**, 22, 464. [Google Scholar] [CrossRef] [PubMed] - Zhang, Y.; Guo, Z.; Wu, J.; Tian, Y.; Tang, H.; Guo, X. Real-Time Vehicle Detection Based on Improved YOLO v5. Sustainability
**2022**, 14, 12274. [Google Scholar] [CrossRef] - Carrasco, D.P.; Rashwan, H.A.; García, M.Á.; Puig, D. T-YOLO: Tiny vehicle detection based on YOLO and multi-scale convolutional neural networks. IEEE Access
**2023**, 11, 22430–22440. [Google Scholar] [CrossRef] - Zhang, Y.; Hou, X.; Hou, X. Combining Self-Supervised Learning and Yolo v4 Network for Construction Vehicle Detection. Mob. Inf. Syst.
**2022**, 2022, 1–10. [Google Scholar] [CrossRef] - Wu, W.; Liu, H.; Li, L.; Long, Y.; Wang, X.; Wang, Z.; Li, J.; Chang, Y. Application of local fully Convolutional Neural Network combined with YOLO v5 algorithm in small target detection of remote sensing image. PLoS ONE
**2021**, 16, e0259283. [Google Scholar] [CrossRef] [PubMed] - Zhu, X.; Lyu, S.; Wang, X.; Zhao, Q. TPH-YOLOv5: Improved YOLOv5 Based on Transformer Prediction Head for Object Detection on Drone-captured Scenarios. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Nashville, TN, USA, 19–25 June 2021; pp. 2778–2788. [Google Scholar]
- Strbac, B.; Gostovic, M.; Lukač, Ž.; Samardzija, D. YOLO Multi-Camera Object Detection and Distance Estimation. In Proceedings of the 2020 Zooming Innovation in Consumer Technologies Conference, Novi Sad, Serbia, 26–27 May 2020; pp. 26–30. [Google Scholar]
- Karthika, K.; Adarsh, S.; Ramachandran, K.I. Distance Estimation of Preceding Vehicle Based on Mono Vision Camera and Artificial Neural Networks. In Proceedings of the International Conference on Computing, Communication and Networking Technologies, Kharagpur, India, 1–3 July 2020; pp. 1–5. [Google Scholar]
- Liu, Z.; Gao, Y.; Du, Q.; Chen, M.; Lv, W. YOLO-Extract: Improved YOLOv5 for Aircraft Object Detection in Remote Sensing Images. IEEE Access
**2023**, 11, 1742–1751. [Google Scholar] [CrossRef] - Song, W.; Suandi, S.A. TSR-YOLO: A Chinese Traffic Sign Recognition Algorithm for Intelligent Vehicles in Complex Scenes. Sensors
**2023**, 23, 749. [Google Scholar] [CrossRef] [PubMed] - Betti, A.; Tucci, M. YOLO-S: A Lightweight and Accurate YOLO-like Network for Small Target Selection in Aerial Imagery. Sensors
**2023**, 23, 1865. [Google Scholar] [CrossRef] [PubMed] - Dong, X.D.; Yan, S.; Duan, C.Q. A lightweight vehicles detection network model based on YOLOv5. Eng. Appl. Artif. Intell.
**2022**, 113, 104914. [Google Scholar] [CrossRef] - Kasper-Eulaers, M.; Hahn, N.; Berger, S.; Sebulonsen, T.; Myrland, Ø.; Kummervold, P. Short Communication: Detecting Heavy Goods Vehicles in Rest Areas in Winter Conditions Using YOLOv5. Algorithms
**2021**, 14, 114. [Google Scholar] [CrossRef] - Hou, Q.; Zhou, D.; Feng, J. Coordinate Attention for Efficient Mobile Network Design. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13713–13722. [Google Scholar]
- Wang, J.; Xu, C.; Yang, W.; Yu, L. A Normalized Gaussian Wasserstein Distance for Tiny Object Detection. arXiv
**2021**, arXiv:2110.13389. [Google Scholar] - Yan, G.; Zhuochun, L.; Wang, C.; Shi, C.; Wei, P.; Cai, X.; Ma, T.; Liu, Z.; Zhong, Z.; Liu, Y.; et al. OpenCalib: A Multi-sensor Calibration Toolbox for Autonomous Driving. arXiv
**2022**, arXiv:2205.14087. [Google Scholar] [CrossRef] - Tan, M.; Pang, R.; Le, Q.V. Efficientdet: Scalable and efficient object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 10781–10790. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 8–16 October 2016; pp. 21–37. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards real-time object detection with region proposal networks. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Montreal, QC, Canada, 7–12 December 2015; pp. 91–99. [Google Scholar]
- Mao, J.; Wei, H.; Sheng, W. Target distance measurement method using monocular vision. IET Image Process.
**2020**, 14, 3181–3187. [Google Scholar]

**Figure 3.**Color space transformation results. (

**a**) Original images; (

**b**) color space transformed image.

**Figure 4.**Sensitivity analysis of small- and normal-sized targets. (

**a**) Small-sized target; (

**b**) normal-sized target.

**Figure 7.**Comparison of thermograms of YOLOv5s and YOLOv5s–coordinate attention. (

**a**) Heat map of YOLOv5s; (

**b**) heat map of YOLOv5s–coordinate attention.

**Figure 8.**Comparison of the detection effect of YOLOv5s with YOLOv5s with the addition of normalized Gaussian Wasserstein distance. (

**a**) Detection effect of YOLOv5s; (

**b**) detection effect of YOLOv5s with added normalized Gaussian Wasserstein distance.

Model | Precision/% | Recall/% | mAP/% | Pa/10^{6} | FPS |
---|---|---|---|---|---|

YOLOv5s | 86.2 | 88.6 | 91.6 | 7.018 | 55.6 |

YOLOv5s-CA | 89.3 | 90.9 | 94 | 7.043 | 51.5 |

YOLOv5s-HSV | 90.6 | 91.3 | 94.2 | 7.018 | 55.6 |

YOLOv5s-NWD | 92 | 87.7 | 94.5 | 7.018 | 55.6 |

YOLOv5s-CA-HSV | 90.5 | 92.5 | 94.5 | 7.043 | 51.5 |

YOLOv5s-CA-HSV-NWD | 93.1 | 93 | 96.5 | 7.043 | 51.5 |

Model | Precision/% | Recall/% | mAP/% | Pa/10^{6} | FPS |
---|---|---|---|---|---|

YOLOv3 | 87.8 | 77.2 | 86.5 | 63.0 | 35.6 |

YOLOv4 | 88.1 | 88.9 | 91.7 | 64.4 | 30.4 |

YOLOv5s | 86.2 | 88.6 | 91.6 | 7.018 | 55.6 |

EfficientDet | 87.3 | 87.8 | 92.1 | 21 | 15.4 |

SSD | 88.7 | 90.4 | 93.4 | 26.2 | 15.3 |

Faster R-CNN | 86.3 | 88.2 | 91.2 | 137 | 3 |

Ours | 93.1 | 93 | 96.5 | 7.043 | 51.5 |

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

**MDPI and ACS Style**

Zhuo, J.; Li, G.; He, Y.
Research on Cone Bucket Detection Algorithm Based on Improved YOLOv5s. *World Electr. Veh. J.* **2023**, *14*, 269.
https://doi.org/10.3390/wevj14100269

**AMA Style**

Zhuo J, Li G, He Y.
Research on Cone Bucket Detection Algorithm Based on Improved YOLOv5s. *World Electric Vehicle Journal*. 2023; 14(10):269.
https://doi.org/10.3390/wevj14100269

**Chicago/Turabian Style**

Zhuo, Jiyue, Gang Li, and Yang He.
2023. "Research on Cone Bucket Detection Algorithm Based on Improved YOLOv5s" *World Electric Vehicle Journal* 14, no. 10: 269.
https://doi.org/10.3390/wevj14100269