CN112651344A - Motorcycle helmet wearing detection method based on YOLOv4 - Google Patents

Motorcycle helmet wearing detection method based on YOLOv4 Download PDF

Info

Publication number
CN112651344A
CN112651344A CN202011590566.6A CN202011590566A CN112651344A CN 112651344 A CN112651344 A CN 112651344A CN 202011590566 A CN202011590566 A CN 202011590566A CN 112651344 A CN112651344 A CN 112651344A
Authority
CN
China
Prior art keywords
helmet
detection
motorcycle
rider
yolov4
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011590566.6A
Other languages
Chinese (zh)
Inventor
李启瑞
贾伟楠
吕衍河
尹芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin University of Science and Technology
Original Assignee
Harbin University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin University of Science and Technology filed Critical Harbin University of Science and Technology
Priority to CN202011590566.6A priority Critical patent/CN112651344A/en
Publication of CN112651344A publication Critical patent/CN112651344A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a motorcycle helmet wearing detection method based on an improved YOLOv4 algorithm. The proposed method is divided into three modules: a motorcycle and rider area detection module, a helmet ROI module and a helmet detection module. For motorcycle and rider area detection, a YOLOv4 target detection network is adopted to combine multiple rider category codes for area detection and extraction; for the helmet ROI module, we determine the ROI region using the dataset statistics; for the helmet detection module, we also train a YOLOv4 network to specialize in helmet detection. The invention not only effectively solves the problems of false detection and multi-detection of the target, but also increases the detection support for multiple riders, and simultaneously improves the wearing and detecting speed and precision of the motorcycle helmet.

Description

Motorcycle helmet wearing detection method based on YOLOv4
Technical Field
The invention belongs to the technical field of image processing and computer vision, relates to a target detection technology, in particular to a method for detecting the wearing of a helmet of a motorcycle rider, and is mainly applied to the field of road traffic safety.
Background
The addition of vehicles not only promoted the progress of human civilization, but also increased the frequency of road safety accidents. In most developing countries, motorcycles share a motorway with large trucks, buses and cars, and thus the risk of accidents is high. According to investigations, helmets have been shown to be the only safety devices for motorcycles, and the use of motorcycle helmets on demand can reduce the likelihood of a motorcycle rider suffering fatal injury in a road traffic accident by 42%. In order to ensure the safety of the cyclist on the road, the action of detecting whether the motorcyclist wears the helmet or not on the driving road is required, the increase of the population and the increase of the number of vehicles bring new challenges to the detection method, and the traditional manual detection method reaches the detection bottleneck because of lack of enough manpower. The motorcycle helmet wearing detection method based on the improved YOLOv4 can effectively solve the problems.
Most of the known motorcycle helmet wearing detection methods at present only describe that the upper part of a motorcycle area is selected for helmet classification, which is usually only the case of a single rider, and do not describe a detection scheme aiming at multiple passengers in detail. This method is not suitable for detecting multiple riders and does not distinguish whether an overload condition exists.
Most of the existing motorcycle helmet wearing detection algorithms are based on a specific detection direction, such as the front visual angle or the rear visual angle of a motorcycle, so that the helmet wearing condition of a motorcycle rider and the motorcycle license plate information can be accurately detected, but due to mutual shielding among riders, the method cannot be well applied to the helmet detection condition of multiple riders.
When the currently known motorcycle helmet wearing detection method detects a target, multiple detection and false detection conditions exist, and particularly, the target category is not easy to distinguish under the conditions that some vehicles are dense and shielding exists.
Disclosure of Invention
Aiming at the defects of the prior art, the invention relates to a motorcycle helmet wearing detection method based on an improved YOLOv4 algorithm. The proposed method is divided into three modules: a motorcycle and rider area detection module, a helmet ROI module and a helmet detection module. For motorcycle and rider area detection, a YOLOv4 target detection network is adopted to combine multiple rider category codes for area detection and extraction; for the helmet ROI module, we determine the ROI region using the dataset statistics; for the helmet detection module, we also train a YOLOv4 network to specialize in helmet detection. The invention not only effectively solves the problems of false detection and multi-detection of the target, but also increases the detection support for multiple riders, and simultaneously improves the wearing and detecting speed and precision of the motorcycle helmet.
A motorcycle helmet wearing detection method based on improved YOLOv4 comprises the following steps:
step 1: category coding for motorcycle and rider areas;
step 2: a Non-Maximum Suppression algorithm (NMS) of YOLOv4 is improved, and training of a YOLOv4 detection network is carried out aiming at the motorcycle and the rider area;
non-maxima suppression: the method is a technology for filtering prediction frames repeatedly detected, a detection frame with the highest score and other detection frames calculate a corresponding IOU value one by one, and all frames with the value exceeding an NMS threshold value are filtered;
and step 3: through inputting a traffic monitoring video frame, passing through a motorcycle and a rider area detection network, when a single rider and two riders are detected, using a rectangular frame to mark a target area, recording the number of the riders, extracting and sending the number into a next module; when more than two riders are detected, directly outputting a target area and calibrating as overload;
and 4, step 4: performing helmet ROI on the extracted motorcycle and rider areas, wherein the ROI areas are directly sent to a next module for helmet detection;
and 5: detecting the original data sets through a first module and a second module to generate a helmet ROI area serving as a helmet detection data set;
step 6: training a YOLOv4 network model for the helmet;
and 7: and (4) performing helmet detection on the ROI of the helmet, and matching the number of the helmets and the number of the chess hands.
Further, in the step 1, the category codes are a motorcycle area of one rider, a motorcycle area of two riders, and a motorcycle area of more than three riders (namely, an overload condition).
Further the NMS algorithm of YOLOv4 in said step 2 adds a filtering operation between different class detection boxes.
Further, the data set used for training the YOLOv4 network in the step 3 adopts the HELMET 2020 data set subjected to the class re-encoding, and performs data enhancement, so that the problem of class imbalance of the data set is solved.
Further the upper 2/5 of the motorcycle and rider area in said step 4 is a helmet ROI.
Further in said step 6 the helmet detection data set is composed of helmet ROI areas in the original data set.
Drawings
FIG. 1 is a general flow diagram of the present invention.
Fig. 2 is an overall detection frame diagram of a motorcycle helmet wearing detection method based on improved YOLOv 4.
Fig. 3 is a block diagram of a motorcycle and rider area detection module of the present invention.
Fig. 4 is a block diagram of a helmet ROI module of the present invention.
Fig. 5 is a block diagram of a helmet detection module of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in fig. 1: the invention comprises the following steps:
step 1: category coding for motorcycle and rider areas;
step 2: a Non-Maximum Suppression algorithm (NMS) of YOLOv4 is improved, and training of a YOLOv4 detection network is carried out aiming at the motorcycle and the rider area;
and step 3: through inputting a traffic monitoring video frame, passing through a motorcycle and a rider area detection network, when a single rider and two riders are detected, using a rectangular frame to mark a target area, recording the number of the riders, extracting and sending the number into a next module; when more than two riders are detected, directly outputting a target area and calibrating as overload;
and 4, step 4: performing helmet ROI on the extracted motorcycle and rider areas, wherein the ROI areas are directly sent to a next module for helmet detection;
and 5: detecting the original data sets through a first module and a second module to generate a helmet ROI area serving as a helmet detection data set;
step 6: training a YOLOv4 network model for the helmet;
and 7: and (4) performing helmet detection on the ROI of the helmet, and matching the number of the helmets and the number of the chess hands.
The overall inspection framework of the present invention is shown in FIG. 2. The method comprises the following specific steps:
step 1: the input image passes through the first module to obtain the areas of the motorcycle and the rider;
step 2: the motorcycle and the rider area pass through the module II to obtain a helmet ROI area;
and step 3: the ROI area of the helmet passes through a third module to obtain a helmet detection result;
and 4, step 4: the detection result is mapped back to the input image.
The structure of the motorcycle and rider area detection module of the present invention is shown in fig. 3. The method comprises the following specific steps:
step 1: inputting a picture to be detected (a road traffic monitoring video frame);
step 2: detecting the categories and areas of motorcycles and riders by using a trained YOLOv4 network;
and step 3: analyzing and extracting the types of the detected areas, if two or less rider areas are detected, sending the detected areas as original images of helmet detection to a next module for further judging the wearing condition of the helmet; if more than three riders are detected, the overload can be directly output.
The structure of the ROI module of the helmet of the present invention is shown in fig. 4. The module cuts the areas of the motorcycle and the rider extracted from the previous module, positions the approximate position of the helmet, and uses the cut area for helmet detection to directly detect the picture before processing, thereby reducing the processing time and improving the helmet detection precision. The method comprises the following specific steps:
step 1: performing statistical analysis on the positions of the helmets in the data set to determine appropriate cutting parameters;
step 2: cutting the motorcycle and the rider area by using the cutting parameters;
and (3) preprocessing the boundary frame in the step (2), and mapping the coordinates of the prediction frame back to the original image for performing a helmet detection task in the next step. The formula for mapping the predicted bounding box back to the original image is as follows
bleft=(bx-bw/2.0)*imw
bright=(bx+bw/2.0)*imw
btop=(by-bh/2.0)*imh
bbot=(by+bh/2.0)*imh
Wherein b denotes a prediction bounding box, bleftAbscissa representing upper left corner of prediction bounding box, brightAbscissa representing lower right corner of the prediction bounding box, btopDenotes the ordinate of the upper left corner, bbotOrdinate, im, representing the lower right cornerw/imhRepresenting the width and height of the original image.
Wherein the ROI formula of the helmet in step 2 is as follows
bleft==bleft
btop=btop
bright==bright
bbot=btop+round((bbot-btop)*0.4)
Where b represents the candidate region and round () represents the rounding function.
The structure of the helmet detection module of the present invention is shown in fig. 5. This module mainly detects the presence of a helmet in the image in order to further analyze whether a rider is not wearing a helmet. The method comprises the following specific steps:
step 1: performing helmet detection using a second YOLOv4 network trained on helmet data sets;
step 2: and matching the number of helmets detected in the area with the number of the riders recorded before, and analyzing whether behaviors of not wearing helmets exist.
In order to improve the accuracy of the helmet detection model, the helmet data set used for training the YOLOv4 network in step 2 is prepared as follows:
step 2.1: randomly selecting 1000 pictures from a HELMET 2020 data set, sending the pictures into a first YOLOv4 network, and generating a motorcycle and a rider area;
step 2.2: performing helmet ROI on the generated target area;
step 2.3: helmet labeling is carried out in a manual mode.
By adopting the method, the motorcycle helmet wearing detection program is compiled by adopting C + + language, and the road traffic monitoring video frame is input into the program to carry out helmet wearing detection. The detection accuracy of the motorcycle and the rider area reaches 97.91%. The accuracy rate of helmet detection reaches 98.66%. The running environment of the program is windows10, the CPU is i5-9400f, and the GPU is GTX 1060.
In summary, the preferred embodiments of the present invention are described above, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the scope of the present invention.

Claims (5)

1. A motorcycle helmet wearing detection method based on an improved YOLOv4 algorithm is characterized by mainly comprising the following steps:
step 1: category coding for motorcycle and rider areas;
step 2: a Non-Maximum Suppression algorithm (NMS) of YOLOv4 is improved, and training of a YOLOv4 detection network is carried out aiming at the motorcycle and the rider area;
and step 3: by inputting a traffic monitoring video frame, the video frame passes through a motorcycle and a rider area detection network, when a single rider and two riders are detected, a rectangular frame is used for calibrating a target area, recording the number of the riders, and extracting and sending the number into a next module; when more than two riders are detected, directly outputting a target area and calibrating as overload;
and 4, step 4: performing helmet ROI on the extracted motorcycle and rider areas, wherein the ROI areas are directly sent to a next module for helmet detection;
and 5: detecting the original data sets through a first module and a second module to generate a helmet ROI area serving as a helmet detection data set;
step 6: training a YOLOv4 network model for the helmet;
and 7: and 4, performing helmet detection on the ROI of the helmet, and matching the number of the helmet and the number of the chess hands.
2. The motorcycle helmet wearing detection method based on the improved YOLOv4 algorithm according to claim 1, wherein: the method is characterized in that category coding is carried out on regions of motorcycles and riders, an original data set HELMET 2020 is adopted for training the detection model, pictures of the original data set, which do not contain motorcycle targets, are removed, only 81374 sample pictures with labeled information and with the resolution of 1920x1080 are reserved, the coding mode of labeling of the original data set is modified, and 36 categories labeled by the original data set are mapped into 3 categories: i.e. one rider case, two rider case and overload case of more than two riders.
3. The motorcycle helmet wearing detection method based on the improved YOLOv4 algorithm according to claim 1, wherein: the non-maximum suppression algorithm of the YOLOv4 target detection network is improved, the non-maximum suppression process among different categories is increased, and the problem of repeated detection of the same target is solved.
4. The motorcycle helmet wearing detection method based on the improved YOLOv4 algorithm according to claim 1, wherein: the motorcycle and rider area detection comprises the following specific steps:
step 1: extracting a traffic monitoring video frame, and sending the traffic monitoring video frame into a YOLOv4 target detection network;
step 2: when more than two riders are detected, judging that the rider is overloaded, and directly outputting a result; and when less than two riders are detected, recording the number of the riders, extracting a target area, and sending the target area into the next module for helmet ROI.
5. The motorcycle helmet wearing detection method based on the improved YOLOv4 algorithm according to claim 1, wherein: and according to the data set statistical information, taking the upper part 2/5 of the predicted area in the step three as a helmet interesting area.
CN202011590566.6A 2020-12-29 2020-12-29 Motorcycle helmet wearing detection method based on YOLOv4 Pending CN112651344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011590566.6A CN112651344A (en) 2020-12-29 2020-12-29 Motorcycle helmet wearing detection method based on YOLOv4

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011590566.6A CN112651344A (en) 2020-12-29 2020-12-29 Motorcycle helmet wearing detection method based on YOLOv4

Publications (1)

Publication Number Publication Date
CN112651344A true CN112651344A (en) 2021-04-13

Family

ID=75363690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011590566.6A Pending CN112651344A (en) 2020-12-29 2020-12-29 Motorcycle helmet wearing detection method based on YOLOv4

Country Status (1)

Country Link
CN (1) CN112651344A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486812A (en) * 2021-07-08 2021-10-08 浙江得图网络有限公司 Riding safety control system and control method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550675A (en) * 2016-02-02 2016-05-04 天津大学 Binocular pedestrian detection method based on optimization polymerization integration channel
CN111310653A (en) * 2020-02-13 2020-06-19 上海眼控科技股份有限公司 Detection method and device for wearing helmet, computer equipment and storage medium
CN111814762A (en) * 2020-08-24 2020-10-23 深延科技(北京)有限公司 Helmet wearing detection method and device
CN111967393A (en) * 2020-08-18 2020-11-20 杭州师范大学 Helmet wearing detection method based on improved YOLOv4
CN111985387A (en) * 2020-08-17 2020-11-24 云南电网有限责任公司电力科学研究院 Helmet wearing early warning method and system based on deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550675A (en) * 2016-02-02 2016-05-04 天津大学 Binocular pedestrian detection method based on optimization polymerization integration channel
CN111310653A (en) * 2020-02-13 2020-06-19 上海眼控科技股份有限公司 Detection method and device for wearing helmet, computer equipment and storage medium
CN111985387A (en) * 2020-08-17 2020-11-24 云南电网有限责任公司电力科学研究院 Helmet wearing early warning method and system based on deep learning
CN111967393A (en) * 2020-08-18 2020-11-20 杭州师范大学 Helmet wearing detection method based on improved YOLOv4
CN111814762A (en) * 2020-08-24 2020-10-23 深延科技(北京)有限公司 Helmet wearing detection method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486812A (en) * 2021-07-08 2021-10-08 浙江得图网络有限公司 Riding safety control system and control method

Similar Documents

Publication Publication Date Title
CN109829403B (en) Vehicle anti-collision early warning method and system based on deep learning
CN104200668B (en) A kind of motorcycle based on graphical analysis is not helmeted violation event detection method
CN103488975B (en) A kind of method that zebra crossing based on intelligent driving detect in real time
CN111680613B (en) Method for detecting falling behavior of escalator passengers in real time
CN111241343A (en) Road information monitoring and analyzing detection method and intelligent traffic control system
CN111652296A (en) Deep learning-based rail wagon lower pull rod fracture fault detection method
CN103400113B (en) Freeway tunnel pedestrian detection method based on image procossing
CN105760847A (en) Visual detection method for detecting whether motor cyclist wears helmet or not
CN109858456B (en) Railway vehicle state fault analysis system
CN106600955A (en) Method and apparatus for detecting traffic state and electronic equipment
CN111626170A (en) Image identification method for railway slope rockfall invasion limit detection
CN111832461A (en) Non-motor vehicle riding personnel helmet wearing detection method based on video stream
CN113033275B (en) Vehicle lane-changing non-turn signal lamp analysis system based on deep learning
CN112153334A (en) Intelligent video box equipment for safety management and corresponding intelligent video analysis method
CN110782409A (en) Method for removing shadow of multi-motion object
CN112651344A (en) Motorcycle helmet wearing detection method based on YOLOv4
CN115512315B (en) Non-motor vehicle child riding detection method, electronic equipment and storage medium
CN103942541A (en) Electric vehicle automatic detection method based on vehicle-mounted vision within blind zone
CN115147869A (en) Electric vehicle rider helmet detection and license plate recognition method based on deep learning
Tschürtz et al. System of systems safety analysis and evaluation in ZalaZONE
Avupati et al. Traffic Rules Violation Detection using YOLO and HAAR Cascade
Jearanaitanakij et al. Fast Classifying Non-helmeted Motorcyclists by Using Convolutional Neural Networks
CN111814582A (en) Method and device for processing driver behavior monitoring image
CN114693606B (en) Pedestrian area merging-based safety equipment wearing detection method
CN117541865B (en) Identity analysis and mobile phone use detection method based on coarse-granularity depth estimation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210413

WD01 Invention patent application deemed withdrawn after publication