Drunk driving behavior early warning identification method and system
By constructing a red face database and combining trajectory analysis methods, identifying and warning of drunk driving behaviors, the problem of difficulty in identifying drunk driving in the existing technology is solved, the recognition accuracy and management efficiency are improved, and the risk of accidents is reduced.
Patent Information
- Application Number
- CN202411617105.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The prior art is difficult to effectively identify and warn of drunk driving behaviors, especially when the blushing characteristics disappear but the alcohol in the body has not yet been fully metabolized.
By constructing a red face database, using a red face recognition algorithm and a database-based face recognition algorithm, combined with trajectory tracking analysis, we can determine whether the driver has drunk driving behavior and issue an early warning signal.
It improves the recognition rate of drunk driving, improves management efficiency, reduces the incidence of accidents, improves the sense of traffic safety in society, and fills the gap in the absence of recognition caused by red face disappearing too quickly but the concentration of alcohol residue in the body is still high.
Smart Images

Figure CN119540927A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent security technology, and in particular to a novel drunk driving behavior early warning identification method and system. Background Art
[0002] Drunk driving refers to the act of controlling and driving a motor vehicle under the influence of alcohol or alcoholic beverages. Drinking alcohol can cause visual impairment, reduced tactile, judgment and operating abilities, psychological changes of overconfidence, and fatigue and drowsiness, which can easily lead to traffic accidents. Therefore, it is crucial to promptly investigate and punish drunk driving.
[0004] Studies have found that drinking alcohol can cause symptoms such as blushing on the face, such as pink or reddish brown. Blushing symptoms usually appear a few minutes after drinking, and last for about 1-2 hours after drinking ends before gradually disappearing. After a person drinks a small amount of alcohol, it takes about 24 hours for the alcohol in the body to be completely metabolized. Excessive drinking that exceeds the liver's metabolic capacity requires 72 hours to be completely metabolized. In order to prevent drivers from driving vehicles 1-2 hours after drinking, when the blushing characteristics disappear but there is still a lot of alcohol in the body, it is also very necessary to identify the blushing situation under public video surveillance in the jurisdiction, and to detect and warn of blushing and drinking in advance.
[0005] In addition, according to statistical results, the driving routes of vehicles driven by drunk drivers are usually in the shape of "S" or "Z". Therefore, the blushing features of the face and the driving trajectory features can be used as the basis for identifying drunk driving behavior.
[0006] Therefore, a method and system for early warning and identification of drunk driving behavior are needed. Summary of the invention
[0007] In view of this, the purpose of the present invention is to provide a method and system for early warning and identification of drunk driving behavior, which utilizes a red face database to identify drunk driving behavior, improve the recognition rate of drunk driving, improve management efficiency, reduce the accident rate, and enhance the society's sense of traffic safety.
[0008] In order to achieve the above object, the present invention provides the following technical solutions:
[0009] The drunk driving behavior warning identification method provided by the present invention comprises the following steps:
[0010] S1: constructing a red face database, wherein the red face database is used to store red face images and image acquisition time;
[0011] S2: Obtain the red face image of the target object on the scene, and store the red face image in a red face database in a queue format, and perform red face validity analysis on the red face image queue within a set time period, and mark the red face image queue that meets the requirements as a valid record;
[0012] S3: Analyze and process the red face image on the scene and the red face images in the red face database to determine whether the detected target object is suspected of drunk driving. If yes, issue a warning signal; if not, return to continue collecting face images on the scene.
[0013] Further, in step S3, determining whether the detected target object is suspected of drunk driving is performed according to the following steps:
[0014] The red face image of the target object collected on site is added to the red face queue of the target in the red face database. Each time a red face image is added, the queue is analyzed for validity. If the validity analysis conditions are met, it is immediately verified whether the target object has a driver's license. If so, an early warning signal is issued;
[0015] If not, return to continue collecting face images on site.
[0016] Furthermore, it also includes trajectory tracking analysis, and the trajectory tracking analysis includes the following steps:
[0017] S4: Acquire vehicle image;
[0018] S5: Determine the vehicle position according to the vehicle image;
[0019] S6: Determine the driving trajectory according to the vehicle position;
[0020] S7: Determine whether the vehicle is driving abnormally based on the driving trajectory. If so, determine it as suspected drunk driving and issue a warning signal; if not, return to continue collecting on-site vehicle images.
[0021] Further, the vehicle trajectory is formed according to the following steps:
[0022] S61: Calculate the number of vehicles whose position coordinates are within a set distance range in a continuous time;
[0023] S62: Calculate a ratio value within a predetermined distance range, where the ratio value is a ratio of the number within the predetermined distance range to the number of position coordinates within a continuous time;
[0024] S62: Determine whether the ratio value is greater than a predetermined threshold value, if yes, the trajectory is normal, if no, the trajectory is abnormal;
[0025] Further, the red face database is established according to the following steps:
[0026] S11: Collecting facial images;
[0027] S12: classifying the detected face image to determine whether the face is in a red face state. If it is recognized as a red face, determining whether there is an identical red face in the database. If there is an identical red face, storing the red face image and updating the image acquisition time.
[0028] S13: If the same red face does not exist, then create a personnel ID queue for the red face image, save the red face image into the queue, and record the capture time of the red face image.
[0029] Further, the method further comprises the following steps:
[0030] S13: When the red face image is added to the queue and reaches the queue capacity Q, the validity of the red face image of the person ID is calculated. The validity is the number of red face images in the queue at a certain time interval T limit The proportion of red faces in Q ratio , the calculation formula is as follows:
[0031]
[0032] Among them, x represents the red face in the queue, if Q ratio Greater than the set threshold T Q , then the red face record of the person ID in the database is considered valid.
[0033] The recognition system constructed according to the above-mentioned drunk driving behavior warning recognition method provided by the present invention comprises an image acquisition module, a red face database, and a warning signal generation module;
[0034] The image acquisition module is used to obtain the red face image on site;
[0035] The red face database is used to store red face images and image acquisition time;
[0036] The warning signal generating module is used to generate and send a drunk driving suspicion warning signal when it is determined that the detected target object is a drunk driving suspect based on the on-site red face image and the red face images in the red face database.
[0037] Furthermore, the target object is judged as suspected of drunk driving in the following manner:
[0038] The red face image of the target object collected on site is added to the red face queue of the target in the red face database. Each time a red face image is added, the queue is analyzed for validity. If the validity analysis conditions are met, it is immediately verified whether the target object has a driver's license. If so, an early warning signal is issued;
[0039] If not, return to continue collecting face images on site.
[0040] Furthermore, it also includes a trajectory recognition module, which is used to determine whether the driving is abnormal according to the acquired vehicle driving trajectory;
[0041] The trajectory recognition module is performed according to the following steps:
[0042] First, obtain the vehicle image; determine the vehicle position based on the vehicle image; then determine the driving trajectory based on the vehicle position; finally, determine whether the vehicle is driving abnormally based on the driving trajectory. If so, it is determined as suspected drunk driving and a warning signal is issued; if not, return to continue collecting on-site vehicle images;
[0043] The vehicle trajectory is formed according to the following steps:
[0044] First, the number of vehicles whose position coordinates are within the set distance range in continuous time is calculated;
[0045] Then, a ratio value within the predetermined distance range is calculated, wherein the ratio value is the ratio of the number within the predetermined distance range to the number of position coordinates within the continuous time;
[0046] Finally, it is determined whether the ratio value is greater than a predetermined threshold. If so, the trajectory is normal; if not, the trajectory is abnormal.
[0047] Furthermore, the image acquisition module uses a camera for shooting, and the camera is set on a camera mounting bracket, and the mounting bracket includes a vertical rod and a horizontal rod; the vertical rod cross-mounts two cameras to irradiate in a "<" direction; the horizontal rod is equipped with a two-way camera, and the two-way camera irradiates in an "I" line; the four lenses are arranged in a K-shaped structure.
[0048] The beneficial effects of the present invention are:
[0049] The drunk driving behavior warning and recognition method provided by the present invention constructs a red face database, analyzes and processes the facial images obtained on site, and determines whether it is a red face. If so, it is determined as suspected drunk driving behavior and a warning signal is issued; if not, it returns to continue collecting facial images on site. With the help of a red face recognition algorithm and a database-based face recognition algorithm, this method can not only realize real-time drunk driving behavior recognition, but also realize drinking behavior recognition within a period of time, filling the gap of missed recognition caused by the red face disappearing too quickly but the residual alcohol concentration in the body is still high. The method based on red face detection can obtain a higher drunk driving behavior recognition accuracy. Combined with the database-based face recognition method, this method effectively expands the time range for drunk driving behavior recognition.
[0050] The present invention is used to solve the problem of drunk driving in road traffic safety management. By installing a new large-scale control camera, a visual artificial intelligence algorithm is used to intelligently judge whether the driver is driving under the influence by identifying the driver's red face and the driver's driving trajectory. The camera is installed in a K-shaped manner, which greatly increases the camera monitoring range, reduces the blind spot of the field of vision, and improves the face capture rate of vehicles such as motorcycles that are blocked by windshields, umbrellas, and awnings, and increases the capture rate by about 4 to 5 times.
[0051] This method can obtain the complete trajectory and driving direction of the vehicle through the abnormal driving trajectory judgment method based on target tracking, and use the trajectory fitting method to perform driving route fitting and comprehensive judgment of multi-frame offsets, which can save the configuration of reference lines and lane line detection, and can more accurately identify the abnormal driving trajectory of the vehicle. There is no need to set reference lines in advance or use additional lane line detection algorithms, which can effectively reduce cost investment. In addition, comprehensive judgment of multi-frame results can effectively improve the accuracy of abnormal driving trajectory recognition.
[0052] This method is the first to propose the use of a red face recognition method based on database face recognition. With the help of a red face recognition algorithm and a database-based face recognition algorithm, it can not only realize real-time drunk driving behavior recognition, but also recognize drunk driving behavior based on red face features. At the same time, the full-scene red face detection and data storage can simultaneously meet the real-time driver red face recognition and red face recognition within a certain period of time, as well as early warning for non-drivers with driving qualifications. In addition to effectively improving the accuracy of drunk driving behavior recognition, it also effectively expands the time range of drunk driving behavior recognition, filling the gap of missed recognition caused by the red face disappearing too quickly but the alcohol residual concentration in the body is still high. At the same time, the combination of red face recognition and driving qualification information retrieval for non-drivers can warn of drunk driving behavior, reduce the risk of drunk driving, and play a role in warning education.
[0053] The present invention provides a method for early warning and identification of drunk driving behavior, which uses target detection, face recognition, database construction, trajectory anomaly recognition and other methods to identify drunk driving behavior. With the help of high-definition cameras and back-end computing services, the scope of manpower investigation can be narrowed, suspicious targets can be screened in advance, and the efficiency of investigating and handling drunk driving behavior can be greatly improved, providing an additional guarantee for road traffic safety.
[0054] In addition, red face recognition can also be used to send text messages or phone calls to non-drivers with driving records, thereby playing a role in publicity and early warning to prevent drunk driving.
[0055] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to make the purpose, technical solution and beneficial effects of the present invention clearer, the present invention provides the following drawings for explanation.
[0057] Figure 1 This is the flow chart of the model inference phase.
[0058] Figure 2 Construct a flow chart for the red face database.
[0059] Figure 3 Schematic diagram of the drunk driving behavior recognition system.
[0060] Figure 4 Schematic diagram of camera installation. DETAILED DESCRIPTION
[0061] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0062] Example 1
[0063] like Figure 1 As shown, a method for early warning and identifying drunk driving behavior provided in this embodiment includes the following steps:
[0064] S1: constructing a red face database, wherein the red face database is used to store red face images and image acquisition time;
[0065] S2: Obtain the red face image of the target object on the scene, and store the red face image in a red face database in a queue format, and perform red face validity analysis on the red face image queue within a set time period, and mark the red face image queue that meets the requirements as a valid record;
[0066] S3: Analyze and process the face image on the scene and the face image in the red face database to determine whether the detected target object is suspected of drunk driving. If yes, issue a warning signal; if not, return to continue collecting face images on the scene.
[0067] In step S3 of this embodiment, determining whether the detected target object is suspected of drunk driving is performed according to the following steps:
[0068] The red face image of the target object collected on site is added to the red face queue of the target in the red face database. Each time a red face image is added, the queue is analyzed for validity. If the validity analysis conditions are met, it is immediately verified whether the target object has a driver's license. If so, an early warning signal is issued;
[0069] If not, return to continue collecting face images on site.
[0070] In this embodiment, the target object suspected of drunk driving meets the following three conditions: (1) the face is red; (2) the record of the red face is valid in the database; (3) the driving conditions are met, that is, there is a vehicle or a driver's license;
[0071] In this embodiment, the warning signal includes signals such as text messages and telephone persuasion. Through red face recognition, this method can send text messages and telephone persuasion to non-drivers with driving records, and send warning signals to corresponding detection objects, thereby playing a role in publicity and warning to prevent drunk driving.
[0072] In this embodiment, the face images of people on the scene are collected from all people under surveillance, and red face recognition is performed on the collected face images to provide early warning and judgment of drunk driving behavior. Combined with the construction and comparison of the red face database, the red face personnel can be tracked across time to infer their drinking situation over a period of time;
[0073] This embodiment also includes trajectory tracking analysis, and the trajectory tracking analysis includes the following steps:
[0074] S4: Acquire vehicle image;
[0075] S5: Determine the vehicle position according to the vehicle image;
[0076] S6: Determine the driving trajectory according to the vehicle position;
[0077] S7: judging whether the vehicle is driving abnormally according to the driving trajectory, if so, judging it as suspected drunk driving behavior and issuing a warning signal; if not, returning to continue collecting on-site vehicle images;
[0078] In this embodiment, after the vehicle image is acquired in step S4, the following steps are also included:
[0079] S41: Acquire a driver's face image from the vehicle image;
[0080] S42: Analyze and process the driver's face image and the face images in the red face database to determine whether the driver has a red face. If so, issue a warning signal and update the red face database at the same time; if not, return to continue collecting face images on the scene;
[0081] In this embodiment, the vehicle and human face in the video frame are judged by trajectory and red face respectively. If the driver meets one of the judgment conditions, it can be identified as drunk driving. If the pedestrian has a red face and driving qualifications, a drunk driving warning can be issued;
[0082] The vehicle trajectory is formed according to the following steps:
[0083] S61: Calculate the number of vehicles whose position coordinates are within a set distance range in a continuous time;
[0084] S62: Calculate a ratio value within a predetermined distance range, where the ratio value is a ratio of the number within the predetermined distance range to the number of position coordinates within a continuous time;
[0085] S62: Determine whether the ratio value is greater than a predetermined threshold value, if yes, the trajectory is normal, if no, the trajectory is abnormal;
[0086] In this embodiment, when the target person in step S3 is determined to be a driver, if the face image is identified as a red face image, or if the driving trajectory of the vehicle is determined to be abnormal, it can be determined as suspected drunk driving and a warning signal is issued;
[0087] When the target object is a pedestrian, if the facial image of the pedestrian is a red face image, the red face record of the person is valid in the database, and the pedestrian has a driver's license, only an output warning signal is issued;
[0088] like Figure 2 As shown, Figure 2 The red face database is constructed as a flow chart. The red face database in this embodiment is established according to the following steps:
[0089] The red face of each person ID in the red face database is stored in the form of a queue with a queue capacity of Q. The queue is updated according to the time when the red face enters the database. The elements in each queue are the red face image and timestamp;
[0090] First, the face detection model is used to perform full-scene face detection on the collected images. After the detected face is cut out, it is classified using the red face classification model to determine whether the face is in a red face state. If it is recognized as a red face, the twin network is used for face recognition. If the same red face exists in the database, the red face is added to the personnel ID queue and the latest timestamp of the queue is updated. If it is recognized as a new red face, the red face personnel ID queue is created and the red face is saved in the queue, and the capture time of the red face is recorded. The construction process is as follows: Figure 2 shown.
[0091] When the red face joins the queue and reaches the queue capacity Q, the red face validity of the person ID is calculated. The validity is defined as the number of red faces in the queue within a certain time interval T limitThe proportion of red faces in Q ratio , calculated as
[0092]
[0093] Among them, x represents the red face in the queue, if Q ratio Greater than the set threshold T Q , then the red face record of the person ID in the database is considered valid, the purpose of which is to filter out the false recognition of red faces caused by lighting;
[0094] Alert for drunk driving: When constructing a red face database, if the red face comes from a facial capture of a person who is not a vehicle driver, and the red face record of the person is valid, a system information search can be performed on the red face person to check whether the person has the driving qualification. If so, the person will be reminded to prohibit drunk driving, and he can be informed to refrain from drunk driving through text messages, phone calls, etc.
[0095] In this embodiment, the image face data collected from the pedestrian includes the collection time. The red face image and the collection time collected by different cameras are analyzed, and it is calculated whether the red face record of the pedestrian in the database is valid. If valid, it is analyzed whether the pedestrian has a driver's license. If so, a warning signal is issued. If not, the face image collection process is returned to the loop; the time threshold of the drunk driving experience in this embodiment can be preset according to the specific situation.
[0096] In this embodiment, the red face data comes from the red face images taken by the camera; including the red face images of pedestrians taken by the camera, and the red face images of people in vehicles;
[0097] In this embodiment, when constructing a red face database, it is necessary to perform validity judgment on the captured images. The validity judgment can filter out the influence of illumination on the captured images. The validity judgment is performed by analyzing the proportion of red face images in the image queue captured within a set time period. For example, if the target queue capacity is 10, and 6 red face images of the target are captured within five minutes, which is greater than the set threshold of 5, the red face data queue is considered valid. If only 1 red face image is captured, the red face data queue is considered invalid, which may be caused by the influence of illumination. Regardless of whether the data queue is valid, it needs to be stored in the database.
[0098] When the database is constructed, as long as there is a valid record and a driver's license is available, a text message warning will be sent;
[0099] In this embodiment, it is possible to determine whether the vehicle's trajectory is normal based on target tracking, and then the image can be used to perform red face image validity analysis, and the photos determined to be red face images are stored in the database;
[0100] When the sum of the facial image captured within the set time and the red face image stored in the database meets the validity judgment, the detected target object is deemed to be suspected of drunk driving and a warning signal is issued.
[0101] Example 2
[0102] like Figure 3 As shown, Figure 3 Schematic diagram of a drunk driving behavior recognition system. The drunk driving behavior warning recognition system provided in this embodiment includes an image acquisition module, a red face database, and a warning signal generation module;
[0103] The image acquisition module is used to obtain the red face image on site;
[0104] The red face database is used to store red face images and image acquisition time;
[0105] The warning signal generating module is used to generate and send a drunk driving suspicion warning signal when the detected target object is determined to be a drunk driving suspect based on the on-site red face image and the red face image in the red face database;
[0106] In this embodiment, whether the target object is suspected of drunk driving is identified in the following manner:
[0107] The red face image of the target object collected on site is added to the red face queue of the target in the red face database. Each time a red face image is added, the queue is analyzed for validity. If the validity analysis conditions are met, it is immediately verified whether the target object has a driver's license. If so, an early warning signal is issued;
[0108] If not, return to continue collecting on-site face images.
[0109] The system provided in this embodiment further includes a trajectory recognition module, which is used to determine whether the driving is abnormal based on the acquired vehicle driving trajectory;
[0110] The trajectory recognition module is performed according to the following steps:
[0111] First, obtain the vehicle image; determine the vehicle position based on the vehicle image; then determine the driving trajectory based on the vehicle position; finally, determine whether the vehicle is driving abnormally based on the driving trajectory. If so, it is determined as suspected drunk driving and a warning signal is issued; if not, return to continue collecting on-site vehicle images;
[0112] The vehicle trajectory in this embodiment is formed according to the following steps:
[0113] First, the number of vehicles whose position coordinates are within the set distance range in continuous time is calculated;
[0114] Then, a ratio value within the predetermined distance range is calculated, wherein the ratio value is the ratio of the number within the predetermined distance range to the number of position coordinates within the continuous time;
[0115] Finally, it is determined whether the ratio value is greater than a predetermined threshold. If so, the trajectory is normal; if not, the trajectory is abnormal.
[0116] In this embodiment, the vehicle trajectory is based on the comparison between the vehicle position coordinate point and the predetermined distance value. For example, a vehicle has 10 coordinate points in 10 consecutive frames. If 8 of the 10 coordinate points are within the set distance range, the ratio is 8 / 10=0.8. Finally, it is determined whether the ratio value is less than the set threshold. If the set threshold is set to 0.5, 0.8>0.5, indicating that the trajectory is normal.
[0117] The image acquisition module in this embodiment uses a camera for shooting, and the camera is arranged on a camera mounting bracket, and the mounting bracket includes a vertical rod and a horizontal rod;
[0118] The two low-altitude cameras cross-mounted on the vertical poles are irradiated in a "<" direction;
[0119] The crossbar is provided with a two-way camera, and the two-way camera is illuminated in an "I" line;
[0120] The four lenses are arranged in a K-shaped structure.
[0121] like Figure 4 As shown, Figure 4 Schematic diagram for camera installation; Figure 4 (a) is the K-shaped camera installation method; (b) is the monitoring field of view from a bird's-eye view, where the two-way camera on the horizontal bar is illuminated in an "I" line, and the two low-altitude cameras cross-mounted on the vertical bar are illuminated in a "<" direction, and the four lenses present an approximately K-shaped structure. The face image in this embodiment is captured by a camera set on a mounting bracket, and the camera is installed in a K shape. The K-shaped video monitoring installation method can better capture obstructed targets and reduce blind spots in the field of view.
[0122] The face image in this embodiment comes from the video data collected by the camera, and is analyzed and processed by visual artificial intelligence. The visual artificial intelligence algorithm consists of two parts. One part is the red face detection of the driver. By building a database, the driver's red face detection results are judged in the most recent time to infer the driver's drinking situation in a period of time. The other part is to judge the driving trajectory of the vehicle. Through the above two conditions, the efficient identification of drunk driving behavior can be better achieved.
[0123] This embodiment provides a drunk driving identification system to perform detailed drunk driving behavior identification, and the main process includes the following:
[0124] Step 1: Data preparation and model training phase
[0125] Camera installation and data collection: The camera installation angle is selected according to different road conditions. The two-way camera on the horizontal bar and the low-altitude cross camera on the vertical bar are set up in a K shape. Video materials in different scenes are collected through the installed cameras, and the original image data set D0 is constructed after the video materials are extracted. Videos within a period of time are collected and extracted to obtain a series of image frames.
[0126] Step 2: Vehicle detection model training
[0127] The dataset D0 is labeled with bounding boxes of all motor vehicles and non-motor vehicles in the image using the labelme annotation tool to obtain the dataset D1. This dataset contains two types of targets: motor vehicles and non-motor vehicles, and is randomly split into a training set and a validation set with a ratio of 4:1.
[0128] Secondly, select yolov8m.pt as the pre-training model, change the data augmentation parameter fliplr in the hyperparameter configuration file hyp.scratch-low.yaml to 0.5, write the paths of the training set and validation set into a yaml file, and configure it to the data parameter in train.py;
[0129] Finally, run train.py for training. In this example, the number of training rounds is 100 and the input image size is 640. Use the vehicle detection model to infer the vehicle images and obtain the vehicle detection result R for each image. V .
[0130] Step 3: Face detection model training
[0131] The dataset D0 is annotated with bounding boxes of the faces in the image using the labelme annotation tool to obtain the dataset D2. This dataset contains faces as targets and is randomly split into a training set and a validation set with a ratio of 4:1.
[0132] Secondly, select yolov8m.pt as the pre-training model, change the data augmentation parameter fliplr in the hyperparameter configuration file hyp.scratch-low.yaml to 0.5, write the paths of the training set and validation set into a yaml file, and configure it to the data parameter in train.py;
[0133] Finally, run train.py for training. In this embodiment, the number of training rounds is 100 and the input image size is 640.
[0134] Step 4: Red face classification model training
[0135] Firstly, the face images in the obtained data set D2 were cropped and saved, and the saved face images were manually screened into red face and non-red face to obtain a two-category data set D3; then, the data set D3 was randomly split into a training set and a validation set with a ratio of 4:1, and the DeiT model was selected as the pre-training model. The steps in the official ReadMe.md file were used to start training to obtain the red face classification model.
[0136] The fifth step is the model reasoning stage
[0137] In the inference and judgment stage, the trained model is used to judge the trajectory and red face of the vehicle and face in the video frame respectively. If one of the judgment conditions is met, it can be identified as drunk driving.
[0138] The vehicle detection model reasoning in this embodiment is performed according to the following steps:
[0139] Vehicle target tracking: The vehicle detection result R of each image V Input ByteTrack model to calculate the vehicle's driving trajectory and output the tracking result Track of each vehicle V , including its coordinate frame, driving direction and corresponding frame number in each frame image.
[0140] Red face database construction: The red face of each person ID in the red face database is stored in the form of a queue. The queue capacity is Q. The queue is updated according to the time when the red face enters the database. The elements in each queue are the red face image and timestamp.
[0141] First, the face detection model is used to perform full-scene face detection on the collected images. After the detected face is cut out, it is classified using the red face classification model to determine whether the face is in a red face state. If it is recognized as a red face, the twin network is used for face recognition. If the same red face exists in the database, the red face is added to the personnel ID queue and the latest timestamp of the queue is updated. If it is recognized as a new red face, the red face personnel ID queue is created and the red face is saved in the queue, and the capture time of the red face is recorded. The construction process is as follows: Figure 2 shown.
[0142] When the red face joins the queue and reaches the queue capacity Q, the red face validity of the person ID is calculated. The validity is defined as the number of red faces in the queue within a certain time interval T limit The proportion of red faces in Q ratio , calculated as
[0143]
[0144] Among them, x represents the red face in the queue, if Q ratioGreater than the set threshold T Q , then the red face record of the person ID in the database is considered valid, the purpose of which is to filter out the false recognition of red faces caused by lighting;
[0145] Determine whether the driver's driving trajectory is abnormal: For each vehicle target, according to Track V Extract the center coordinates of the target in all video frames to obtain a coordinate sequence S xy =[x1, y1, x2, y2, ...x i ,y i ...x n ,y n ], a quadratic curve fitting is performed on the coordinate sequence to obtain curve C, and a reference threshold T is set shift It is used to measure the distance error from the reference point to the quadratic curve. If the trajectory is smooth, the trajectory coordinate points are all within a certain error range of curve C. Calculate the distance dist from each coordinate point to curve C. i , if dist exists i <T shift , then the coordinate point is considered to be within the reasonable error range of the fitting trajectory, and the number of all points within the error range m is counted, and its ratio to the number of all points n in the coordinate sequence is calculated R in , if R in Greater than a specified threshold T num , then the vehicle target trajectory is judged to be normal, otherwise it is judged to be abnormal;
[0146] Determine whether the driver is red-faced: For each vehicle target, according to Track V Extract the coordinate frame and driving direction of the target in all video frames, and use the coordinate frame to cut out the original image to obtain a cutout image sequence S I =[11, I2, ... I i ,...I n ], for each image I i , use the face detection model to perform face detection. If there are multiple detection results in the longitudinal direction, only the results close to the driving direction are retained;
[0147] If there are multiple detection results in the horizontal direction, only the right result in the driving direction is retained. The final face detection result is cut out and judged using the red face classification model. If it is recognized as a red face, the current image I i The state is counted as 1. If it is not a red face, the current face and the red face in the red face database are recognized using the twin network. If they are recognized as the same person and the red face record is valid, the interval T between the latest snapshot timestamp of the personnel queue in the database and the current date is calculated. interval , if the interval is less than the set interval threshold Ttime , then the current picture state is counted as 1, and the picture sequence S is counted I The ratio of the number of states that are 1 to the length of the sequence R state , if R state Greater than a specified threshold T state , it is determined that the vehicle is suspected of drunk driving, and the red face images marked as 1 are entered into the red face database in chronological order;
[0148] For each target, if the target has any of the judgment conditions of blushing or abnormal driving trajectory, it can be determined that there is drunk driving behavior.
[0149] In this embodiment, target detection is performed on various videos: identifying and locating targets of interest in images or videos, which may be people, objects, faces, etc. The application of target detection is very wide, including scenic spots and face recognition in the field of security, medical diagnosis in the field of medicine, pedestrian detection in the field of autonomous driving, etc.
[0150] Face recognition: Face recognition refers to the technology of detecting a face through an object detection algorithm, then extracting features from the face, and then comparing the extracted features with the features in the system database to achieve identity confirmation or identity search.
[0151] Siamese Network: A Siamese Network is a type of neural network structure that consists of two or more identical networks. The basic idea is to input the input data into two identical neural networks at the same time. The two networks share the same weights and parameters. By learning the representation of the input data in the two networks, the Siamese network can calculate the similarity between the two input samples.
[0152] YOLO (You Only Look Once) target detection algorithm: is a target detection algorithm based on CNN. YOLO is one of the faster object detection algorithms. Based on this advantage, this model is very suitable for scenarios with strong real-time requirements. This embodiment uses YOLOv8. Compared with YOLOv5, YOLOv8 can achieve higher performance while effectively reducing detection delay, and can better meet the high-precision and high-performance requirements for driving behavior in traffic scenarios.
[0153] Multiple Object Tracking (MOT): Aims to detect the targets of interest or desired tracking in the video and obtain their positions in the image, and assign an ID to each target. During the target's movement, each target ID remains unchanged. As one of the most important research directions in the field of computer vision, MOT can be widely used in smart cities, smart retail, security monitoring, autonomous driving, robotics and other fields.
[0154] ByteTrack multi-target tracking algorithm: is a tracking method based on the tracking-by-detection paradigm, which solves the problems existing in most multi-target tracking methods. In some previous target tracking algorithms, only detection boxes with association scores higher than the threshold are used to obtain the target ID, while targets with lower detection scores, such as occluded targets, are simply discarded, which leads to a large number of missed detections and fragmented tracks. ByteTrack proposes a simple, efficient and general data association method BYTE, which tracks by associating each detection box instead of just the high-scoring detection boxes. For low-scoring detection boxes, their similarity with the trajectory is used to restore the real target and filter out background detections. BYTE can be easily applied to a variety of excellent MOT methods and achieve good tracking results.
[0155] Data-efficient Image Transformers (DeiT): is an image classification model developed by Facebook AI in collaboration with Sorbonne University, which aims to improve data efficiency, that is, to generate high-performance image classification models using less data and computing resources.
[0156] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for early warning and identification of drunk driving behavior, characterized in that: The following steps are involved: S1: constructing a red face database, wherein the red face database is used to store red face images and image acquisition time; S2: Obtain the red face image of the target object on the scene, and store the red face image in a red face database in a queue format, and perform red face validity analysis on the red face image queue within a set time period, and mark the red face image queue that meets the requirements as a valid record; S3: Analyze and process the red face image on the scene and the red face images in the red face database to determine whether the detected target object is suspected of drunk driving. If yes, issue a warning signal; if not, return to continue collecting face images on the scene.
2. The drunk driving behavior warning identification method according to claim 1, characterized in that: In step S3, determining whether the detected target object is suspected of drunk driving is performed according to the following steps: The red face image of the target object collected on site is added to the red face queue of the target in the red face database. Each time a red face image is added, the queue is analyzed for validity. If the validity analysis conditions are met, it is immediately verified whether the target object has a driver's license. If so, an early warning signal is issued; If not, return to continue collecting on-site face images.
3. The method for early warning and identification of drunk driving behavior according to claim 1, characterized in that: Also included is a trajectory tracking analysis, the trajectory tracking analysis comprising the following steps: S4: Acquire vehicle image; S5: Determine the vehicle position according to the vehicle image; S6: Determine the driving trajectory according to the vehicle position; S7: Determine whether the vehicle is driving abnormally based on the driving trajectory. If so, determine it as suspected drunk driving and issue a warning signal; if not, return to continue collecting on-site vehicle images.
4. The method for early warning and identification of drunk driving behavior according to claim 1, characterized in that: The vehicle trajectory is formed according to the following steps: S61: Calculate the number of vehicles whose position coordinates are within a set distance range in a continuous time; S62: Calculate a ratio value within a predetermined distance range, where the ratio value is a ratio of the number within the predetermined distance range to the number of position coordinates within a continuous time; S62: Determine whether the ratio value is greater than a predetermined threshold value, if yes, the trajectory is normal, if no, the trajectory is abnormal.
5. The method for early warning and identification of drunk driving behavior according to claim 1, characterized in that: The red face database is established according to the following steps: S11: Collecting facial images; S12: classifying the detected face image to determine whether the face is in a red face state. If it is recognized as a red face, determining whether there is an identical red face in the database. If there is an identical red face, storing the red face image and updating the image acquisition time. S13: If the same red face does not exist, then create a personnel ID queue for the red face image, save the red face image into the queue, and record the capture time of the red face image.
6. The method for early warning and identification of drunk driving behavior as claimed in claim 5, characterized in that: The following steps are also included: S13: When the red face image is added to the queue and reaches the queue capacity Q, the validity of the red face image of the person ID is calculated. The validity is the number of red face images in the queue at a certain time interval T limit The proportion of red faces in Q ratio , the calculation formula is as follows: Among them, x represents the red face in the queue, if Q ratio Greater than the set threshold T Q , then the red face record of the person ID in the database is considered valid.
7. A recognition system constructed according to the drunk driving behavior warning recognition method according to any one of claims 1 to 6, characterized in that: It includes image acquisition module, red face database, and warning signal generation module; The image acquisition module is used to obtain the red face image on site; The red face database is used to store red face images and image acquisition time; The warning signal generating module is used to generate and send a drunk driving suspicion warning signal when it is determined that the detected target object is a drunk driving suspect based on the on-site red face image and the red face images in the red face database.
8. The drunk driving behavior recognition system according to claim 7, characterized in that: The target object is judged as suspected of drunk driving in the following manner: The red face image of the target object collected on site is added to the red face queue of the target in the red face database. Each time a red face image is added, the queue is analyzed for validity. If the validity analysis conditions are met, it is immediately verified whether the target object has a driver's license. If so, an early warning signal is issued; If not, return to continue collecting face images on site.
9. The drunk driving behavior recognition system according to claim 7, characterized in that: It also includes a trajectory recognition module, which is used to determine whether the driving is abnormal based on the acquired vehicle driving trajectory; The trajectory recognition module is performed according to the following steps: First, obtain the vehicle image; determine the vehicle position based on the vehicle image; then determine the driving trajectory based on the vehicle position; finally, determine whether the vehicle is driving abnormally based on the driving trajectory. If so, it is determined as suspected drunk driving and a warning signal is issued; if not, return to continue collecting on-site vehicle images; The vehicle trajectory is formed according to the following steps: First, the number of vehicles whose position coordinates are within the set distance range in continuous time is calculated; Then, a ratio value within the predetermined distance range is calculated, wherein the ratio value is the ratio of the number within the predetermined distance range to the number of position coordinates within the continuous time; Finally, it is determined whether the ratio value is greater than a predetermined threshold. If so, the trajectory is normal; if not, the trajectory is abnormal.
10. The drunk driving behavior recognition system according to claim 7, characterized in that: The image acquisition module uses a camera for shooting, and the camera is set on a camera mounting bracket, and the mounting bracket includes a vertical rod and a horizontal rod; the vertical rod cross-mounts two cameras to irradiate in a "<" direction; the horizontal rod is equipped with a two-way camera, and the two-way camera irradiates in an "I" line; the four lenses are arranged in a K-shaped structure.
Citation Information
Patent Citations
Drunk driving intelligent identification method, device and system
CN109147342A
Face picture storage method and device
CN109635148A
Face state recognition method and device based on deep learning
CN110472512A
Non-contact drunk driving detection method and device
CN114299574A
Stopping and parking monitoring camera device for deadzone monitoring
KR1020160053488A