Citation: Luo, Q.; Wang, J.; Gao, M.;
He, Z.; Yang, Y.; Zhou, H. Multiple
Mechanisms to Strengthen the Ability
of YOLOv5s for Real-Time
Identification of Vehicle Type.
Electronics 2022, 11, 2586. https://
doi.org/10.3390/electronics11162586
Academic Editor: Silvia Liberata
Ullo
Received: 29 July 2022
Accepted: 16 August 2022
Published: 18 August 2022
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2022 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/).
Article
Multiple Mechanisms to Strengthen the Ability of YOLOv5s for
Real-Time Identification of Vehicle Type
Qiang Luo
1,2,3
, Junfan Wang
1,3
, Mingyu Gao
1,3,
*, Zhiwei He
1,3
, Yuxiang Yang
1,3
and Hongtao Zhou
4
1
School of Electronics and Information, Hangzhou Dianzi University, Hangzhou 310018, China
2
School of Communication and Electronics, Jiangxi Science and Technology Normal University,
Nanchang 330038, China
3
Zhejiang Provincial Key Lab of Equipment Electronics, Hangzhou 310018, China
4
Zhejiang Leapmotor Technology Co., Ltd., Hangzhou 310018, China
* Correspondence: mackgao@hdu.edu.cn; Tel.: +86-133-8651-0408
Abstract:
Identifying the type of vehicle on the road is a challenging task, especially in the natural
environment with all its complexities, such that the traditional architecture for object detection
requires an excessively large amount of computation. Such lightweight networks as MobileNet are
fast but cannot satisfy the performance-related requirements of this task. Improving the detection-
related performance of small networks is, thus, an outstanding challenge. In this paper, we use
YOLOv5s as the backbone network to propose a large-scale convolutional fusion module called the
ghost cross-stage partial network (G_CSP), which can integrate large-scale information from different
feature maps to identify vehicles on the road. We use the convolutional triplet attention network
(C_TA) module to extract attention-based information from different dimensions. We also optimize
the original spatial pyramid pooling fast (SPPF) module and use the dilated convolution to increase
the capability of the network to extract information. The optimized module is called the DSPPF. The
results of extensive experiments on the bdd100K, VOC2012 + 2007, and VOC2019 datasets showed
that the improved YOLOv5s network performs well and can be used on mobile devices in real time.
Keywords: vehicle type detection; object detection; G_CSP; C_TA; DSPPF
1. Introduction
Object detection [
1
] is a basic task in computer vision that has attracted growing
research interest in recent years. Designing a valid neural network structure based on the
CNN is the main means of object detection in natural scenes. For example, object detection
methods are used to efficiently identify the type of vehicle and its license plate number in
the context of intelligent transportation. One-stage and two-stage methods are the major
frameworks used for object detection. When predicting the classes and locations of objects,
the one-stage method can be used to directly extract features from the feature map. The
YOLO series is an example of this [
2
,
3
]. This study uses logistic regression to predict the
objectiveness score of each bounding box (bbox) [
4
]. In the implementation of the algorithm,
if a bounding box overlaps with the ground truth object more than any other bounding box
a priori, its value is set to one. When the prior value of the bounding box is not optimal,
the algorithm ignores the predicted value even if it overlaps with the real ground truth
value of the object beyond a certain threshold. Gaussian YOLOv3 [
4
] can not only improve
the accuracy of detection of the algorithm, but can also support its real-time operation. It
involves redesigning the loss function and using Gaussian parameters to model the bbox
of YOLOv3.
A considerable amount of research has been reported on the one-stage object detection
network. The SSD [
5
] uses the feature pyramid network to extract feature-related infor-
mation. It can improve the capability of the algorithm to detect large and small objects by
extracting feature maps at different scales. The shape of the detected object can be better
Electronics 2022, 11, 2586. https://doi.org/10.3390/electronics11162586 https://www.mdpi.com/journal/electronics