As a common means of transportation,electric bicycles not only greatly facilitate residents’ travel,but also lead to many traffic accidents and become a major hidden danger to traffic safety.Wearing helmets can effectively protect life safety of electric bicycle riders and greatly reduce injury of traffic accidents.So it is of great significance to detect whether electric bicycle riders wear helmets.At present,helmet detection of electric bicycles is mainly based on manual detection by law enforcement officers,which is inefficient,time-consuming and laborious.It is imminent to realize automatic detection of helmet wearing.For this reason,this paper studies a method for helmet detection and license plate recognition of electric bicycles based on deep learning,algorithms are used to detect whether electric bicycle riders wear helmets and recognize the relevant license plate of riders without helmets.Achieving the effect of restraint and supervision.The main contents of this paper are as follows:(1)A detection data set for helmet and license plate of electric bicycle is established.In order to solve the problem of lack special image data of electric bicycle helmets and license plates,4000 electric bicycle riding images are collected by video frame extraction and labeled with categories to create a dataset.The data set is expanded to 8000 by using methods of geometric transformation,color transformation and multi-sample data augmentation to make algorithm more robust.(2)A detection algorithm for helmet and license plate of electric bicycle based on improved YOLOv5 s is proposed.In order to quickly and accurately detect information of helmet and license plate,YOLOv5 s model is selected as baseline network for helmet and license plate detection,considering accuracy and speed indicators.Aiming at the problems of too many small objects and a single shape of label frame in data set,this paper analyzes the shortcomings of YOLOv5 s model from three aspects: backbone network structure,the number of anchor boxes and loss function.YOLOv5 s is improved by adding CA attention mechanism,reducing the number of anchor boxes and using CIo U loss function.According to experimental results,YOLOv5s_Final model proposed in this paper has higher detection accuracy,m AP@.5 is 2.8% higher than YOLOv5 s,m AP@.5:.95 is improved by 4.5% and inference time is 21 ms.The problem of missed detection and false detection are effectively alleviated and the rapid detection of helmets and license plates of electric bicycles is realized.(3)A data matching method for helmet and license plate of electric bicycle is proposed and license plate recognition of electric bicycle is realized.Aiming at the problem that YOLOv5s_Final cannot judge the corresponding relationship between helmet and license plate,this paper establishes a data matching mechanism between helmet and license plate by improving the post-processing process of model detection,and obtains the relevant license plate pictures of riders without helmets.A data set for electric bicycle license plate recognition is established in this paper and experiments on license plate recognition is carried out by using PP-OCR character recognition algorithm.Aiming at the problem of blurred and high-exposure images,real-time data augmentation is used to improve the recognition accuracy of PP-OCR,license plate recognition accuracy rate is increased by 2.43% and recognition time is 38 ms.Experiments show that PP-OCR model can achieve automatic recognition of electric bicycle license plates for riders without helmets to a certain extent. |