Fatigue driving monitoring method based on machine learning and facial feature analysis
Through a multi-feature weighted fusion method based on machine learning, combined with the Haar-Like feature and the cascade regression tree algorithm, the driver's eye, mouth and head features are identified, which solves the problem of illumination changes affecting detection accuracy under the existing technology. problem, improving the accuracy of fatigue detection.
Patent Information
- Application Number
- CN202410651672.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-06
AI Technical Summary
Existing driver fatigue detection methods fail to identify feature points under different environmental lighting conditions, resulting in low detection accuracy and inability to effectively identify driver fatigue status.
Using a multi-feature weighted fusion method based on machine learning and facial feature analysis, the eyes, mouth and head are extracted by collecting and preprocessing driver images, using the Adaboost algorithm of Haar-Like features and the improved cascade regression tree algorithm. Features, combined with support vector machine for fatigue degree identification.
It improves the accuracy of driver fatigue detection, improves the disadvantages of single features of traditional detection systems, and enhances the ability to identify driver fatigue status.
Smart Images

Figure CN118609094A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fatigue driving monitoring, and more specifically to a fatigue driving monitoring method based on machine learning and facial feature analysis. Background Art
[0002] Fatigue driving is one of the main causes of traffic accidents. Research on the identification and monitoring system based on the driver's fatigue status will help reduce traffic accidents caused by fatigue driving and is of great significance for protecting the life safety of drivers.
[0003] At present, there are two main methods for driver fatigue detection: based on the driver's physiological parameters and behavioral characteristics. Among them, the detection based on the driver's physiological parameters is to analyze and judge the driver's fatigue level based on parameters such as electroencephalogram (EEG), electrocardiogram (ECG) and electromyography (EMG); the detection of driver behavioral characteristics uses computer vision to analyze their facial features, extract the characteristic parameters of the driver's eye movement characteristics, mouth characteristics and head position to determine whether they are in a fatigue state. However, most of the existing methods are based on selecting feature points from the eyes and establishing related algorithm models. Different lighting conditions in different environments will directly lead to feature point recognition failures and large feature parameter errors, thereby affecting the accuracy of driver fatigue detection.
[0004] Therefore, how to improve the accuracy of driver fatigue detection is an urgent problem that technical personnel in this field need to solve. Summary of the invention
[0005] In view of this, the present invention provides a fatigue driving monitoring method and system based on machine learning and facial feature analysis, which calculates weighted multi-feature fusion of the adopted feature parameters to improve the accuracy of driver fatigue detection.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] The present invention discloses a method for monitoring driving fatigue based on machine learning and facial feature analysis, comprising the following steps:
[0008] Collecting and preprocessing the driving image of the driver to obtain a preprocessed image;
[0009] Performing face detection on the preprocessed image, extracting facial features of the face, and determining the face area; updating the position and size of the face area, and tracking the driver's face;
[0010] Positioning feature points of the face in the face area, and identifying eye features, mouth features, and head features of the face based on the positioned feature points;
[0011] Multi-feature weighted fatigue degree recognition is performed based on the eye features, the mouth features, and the head features.
[0012] Furthermore, the preprocessing is an adaptive median filtering, comprising:
[0013] Initialize the filter window of the target pixel and execute process M;
[0014] In the process M, when the difference between the median and the minimum value of the brightness value of the pixel point in the filter window is greater than 0, and the difference between the median and the maximum value is less than 0, the process M is transferred to the process N; otherwise, the size of the filter window is increased, and it is determined whether the size of the filter window meets the maximum threshold of the filter window size. If so, the process M is repeatedly executed; otherwise, the median brightness of the pixel points in the filter window is directly output as the brightness value of the target pixel point;
[0015] In the process N, when the difference between the target pixel brightness value and the minimum pixel brightness value in the filtering window is greater than 0, and the difference between the target pixel brightness value and the maximum pixel brightness value in the filtering window is less than 0, the target pixel brightness value is directly output; otherwise, the median brightness of the pixels in the filtering window is output as the target pixel brightness value;
[0016] Each pixel in the image is filtered one by one to obtain a complete preprocessed image.
[0017] Furthermore, the facial features are extracted using the Adaboost algorithm based on Haar-Like features, specifically including:
[0018] Obtaining Haar-Like feature values: by sliding the linear feature rectangular box, the edge feature rectangular box, the point feature rectangular box and the diagonal feature rectangular box on the preprocessed image, respectively, the corresponding rectangular images are obtained; based on the rectangular images, the feature values of the linear features, edge features, point features and diagonal features of each pixel are calculated using the integral image to obtain the Haar-Like feature values;
[0019] The Haar-Like feature value is input into a trained strong classifier to identify the face region in the preprocessed image.
[0020] Furthermore, the calculation formula of the integral graph is:
[0021]
[0022] In the formula, O'(m,n) represents the eigenvalue of point (m,n), and O(m,n) represents the grayscale value of point (m,n), which can be further simplified through iteration:
[0023] O'(m,n)=O'(m-1,n)+O'(m,n-1)+O(m,n)-O'(m-1,n-1).
[0024] Furthermore, the strong classifier is obtained by:
[0025] Obtain a sample image containing a human face, and obtain a Haar-Like feature value of the sample image, and determine the classification label of the rectangular image according to whether the rectangular image of the sample image contains a human face image, use the coordinates, feature values, and classification label of the rectangular image as a sample data, and initialize the weight of the sample data, and multiple sample data constitute an initial training data set;
[0026] Iterative training is performed based on the initial training data set, and a weak classifier is obtained in each iterative training. The error rate of the weak classifier is calculated, and the weight coefficient of the weak classifier can be calculated according to the error rate. Multiple weak classifiers are weighted to construct a strong classifier.
[0027] Furthermore, a kernel correlation tracking algorithm that integrates adaptive template updating and predicted target position relocation is used to update the position and size of the face area and track the driver's face.
[0028] Furthermore, the positioning of the feature points of the face in the face area includes: establishing a face feature point model, using an improved cascade regression tree algorithm to position the face in the face area, and estimating the position of the feature points of the face by pixel intensity;
[0029] Wherein, using the improved cascade regression tree algorithm to locate the face in the face area includes:
[0030] Step 1: Extract the directional gradient histogram features of the face image and face shape in the sample data, establish the mapping relationship between the face image and the face shape, and finally calculate the transformed initial shape;
[0031] Step 2: Randomly select X pixels near the feature points of the face to generate X 2 The difference feature of pixels, from X 2 Select the difference feature of the γ pair pixels related to the target from the pixels;
[0032] Step 3: construct a random feature difference set through the difference feature, and then perform machine learning on it to obtain a binary feature;
[0033] Step 4: Substitute all samples in the sample data set into steps 1-3 to calculate the corresponding binary features, use the linear regression method to get the regression matrix, and finally calculate the shape increment of the sample data set;
[0034] Step 5: Perform secondary regression on the data set, repeat steps 1-4, substitute the test data to encode the feature point data area set, and obtain the binary encoding and regression matrix until the initial shape of the face is close to the real face shape.
[0035] Furthermore, the eye features are obtained by:
[0036] Based on the located feature points, six key points of the eye are selected;
[0037] Calculate the aspect ratio of the eye using the six key points of the eye;
[0038] According to the aspect ratio of the eye, using a support vector machine to determine whether the eye is in an open or closed state;
[0039] According to the open or closed state of the eyes in each frame image, the percentage of closed-eye frames, the longest continuous closed-eye time, and the blinking frequency are calculated to obtain the eye features.
[0040] Furthermore, the mouth feature is obtained by:
[0041] Based on the located feature points, six key points of the mouth are selected;
[0042] Calculate the aspect ratio of the mouth using the six key points of the mouth;
[0043] According to the aspect ratio of the mouth, using a support vector machine to determine whether the mouth is in an open or closed state;
[0044] The yawning frequency is calculated according to the opening and closing state of the mouth in each frame image to obtain the mouth feature.
[0045] Furthermore, based on the displacement of the located feature points in the preprocessed image, the driver's nodding frequency is calculated to obtain the head features.
[0046] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a fatigue driving monitoring method based on machine learning and facial feature analysis. In view of the fact that the main cause of most traffic accidents comes from fatigue driving, the driver's fatigue level is identified and detected based on a multi-feature weighted sum algorithm; combined with machine learning, artificial intelligence and other related algorithms, the features of the driver's eyes, mouth and head are monitored, which improves the disadvantages of the single feature of the traditional detection system and improves the accuracy of fatigue driving detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0048] Figure 1 It is a schematic diagram of the overall process of an embodiment of the present invention.
[0049] Figure 2 Schematic diagram of Haar-Like feature classification according to an embodiment of the present invention.
[0050] Figure 3 Schematic diagram of the pixels in the rectangular D area according to an embodiment of the present invention.
[0051] Figure 4 Schematic diagram of facial feature points according to an embodiment of the present invention.
[0052] Figure 5 Schematic diagram of key points of the eyes-open state according to an embodiment of the present invention.
[0053] Figure 6 Schematic diagram of key points of the eyes closed state according to an embodiment of the present invention.
[0054] Figure 7 Schematic diagram of key points of the mouth according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 creative work are within the scope of protection of the present invention.
[0056] The embodiment of the present invention discloses a method for monitoring driving fatigue based on machine learning and facial feature analysis, such as Figure 1 As shown, the following steps are included:
[0057] Collecting and preprocessing the driving image of the driver to obtain a preprocessed image;
[0058] Perform face detection on the preprocessed image, extract facial features, and determine the face area; update the position and size of the face area, and track the driver's face;
[0059] Locate the feature points of the face in the face area, and based on the located feature points, recognize the eye features, mouth features, and head features of the face;
[0060] Multi-feature weighted fatigue degree recognition is performed based on eye features, mouth features, and head features.
[0061] In a specific embodiment, the preprocessing is an adaptive median filtering, including:
[0062] Initialize the filter window of the target pixel and execute process M;
[0063] In process M, when the difference between the median and the minimum brightness value of the pixel point in the filter window is greater than 0, and the difference between the median and the maximum brightness value is less than 0, then the process M is transferred to process N; otherwise, the filter window size is increased to determine whether the filter window size meets the maximum threshold of the filter window size. If it meets the threshold, process M is repeated; otherwise, the median brightness value of the pixel point in the filter window is directly output as the target pixel point brightness value;
[0064] In process N, when the difference between the target pixel brightness value and the minimum pixel brightness value in the filter window is greater than 0, and the difference between the target pixel brightness value and the maximum pixel brightness value in the filter window is less than 0, the target pixel brightness value is directly output; otherwise, the median brightness value of the pixels in the filter window is output as the target pixel brightness value;
[0065] Each pixel in the image is filtered one by one to obtain a complete preprocessed image.
[0066] Specifically, process M is represented by: M1 = V med -V min 、M2=V med -V max ;
[0067] If M1>0 and M2<0, directly transfer from process M to process N to determine whether it is a noise point; if not transferred to process N, it is necessary to increase the filter size, if the size ≤U max , then the operation of process M will be repeated, if not repeated, the output will be V med .
[0068] Process N is represented by: N1 = V xy -V min 、N2=V xy -V max ;
[0069] If N1>0 and N2<0, then the output will be V xy , otherwise it will output V med .
[0070] Among them U max Indicates U xy Maximum value of the filter window allowed; V min 、Vmed and V max Respectively represent U xy The minimum, medium and maximum values of brightness; V xy Represents the brightness index of the image coordinate (x,y).
[0071] In a specific embodiment, facial features are extracted using the Adaboost algorithm based on Haar-Like features, specifically including:
[0072] Obtain Haar-Like feature values: The linear feature rectangle, edge feature rectangle, point feature rectangle and diagonal feature rectangle are continuously slid on the preprocessed image to obtain the corresponding rectangular image; based on the rectangular image, the integral image is used to calculate the feature values of the linear feature, edge feature, point feature and diagonal feature of each pixel to obtain the Haar-Like feature value; Haar-Like feature classification is as follows Figure 2 shown.
[0073] The Haar-Like feature value is input into the trained strong classifier to identify the face area in the preprocessed image.
[0074] In a specific embodiment, the calculation formula of the integral map is:
[0075]
[0076] In the formula, O'(m,n) represents the eigenvalue of point (m,n), and O(m,n) represents the grayscale value of point (m,n), which can be further simplified through iteration:
[0077] O'(m,n)=O'(m-1,n)+O'(m,n-1)+O(m,n)-O'(m-1,n-1).
[0078] Specifically, Figure 3 The calculation is explained by taking the rectangular D area pixels and schematic diagram as an example, in the figure:
[0079] D region vertex 1 integral O1' = sum(A)
[0080] D region vertex 2 integral O2'=sum(A)+sum(B)
[0081] D region vertex 3 integral O3'=sum(A)+sum(C)
[0082] D region vertex 4 integral O4' = sum(A) + sum(B) + sum(C) + sum(D)
[0083] Therefore, the sum of pixels in area D is sum(D)=O1'-O2'-O3'+O4'.
[0084] In a specific embodiment, the strong classifier is obtained by:
[0085] Obtain a sample image containing a human face, and obtain the Haar-Like eigenvalue of the sample image, and determine the classification label of the rectangular image according to whether the rectangular image of the sample image contains a human face image, use the coordinates, eigenvalues, and classification label of the rectangular image as a sample data, and initialize the weight of the sample data, and multiple sample data constitute an initial training data set;
[0086] Iterative training is performed based on the initial training data set. Each iterative training obtains a weak classifier, calculates the error rate of the weak classifier, and can calculate the weight coefficient of the weak classifier based on the error rate. Multiple weak classifiers are weighted to construct a strong classifier. Specifically:
[0087] Initial training data set: H1 = {c 11 ,c 12 ,...,c 1n ,...,c 1N}, n=1,2,...,N, H1 represents the first iteration; c 1n Represents the weight of the nth sample in the first iteration.
[0088] Let h = 1, 2, ..., N, where h represents the number of iterations. Perform multiple iterations and obtain the weak classifier G through data set training. h (x):x→{-1,+1};
[0089] The error rate of the weak classifier is:
[0090]
[0091] The weight coefficient of each iteration of the weak classifier:
[0092]
[0093] Train the data set and calculate its weight distribution;
[0094] After continuous iteration, a strong classifier is obtained:
[0095]
[0096] In the formula, δ h Represents the weak classifier G h The error rate, L is the loss function, K represents the gray value, c hn is the weight of the nth sample in the hth iteration, x n and nare the feature values and label values of the nth samples.
[0097] In a specific embodiment, a kernel correlation tracking algorithm that integrates adaptive template update and predicted target position relocation is used to update the position and size of the face area and track the driver's face. Specifically, it includes:
[0098] Object detection: In the first frame, use a face detection algorithm (such as a Haar cascade classifier or a deep learning model) to detect and locate the face;
[0099] Template initialization: extract the features of the detected face area (such as color, texture, shape, etc.) and save it as the initial template;
[0100] Target area feature extraction: In the current frame, extract the features of the corresponding area based on the target position predicted in the previous frame;
[0101] Template matching: Match the target area features of the current frame with the template and calculate the similarity (such as correlation, Euclidean distance, etc.);
[0102] Predict target location: Based on similarity, predict the location of the target in the current frame according to the area with the highest similarity;
[0103] Trajectory prediction: Combine historical trajectory information (such as Kalman filtering, particle filtering, etc.) to further predict and optimize the target position.
[0104] Among them, target detection and template initialization are the initialization part of face tracking; target area feature extraction, template matching, target position prediction, and trajectory prediction are the tracking part of face tracking. The face tracking part also includes adaptive template update, which is to decide whether to update the template according to the tracking result of the current frame and the matching degree of the template; if the matching similarity is higher than the threshold, it means that the template is still valid and will not be updated; if the matching similarity is lower than the threshold, it means that the template may be outdated and needs to be updated.
[0105] In a specific embodiment, locating the feature points of a face in a face region includes: establishing a face feature point model, such as Figure 4 As shown, the face in the face area is located using an improved cascade regression tree algorithm, and the position of the feature points of the face is estimated by pixel intensity;
[0106] Among them, using the improved cascade regression tree algorithm to locate the face in the face area includes:
[0107] Step 1: Extract the directional gradient histogram features of the face image and face shape in the sample data, establish the mapping relationship between the face image and the face shape, and finally calculate the transformed initial shape;
[0108] Step 2: Randomly select X pixels near the feature points of the face to generate X 2 The difference feature of pixels, from X 2 Select the difference feature of the γ pair pixels related to the target from the pixels;
[0109] Step 3: Construct a random feature difference set through the difference feature, and then perform machine learning on it to obtain binary features;
[0110] Step 4: Substitute all samples in the sample data set into steps 1-3 to calculate the corresponding binary features, use the linear regression method to get the regression matrix, and finally calculate the shape increment of the sample data set;
[0111] Step 5: Perform secondary regression on the data set, repeat steps 1-4, substitute the test data to encode the feature point data area set, and obtain the binary encoding and regression matrix until the initial shape of the face is close to the real face shape.
[0112] Specifically,
[0113] In step 1, feature extraction is first performed: the Histogram of Oriented Gradients (HOG) features are extracted from the face image. These features describe the gradient and directional distribution of local targets in the image. Then a mapping relationship is established: these HOG features are used to establish a mapping relationship between the face image and the face shape (represented by a series of feature points). This is usually achieved through a statistical shape model (SSM), which describes the range and pattern of shape changes. Finally, the transformed initial shape is calculated: the best matching shape, that is, the transformed initial shape, is found by optimizing an energy function (which combines the likelihood of the shape model and image information).
[0114] In step 2, first, a certain number of pixels are selected near the feature points of the face (for example, the local area around each feature point). Then the difference between these pixels and the reference pixels (which can be the feature point itself or the average pixel around the feature point) is calculated; these differences represent the changes in the local image structure and can be used to describe the shape and texture of the face. Usually, not all pixel differences are useful or relevant. Therefore, the pixel difference features that are most relevant to the target (i.e., face shape and texture) are selected.
[0115] In step 3, a supervised learning algorithm (such as support vector machine, decision tree, etc.) is used to train the pixel difference features selected in step 2. The goal of the training is to find a decision boundary that can map the input pixel difference features to binary features (usually 0 and 1). This decision boundary represents the relationship between the input features and the output binary features.
[0116] In step 4, linear regression is used to train a model that can predict the increment of face shape based on the binary features obtained in step 3. Specifically, the binary features are used as input, the shape increment (i.e., the displacement of the feature points in the image) is used as output, and the model is trained by minimizing the error between the predicted value and the actual value. After training, the model can be used to predict the increment of face shape in new images.
[0117] In step 5, the initial shape of the face is gradually optimized by iteratively applying the process in steps 1-4. Specifically, in each iterative step, the current shape estimate is used to extract new pixel difference features, and the binary features obtained in step 3 and the regression matrix obtained in step 4 are used to predict the shape increment. Then, this increment is applied to the current shape estimate to obtain a new shape estimate. This process is repeated until the stopping criterion (such as the set number of iterations) is met, and the final shape estimate is the shape of the face.
[0118] In a specific embodiment, the eye features are obtained by:
[0119] Based on the located feature points, select 6 key points of the eyes;
[0120] Using the six key points of the eye, calculate the aspect ratio of the eye;
[0121] Based on the aspect ratio of the eyes, support vector machines are used to determine whether the eyes are open or closed.
[0122] According to the open or closed state of the eyes in each frame image, the percentage of closed frames, the longest continuous closed time, and the blinking frequency are calculated to obtain eye features. Specifically,
[0123] Percentage of closed-eye frames: By analyzing video frames, the percentage of frames with closed eyes in a certain period of time is calculated to reflect the driver's fatigue level. For example, when the percentage of closed-eye frames exceeds the threshold, it can be considered that the driver is in a fatigued state.
[0124] Maximum continuous closing time: records the maximum time the driver has closed his eyes continuously. Closing eyes for a long time may be an obvious sign of fatigue. Through threshold comparison, when the continuous closing time exceeds the threshold, it can be considered that the driver is at a high level of fatigue.
[0125] Blinking frequency: Counts the number of times the driver blinks per unit time. When the driver is tired, the blinking frequency may change. By comparing it with the blinking frequency under normal conditions, the driver's fatigue level can be determined.
[0126] In a specific embodiment, the mouth feature is obtained by:
[0127] Based on the located feature points, select 6 key points of the mouth;
[0128] Using the six key points of the mouth, calculate the aspect ratio of the mouth;
[0129] Based on the aspect ratio of the mouth, support vector machine is used to determine whether the mouth is open or closed;
[0130] According to the opening and closing state of the mouth in each frame image, the yawning frequency is calculated to obtain the mouth features.
[0131] In a specific embodiment, Figure 5-7 Take this as an example to explain the aspect ratio calculation:
[0132] The key points of the eyes when they are open and closed are as follows Figure 5-6 As shown, the mouth key points are as follows Figure 7 As shown, the aspect ratio calculation formula is:
[0133]
[0134] Among them, x1 to x6 represent six key points respectively. The Euclidean distance between points x1 and x4 is calculated to obtain the horizontal Euclidean distance. The Euclidean distance between x2 and x6, and between x3 and x5 are calculated to obtain the vertical Euclidean distance, thereby obtaining the aspect ratio. The Euclidean distance calculation formula is:
[0135]
[0136] Among them, x a 、x b Represents the horizontal coordinates of point a and point b, y a and b Represents the ordinates of point a and point b
[0137] In a specific embodiment, based on the displacement of the located feature points in the preprocessed image, the driver's nodding frequency is calculated to obtain the head features.
[0138] In a specific embodiment, multi-feature weighted fatigue level recognition includes:
[0139] According to the feature values x of eyes, mouth and head α 、x β 、xγ The parameter selects its weight value for the accuracy of driver fatigue judgment, and the calculation formula is as follows:
[0140] Y=α·x α +β·x β +γ·x γ ;
[0141] In the formula, Y is the fatigue value, and α, β, and γ are the weights of the eye, mouth, and head features, respectively. Specifically, the weights are determined by using the analytic hierarchy process (AHP) to decompose the problem into different levels and factors, and the relative importance of each factor is determined by pairwise comparison to obtain the weights.
[0142] The weights determined by the layer-side analysis method specifically include:
[0143] Determine the goals and criteria: clarify the goal of driver fatigue detection, that is, to accurately and in real time detect the driver's fatigue state. Then, determine the main criteria that affect the system's detection effect, which include the collected physiological characteristics (such as eye movement, head movement, mouth movement, etc.) and environmental factors (such as light, noise, etc.).
[0144] Constructing a hierarchical structure: Decompose the problem into multiple levels to form a hierarchical structure. The top layer is the target layer, which is to accurately detect the driver's fatigue state; the middle layer is the criterion layer, which includes the various criteria mentioned above that affect the detection effect; the bottom layer is the indicator layer, which is the specific feature parameters. The criterion layer is based on the behavioral characteristics of the driver when he is fatigued, including the driver's eye features, mouth features, and head features; the bottom layer is the indicator layer to achieve the specific feature parameters that the target layer relies on.
[0145] Construct a judgment matrix: For criteria or indicators at the same level, compare them pairwise to evaluate their importance to a criterion at the previous level. The results of the comparison form a judgment matrix, and the elements in the matrix represent the importance of one factor relative to another.
[0146] Consistency test: Use consistency indicators (such as CR value) to perform the test. When the CR value is less than 0.1, it is considered that the consistency of the judgment matrix meets the requirements.
[0147] Calculate relative weights: The relative weights of each criterion or indicator relative to the considered criterion are calculated through the judgment matrix, thereby reflecting the importance of different criteria or indicators in detecting the driver's fatigue state.
[0148] Comprehensive analysis and optimization: Based on the calculated relative weights, comprehensive analysis and optimization of multi-feature fusion driver fatigue detection are performed. The sensitivity of different features is adjusted according to the weights to better adapt to the fatigue performance of different drivers.
[0149] The degree of fatigue can be divided into three stages: mild fatigue, moderate fatigue and severe fatigue.
[0150] Mild fatigue: The driver will feel physical fatigue, lack of energy, lack of concentration, memory loss, and emotional instability. However, this fatigue state usually does not have a significant impact on the driver's driving ability. After proper rest, the discomfort symptoms will gradually ease or even disappear.
[0151] Moderate fatigue: The driver will experience physical and mental fatigue, accompanied by symptoms such as inattention, memory loss, emotional instability and sleep disorders. Although the fatigue is more obvious, the driver's driving ability can still be maintained. After rest, the discomfort symptoms will be relieved to a certain extent.
[0152] Severe fatigue: The driver will experience severe physical and mental fatigue, accompanied by symptoms such as inattention, memory loss, emotional instability and sleep disorders. At this time, the driver's driving ability will be significantly affected, and the driver may even experience symptoms such as physical exhaustion, low mood and depression. After rest, the discomfort symptoms may not be significantly relieved and may even worsen.
[0153] Through the hierarchical analysis method and repeated experimental simulation based on the data of the training set, the weight values of the three eigenvalues of the eyes, mouth and head are determined, and the corresponding weight values are shown in Table 1.
[0154] According to the differences in the weight values of the characteristic value parameters obtained from the simulation experiment, the state is divided into four levels: awake, mild fatigue, moderate fatigue and severe fatigue. The comprehensive parameter value corresponds the weight value to the fatigue level to obtain the driver's fatigue level. The corresponding relationship between the fatigue level and the parameter value is shown in Table 2.
[0155] Table 1 Eigenvalue parameter weight values
[0156]
[0157] Table 2 Correspondence between fatigue degree and parameter value
[0158]
[0159]
[0160] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0161] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for monitoring driving fatigue based on machine learning and facial feature analysis, characterized in that: The steps include: Collecting and preprocessing the driving image of the driver to obtain a preprocessed image; Performing face detection on the preprocessed image, extracting facial features of the face, and determining the face area; updating the position and size of the face area, and tracking the driver's face; Positioning feature points of the face in the face area, and identifying eye features, mouth features, and head features of the face based on the positioned feature points; Multi-feature weighted fatigue degree recognition is performed based on the eye features, the mouth features, and the head features.
2. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: The preprocessing is adaptive median filtering, including: Initialize the filter window of the target pixel and execute process M; In the process M, when the difference between the median and the minimum value of the brightness value of the pixel point in the filter window is greater than 0, and the difference between the median and the maximum value is less than 0, the process M is transferred to the process N; otherwise, the size of the filter window is increased, and it is determined whether the size of the filter window meets the maximum threshold of the filter window size. If so, the process M is repeatedly executed; otherwise, the median brightness of the pixel points in the filter window is directly output as the brightness value of the target pixel point; In the process N, when the difference between the target pixel brightness value and the minimum pixel brightness value in the filtering window is greater than 0, and the difference between the target pixel brightness value and the maximum pixel brightness value in the filtering window is less than 0, the target pixel brightness value is directly output; otherwise, the median brightness of the pixels in the filtering window is output as the target pixel brightness value; Each pixel in the image is filtered one by one to obtain a complete preprocessed image.
3. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: The facial features are extracted using the Adaboost algorithm based on Haar-Like features, specifically including: Obtaining Haar-Like feature values: by sliding the linear feature rectangular box, the edge feature rectangular box, the point feature rectangular box and the diagonal feature rectangular box on the preprocessed image, respectively, the corresponding rectangular images are obtained; based on the rectangular images, the feature values of the linear features, edge features, point features and diagonal features of each pixel are calculated using the integral image to obtain the Haar-Like feature values; The Haar-Like feature value is input into a trained strong classifier to identify the face region in the preprocessed image.
4. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 3, characterized in that: The calculation formula of the integral graph is: In the formula, O'(m,n) represents the eigenvalue of point (m,n), and O(m,n) represents the grayscale value of point (m,n), which can be further simplified through iteration: O'(m,n)=O'(m-1,n)+O'(m,n-1)+O(m,n)-O'(m-1,n-1).
5. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 3, characterized in that: The strong classifier is obtained in the following way: Obtain a sample image containing a human face, and obtain a Haar-Like feature value of the sample image, and determine the classification label of the rectangular image according to whether the rectangular image of the sample image contains a human face image, use the coordinates, feature values, and classification label of the rectangular image as a sample data, and initialize the weight of the sample data, and multiple sample data constitute an initial training data set; Iterative training is performed based on the initial training data set, and a weak classifier is obtained in each iterative training. The error rate of the weak classifier is calculated, and the weight coefficient of the weak classifier can be calculated according to the error rate. Multiple weak classifiers are weighted to construct a strong classifier.
6. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: A kernel correlation tracking algorithm integrating adaptive template updating and predicted target position relocation is adopted to update the position and size of the face area and track the driver's face.
7. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: The positioning of the feature points of the face in the face area comprises: establishing a face feature point model, using an improved cascade regression tree algorithm to position the face in the face area, and estimating the position of the feature points of the face by pixel intensity; Wherein, using the improved cascade regression tree algorithm to locate the face in the face area includes: Step 1: Extract the directional gradient histogram features of the face image and face shape in the sample data, establish the mapping relationship between the face image and the face shape, and finally calculate the transformed initial shape; Step 2: Randomly select X pixels near the feature points of the face to generate X 2 The difference feature of pixels, from X 2 Select the difference feature of the γ pair pixels related to the target from the pixels; Step 3: construct a random feature difference set through the difference feature, and then perform machine learning on it to obtain a binary feature; Step 4: Substitute all samples in the sample data set into steps 1-3 to calculate the corresponding binary features, use the linear regression method to get the regression matrix, and finally calculate the shape increment of the sample data set; Step 5: Perform secondary regression on the data set, repeat steps 1-4, substitute the test data to encode the feature point data area set, and obtain the binary encoding and regression matrix until the initial shape of the face is close to the real face shape.
8. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: The eye features are obtained by: Based on the located feature points, six key points of the eye are selected; Calculate the aspect ratio of the eye using the six key points of the eye; According to the aspect ratio of the eye, using a support vector machine to determine whether the eye is in an open or closed state; According to the open or closed state of the eyes in each frame image, the percentage of closed-eye frames, the longest continuous closed-eye time, and the blinking frequency are calculated to obtain the eye features.
9. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: The mouth features are obtained by: Based on the located feature points, six key points of the mouth are selected; Calculate the aspect ratio of the mouth using the six key points of the mouth; According to the aspect ratio of the mouth, using a support vector machine to determine whether the mouth is in an open or closed state; The yawning frequency is calculated according to the opening and closing state of the mouth in each frame image to obtain the mouth feature.
10. The method for monitoring driving fatigue based on machine learning and facial feature analysis according to claim 1, characterized in that: Based on the displacement of the located feature points in the preprocessed image, the driver's nodding frequency is calculated to obtain the head features.
Citation Information
Cited By
Face recognition tracking-based driver fatigue state early warning method and system
CN120932210A
Driver fatigue risk dynamic assessment method, system, equipment and medium
CN121033812A
Optimized driver fatigue monitoring method and apparatus
WO2026102844A1
