Driver abnormal behavior identification method and device and vehicle-mounted terminal
Through lightweight target detection and face key point detection models, combined with head posture angle and facial key points, the driver's abnormal behavior is identified, which solves the problems of high miss detection rate and high resource consumption in the existing technology, and improves driving efficiency. identification accuracy and driving safety of abnormal driver behavior.
Patent Information
- Application Number
- CN202410748308.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-08
AI Technical Summary
Existing driver abnormal behavior recognition technology is difficult to effectively obtain the characteristics of cigarettes, phones, and water bottles, has a high miss detection rate, and consumes large algorithm resources, which is not conducive to the deployment of embedded devices.
Using a lightweight target detection model and a face key point detection model, by obtaining the image to be detected, the head posture angle and facial key points are determined, and combined with the center point of the hand frame and the center point of the face frame, it identifies whether the driver is triggered by abnormal behavior area, and utilize a lightweight abnormal behavior recognition model for identification.
It improves the recognition accuracy of abnormal driver behavior, reduces model running resource consumption, and improves driving safety.
Smart Images

Figure CN118747883A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle networking, and in particular to a method and device for identifying abnormal driver behavior, and a vehicle-mounted terminal. Background Art
[0002] In daily driving, distraction, smoking, drinking, and making phone calls can distract the driver and may lead to traffic accidents. Therefore, the research on driver abnormal behavior recognition is very important.
[0003] The existing technology generally uses simple face expansion or full-image data training models to detect abnormal behavior. It is difficult to effectively obtain the characteristics of cigarettes, phones and water cups. The missed detection rate of abnormal behavior is high, and the algorithm consumes a lot of resources, which is not conducive to the deployment of embedded devices. Summary of the invention
[0004] The present application provides a method, device and vehicle-mounted terminal for identifying abnormal driver behavior to solve the above-mentioned technical problems.
[0005] An embodiment of the present application provides a method for identifying abnormal driver behavior, the method comprising: acquiring an image to be detected, inputting the image data to be detected into a real-time or pre-trained lightweight target detection model to obtain a target detection frame, the target detection frame comprising a face frame to be detected and a hand frame to be detected; inputting the face frame to be detected into a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; if the head posture angle is greater than a preset safety angle and lasts for a preset time period, an alarm message is issued; if the head posture angle is less than or equal to the preset safety angle, determining whether the driver is in an abnormal behavior triggering area based on a horizontal distance between the facial key points and a border of the hand frame to be detected; when it is determined that the driver is in the abnormal behavior triggering area, obtaining abnormal behavior area coordinates based on the center point of the hand frame to be detected and the center point of the face frame to be detected, and obtaining an abnormal behavior recognition result through the abnormal behavior area coordinates and a real-time or pre-trained lightweight abnormal behavior recognition model to identify the driver's abnormal behavior.
[0006] In one embodiment of the present application, determining whether the driver is in an abnormal behavior triggering area based on the horizontal distance between the facial key points and the border of the hand frame to be detected includes: extracting a left eye key point and a right eye key point from the facial key points, and calculating the center point of the eye through the left eye key point and the right eye key point; calculating the horizontal distance between the left border of the hand frame to be detected and the left eye key point to obtain a first horizontal distance, and calculating the horizontal distance between the right border of the hand frame to be detected and the right eye key point to obtain a second horizontal distance; if any one of the first horizontal distance and the second horizontal distance is less than the width of the hand frame to be detected, or; calculating the vertical distance between the upper border of the hand frame to be detected and the center point of the eye to obtain a first vertical distance, if the maximum first vertical distance is less than the height of the hand frame, or; calculating the vertical distance between the lower border of the hand frame to be detected and the center point of the eye to obtain a second vertical distance; if the minimum second vertical distance is less than a preset threshold, it is determined that the driver is in the abnormal behavior triggering area.
[0007] In one embodiment of the present application, the coordinates of the abnormal behavior area are obtained based on the center point of the hand frame to be detected and the center point of the face frame to be detected, including: extracting the center point of the hand frame to be detected and the center point of the face frame to be detected; if the center point of the hand frame to be detected is to the left of the center point of the face frame to be detected, then based on the hand frame to be detected and the left eye key point, a fusion is performed according to a first fusion rule to obtain a first abnormal behavior area; if the center point of the hand frame to be detected is to the right of the center point of the face frame to be detected, then based on the hand frame to be detected and the right eye key point, a fusion is performed according to a second fusion rule to obtain a second abnormal behavior area.
[0008] In one embodiment of the present application, based on the hand frame to be detected and the left eye key point, fusion is performed according to a first fusion rule to obtain a first abnormal behavior area, including: establishing a rectangular coordinate system with the lower left corner point of the hand frame to be detected as the origin, and extracting the coordinates of the hand frame to be detected and the left eye key point coordinates; determining the horizontal coordinate of the upper left corner point of the hand frame to be detected as the horizontal coordinate of the upper left corner point of the first abnormal behavior area, and determining the smaller vertical coordinate of the vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the left eye key point coordinate as the vertical coordinate of the upper left corner point of the first abnormal behavior area, so as to obtain the coordinates of the upper left corner point of the first abnormal behavior area; and determining the larger horizontal coordinate of the horizontal coordinate of the lower right corner point of the hand frame to be detected and the horizontal coordinate of the left eye key point coordinate as the horizontal coordinate of the lower right corner point of the first abnormal behavior area, and determining the vertical coordinate of the lower right corner point of the hand frame to be detected as the vertical coordinate of the lower right corner point of the first abnormal behavior area, so as to obtain the coordinates of the lower right corner point of the first abnormal behavior area; fusing the coordinates of the upper left corner point of the first abnormal behavior area and the coordinates of the lower right corner point of the first abnormal behavior area to obtain the coordinates of the first abnormal behavior area.
[0009] In one embodiment of the present application, based on the hand frame to be detected and the right eye key point, fusion is performed according to a second fusion rule to obtain a second abnormal behavior area, including: establishing a rectangular coordinate system with the lower left corner point of the hand frame to be detected as the origin, and extracting the coordinates of the hand frame to be detected and the right eye key point coordinates; determining the smaller vertical coordinate of the horizontal coordinate of the upper left corner point of the hand frame to be detected and the horizontal coordinate of the right eye key point coordinate as the horizontal coordinate of the upper left corner point of the second abnormal behavior area, and taking the smaller vertical coordinate of the vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the right eye key point coordinate as the horizontal coordinate of the upper left corner point of the second abnormal behavior area. The smaller vertical coordinate is determined as the vertical coordinate of the upper left corner point of the second abnormal behavior area to obtain the coordinates of the upper left corner point of the second abnormal behavior area; and the horizontal coordinate of the lower right corner point of the hand frame to be detected is determined as the horizontal coordinate of the lower right corner point of the second abnormal behavior area, and the vertical coordinate of the lower right corner point of the hand frame to be detected is determined as the vertical coordinate of the lower right corner point of the second abnormal behavior area to obtain the coordinates of the lower right corner point of the second abnormal behavior area; the coordinates of the upper left corner point of the second abnormal behavior area and the coordinates of the lower right corner point of the second abnormal behavior area are merged to obtain the coordinates of the second abnormal behavior area.
[0010] In one embodiment of the present application, the training process of the lightweight target detection model includes: extracting target image data from a first open source data set, and annotating the target image data with a face frame and a hand frame to obtain a human image training data set, wherein the first open source data set represents a multi-target image database; when the target vehicle is in a starting state and the vehicle speed is zero, obtaining a driver behavior image through a camera head; annotating the driver behavior image with a face frame and a hand frame to obtain a behavior training data set; integrating the human image training data set and the behavior training data set, and performing data enhancement on the integrated training data set to obtain target detection training data; constructing an initial lightweight target detection model, replacing the convolution module in the initial lightweight target detection model with a lightweight convolution module, and obtaining a lightweight target detection model to be trained; inputting the abnormal human behavior training data into the lightweight target detection model to be trained for model training to obtain a lightweight target detection model.
[0011] In one embodiment of the present application, the training process of the lightweight facial key point detection model includes: obtaining a sample target detection frame through the lightweight target detection model, the sample target detection frame includes a sample face frame, labeling the facial key points in the sample face frame based on a preset facial key point detection algorithm, and labeling the head posture angles in the sample face frame through a preset head posture angle detection algorithm to obtain a self-collected training data set; extracting facial key points and head posture angles from a second open source data set to obtain an open source training data set, wherein the second open source data set represents a face database; integrating the self-collected training data set and the open source training data set, and performing data enhancement on the integrated training data set to obtain facial key point training data; constructing an initial facial key point detection model, replacing the inverted residual module in the initial facial key point detection model with a lightweight convolution module, and obtaining a lightweight facial key point detection model to be trained; performing model training on the lightweight facial key point detection model to be trained based on the facial key point training data set to obtain a lightweight facial key point detection model.
[0012] In one embodiment of the present application, the training process of the lightweight abnormal behavior recognition model includes: obtaining a sample abnormal behavior region; randomly rotating the sample abnormal behavior region, randomly changing the brightness, contrast and saturation, and randomly adding noise to enhance the data of the sample abnormal behavior region; determining the sample abnormal behavior region after data enhancement as an abnormal behavior training data set; constructing an initial abnormal behavior recognition model, replacing the inverse residual module in the initial abnormal behavior recognition model with a lightweight convolution module to obtain a lightweight abnormal behavior recognition model to be trained; and performing model training on the lightweight abnormal behavior recognition model to be trained based on the abnormal behavior training data set to obtain a lightweight abnormal behavior recognition model.
[0013] The embodiment of the present application provides a device for identifying abnormal behavior of a driver, the device comprising: an acquisition module, used to acquire an image to be detected, input the image data to be detected into a real-time or pre-trained lightweight target detection model, and obtain a target detection frame, wherein the target detection frame comprises a face frame to be detected and a hand frame to be detected; input the face frame to be detected into a real-time or pre-trained lightweight face key point detection model, and obtain a head posture angle and facial key points; a determination module, used to issue an alarm message if the head posture angle is greater than a preset safety angle and lasts for a preset time period; if the head posture angle is less than or equal to the preset safety angle, determine whether the driver is in an abnormal behavior triggering area based on the horizontal distance between the facial key points and the frame of the hand frame to be detected; and a recognition module, when it is determined that the driver is in the abnormal behavior triggering area, obtain the coordinates of the abnormal behavior area based on the center point of the hand frame to be detected and the center point of the face frame to be detected, and obtain the abnormal behavior recognition result through the abnormal behavior area coordinates and the real-time or pre-trained lightweight abnormal behavior recognition model to identify the abnormal behavior of the driver.
[0014] An embodiment of the present application provides a vehicle-mounted terminal, including a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the above-mentioned driver abnormal behavior identification method.
[0015] The beneficial effects of the present application are as follows: the image to be detected is input into a lightweight target detection model to obtain a target detection frame, which includes a face frame to be detected and a hand frame to be detected; the face frame to be detected is input into a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; if the head posture angle is less than or equal to a preset safety angle, whether the driver is in the abnormal behavior triggering area is determined based on the horizontal distance between the eye key points and the frame of the hand frame to be detected, so that for simple face expansion, the face expansion features can be accurately identified, and when it is determined that the driver is in the abnormal behavior triggering area, the abnormal behavior area coordinates are obtained based on the center point of the hand frame and the center point of the face frame, and the abnormal behavior area coordinates are input into a real-time or pre-trained lightweight abnormal behavior recognition model, and the abnormal behavior recognition result is output to perform abnormal behavior recognition on the abnormal behavior area, and the target detection model, the face key point detection model and the abnormal behavior model are improved based on the lightweight model structure, which can not only improve the accuracy of identifying abnormal behaviors, but also reduce the model operation resource consumption, thereby improving driving safety.
[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0018] Figure 1 is a flowchart of a method for identifying abnormal driver behavior shown in an exemplary embodiment of the present application;
[0019] Figure 2 is a flowchart of a method for identifying abnormal driver behavior shown in an exemplary embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a trigger area shown in an exemplary embodiment of the present application;
[0021] Figure 4 is a schematic diagram of model training shown in an exemplary embodiment of the present application;
[0022] Figure 5 is a block diagram of a device for identifying abnormal driver behavior shown in an exemplary embodiment of the present application;
[0023] Figure 6 It is a structural schematic diagram of a vehicle-mounted terminal shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.
[0025] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0026] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0027] The embodiments of the present application respectively propose a method for identifying abnormal driver behavior, a device for identifying abnormal driver behavior, and a vehicle-mounted terminal, which will be described in detail below.
[0028] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for identifying abnormal driver behavior according to an embodiment of the present application. Figure 1 As shown, the method at least includes steps S110 to S150, which are described in detail as follows:
[0029] Step S110, obtaining an image to be detected, inputting the image data to be detected into a real-time or pre-trained lightweight target detection model, and obtaining a target detection frame, which includes a face frame to be detected and a hand frame to be detected.
[0030] In one embodiment of the present application, when the target vehicle is in a starting state and the speed is zero, the driver behavior image is acquired in real time by a camera device, the driver behavior image is affine transformed to the target size as the image to be detected, and the image to be detected is input into a lightweight target detection model to obtain a target detection frame.
[0031] Step S120: input the face frame to be detected into a real-time or pre-trained lightweight face key point detection model to obtain the head posture angle and facial key points.
[0032] In one embodiment of the present application, the facial key points include eye key points, and the eye key points include the left eye geometric center point, the right eye geometric center point, the left eye left corner key point, the left eye right left corner key point, the right eye left corner key point, and the right eye right corner key point.
[0033] Step S130: If the right posture angle of the head is greater than the preset safety angle and lasts for a preset time period, an alarm message is issued; if the head posture angle is less than or equal to the preset safety angle, it is determined whether the driver is in the abnormal behavior triggering area based on the horizontal distance between the eye key point and the hand frame to be detected.
[0034] Step S140, when it is determined that the driver is in the abnormal behavior triggering area, the coordinates of the abnormal behavior area are obtained based on the center point of the hand frame to be detected and the center point of the face frame to be detected.
[0035] Step S150, obtaining abnormal behavior recognition results through abnormal behavior area coordinates and a real-time or pre-trained lightweight abnormal behavior recognition model to recognize abnormal driver behavior.
[0036] exist Figure 1 In the technical solution shown, the image to be detected is input into a lightweight target detection model to obtain a target detection frame, which includes a face frame to be detected and a hand frame to be detected; the face frame to be detected is input into a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; if the head posture angle is less than or equal to a preset safety angle, whether the driver is in the abnormal behavior triggering area is determined based on the horizontal distance between the eye key points and the frame of the hand frame to be detected, so that for simple face expansion, the face expansion features can be accurately identified. When it is determined that the driver is in the abnormal behavior triggering area, the coordinates of the abnormal behavior area are obtained based on the center point of the hand frame and the center point of the face frame, and the coordinates of the abnormal behavior area are input into a real-time or pre-trained lightweight abnormal behavior recognition model, and the abnormal behavior recognition result is output to perform abnormal behavior recognition on the abnormal behavior area. The target detection model, the face key point detection model and the abnormal behavior model are improved based on the lightweight model structure, which can not only improve the accuracy of identifying abnormal behaviors, but also reduce the resource consumption of model operation, thereby improving driving safety.
[0037] In one embodiment of the present application, Figure 2The flowchart of the method for identifying abnormal driver behavior is shown in an embodiment of the present application. The camera device is a DMS (Driver Monitoring System) camera. The preset safety angle is 10 degrees and the preset time period is 5 seconds. When the target vehicle is in the starting state and the speed is zero, the driver behavior image is obtained in real time through the DMS camera. The driver behavior image is affine transformed to the target size as the image to be detected, and the image to be detected is input into the lightweight target detection model to obtain the target detection frame. The target detection frame includes the hand frame to be detected and the face frame to be detected. The face frame to be detected is input into the lightweight face key point detection model to obtain the facial key points and the head posture angle. If the head posture angle is greater than the preset safety angle "10 degrees", it is determined that the driver is distracted. If the current head posture angle is maintained for the preset time period "5 seconds", an alarm message is issued. For example, the alarm message can be "Please focus on driving". Through the in-vehicle voice broadcast, if the head posture angle is less than or equal to the preset safety angle "10 degrees", it is determined whether the driver is abnormal based on the horizontal distance between the facial key points and the hand frame to be detected. Behavior triggering area: If the driver is determined to be in the abnormal behavior triggering area, the abnormal behavior area is obtained based on the center point of the hand frame to be detected and the center point of the face frame to be detected. The abnormal behavior area is expanded and resized to 224x224. The expanded abnormal behavior area is input into the lightweight abnormal behavior recognition model. The sliding average window algorithm is used to smooth the multi-frame model to output the abnormal behavior recognition result. For example, if the abnormal behavior recognition result is a phone call, when the abnormal behavior duration is detected to be greater than the preset time threshold, such as the preset time threshold of 5 seconds, an alarm message is issued. For example, the alarm message can be "Please focus on driving". If the abnormal behavior duration is less than or equal to the preset time threshold "5 seconds", the next frame of the image to be detected is determined through the in-vehicle voice broadcast. For simple face expansion, the face expansion features can be accurately identified, and the target detection model, face key point detection model and abnormal behavior model are improved based on the lightweight model structure, which can not only improve the accuracy of abnormal behavior recognition, but also reduce the model operation resource consumption, thereby improving driving safety.
[0038] In one embodiment of the present application, determining whether a driver is in an abnormal behavior triggering area based on the horizontal distance between facial key points and the border of a hand frame to be detected includes: extracting left eye key points and right eye key points from the facial key points, and calculating the eye center point through the left eye key points and the right eye key points; calculating the horizontal distance between the left border of the hand frame to be detected and the left eye key point to obtain a first horizontal distance, and calculating the horizontal distance between the right border of the hand frame to be detected and the right eye key point to obtain a second horizontal distance; if any of the first horizontal distance and the second horizontal distance is less than the width of the hand frame to be detected, or; calculating the vertical distance between the upper border of the hand frame to be detected and the eye center point to obtain the first vertical distance, if the maximum first vertical distance is less than the height of the hand frame, or; calculating the vertical distance between the lower border of the hand frame to be detected and the eye center point to obtain the second vertical distance; if the minimum second vertical distance is less than a preset threshold, it is determined that the driver is in the abnormal behavior triggering area. By tracking facial key points and hand positions in real time, it can adapt to different lighting, environmental and driver conditions, and use different abnormal behavior trigger area determination methods in different scenarios to reduce misjudgment, thereby improving recognition accuracy. The monitoring system based on facial key points and hand positions can be easily expanded to other types of abnormal behavior detection, reducing traffic accidents caused by driver distraction or improper operation.
[0039] As an example, Figure 3 A schematic diagram of a trigger area is shown in an exemplary embodiment of the present application. Figure 3 As shown, the trigger area is the abnormal behavior trigger area, the hand frame to be detected is the hand frame, and the face frame to be detected is the face frame. In the face frame, e1 is the left eye key point, the left eye key point is the left eye geometric center point, e2 is the right eye key point, the right eye key point is the right eye geometric center point, and e3 is the eye center point, which is the midpoint between the left eye geometric center point and the right eye geometric center point. The horizontal distance between the left frame of the hand frame and e1 is calculated to obtain the first horizontal distance. If the minimum first horizontal distance is less than the hand frame width, the abnormal behavior recognition algorithm is triggered. If the minimum first horizontal distance is greater than or equal to the hand frame width, it is determined whether the next frame of the image to be detected is in the abnormal behavior trigger area, until it is determined that the image to be detected is in the abnormal behavior trigger area. By tracking the key points of the eyes and the position of the hands in real time, and the horizontal distance between the left border of the hand frame and the key point of the left eye, it is possible to quickly and accurately determine whether the driver is in the abnormal behavior trigger area, thereby using different abnormal behavior trigger area determination methods in different scenarios to reduce misjudgments, thereby improving recognition accuracy and reducing traffic accidents caused by driver distraction or improper operation.
[0040] As an example, the horizontal distance between the right frame of the hand frame to be detected and e2 can also be calculated to obtain the second horizontal distance. If the minimum second horizontal distance is less than the hand frame width, the abnormal behavior recognition algorithm is triggered. If the minimum second horizontal distance is greater than or equal to the hand frame width, it is determined whether the next frame of the image to be detected is in the abnormal behavior triggering area, until it is determined that the image to be detected is in the abnormal behavior triggering area. By real-time tracking of eye key points and hand positions, the horizontal distance between the right frame of the hand frame to be detected and the right eye key point can be used to quickly and accurately determine whether the driver is in the abnormal behavior triggering area, thereby using different abnormal behavior triggering area determination methods in different scenarios to reduce misjudgments, thereby improving recognition accuracy, and thus reducing traffic accidents caused by driver distraction or improper operation.
[0041] As an example, when it is detected that the upper frame of the hand frame to be detected is above the key point of the eye, the vertical distance between the upper frame of the hand frame to be detected and e3 is calculated to obtain the first vertical distance. If the maximum first vertical distance is less than the hand frame height, the abnormal behavior recognition algorithm is triggered. If the maximum first vertical distance is greater than or equal to the hand frame height, it is determined whether the next frame of the image to be detected is in the abnormal behavior triggering area, until it is determined that the image to be detected is in the abnormal behavior triggering area. By real-time tracking of the key points of the eye and the position of the hand, the horizontal distance between the upper frame of the hand frame to be detected and the center point of the eye can be used to quickly and accurately determine whether the driver is in the abnormal behavior triggering area, so that different abnormal behavior triggering area determination methods are used in different scenarios to reduce misjudgments, thereby improving the recognition accuracy, and thus reducing traffic accidents caused by driver distraction or improper operation.
[0042] As an example, the preset threshold is 2h, where h is the height of the hand frame. When the lower frame of the hand frame to be detected is detected below the eye key point, the vertical distance between the lower frame of the hand frame to be detected and e3 is calculated to obtain the second vertical distance. If the minimum second vertical distance is less than 2h, the abnormal behavior recognition algorithm is triggered. If the minimum second vertical distance is greater than or equal to 2h, it is determined whether the next frame of the image to be detected is in the abnormal behavior triggering area, until it is determined that the image to be detected is in the abnormal behavior triggering area. By real-time tracking of the eye key points and hand positions, the horizontal distance between the lower frame of the hand frame to be detected and the center point of the eye can be used to quickly and accurately determine whether the driver is in the abnormal behavior triggering area, thereby using different abnormal behavior triggering area determination methods in different scenarios to reduce misjudgments, thereby improving recognition accuracy, and thus reducing traffic accidents caused by driver distraction or improper operation.
[0043] In one embodiment of the present application, the coordinates of the abnormal behavior region are obtained based on the center point of the hand frame to be detected and the center point of the face frame to be detected, including: extracting the center point of the hand frame to be detected and the center point of the face frame to be detected; if the center point of the hand frame to be detected is on the left side of the center point of the face frame to be detected, then based on the hand frame to be detected and the left eye key point, a fusion is performed according to a first fusion rule to obtain a first abnormal behavior region; if the center point of the hand frame to be detected is on the right side of the center point of the face frame to be detected, then based on the hand frame to be detected and the right eye key point, a fusion is performed according to a second fusion rule to obtain a second abnormal behavior region. By comparing the positions of the center points of the hand frame and the face frame, the direction of the driver's hand position relative to the face can be accurately determined, and different fusion rules are selectively applied according to the positions of the center points of the hand frame to detect the abnormal behavior region, thereby avoiding unnecessary calculations, improving the detection efficiency of the system, and adapting to the personalized characteristics of different drivers. Through accurate fusion based on facial key points and hand positions, real abnormal behaviors can be more accurately identified, rather than false alarms triggered by normal driving operations of the driver or environmental interference. This improves the accuracy of abnormal behavior recognition and reduces the false alarm rate.
[0044] In one embodiment of the present application, based on the hand frame to be detected and the left eye key point, fusion is performed according to a first fusion rule to obtain a first abnormal behavior area, including: establishing a rectangular coordinate system with the lower left corner point of the hand frame to be detected as the origin, and extracting the coordinates of the hand frame to be detected and the left eye key point coordinates; determining the horizontal coordinate of the upper left corner point of the hand frame to be detected as the horizontal coordinate of the upper left corner point of the first abnormal behavior area, and determining the smaller vertical coordinate of the vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the left eye key point coordinate as the vertical coordinate of the upper left corner point of the first abnormal behavior area, so as to obtain the coordinates of the upper left corner point of the first abnormal behavior area; and determining the larger horizontal coordinate of the horizontal coordinate of the lower right corner point of the hand frame to be detected and the horizontal coordinate of the left eye key point coordinate as the horizontal coordinate of the lower right corner point of the first abnormal behavior area, and determining the vertical coordinate of the lower right corner point of the hand frame to be detected as the vertical coordinate of the lower right corner point of the first abnormal behavior area, so as to obtain the coordinates of the lower right corner point of the first abnormal behavior area; fusing the coordinates of the upper left corner point of the first abnormal behavior area with the coordinates of the lower right corner point of the first abnormal behavior area to obtain the coordinates of the first abnormal behavior area. When the hand frame is on the left side of the face frame, the first fusion rule is applied to detect the abnormal behavior area, which avoids unnecessary calculations, improves the detection efficiency of the system, and adapts to the personalized characteristics of different drivers. Moreover, through the precise fusion of facial key points and hand positions, it can more accurately identify real abnormal behaviors rather than false alarms triggered by the driver's normal driving operations or environmental interference, thereby improving the accuracy of abnormal behavior recognition and reducing the false alarm rate.
[0045] As an example, the first abnormal behavior region is the first abnormal behavior ROI (Region of Interest), which is based on the hand frame to be detected and the left eye key point, and is fused according to the first fusion rule to obtain the first abnormal behavior region, specifically including: when it is determined that the image to be detected is in the abnormal behavior triggering area, the abnormal behavior recognition algorithm is triggered. First, a rectangular coordinate system is established with the lower left corner point of the hand frame to be detected as the origin, and the center point of the hand frame to be detected and the center point of the face frame to be detected are extracted, and the position of the center point of the hand frame to be detected relative to the center point of the face frame to be detected in the horizontal direction is determined; if the hand frame to be detected is on the left, then in the rectangular coordinate system The coordinates of the hand frame to be detected are extracted as (x1, y1, x2, y2), and the coordinates of the left eye key point e1 are extracted as (x, y) in the rectangular coordinate system. The coordinates of the hand frame to be detected are fused with the coordinates of the left eye key point e1 to obtain the coordinates of the first abnormal behavior ROI as (x1, y3, x3, y2), y3 = min (y1, y), x3 = max (x2, x), and the first abnormal behavior ROI is expanded and resized to 224x224 to obtain the expanded abnormal behavior ROI as the input of the lightweight abnormal behavior model. When the hand frame is on the left side of the face frame, the first fusion rule is applied to detect the abnormal behavior area, avoiding unnecessary calculations, improving the detection efficiency of the system, and adapting to the personalized characteristics of different drivers. In addition, through the precise fusion of facial key points and hand positions, the real abnormal behavior can be more accurately identified, rather than the false alarm triggered by the driver's normal driving operation or environmental interference, which improves the accuracy of abnormal behavior recognition and reduces the false alarm rate.
[0046] In one embodiment of the present application, based on the hand frame to be detected and the right eye key point, fusion is performed according to a second fusion rule to obtain the second abnormal behavior area, including: establishing a rectangular coordinate system with the lower left corner point of the hand frame to be detected as the origin, and extracting the coordinates of the hand frame to be detected and the right eye key point coordinates; determining the smaller vertical coordinate of the horizontal coordinate of the upper left corner point of the hand frame to be detected and the horizontal coordinate of the right eye key point coordinate as the horizontal coordinate of the upper left corner point of the second abnormal behavior area, and determining the smaller vertical coordinate of the vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the right eye key point coordinate as the vertical coordinate of the upper left corner point of the second abnormal behavior area, so as to obtain the coordinates of the upper left corner point of the second abnormal behavior area; and determining the horizontal coordinate of the lower right corner point of the hand frame to be detected as the horizontal coordinate of the lower right corner point of the second abnormal behavior area, and determining the vertical coordinate of the lower right corner point of the hand frame to be detected as the vertical coordinate of the lower right corner point of the second abnormal behavior area, so as to obtain the coordinates of the lower right corner point of the second abnormal behavior area; fusing the coordinates of the upper left corner point of the second abnormal behavior area with the coordinates of the lower right corner point of the second abnormal behavior area to obtain the coordinates of the second abnormal behavior area. When the hand frame is to the right of the face frame, the second fusion rule is applied to detect the abnormal behavior area, which avoids unnecessary calculations, improves the detection efficiency of the system, and adapts to the personalized characteristics of different drivers. Moreover, through the precise fusion of facial key points and hand positions, it can more accurately identify real abnormal behaviors rather than false alarms triggered by the driver's normal driving operations or environmental interference, thereby improving the accuracy of abnormal behavior recognition and reducing the false alarm rate.
[0047] As an example, the second abnormal behavior region is the second abnormal behavior ROI, based on the hand frame to be detected and the right eye key point, fusion is performed according to the second fusion rule to obtain the second abnormal behavior region, specifically including: when it is determined that the image to be detected is in the abnormal behavior triggering area, the abnormal behavior recognition algorithm is triggered, firstly, a rectangular coordinate system is established with the lower left corner point of the hand frame to be detected as the origin, the center point of the hand frame to be detected and the center point of the face frame to be detected are extracted, and the position of the center point of the hand frame to be detected relative to the center point of the face frame to be detected in the horizontal direction is determined; if If the hand frame to be detected is on the right, the coordinates of the hand frame to be detected are extracted in the rectangular coordinate system as (x1, y1, x2, y2), and the coordinates of the left eye key point e1 are extracted in the rectangular coordinate system as (x, y), and the coordinates of the second abnormal behavior ROI are obtained as (x3, y3, x2, y2), y3 = min (y1, y), x3 = min (x1, x), the second abnormal behavior ROI is expanded and resized to 224x224, and the expanded abnormal behavior ROI is obtained as the input of the lightweight abnormal behavior model. When the hand frame is on the right side of the face frame, the second fusion rule is applied to detect the abnormal behavior area, avoiding unnecessary calculations, improving the detection efficiency of the system, adapting to the personalized characteristics of different drivers, and through the precise fusion of facial key points and hand positions, it can more accurately identify the real abnormal behavior, rather than the false alarm triggered by the driver's normal driving operation or environmental interference, improving the accuracy of abnormal behavior recognition and reducing the false alarm rate.
[0048] In one embodiment of the present application, the training process of the lightweight target detection model includes: extracting target image data from a first open source data set, and annotating the target image data with a face frame and a hand frame to obtain a human image training data set, wherein the first open source data set represents a multi-target image database; when the target vehicle is in a start-up state and the vehicle speed is zero, obtaining a driver behavior image through a camera head; annotating the driver behavior image with a face frame and a hand frame to obtain a behavior training data set; integrating the human image training data set and the behavior training data set, and performing data enhancement on the integrated training data set to obtain target detection training data; constructing an initial lightweight target detection model, replacing the convolution module in the initial lightweight target detection model with a lightweight convolution module, and obtaining a lightweight target detection model to be trained; inputting the abnormal human behavior training data into the lightweight target detection model to be trained for model training, and obtaining a lightweight target detection model. Improving the target detection model based on the lightweight model structure can not only improve the accuracy of identifying the target detection frame, but also reduce the resource consumption of the model operation, thereby improving driving safety.
[0049] As an example, the initial lightweight target detection model is the YOLOV5 model. The convolution module in the YOLOV5 backbone network is replaced with a lightweight convolution module to obtain a lightweight target detection model to be trained. The convolution module is a CSP (CrossStage Partial) module, and the lightweight convolution module is a Mobileone module. That is, the CSP (Cross Stage Partial) module in the YOLOV5 backbone network is replaced with the Mobileone module. The Mobileone module is built based on deep separable convolution and re-parameterization technology, which not only retains the advantages of good training effects of multi-branch models, but also has the characteristics of fast inference speed and memory saving of single-channel models. Since the multi-branch structure in YOLOV5 needs to save intermediate results and increase the amount of video memory occupied, the lightweight convolution is built based on deep separable convolution and re-parameterization technology, which has the advantages of good training effects of multi-branch models and fast inference speed and memory saving of single-channel models; such as Figure 4 As shown, Figure 4 The model training diagram shown in an exemplary embodiment of the present application shows that in the training state, the depth-by-depth convolution module has three branches, namely, a 1×1 depth-by-depth convolution branch, a 3×3 depth-by-depth convolution branch, and a batch normalization (BN) layer branch. The point-by-point convolution module has two branches, namely, a 1×1 convolution branch and a BN layer branch; during reasoning, the depth-by-depth convolution module and the point-by-point convolution module are respectively fused into a 3×3 depth-by-depth convolution and a 1×1 convolution. In order to increase the generalization of the model, based on the first open source dataset, such as: COCO (Common Objects in Context), VOC (Visual Object Classes) and MPII (Max Planck Institute for Informatics) public datasets, the lightweight target detection model to be trained is pre-trained; in view of the current lack of public datasets for hand, face and body detection, human images are extracted based on COCO, VOC and MPII public datasets to annotate face, hand and body frames, and a human image training dataset is constructed. The driver behavior data is collected and annotated using the DMS camera, and data enhancement methods such as random rotation, random noise addition, random blurring, and random erasing are used to obtain the behavior training data set; based on the behavior training data set and the human image training data set, the OneCycleLR learning rate regulator and Adam optimizer are used to train the model for 200 Epochs, and the lightweight target detection model to be trained is trained to obtain the lightweight target detection model. Improving the target detection model based on the lightweight model structure can not only improve the accuracy of identifying the target detection frame, but also reduce the resource consumption of the model operation, thereby improving driving safety.
[0050] As a specific example, the COCO dataset is a large and rich computer vision dataset, which contains more than 330,000 images, annotated with more than 2.5 million target instances, covering 80 categories. The objects in the images include but are not limited to people, animals, vehicles, furniture, food, etc., with high diversity and complexity. The COCO dataset has a wide range of applications in the field of computer vision, including tasks such as target detection, instance segmentation, pose estimation, and cross-modal matching; the VOC dataset contains tens of thousands of images and corresponding annotation information, covering targets of multiple categories, such as people, vehicles, animals, etc. The VOC dataset is mainly used for tasks such as target detection and image segmentation, for face recognition and intelligent monitoring; the MPII dataset is a large image dataset for human pose estimation, which contains rich human activity scenes, such as walking, standing, sitting, exercising, etc. in daily life. Each picture provides detailed human pose annotations, including joint locations, visibility landmarks, and hand annotations.
[0051] As a specific example, after the model training is completed, the image to be detected is detected to obtain the target detection frame. When there is no target object in the target detection frame, the system checks whether the vehicle safety braking system is enabled to prevent the vehicle from accidentally sliding or moving. When it is detected that there is a target object in the target detection frame and the vehicle speed is greater than the preset speed, the target detection result will enter the subsequent algorithm process.
[0052] In one embodiment of the present application, the training process of the lightweight facial key point detection model includes: obtaining a sample target detection frame through a lightweight target detection model, the sample target detection frame includes a sample face frame, annotating the facial key points in the sample face frame based on a preset facial key point detection algorithm, and annotating the head posture angles in the sample face frame through a preset head posture angle detection algorithm to obtain a self-collected training data set; extracting facial key points and head posture angles from a second open source data set to obtain an open source training data set, and the second open source data set represents a face database; integrating the self-collected training data set and the open source training data set, and performing data enhancement on the integrated training data set to obtain facial key point training data; constructing an initial facial key point detection model, replacing the inverted residual module in the initial facial key point detection model with a lightweight convolution module, and obtaining a lightweight facial key point detection model to be trained; performing model training in the lightweight facial key point detection model to be trained based on the facial key point training data set to obtain a lightweight facial key point detection model. Improving the facial key point detection model based on a lightweight model structure can not only improve the accuracy of facial key points and head posture angles, but also reduce the resource consumption of model operation, thereby improving driving safety.
[0053] As an example, PFLD (Practical Facial Landmark Detector) is used as the initial face key point detection model. In order to further improve the key point model inference speed and key point prediction effect, considering that the re-parameterization technique can not only adopt a multi-branch structure during training to increase the expressiveness of the model, but also merge the multi-branch structure into a single branch during inference to reduce video memory occupancy and inference time; for this reason, the lightweight convolution module based on the re-parameterization technique replaces the inverted residual module in the PFLD network, that is, the Mobileone module replaces the inverted residual module in the PFLD network. Based on the lightweight output of the sample target detection frame, the face key points in the sample face frame are annotated based on the preset face key point detection algorithm dlib algorithm, and the head posture angles in the sample face frame are annotated by the preset head posture angle detection algorithm solve PnP algorithm to obtain a self-collected training data set. From the second open source data set, for example: WLFW (Labeled Faces in-the-Wild with landmarks) open source data set and AFLW (Annotated Facial Landmarks in the Wild) open source data set, the face key points in the second open source data set are annotated based on the preset face key point detection algorithm dlib algorithm, and the head posture angles in the second open source data set are annotated by the preset head posture angle detection algorithm solve PnP algorithm to obtain an open source training data set. The self-collected training data set and the open source training data set are integrated, and the integrated training data set is data enhanced to obtain face key point training data. The lightweight face key point detection model is trained for 100 Epochs using a hot-start exponential decay learning rate regulator and an AdamW optimizer to obtain a lightweight face key point detection model. Improving the facial key point detection model based on a lightweight model structure can not only improve the accuracy of facial key points and head posture angles, but also reduce the resource consumption of model operation, thereby improving driving safety.
[0054] As a specific example, the WLFW dataset mainly collects key point annotations of face images in natural environments. The AFLW dataset contains face images with multiple poses and perspectives. Each face is annotated with multiple feature points. Usually, the number of these feature points may exceed 21, but 21 points can be selected for use as needed.
[0055] As a specific example, after acquiring the image to be detected, the image to be detected is input into a lightweight target detection model, and a target detection frame is output. The target detection frame includes a face frame to be detected and a hand frame to be detected. When there is a target object in the target detection frame, the face frame to be detected is input into a lightweight face key point detection model, and the head posture angle and facial key points are output. If the head posture angle is greater than a preset safety angle and lasts for a preset time period, an alarm message is issued; if the head posture angle is less than or equal to the preset safety angle, the abnormal behavior recognition algorithm is triggered.
[0056] The training process of the lightweight abnormal behavior recognition model includes: obtaining the sample abnormal behavior area; randomly rotating the sample abnormal behavior area, randomly changing the brightness, contrast and saturation, and randomly adding noise to enhance the data of the sample abnormal behavior area; determining the sample abnormal behavior area after data enhancement as the abnormal behavior training data set; constructing the initial abnormal behavior recognition model, replacing the inverse residual module in the initial abnormal behavior recognition model with a lightweight convolution module to obtain the lightweight abnormal behavior recognition model to be trained; training the lightweight abnormal behavior recognition model to be trained based on the abnormal behavior training data set to obtain the lightweight abnormal behavior recognition model. Improving the abnormal behavior recognition model based on the lightweight model structure can not only improve the accuracy of identifying abnormal behaviors, but also reduce the resource consumption of model operation, thereby improving driving safety.
[0057] As an example, the initial abnormal behavior recognition model is constructed through PFLD, and the lightweight convolution module replaces the inverted residual module in MobilenetV2 to identify abnormal behavior, that is, the Mobileone module replaces the inverted residual module in the PFLD network to obtain the lightweight abnormal behavior recognition model to be trained, obtain the sample abnormal behavior area, and randomly rotate the sample abnormal behavior area, randomly change the brightness, contrast and saturation, and randomly add noise to enhance the data of the sample abnormal behavior area. The sample abnormal behavior area after data enhancement is labeled with abnormal smoking behavior, abnormal drinking behavior, and abnormal phone call behavior to form an abnormal behavior training data set. The lightweight abnormal behavior recognition model to be trained is trained for 60 Epochs using the hot-start exponential decay learning rate regulator and AdamW optimizer to obtain a lightweight abnormal behavior recognition model. Improving the abnormal behavior recognition model based on the lightweight model structure can not only improve the accuracy of identifying abnormal behavior, but also reduce the resource consumption of model operation, thereby improving driving safety.
[0058] As a specific example, in order to reduce model false alarms, a sliding average window algorithm is used to smooth the output results of the multi-frame model. The expanded abnormal behavior area is input into the lightweight abnormal behavior recognition model, and the sliding average window algorithm is used to smooth the multi-frame model output abnormal behavior recognition results. For example, if the abnormal behavior recognition result is a phone call, when it is detected that the duration of the abnormal behavior is greater than the preset time threshold, such as the preset time threshold of 5 seconds, an alarm message is issued, such as "Please focus on driving", which is broadcast through the in-vehicle voice and the sliding average window is cleared. If the duration of the abnormal behavior is less than or equal to the preset time threshold "5 seconds", the next frame of the image to be detected is determined, and the sliding average window is moved back.
[0059] Figure 5 FIG. 1 is a block diagram of a device for identifying abnormal driver behavior according to an exemplary embodiment of the present application. Figure 5As shown, according to an embodiment of the present application, a driver abnormal behavior recognition device 500 includes: an acquisition module 510, a determination module 520 and a recognition module 530. The acquisition module is used to acquire an image to be detected, input the image data to be detected into a real-time or pre-trained lightweight target detection model, and obtain a target detection frame, which includes a face frame to be detected and a hand frame to be detected; input the face frame to be detected into a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; the determination module is used to issue an alarm message if the head posture angle is greater than a preset safety angle and lasts for a preset time period; if the head posture angle is less than or equal to the preset safety angle, determine whether the driver is in an abnormal behavior triggering area based on the horizontal distance between the facial key points and the hand frame to be detected; the recognition module, when it is determined that the driver is in the abnormal behavior triggering area, is used to obtain the coordinates of the abnormal behavior area based on the center point of the hand frame to be detected and the center point of the face frame to be detected, and obtain the abnormal behavior recognition result through the abnormal behavior area coordinates and the real-time or pre-trained lightweight abnormal behavior recognition model to identify the driver's abnormal behavior. The image to be detected is input into a lightweight target detection model to obtain a target detection frame, which includes a face frame to be detected and a hand frame to be detected; the face frame to be detected is input into a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; if the head posture angle is less than or equal to a preset safety angle, whether the driver is in the abnormal behavior triggering area is determined based on the horizontal distance between the eye key points and the frame of the hand frame to be detected, so that for simple face expansion, the face expansion features can be accurately identified. When it is determined that the driver is in the abnormal behavior triggering area, the coordinates of the abnormal behavior area are obtained based on the center point of the hand frame and the center point of the face frame, and the coordinates of the abnormal behavior area are input into a real-time or pre-trained lightweight abnormal behavior recognition model, and the abnormal behavior recognition result is output to perform abnormal behavior recognition on the abnormal behavior area. The target detection model, the face key point detection model and the abnormal behavior model are improved based on the lightweight model structure, which can not only improve the accuracy of identifying abnormal behaviors, but also reduce the resource consumption of model operation, thereby improving driving safety.
[0060] In one embodiment of the present application, a determination module is used to extract left eye key points and right eye key points from facial key points, and calculate the eye center point through the left eye key points and the right eye key points; calculate the horizontal distance between the left frame of the hand frame to be detected and the left eye key point to obtain a first horizontal distance, and calculate the horizontal distance between the right frame of the hand frame to be detected and the right eye key point to obtain a second horizontal distance; if any of the first horizontal distance and the second horizontal distance is less than the width of the hand frame to be detected, or; calculate the vertical distance between the upper frame of the hand frame to be detected and the eye center point to obtain the first vertical distance, if the maximum first vertical distance is less than the height of the hand frame, or; calculate the vertical distance between the lower frame of the hand frame to be detected and the eye center point to obtain the second vertical distance; if the minimum second vertical distance is less than a preset threshold, it is determined that the driver is in the abnormal behavior triggering area.
[0061] In one embodiment of the present application, the recognition module is used to extract the center point of the hand frame to be detected and the center point of the face frame to be detected; if the center point of the hand frame to be detected is to the left of the center point of the face frame to be detected, then based on the hand frame to be detected and the left eye key points, fusion is performed according to a first fusion rule to obtain a first abnormal behavior area; if the center point of the hand frame to be detected is to the right of the center point of the face frame to be detected, then based on the hand frame to be detected and the right eye key points, fusion is performed according to a second fusion rule to obtain a second abnormal behavior area.
[0062] In one embodiment of the present application, the recognition module is used to establish a rectangular coordinate system with the lower left corner point of the hand frame to be detected as the origin, and extract the coordinates of the hand frame to be detected and the left eye key point coordinates; the horizontal coordinate of the upper left corner point of the hand frame to be detected is determined as the horizontal coordinate of the upper left corner point of the first abnormal behavior area, and the smaller vertical coordinate of the vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the left eye key point coordinate is determined as the vertical coordinate of the upper left corner point of the first abnormal behavior area to obtain the coordinates of the upper left corner point of the first abnormal behavior area; and the larger horizontal coordinate of the horizontal coordinate of the lower right corner point of the hand frame to be detected and the horizontal coordinate of the left eye key point coordinate is determined as the horizontal coordinate of the lower right corner point of the first abnormal behavior area, and the vertical coordinate of the lower right corner point of the hand frame to be detected is determined as the vertical coordinate of the lower right corner point of the first abnormal behavior area to obtain the coordinates of the lower right corner point of the first abnormal behavior area; the coordinates of the upper left corner point of the first abnormal behavior area and the coordinates of the lower right corner point of the first abnormal behavior area are merged to obtain the coordinates of the first abnormal behavior area.
[0063] In one embodiment of the present application, the recognition module is used to establish a rectangular coordinate system with the lower left corner point of the hand frame to be detected as the origin, and extract the coordinates of the hand frame to be detected and the right eye key point coordinates; determine the smaller vertical coordinate of the horizontal coordinate of the upper left corner point of the hand frame to be detected and the horizontal coordinate of the right eye key point coordinate as the horizontal coordinate of the upper left corner point of the second abnormal behavior area, and determine the smaller vertical coordinate of the vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the right eye key point coordinate as the vertical coordinate of the upper left corner point of the second abnormal behavior area, so as to obtain the coordinates of the upper left corner point of the second abnormal behavior area; and determine the horizontal coordinate of the lower right corner point of the hand frame to be detected as the horizontal coordinate of the lower right corner point of the second abnormal behavior area, and determine the vertical coordinate of the lower right corner point of the hand frame to be detected as the vertical coordinate of the lower right corner point of the second abnormal behavior area, so as to obtain the coordinates of the lower right corner point of the second abnormal behavior area; merge the coordinates of the upper left corner point of the second abnormal behavior area and the coordinates of the lower right corner point of the second abnormal behavior area to obtain the coordinates of the second abnormal behavior area.
[0064] In one embodiment of the present application, the driver abnormal behavior identification device also includes a model training module 540, which is used to extract target image data from a first open source data set, and perform face frame annotation and hand frame annotation on the target image data to obtain a human image training data set, where the first open source data set represents a multi-target image database; when the target vehicle is in a starting state and the vehicle speed is zero, the driver behavior image is obtained through a camera head; the driver behavior image is annotated with a face frame and a hand frame to obtain a behavior training data set; the human image training data set and the behavior training data set are integrated, and the integrated training data set is data enhanced to obtain target detection training data; an initial lightweight target detection model is constructed, and the convolution module in the initial lightweight target detection model is replaced with a lightweight convolution module to obtain a lightweight target detection model to be trained; the abnormal human behavior training data is input into the lightweight target detection model to be trained for model training to obtain a lightweight target detection model.
[0065] In one embodiment of the present application, a model training module is used to obtain a sample target detection frame through a lightweight target detection model, the sample target detection frame includes a sample face frame, the face key points in the sample face frame are annotated based on a preset face key point detection algorithm, and the head posture angles in the sample face frame are annotated through a preset head posture angle detection algorithm to obtain a self-collected training data set; the face key points and head posture angles are extracted from a second open source data set to obtain an open source training data set, and the second open source data set represents a face database; the self-collected training data set and the open source training data set are integrated, and the integrated training data set is data enhanced to obtain face key point training data; an initial face key point detection model is constructed, and the inverted residual module in the initial face key point detection model is replaced with a lightweight convolution module to obtain a lightweight face key point detection model to be trained; model training is performed in the lightweight face key point detection model to be trained based on the face key point training data set to obtain a lightweight face key point detection model.
[0066] In one embodiment of the present application, a model training module is used to obtain a sample abnormal behavior region; randomly rotate the sample abnormal behavior region, randomly change the brightness, contrast and saturation, and randomly add noise to perform data enhancement on the sample abnormal behavior region; determine the sample abnormal behavior region after data enhancement as an abnormal behavior training data set; construct an initial abnormal behavior recognition model, replace the inverse residual module in the initial abnormal behavior recognition model with a lightweight convolution module, and obtain a lightweight abnormal behavior recognition model to be trained; perform model training on the lightweight abnormal behavior recognition model to be trained based on the abnormal behavior training data set to obtain a lightweight abnormal behavior recognition model.
[0067] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0068] See also Figure 6 , Figure 6 is a schematic diagram of a vehicle-mounted terminal according to an exemplary embodiment of the present application. It should be noted that: Figure 6 The vehicle-mounted terminal 600 shown is only an example and should not bring any limitation to the functions and usage area of the embodiments of the present application.
[0069] like Figure 6As shown, the vehicle terminal 600 includes a processor 601, a memory 602 and a communication bus 603; the communication bus 603 is used to connect the processor 601 and the memory 602; the processor 601 is used to execute the computer program stored in the memory 602 to implement one or more methods as in the above embodiments.
[0070] The vehicle-mounted terminal provided in the present application includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run computer programs so that the electronic device executes the various steps of the above method.
[0071] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0072] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0073] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for identifying abnormal driver behavior, It is characterized in that The method comprises: Acquire an image to be detected, input the image data to a real-time or pre-trained lightweight target detection model to obtain a target detection frame, wherein the target detection frame includes a face frame to be detected and a hand frame to be detected; input the face frame to be detected to a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; If the head posture angle is greater than the preset safety angle and lasts for a preset period of time, an alarm message is issued; if the head posture angle is less than or equal to the preset safety angle, it is determined whether the driver is in the abnormal behavior triggering area based on the horizontal distance between the facial key points and the hand frame to be detected; When it is determined that the driver is in the abnormal behavior triggering area, the coordinates of the abnormal behavior area are obtained based on the center point of the hand frame to be detected and the center point of the face frame to be detected. The abnormal behavior recognition result is obtained through the abnormal behavior area coordinates and a real-time or pre-trained lightweight abnormal behavior recognition model to identify the driver's abnormal behavior.
2. The method for identifying abnormal driver behavior according to claim 1, It is characterized in that Determining whether the driver is in an abnormal behavior triggering area based on the horizontal distance between the facial key points and the hand frame frame to be detected includes: Extracting a left eye key point and a right eye key point from the facial key points, and calculating an eye center point through the left eye key point and the right eye key point; Calculate the horizontal distance between the left frame of the hand frame to be detected and the left eye key point to obtain a first horizontal distance, and calculate the horizontal distance between the right frame of the hand frame to be detected and the right eye key point to obtain a second horizontal distance. If either the first horizontal distance or the second horizontal distance is less than the width of the hand frame to be detected, or; Calculate the vertical distance between the upper frame of the hand frame to be detected and the center point of the eye to obtain a first vertical distance. If the maximum first vertical distance is less than the hand frame height, or; The vertical distance between the lower frame of the hand frame to be detected and the center point of the eye is calculated to obtain a second vertical distance; if the minimum second vertical distance is less than a preset threshold, it is determined that the driver is in the abnormal behavior triggering area.
3. The method for identifying abnormal driver behavior according to claim 1, It is characterized in that The coordinates of the abnormal behavior area are obtained based on the center point of the hand frame to be detected and the center point of the face frame to be detected, including: Extract the center point of the hand frame to be detected and the center point of the face frame to be detected; If the center point of the hand frame to be detected is on the left of the center point of the face frame to be detected, then based on the hand frame to be detected and the left eye key point, fusion is performed according to a first fusion rule to obtain a first abnormal behavior area; If the center point of the hand frame to be detected is on the right side of the center point of the face frame to be detected, the hand frame to be detected and the right eye key point are fused according to a second fusion rule to obtain a second abnormal behavior area.
4. The method for identifying abnormal driver behavior according to claim 3, It is characterized in that Based on the hand frame to be detected and the left eye key point, fusion is performed according to a first fusion rule to obtain a first abnormal behavior area, including: Establish a rectangular coordinate system with the lower left corner of the hand frame to be detected as the origin, and extract the coordinates of the hand frame to be detected and the coordinates of the left eye key point; Determine the horizontal coordinate of the upper left corner point of the hand frame to be detected as the horizontal coordinate of the upper left corner point of the first abnormal behavior area, and determine the smaller vertical coordinate of the upper left corner point of the hand frame to be detected and the vertical coordinate of the left eye key point coordinate as the vertical coordinate of the upper left corner point of the first abnormal behavior area, so as to obtain the coordinates of the upper left corner point of the first abnormal behavior area; and The larger of the abscissa of the lower right corner point of the hand frame to be detected and the abscissa of the left eye key point coordinates is determined as the abscissa of the lower right corner point of the first abnormal behavior area, and the ordinate of the lower right corner point of the hand frame to be detected is determined as the ordinate of the lower right corner point of the first abnormal behavior area, so as to obtain the coordinates of the lower right corner point of the first abnormal behavior area; The coordinates of the upper left corner point of the first abnormal behavior area and the coordinates of the lower right corner point of the first abnormal behavior area are merged to obtain the coordinates of the first abnormal behavior area.
5. The method for identifying abnormal driver behavior according to claim 3, It is characterized in that Based on the hand frame to be detected and the right eye key point, fusion is performed according to the second fusion rule to obtain a second abnormal behavior area, including: Establish a rectangular coordinate system with the lower left corner of the hand frame to be detected as the origin, and extract the coordinates of the hand frame to be detected and the coordinates of the right eye key point; Determine the smaller ordinate of the abscissa of the upper left corner point of the hand frame to be detected and the abscissa of the right eye key point coordinates as the abscissa of the upper left corner point of the second abnormal behavior area, and determine the smaller ordinate of the ordinate of the upper left corner point of the hand frame to be detected and the ordinate of the right eye key point coordinates as the ordinate of the upper left corner point of the second abnormal behavior area, so as to obtain the coordinates of the upper left corner point of the second abnormal behavior area; and The horizontal coordinate of the lower right corner point of the hand frame to be detected is determined as the horizontal coordinate of the lower right corner point of the second abnormal behavior area, and the vertical coordinate of the lower right corner point of the hand frame to be detected is determined as the vertical coordinate of the lower right corner point of the second abnormal behavior area, so as to obtain the coordinates of the lower right corner point of the second abnormal behavior area; The coordinates of the upper left corner point of the second abnormal behavior area and the coordinates of the lower right corner point of the second abnormal behavior area are merged to obtain the coordinates of the second abnormal behavior area.
6. The method for identifying abnormal driver behavior according to claim 1, It is characterized in that The training process of the lightweight object detection model includes: Extracting target image data from a first open source data set, and annotating the target image data with a face frame and a hand frame to obtain a human image training data set, wherein the first open source data set represents a multi-target image database; When the target vehicle is in the starting state and the speed is zero, the driver's behavior image is obtained through the camera head; Performing face frame annotation and hand frame annotation on the driver behavior image to obtain a behavior training data set; Integrating the human image training data set and the behavior training data set, and performing data enhancement on the integrated training data set to obtain target detection training data; Construct an initial lightweight target detection model, replace the convolution in the initial lightweight target detection model with a lightweight convolution module, and obtain a lightweight target detection model to be trained; The abnormal human behavior training data is input into the lightweight target detection model to be trained for model training to obtain a lightweight target detection model.
7. The method for identifying abnormal driver behavior according to claim 6, It is characterized in that The training process of the lightweight face key point detection model includes: A sample target detection frame is obtained by using the lightweight target detection model, wherein the sample target detection frame includes a sample face frame, face key points in the sample face frame are annotated based on a preset face key point detection algorithm, and head posture angles in the sample face frame are annotated by using a preset head posture angle detection algorithm to obtain a self-collected training data set; Extracting facial key points and head posture angles from a second open source data set to obtain an open source training data set, wherein the second open source data set represents a face database; Integrate the self-collected training data set and the open source training data set, and perform data enhancement on the integrated training data set to obtain facial key point training data; An initial facial key point detection model is constructed, and the inverted residual module in the initial facial key point detection model is replaced with a lightweight convolution module to obtain a lightweight facial key point detection model to be trained; Model training is performed on the lightweight face key point detection model to be trained based on the face key point training data set to obtain a lightweight face key point detection model.
8. The method for identifying abnormal driver behavior according to claim 1, It is characterized in that The training process of the lightweight abnormal behavior recognition model includes: Obtain sample abnormal behavior areas; Randomly rotating the sample abnormal behavior area, randomly changing brightness, contrast and saturation, and randomly adding noise to enhance data of the sample abnormal behavior area; The abnormal behavior areas of the samples after data enhancement are annotated with abnormal behavior to form an abnormal behavior training data set; Construct an initial abnormal behavior recognition model, replace the inverted residual module in the initial abnormal behavior recognition model with a lightweight convolution module, and obtain a lightweight abnormal behavior recognition model to be trained; Model training is performed on the lightweight abnormal behavior recognition model to be trained based on the abnormal behavior training data set to obtain a lightweight abnormal behavior recognition model.
9. A device for identifying abnormal driver behavior, It is characterized in that The device comprises: An acquisition module is used to acquire an image to be detected, input the image data to be detected into a real-time or pre-trained lightweight target detection model to obtain a target detection frame, wherein the target detection frame includes a face frame to be detected and a hand frame to be detected; input the face frame to be detected into a real-time or pre-trained lightweight face key point detection model to obtain a head posture angle and facial key points; A determination module, configured to issue an alarm message if the head posture angle is greater than a preset safety angle and lasts for a preset time period; and to determine whether the driver is in an abnormal behavior triggering area based on the horizontal distance between the facial key points and the hand frame to be detected if the head posture angle is less than or equal to the preset safety angle; The recognition module, when determining that the driver is in the abnormal behavior triggering area, is used to obtain the coordinates of the abnormal behavior area based on the center point of the hand frame to be detected and the center point of the face frame to be detected, and obtain the abnormal behavior recognition result through the abnormal behavior area coordinates and the real-time or pre-trained lightweight abnormal behavior recognition model to identify the driver's abnormal behavior.
10. A vehicle-mounted terminal, It is characterized in that It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement the method for identifying abnormal driver behavior as described in any one of claims 1 to 8.
