Driver fatigue state detection method based on computer vision

Using computer vision technology to analyze the photoplethysmographic pulse wave signal and facial features of the human face skin area, combined with deep neural networks and decision trees, it solves the shortcomings of detecting driver fatigue status in the existing technology and achieves efficient and accurate detection without additional equipment. detection.

CN114612885BActive Publication Date: 2024-10-18GUANGZHOU HANNAN ENG TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210241487.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2024-10-18
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

It is difficult to effectively detect driver fatigue status with existing technology. Traditional methods require wearing additional equipment and the cost of vehicle modification is high, and the judgment based only on facial features lacks effectiveness.

Method used

Using a method based on computer vision, the video of the human face skin area is captured through the camera, the periodic changes of blood flow to light caused by the heartbeat are analyzed, the photoelectric volume pulse wave signal is recovered, and combined with the duration of eye closure and yawning frequency, through deep neural Networks and decision trees for fatigue state detection.

Benefits of technology

It realizes driver fatigue status detection without additional equipment. Through comprehensive analysis of heart rate variability and facial features, it improves the accuracy and effectiveness of detection and avoids high vehicle modification costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612885B_ABST
    Figure CN114612885B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting driver fatigue status based on computer vision, comprising the following steps: performing face recognition on a target to obtain a face image and face key point data; judging whether the eyes are closed and yawning based on the face key point data; segmenting and preprocessing the face region of interest; using a deep neural network to detect the photoelectric volume pulse wave signal of the preprocessed image, and calculating the heart rate variability; analyzing the driver's current driving status based on the above acquired data. The present invention uses computer vision technology to detect the driver's heart rate variability, eye closure duration, and yawning frequency, so as to analyze whether the current driver is in a fatigue state; and promptly issues an alarm when the driving state is abnormal to avoid traffic accidents. The implementation of the method of the present invention only requires the installation of a camera on the vehicle, and has the advantages of low cost and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of visual intelligent detection, and in particular to a method for detecting driver fatigue status based on computer vision. Background Art

[0002] Currently, tens of thousands of people die each year in traffic accidents, a large portion of which are caused by driver fatigue and inattention. Therefore, it is very necessary to detect the fatigue status of drivers, especially public transportation drivers, to prevent traffic accidents caused by fatigue driving.

[0003] Current fatigue detection technologies primarily rely on detecting key points on a target's face to capture features such as the duration of eye closure and yawning frequency over a period of time, and then determine fatigue based on these features. Alternatively, deep learning techniques employ neural network models trained on large amounts of data to recognize facial expressions and determine fatigue. However, fatigue doesn't necessarily manifest itself through specific facial features, making it ineffective to determine fatigue based solely on facial features. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for detecting driver fatigue based on computer vision in order to solve the problem that traditional heart rate detection requires wearing additional equipment close to the human body for detection and cannot effectively monitor the driver's fatigue state, while at the same time achieving the above requirements requires high vehicle modification costs. The present invention uses computer vision technology to capture video of the facial skin area through a camera, analyzes the regular absorption of light by the regular blood flow caused by the heartbeat in the facial skin area, and then restores the corresponding photoplethysmographic signal through deep neural network technology, and measures the heart rate variability. The method can also be combined with facial recognition technology to analyze the driver's driving state and determine whether the driver is driving fatigued.

[0005] The purpose of the present invention can be achieved by taking the following technical solutions:

[0006] A method for detecting driver fatigue based on computer vision, comprising the following steps:

[0007] S1. Perform face recognition and facial key point detection on the target. Calculate the aspect ratio of the eyes and lips based on the key points of the inner contours of the eyes and lips, and detect whether the target has closed eyes or is yawning.

[0008] S2. Masking the acquired target face image frame sequence over a period of time according to the facial key point data to retain the facial skin area; dividing the facial skin area into regions to obtain multiple ROI regions; extracting the average value of each YUV color channel for each ROI region, obtaining the periodic change data of the color channel value of the skin area of ​​the target face frame image over time, and synthesizing a spatiotemporal feature representation graph;

[0009] S3. Using the spatiotemporal feature representation graph as input, training a deep neural network, and calculating the photoplethysmographic signal of the detection target over a period of time through the trained deep neural network; the deep neural network includes an input layer, a first convolutional layer, a first mean pooling layer, a first residual block layer, a second residual block layer, a third residual block layer, a fourth residual block layer, a fifth residual block layer, a sixth residual block layer, a first adaptive mean pooling layer, a first deconvolution layer, a second deconvolution layer, a second adaptive mean pooling layer, a second convolutional layer, and an output layer connected in sequence;

[0010] S4. extracting the peak value of the photoplethysmography signal by a threshold method, extracting a set of signal peak points, calculating the power spectrum of the photoplethysmography signal by fast Fourier transform, and estimating the heart rate variability of the detection target;

[0011] S5. Combine the eye closure duration, yawning frequency, and heart rate variability obtained in the above steps with the open source dataset and construct a fatigue detection decision tree using the C4.5 decision tree algorithm. Perform fatigue detection on the face of the actual detection target to determine whether the detection target is currently in a fatigue driving state.

[0012] Furthermore, the process of step S1 is as follows:

[0013] S101. Obtain a video image of the driver's head through a camera, perform facial recognition on the driver, and obtain a video frame image of the driver's face;

[0014] S102, performing key point regression on the collected video frame images of the driver's face to obtain facial key point data;

[0015] S103, extracting left eye contour key points, right eye contour key points, and lip inner contour key points based on the acquired facial key point data;

[0016] S104: Calculate the eye aspect ratio based on the left eye outline key points and the right eye outline key points, and compare the obtained eye aspect ratio value with a pre-specified first judgment threshold. If the eye aspect ratio value is higher than the first judgment threshold, it indicates that the eyes are closed; if it is lower than the first judgment threshold, it indicates that the eyes are open. Continuously calculate the driver's eye closure time (ET) over a period of time.

[0017] S105. Calculate the lip aspect ratio based on the key points of the lip internal contour, and compare the obtained lip aspect ratio value with a pre-specified second judgment threshold. When the lip aspect ratio value is higher than the second judgment threshold, it indicates that the driver's mouth is open or yawning; when it is lower than the second judgment threshold, it indicates that the driver's mouth is closed. Count the time the driver keeps his mouth open. If the time the driver keeps his mouth open exceeds a pre-specified third judgment threshold, it indicates that the driver is yawning. Then, continuously count the frequency M of the driver's yawning over a period of time.

[0018] In step S1, the driver's face is recognized and key points are detected. The eye aspect ratio and lip aspect ratio are calculated based on the key points to detect the driver's closed eyes and yawning. In fact, face recognition and key point detection can be achieved through open source face recognition tools.

[0019] Furthermore, the process of step S2 is as follows:

[0020] S201, extracting n frames of facial images with a time length of t and facial key point data corresponding to each frame of the image;

[0021] S202: Based on the facial key point data, mask the image data outside the eyes, lips, and facial regions, retaining the facial skin data. Removing the remaining image data irrelevant to photoplethysmography detection can effectively improve detection accuracy. Divide the facial skin data into m ROI regions based on the key points.

[0022] S203, convert each ROI region image into a YUV format image, where the YUV color model reflects the image brightness and chromaticity. Converting the RGB image into a YUV format image helps to extract subtle changes in facial skin color. Perform averaging processing on each ROI region and extract the average value C of each color channel of each ROI region yuv , the specific implementation of RGB format to YUV format is as follows:

[0023] Y=0.299R+0.587G+0.114B

[0024] U=0.500R-0.419G-0.081B+128

[0025] V=-0.169R-0.331G+0.500B+128

[0026] Among them, R is the red color channel, G is the green color channel, B is the blue color channel, Y is the brightness, U is the blue chroma, and V is the red chroma;

[0027] S204、Set C iFor the m ROI regions of the face image of the i-th frame, execute step S203 to obtain the YUV color channel average data reflecting different skin regions of the face, and let MstMap(n,m,c)={C1,C2,...,C n}, MstMap(n,m,c) represents a spatiotemporal feature representation map with a length of n, a width of m, and c channels.

[0028] In step S2, each facial frame image sequence extracted over a period of time is converted into a one-dimensional vector through skin segmentation, color model conversion, ROI region division, and ROI region mean calculation. After n facial image frames are transformed and combined through the above steps, a spatiotemporal feature representation is generated. The horizontal axis of the spatiotemporal feature representation represents the average value of the ROI color channel of a facial ROI region at different time points, i.e., the temporal domain features of the facial video frame image sequence. The vertical axis represents the average value of the color channel of different ROI regions of the face at a single time point, i.e., the spatial domain features of the facial video frame image sequence.

[0029] Furthermore, the deep neural network is specifically as follows:

[0030] The input layer adjusts the dimension of the spatiotemporal feature representation graph to the three-dimensional tensor required by the deep neural network as the input data of the deep neural network;

[0031] The first convolutional layer uses 64 convolution kernels of size 7×7 and ReLU activation function to convolve the input layer data;

[0032] The first mean pooling layer performs mean pooling on the data output by the first convolutional layer using a filter with a convolution kernel size of 2×2;

[0033] The first residual block layer consists of two sequentially connected convolutional layers. Each convolutional layer uses 64 3×3 convolution kernels. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the first mean pooling layer. The output of the first residual block layer is the output of the second convolutional layer plus the output of the first mean pooling layer and is calculated using the Relu activation function.

[0034] The second residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 64 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the first residual block layer. The output of the second residual block layer is the output of the second convolutional layer plus the output of the first residual block layer and is calculated by the Relu activation function.

[0035] The third residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 128 convolution kernels of size 3×3. The first convolutional layer uses the ReLU function as the activation function to perform a convolution operation on the output data of the second residual block layer. The output of the third residual layer is the output of the second convolutional layer plus the output of the second residual block layer and is calculated by the ReLU activation function.

[0036] The fourth residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 128 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function and performs a convolution operation on the output data of the third residual block layer. The output of the fourth residual layer is the output of the second convolutional layer plus the output of the third residual block layer and is calculated by the Relu activation function.

[0037] The fifth residual block layer consists of two sequentially connected convolutional layers. Each convolutional layer uses 256 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function and performs a convolution operation on the output data of the fourth residual block layer. The output of the fifth residual layer is the output of the second convolutional layer plus the output of the fourth residual block layer and is calculated by the Relu activation function.

[0038] The sixth residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 256 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function and performs a convolution operation on the output data of the fifth residual block layer. The output of the sixth residual layer is the output of the second convolutional layer plus the output of the fifth residual block layer and is calculated by the Relu activation function.

[0039] The first adaptive mean pooling layer performs mean pooling on each feature map in the output data of the sixth residual block layer and converts it into a feature map of size 1×10;

[0040] The first deconvolution layer uses 64 convolution kernels of size 1×3 to perform deconvolution on the output data of the first adaptive mean pooling layer;

[0041] The second deconvolution layer uses 32 convolution kernels of size 1×5 to perform deconvolution operation on the output data of the first deconvolution layer;

[0042] The second adaptive mean pooling layer performs mean pooling on each feature map in the output data of the second deconvolution layer and converts it into a feature map of size 1×300;

[0043] The second convolutional layer uses a 1×1 convolution kernel and a ReLU activation function to convolve the output data of the second adaptive mean pooling layer.

[0044] The output layer outputs 1×300 data, which is the photoplethysmography signal.

[0045] Furthermore, the process of step S4 is as follows:

[0046] S401, extract the photoplethysmography signal PV={PV1, PV2, ..., PV i ,...,PV n}, calculate the signal peak point set TP={TP1, TP2, ..., TP k}, where PV i is the photoelectric volume pulse wave signal value corresponding to the face image of the i-th frame, k is the number of signal peak points, TP k is the kth signal peak point;

[0047] S402. Perform fast Fourier transform on the signal peak point set TP to calculate the power spectrum of the photoplethysmography signal, extract the 0.04-0.15 Hz low-frequency band signal LF and the 0.15-0.4 Hz high-frequency band signal HF, and calculate the LF / HF index to estimate the target heart rate variability.

[0048] Step S4 extracts the peak value of the photoplethysmography signal using a threshold method and calculates the power spectrum using a fast Fourier transform. The LF and HF signals are then extracted and the LF / HF ratio is calculated. In practice, the LF index reflects the dual regulation of the sympathetic and vagus nerves; the HF index reflects the regulation of the vagus nerve; and the LF / HF ratio reflects the balance of the autonomic nervous system. Research has shown that the balance of the autonomic nervous system, as reflected by the LF / HF ratio, is a primary indicator of driver fatigue. As driver fatigue increases, the LF index decreases, the HF index increases, and the LF / HF ratio decreases.

[0049] Furthermore, the process of step S401 is as follows:

[0050] S4011. Find the maximum element value PV of the photoplethysmography signal PV max , and set the fourth judgment threshold b = 0.4*PV max The signal peak point required for calculating the heart rate variability frequency domain signal is generally not less than the maximum element value of the photoplethysmography signal multiplied by 0.5. Therefore, the calculation of the fourth threshold as the maximum element value of the photoplethysmography signal multiplied by 0.4 can ensure that the signal peak point is not missed;

[0051] S4012, perform binarization processing on the photoplethysmography signal PV, compare each element value in the photoplethysmography signal PV with the fourth judgment threshold, and set it to 1 if it is higher than the threshold, and set it to 0 if it is lower than the threshold, to obtain the signal after binarization processing The definition is as follows:

[0052]

[0053] in, is the value obtained by binarizing the photoplethysmography signal value corresponding to the i-th frame face image;

[0054] S4013, signal PV proc Calculate the difference

[0055]

[0056] in, For the Frame and The binary photoplethysmography signal value of the frame face image is obtained by differential operation. The differential result 1 is the rising direction of the pulse wave, and the differential result -1 is the falling direction of the pulse wave. The maximum value point of the photoplethysmography signal between the differential results 1 and -1 is a signal peak point.

[0057] Furthermore, the process of step S5 is as follows:

[0058] S501. Extract information about eye closure duration ET, yawn frequency M, fatigue status labels, and corresponding facial videos from the fatigue detection open source dataset, detect the facial videos using the above-mentioned deep neural network model, calculate the target photoplethysmographic signal, obtain the low-frequency band signal LF, the high-frequency band signal HF, and calculate the LF / HF index. Based on ET, M, LF, HF, LF / HF, and the corresponding fatigue status, construct the sample set D required for training the decision tree, where D is divided into γ categories and contains attributes a∈{ET,M,LF,HF,LF / HF}, and attribute a has V possible values. in For attribute a Kind of value;

[0059] S502: Construct a fatigue detection decision tree for the sample set D using the C4.5 decision tree algorithm. The C4.5 decision tree algorithm divides the decision tree nodes based on the information gain rate. The information gain rate is defined as follows:

[0060]

[0061] Wherein, GainRatio(D,a) is the information gain rate calculated by partitioning the sample set D by attribute a, Gain(D,a) is the information gain calculated by partitioning the sample set D by attribute a, and IV(a) is the intrinsic value of attribute a.

[0062]

[0063]

[0064] in, For all the samples in the set D whose attribute a has the value The sample set, |D| calculates the total number of sample set D, Calculate the sample set D v The total number of, Ent(D) is the information entropy of the calculated sample set D, To calculate the sample set D v The information entropy is calculated as follows: p j is the proportion of samples of the jth class in the sample set D, where j = 1, 2, ...γ;

[0065] S503: Collect real face data of the detection target and input it into the decision tree to detect whether the target is in a fatigue state.

[0066] The present invention has the following advantages and effects compared to the prior art:

[0067] (1) The present invention introduces the heart rate variability index, and combines it with two types of facial features, namely, the duration of eye closure and the frequency of yawning, to detect fatigue status. Fatigue degree analysis is performed through heart rate variability, and frequency domain analysis of the photoplethysmogram is usually performed to obtain three types of frequency domain indicators: LF, HF, and LF / HF. Frequency domain analysis analyzes the target heart rate change pattern from a spectrum perspective, and reveals more complex change characteristics of the heart rate through different frequency indicators. The LF indicator reflects the dual regulation of the sympathetic and vagus nerves; HF reflects the regulation of the vagus nerve; and LF / HF reflects the balance state of the autonomic nervous system. Studies have shown that the balance state of the autonomic nervous system reflected by LF / HF is the main indicator of the driver's fatigue state. As the driver's fatigue level increases, the LF index decreases, the HF index increases, and the LF / HF index decreases. The frequency domain index of heart rate variability, combined with the two facial features of the duration of eye closure and the frequency of yawning, can more effectively reflect the driver's fatigue level and determine whether the driver is in a fatigue state.

[0068] (2) To determine whether the driver is in a fatigue state through the heart rate variability index, it is necessary to accurately detect the driver's heart rate variability. The present invention uses an image processing method to segment the driver's facial image, retain the facial skin area, and remove the remaining noise signals that are irrelevant to the detection of heart rate variability. The YUV color model mainly reflects the color changes of the image. The detection of photoelectric volume pulse wave signals through facial skin is mainly through detecting the slight changes in natural light reflected by the facial skin with the heartbeat. By converting the facial skin RGB image into a YUV image, the slight changes in the color of the facial skin area can be better reflected. The above methods all help to more accurately detect the driver's photoelectric volume pulse wave signal BRIEF DESCRIPTION OF THE DRAWINGS

[0069] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0070] Figure 1 is a flow chart of a method for detecting driver fatigue based on computer vision in an embodiment of the present invention;

[0071] Figure 2 is an eye key point diagram in an embodiment of the present invention;

[0072] Figure 3 is a lip key point map in an embodiment of the present invention;

[0073] Figure 4 This is a flow chart of heart rate variability detection in an embodiment of the present invention;

[0074] Figure 5 is a structural diagram of a deep neural network in an embodiment of the present invention;

[0075] Figure 6 This is a flow chart of generating a spatiotemporal feature representation graph in an embodiment of the present invention;

[0076] Figure 7 This is a comparison chart of the results of detecting photoplethysmography signals using a deep neural network in an embodiment of the present invention. DETAILED DESCRIPTION

[0077] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0078] Example

[0079] This embodiment discloses a method for detecting driver fatigue based on computer vision. The detection method process is as follows:

[0080] S1. Perform face recognition and facial key point detection on the target. Calculate the aspect ratio of the eyes and lips based on the key points of the inner contours of the eyes and lips, and detect whether the target has closed eyes or is yawning.

[0081] In this embodiment, step S1 is specifically as follows:

[0082] S101. Capture a video image of the driver's head using a camera and perform facial recognition on the driver using the open source facial recognition tool SeetaFace. Extract the four values ​​(x, y, w, h) of the facial bounding box, where (x, y) are the top-left corner coordinates of the facial bounding box, w is the width of the facial bounding box, and h is the height of the facial bounding box. A partial facial image is captured using the top-left corner coordinates, width, and height data to obtain a facial image, and a video frame image of the driver's facial portion is obtained.

[0083] S102. Using the open source face recognition tool SeetaFace, perform key point regression on the collected video frame images of the driver's face to obtain facial key point data;

[0084] S103, extract the left eye contour key points, the right eye contour key points and the inner lip contour key points according to the acquired face key point data, such as Figures 2-3 As shown. The left eye key point is The key point of the right eye is The key points on the inside of the lips are

[0085] S104. Calculate the eye aspect ratio based on the left eye contour key points and the right eye contour key points. The eye aspect ratio calculation formula is as follows:

[0086]

[0087]

[0088]

[0089] EAR=(EAR left +EAR right ) / 2

[0090] Where EAR is the eye aspect ratio to be calculated; EAR left is the left eye aspect ratio; EAR rightis the aspect ratio of the right eye; dis(p,q) is the Euclidean distance between the coordinate points p and q, where p x is the horizontal coordinate of point p, p y is the ordinate of point p;

[0091] The obtained eye aspect ratio is compared with a pre-specified value of 0.3. If the eye aspect ratio is higher than 0.3, it indicates that the eyes are open, and if it is lower than 0.3, it indicates that the eyes are closed. The driver's eye closure time (ET) over a period of time is continuously counted.

[0092] S105. Calculate the lip aspect ratio based on the key points on the inner side of the lips. The lip aspect ratio calculation formula is as follows:

[0093]

[0094] Where MAR is the eye aspect ratio that needs to be calculated;

[0095] The obtained lip aspect ratio is compared with a pre-specified value of 1.0. When the lip aspect ratio is higher than 1.0, it indicates that the driver's mouth is open or yawning. When it is lower than 1.0, it indicates that the driver's mouth is closed. The driver's mouth-open time is then counted. If the mouth-open time exceeds a pre-specified 3 seconds, it indicates that the driver is yawning. The frequency M of the driver's yawns over a period of time is then continuously counted.

[0096] S2. Masking the acquired target face image frame sequence over a period of time according to the facial key point data to retain the facial skin area; dividing the facial skin area into regions to obtain multiple ROI regions; extracting the average value of each YUV color channel for each ROI region, obtaining the periodic change data of the color channel value of the skin area of ​​the target face frame image over time, and synthesizing a spatiotemporal feature representation graph;

[0097] In this embodiment, step S2 is specifically as follows:

[0098] S201, extracting 300 frames of facial images with a time length of 10 seconds and facial key point data corresponding to each frame of image;

[0099] S202: retaining facial skin data through mask processing based on facial key point data, and dividing the facial skin into 64 ROI regions based on the key points;

[0100] S203: Convert each ROI region image into a YUV format image, perform averaging processing on each ROI region, and extract the average value C of each color channel of the YUV of each ROI region. yuv , the specific implementation of RGB format to YUV format is as follows:

[0101] Y=0.299R+0.587G+0.114B

[0102] U=0.500R-0.419G-0.081B+128

[0103] V=-0.169R-0.331G+0.500B+128

[0104] Among them, R is the red color channel, G is the green color channel, B is the blue color channel, Y is the brightness, U is the blue chroma, and V is the red chroma;

[0105] S204、Set C i For the 64 ROI regions of the face image of the i-th frame, execute step S203 to obtain the YUV color channel average data reflecting different skin areas of the face, and let MstMap(300,64,3)={C1,C2,...,C 300}, MstMap(300,64,3) represents a spatiotemporal feature representation map with a length of 300, a width of 64, and 3 channels;

[0106] S3. Convert the spatiotemporal feature representation map into a three-dimensional tensor of 3×320×320 size as input, train a deep neural network, and calculate the photoplethysmography signal of the detection target over a period of time through the trained deep neural network; the deep neural network includes an input layer, a first convolutional layer, a first mean pooling layer, a first residual block layer, a second residual block layer, a third residual block layer, a fourth residual block layer, a fifth residual block layer, a sixth residual block layer, a first adaptive mean pooling layer, a first deconvolution layer, a second deconvolution layer, a second adaptive mean pooling layer, a second convolutional layer, and an output layer connected in sequence;

[0107] In this embodiment, step S3 is specifically as follows:

[0108] The spatiotemporal feature representation graph is used as input to train a deep neural network. The deep neural network structure includes an input layer, a first convolutional layer, a first mean pooling layer, a first residual block layer, a second residual block layer, a third residual block layer, a fourth residual block layer, a fifth residual block layer, a sixth residual block layer, a seventh residual block layer, a first adaptive mean pooling layer, a first deconvolution layer, a second deconvolution layer, a second adaptive mean pooling layer, a second convolutional layer, and an output layer connected in sequence. The specific structure and hyperparameter design are as follows. Figure 5 As shown:

[0109] Where conv is the convolution layer; kernel is the convolution kernel; channel is the depth of the convolution kernel; stride is the number of sliding steps of the convolution kernel; Trans conv is the deconvolution layer; Avg Pooling is the average pooling layer; Adap Avg Pooling is the adaptive average pooling layer;

[0110] The loss function of the neural network is the MSE loss function; the learning rate is 0.001; the optimizer is Adam, and the number of training epochs is 50, the model with the minimum error is obtained;

[0111] By dividing 90% of the UBFC open source dataset into a training set and 10% as a test set, the deep neural network model trained was used to extract 300 frames of face video images from a face video data in the test set, such as Figure 6 As shown in the figure, a spatiotemporal feature representation graph is generated as the input of the deep neural network, and the photoelectric volume pulse wave signal of the target within a period of time is calculated. The comparison results between the photoelectric volume pulse wave signal calculated by the deep neural network model and the real photoelectric volume pulse wave signal are shown in the figure. Figure 7 As shown, target is the true value of the test data photoelectric pulse wave; predict is the output value of the deep neural network model. Figure 7 It can be seen intuitively that the number of peaks in the true value and output value signals is basically the same.

[0112] S4. extracting the peak value of the photoplethysmography signal by a threshold method, extracting a set of signal peak points, calculating the power spectrum of the photoplethysmography signal by fast Fourier transform, and estimating the heart rate variability of the detection target;

[0113] In this embodiment, step S4 is specifically as follows:

[0114] S401, extract the photoplethysmography signal PV={PV1, PV2, ..., PV i ,...,PV n}, where PV i is the photoelectric volume pulse wave signal value corresponding to the face image of the i-th frame, and the signal peak point set TP={TP1, TP2, ..., TP k}, where subscript k is the number of signal peak points; the details are as follows:

[0115] S4011. Find the maximum element value PV of the photoplethysmography signal PV max , and set the fourth judgment threshold b = 0.4*PV max ;

[0116] S4012, perform binarization processing on the photoplethysmography signal PV, compare each element value in the photoplethysmography signal PV with the fourth judgment threshold, and set it to 1 if it is higher than the threshold, and set it to 0 if it is lower than the threshold, to obtain the signal after binarization processing The definition is as follows:

[0117]

[0118] in, is the value obtained by binarizing the photoplethysmography signal value corresponding to the i-th frame face image;

[0119] S4013, signal PV proc Calculate the difference

[0120]

[0121] in, For the Frame and The binary photoplethysmography signal value of the frame face image is obtained by differential operation. The differential result 1 is the rising direction of the pulse wave, and the differential result -1 is the falling direction of the pulse wave. The maximum value point of the photoplethysmography signal between the differential results 1 and -1 is a signal peak point.

[0122] S402 , performing fast Fourier transform on the signal peak point set TP to calculate the power spectrum of the photoplethysmography signal, and extracting the 0.04-0.15 Hz low-frequency band signal LF and the 0.15-0.4 Hz high-frequency band signal HF to estimate the heart rate variability of the detection target.

[0123] S5. Combine the eye closure duration, yawning frequency, and heart rate variability obtained in the above steps with the open source dataset and construct a fatigue detection decision tree using the C4.5 decision tree algorithm. Perform fatigue detection on the face of the actual detection target to determine whether the detection target is currently in a fatigue driving state.

[0124] In this embodiment, the steps are as follows:

[0125] S501. Extract the eye closure duration (ET), yawn frequency (M), fatigue state label, and corresponding face video from the Driver Drowsiness Detection Dataset collected by the NTHU Computer Vision Laboratory. Detect the face video using the above-mentioned deep neural network model, calculate the target photoplethysmography signal, obtain the low-frequency signal LF, the high-frequency signal HF, and calculate the LF / HF index. Based on ET, M, LF, HF, LF / HF, and the corresponding fatigue state, construct the sample set D required for training the decision tree. D is divided into two categories: fatigue state and non-fatigue state. D contains the attribute a∈{ET,M,LF,HF,LF / HF}, and attribute a has V possible values. in For attribute a Kind of value;

[0126] S502: Construct a fatigue detection decision tree for the sample set D using the C4.5 decision tree algorithm. The C4.5 decision tree algorithm divides the decision tree nodes based on the information gain rate. The information gain rate is defined as follows:

[0127]

[0128] Wherein, GainRatio(D,a) is the information gain rate calculated by partitioning the sample set D by attribute a, Gain(D,a) is the information gain calculated by partitioning the sample set D by attribute a, and IV(a) is the intrinsic value of attribute a.

[0129]

[0130]

[0131] in, For all the samples in the set D whose attribute a has the value The sample set, |D| calculates the total number of sample set D, Calculate the sample set D v The total number of, Ent(D) is the information entropy of the calculated sample set D, To calculate the sample set D v The information entropy is calculated as follows: p j is the proportion of samples of the jth category in the sample set D, where j = 1, 2;

[0132] S503: Collect real face data of the detection target and input it into the decision tree to detect whether the target is in a fatigue state.

[0133] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A method for detecting driver fatigue status based on computer vision, characterized in that: The detection method comprises the following steps: S1, perform face recognition and face key point detection on the detection target, calculate the aspect ratio of the eyes and lips according to the key points of the internal contours of the eyes and lips, and detect whether the target closes its eyes and yawns; S2, for the continuous target face image frame sequence acquired within a period of time, mask processing is performed according to the face key point data to retain the face skin area; and the face skin area is divided into regions to obtain multiple ROI regions; for each ROI region, the average value of each YUV color channel is extracted to obtain the periodic change data of the color channel value of the skin area of ​​the target face frame image over time, and a spatiotemporal feature representation diagram is synthesized; S3, taking the spatiotemporal feature representation graph as input, training a deep neural network, and calculating the photoelectric volume pulse wave signal of the detection target within a period of time through the trained deep neural network; the deep neural network includes an input layer, a first convolutional layer, a first mean pooling layer, a first residual block layer, a second residual block layer, a third residual block layer, a fourth residual block layer, a fifth residual block layer, a sixth residual block layer, a first adaptive mean pooling layer, a first deconvolution layer, a second deconvolution layer, a second adaptive mean pooling layer, a second convolutional layer, and an output layer connected in sequence; S4, extracting the peak value of the photoplethysmogram signal by a threshold method, extracting a set of signal peak points, calculating the power spectrum of the photoplethysmogram signal by fast Fourier transform, and estimating the heart rate variability of the detection target; S5. Combine the eye closure duration, yawning frequency, and heart rate variability obtained in the above steps with the open source data set, and use the C4.5 decision tree algorithm to build a fatigue detection decision tree, perform fatigue detection on the face of the real detection target, and determine whether the detection target is currently in a fatigue driving state.

2. The driver fatigue state detection based on computer vision according to claim 1 is characterized in that: The process of step S1 is as follows: S101, obtaining a video image of the driver's head through a camera, and performing face recognition on the driver to obtain a video frame image of the driver's face; S102, performing key point regression on the collected video frame images of the driver's face to obtain face key point data; S103, extracting left eye contour key points, right eye contour key points and lip inner contour key points according to the acquired face key point data; S104, calculating the eye aspect ratio according to the left eye contour key points and the right eye contour key points, and comparing the obtained eye aspect ratio value with a pre-specified first judgment threshold value, when the eye aspect ratio value is higher than the first judgment threshold value, it indicates that the eyes are closed, and lower than the first judgment threshold value, it indicates that the eyes are open, and continuously counting the driver's eye closing time ET within a period of time; S105. Calculate the lip aspect ratio based on the key points of the lip internal contour, and compare the obtained lip aspect ratio value with a pre-specified second judgment threshold. When the lip aspect ratio value is higher than the second judgment threshold, it indicates that the mouth is open or the driver is yawning. When it is lower than the second judgment threshold, it indicates that the mouth is closed. The driver's mouth opening time is counted. If the mouth opening time exceeds a pre-specified third judgment threshold, it indicates that the driver is yawning. Then, the frequency M of the driver's yawning within a period of time is continuously counted.

3. The driver fatigue status monitoring based on computer vision according to claim 2 is characterized in that: The process of step S2 is as follows: S201, extracting n frames of face images with a time length of t and face key point data corresponding to each frame of the image; S202, retaining facial skin data through mask processing according to the facial key point data, and dividing the facial skin into m ROI areas according to the key points; S203, convert each ROI region image into a YUV format image, perform averaging processing on each ROI region, and extract the average value C of each color channel of the YUV of each ROI region yuv , the specific implementation of RGB format to YUV format is as follows: Y=0.299R+0.587G+0.114B U=0.500R-0.419G-0.081B+128 V=-0.169R-0.331G+0.500B+128 Among them, R is the red color channel, G is the green color channel, B is the blue color channel, Y is the brightness, U is the blue chromaticity, and V is the red chromaticity; S204, set C i For the m ROI regions of the i-th frame face image, execute step S203 to obtain the YUV color channel average data reflecting different skin regions of the face, and let MstMap(n,m,c)={C1,C2,...,C n }, MstMap(n,m,c) represents a spatiotemporal feature representation map with a length of n, a width of m, and c channels.

4. The driver fatigue status monitoring based on computer vision according to claim 1 is characterized in that: The deep neural network is specifically as follows: The input layer adjusts the dimension of the spatiotemporal feature representation graph to the three-dimensional tensor required by the deep neural network as the input data of the deep neural network; The first convolutional layer uses 64 convolution kernels of size 7×7 and Relu activation function to convolve the input layer data; The first mean pooling layer uses a filter with a convolution kernel size of 2×2 to perform mean pooling on the data output by the first convolutional layer; The first residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 64 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the first mean pooling layer. The output of the first residual block layer is the output of the second convolutional layer plus the output of the first mean pooling layer and is calculated by the Relu activation function. The second residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 64 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the first residual block layer. The output of the second residual block layer is the output of the second convolutional layer plus the output of the first residual block layer and is calculated by the Relu activation function. The third residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 128 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the second residual block layer. The output of the third residual layer is the output of the second convolutional layer plus the output of the second residual block layer and is calculated by the Relu activation function. The fourth residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 128 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the third residual block layer. The output of the fourth residual layer is the output of the second convolutional layer plus the output of the third residual block layer and is calculated by the Relu activation function. The fifth residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 256 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the fourth residual block layer. The output of the fifth residual layer is the output of the second convolutional layer plus the output of the fourth residual block layer and is calculated by the Relu activation function. The sixth residual block layer includes two convolutional layers connected in sequence. Each convolutional layer uses 256 convolution kernels of size 3×3. The first convolutional layer uses the Relu function as the activation function to perform a convolution operation on the output data of the fifth residual block layer. The output of the sixth residual layer is the output of the second convolutional layer plus the output of the fifth residual block layer and is calculated by the Relu activation function. The first adaptive mean pooling layer performs mean pooling on each feature map in the output data of the sixth residual block layer and converts it into a feature map of size 1×10; The first deconvolution layer uses 64 convolution kernels of size 1×3 to perform deconvolution operations on the output data of the first adaptive mean pooling layer; The second deconvolution layer uses 32 convolution kernels of size 1×5 to perform deconvolution operation on the output data of the first deconvolution layer; The second adaptive mean pooling layer performs mean pooling on each feature map in the output data of the second deconvolution layer and converts it into a feature map of size 1×300; The second convolutional layer uses a 1×1 convolution kernel and a Relu function as the activation function to convolve the output data of the second adaptive mean pooling layer. The output layer outputs 1×300 data, which is the photoelectric volumetric pulse wave signal.

5. The driver fatigue status monitoring based on computer vision according to claim 1 is characterized in that: The process of step S4 is as follows: S401, extract the photoplethysmogram signal PV = {PV1, PV2, ..., PV i ,...,PV n }, calculate the signal peak point set TP={TP1,TP2,...,TP k }, where PV i is the photoelectric volume pulse wave signal value corresponding to the i-th frame face image, k is the number of signal peak points, TP k is the kth signal peak point; S402, perform fast Fourier transform on the signal peak point set TP to calculate the power spectrum of the photoplethysmogram signal, extract the 0.04-0.15 Hz low frequency band signal LF, the 0.15-0.4 Hz high frequency band signal HF, calculate the LF / HF index, and estimate the heart rate variability of the detection target.

6. The driver fatigue status monitoring based on computer vision according to claim 5 is characterized in that: The process of step S401 is as follows: S4011. Find the maximum element value PV of the photoplethysmographic signal PV max , and set the fourth judgment threshold b = 0.4*PV max ; S4012, perform binarization processing on the photoplethysmographic signal PV, compare each element value in the photoplethysmographic signal PV with the fourth judgment threshold, and set it to 1 if it is higher than the threshold, and set it to 0 if it is lower than the threshold, to obtain a signal after binarization processing The definition is as follows: in, is the value obtained by binarizing the photoplethysmographic signal value corresponding to the i-th frame of the face image; S4013, signal PV proc Taking the difference operation, we get in, For the Frame and The binary photoelectric volumetric pulse wave signal value of the frame face image is obtained by differential operation, the differential result 1 is the rising direction of the pulse wave, the differential result -1 is the falling direction of the pulse wave, and the maximum value point of the photoelectric volumetric pulse wave signal between the differential results 1 and -1 is a signal peak point.

7. The driver fatigue status monitoring based on computer vision according to claim 1 is characterized in that: The process of step S5 is as follows: S501. Extract information about eye closure duration ET, yawning frequency M, fatigue status label and corresponding face video from fatigue detection open source dataset, detect face video through the above-mentioned deep neural network model, calculate target photoelectric volume pulse wave signal, obtain low-frequency band signal LF, high-frequency band signal HF and calculate LF / HF index, and construct sample set D required for training decision tree according to ET, M, LF, HF, LF / HF and corresponding fatigue status, where D is divided into γ classes, including attribute a∈{ET,M,LF,HF,LF / HF}, and attribute a has V possible values. in For attribute a Kind of value; S502: construct a fatigue detection decision tree for the sample set D using the C4.5 decision tree algorithm, wherein the C4.5 decision tree algorithm divides the decision tree nodes using the information gain rate, and the information gain rate is defined as follows: Wherein, GainRatio(D,a) is the information gain rate calculated by partitioning the sample set D by attribute a, Gain(D,a) is the information gain calculated by partitioning the sample set D by attribute a, and IV(a) is the intrinsic value of attribute a; in, For all the samples in the sample set D whose values ​​on attribute a are A sample set of 1,2,...V,|D| calculates the total number of sample set D, Calculate the sample set D v The total number of, Ent(D) is the information entropy of the calculated sample set D, To calculate the sample set D v The information entropy of is calculated as follows: p j is the proportion of samples of the jth class in the sample set D, where j = 1, 2, ...γ; S503: Collect the real face data of the detection target and input it into the decision tree to detect whether the target is in a fatigue state.

Citation Information

Patent Citations

  • System for achieving fatigue driving judgment on basis of image processing and fusion between heart rate characteristic and expression characteristic

    CN103714660A

  • Non-contact learning state monitoring system and learning state detection method

    CN110197169A

  • Driver drowsiness detection system using image and PPG data based on multimodal deep learning

    KR102096617B1