A driver road rage emotion detection method based on machine learning
By using multi-source data acquisition and machine learning algorithms, combined with AdaBoost, Haar-Cascade, and support vector machine models, road rage is accurately detected and warnings are issued. This solves the problems of inaccurate detection and lack of real-time warnings in existing technologies, enabling real-time warnings of road rage and improving driving safety.
Patent Information
- Application Number
- CN202310205506.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-03-06
AI Technical Summary
Existing technologies cannot accurately detect road rage in drivers and lack real-time warning measures, leading to traffic safety hazards.
Employing multi-source data acquisition and machine learning algorithms, the system collects driver data through infrared cameras, microphones, pressure sensors, and grip force sensors. It combines AdaBoost and Haar-Cascade algorithms for face recognition and feature point localization, uses support vector machine models and particle swarm optimization algorithms for emotion detection, and implements warning measures when road rage is detected.
It enables accurate detection and real-time alerts of drivers' road rage, reducing traffic accidents and improving driving safety and behavioral norms.
Smart Images

Figure CN116189267B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to machine learning, computer vision and vehicle driving assistance technology, in particular to a driver road rage emotion detection method based on machine learning. BACKGROUND
[0002] With the popularization of automobiles and the increasing traffic congestion, the problem of traffic safety on the road has attracted more and more attention, and the emotional state of the driver is one of the important factors affecting driving safety. Road rage refers to the negative emotions such as anger, dissatisfaction and anxiety caused by traffic congestion, illegal driving, and other vehicle behaviors during driving, which can lead to inappropriate or violent reactions of the driver, thereby affecting driving behavior and traffic safety. Road rage not only affects the physical and mental health of the driver, but also can lead to traffic accidents, posing a threat to traffic safety and social safety. Therefore, how to accurately detect the road rage of the driver is of great significance to improve driving safety.
[0003] Traditional driver behavior detection technology is mainly based on sensors to collect dynamic parameters such as acceleration, steering, and braking, and to judge by pre-set thresholds and rules to detect the bad behavior of the driver. However, this method has limitations and cannot accurately detect the emotional state and behavior motivation of the driver, nor can it effectively intervene and regulate the psychological state of the driver. There have been some studies on driver road rage detection technology, but there are the following shortcomings: the collected information is not comprehensive, only considering single information such as sound signal or vehicle state; the accuracy and generalization ability of the algorithm need to be improved, and for complex driving scenarios and emotional differences of different drivers, the detection effect is not ideal; lack of real-time warning measures, unable to effectively prevent accidents.
[0004] In recent years, with the continuous development of computer vision and machine learning technology, by collecting physiological data, voice data and facial images of the driver and other multi-source data, and processing and analyzing through deep learning, support vector machine and other algorithms, the emotional state and behavior intention of the driver can be more accurately judged, thereby improving the safety and reliability of driving behavior. Therefore, developing a driver road rage emotion detection method based on machine learning has broad application prospects and social significance. SUMMARY
[0005] The purpose of the present application is to provide a driver road rage emotion detection method based on machine learning to solve the above technical problems.
[0006] The driver road rage emotion detection method based on machine learning includes the following modules: a sampling module, a face recognition module, a feature point positioning module, a road rage emotion detection module and a warning module.
[0007] The sampling module uses a 940nm infrared camera arranged on the dashboard of the vehicle as a driver face sampling device; uses a microphone installed on the left side of the headrest of the driver's seat as a driver voice sampling device; uses pressure sensors arranged on the accelerator pedal and brake pedal, and a grip sensor arranged on the steering wheel as driver force state sampling devices.
[0008] The face recognition module uses AdaBoost algorithm and Haar-Cascade algorithm to detect faces in the images collected by the face sampling module, identify face positions, and preliminarily locate local organs including eyebrows, eyes, nose, and mouth. The specific steps are as follows:
[0009] S1: Data preparation: Obtain the images collected by the face sampling module and convert them into grayscale images.
[0010] S2: Haar-like feature extraction: Extract Haar-like features of different sizes and positions from each grayscale image.
[0011] S3: AdaBoost classifier training: Use the extracted Haar-like features as input to train the training set and obtain multiple AdaBoost classifiers.
[0012] S4: Cascade classifier construction: Cascade the trained AdaBoost classifiers to form a cascade classifier.
[0013] S5: Image scanning: Use sliding window technology to scan each position in the image, and use the cascade classifier to classify and determine whether the window contains a face.
[0014] S6: Face positioning: If a window is classified as containing a face, it is considered that there is a face at the center of the window. According to the position and size of the window, the position of the face can be preliminarily located.
[0015] S7: Local organ positioning: According to the face position and size, preliminarily locate the eyebrows, eyes, nose, and mouth.
[0016] The feature point positioning and tracking module is based on the preliminary positioning results of the face recognition module, uses a constrained local neural domain model to locate the feature points of the face, and establishes a constrained local neural domain model containing n feature points. The specific steps are as follows:
[0017] S1: According to the preliminary positioning position of eyebrows, eyes, nose and mouth obtained in the face recognition module, the preliminary positioning position is taken as the initial position of the constrained local neural domain model, that is, the initial face feature point position is assumed to be x0=[x1, y1,..., x n ,y n ] T .
[0018] S2: The offset of each feature point is estimated to obtain an offset matrix w, and each element w ij of the offset matrix represents the combination of the offset of the feature point i in the x direction and the offset in the y direction, that is, w ij =[Δx i ,Δy i ].
[0019] S3: According to the offset matrix and the initial position x0, the estimated feature point position x=[x1+Δx1, y1+Δy1,..., x n +Δx n ,y n +Δy n ] T .
[0020] S4: The feature point position is optimized by a conditional random field model, and the optimized feature point position is denoted as x * , and the conditional random field model can be defined as:
[0021]
[0022] where I is the input face image, Z is a normalization factor, E(x|I) is the energy function of CRF, including global energy term E global (x) and local energy term E loc (x * ,x) two parts:
[0023] E(x|I) = E global (x) + E loc (x * ,x)
[0024]
[0025]
[0026] where μ and Σ are the mean and covariance matrix of all feature points on the training data set, λ i , a i and b i represent the weight, major axis and minor axis of the i-th feature point, respectively, and x *The feature point position after global constraint is represented, and the CRF energy function is minimized by gradient descent optimization algorithm to obtain the optimized feature point position x * .
[0027] S5: repeatedly performing S3 to S5 until the feature point position converges or the maximum iteration number is reached, and finally obtaining the key point position of the face.
[0028] The road rage emotion detection module is based on a support vector machine model with strong generalization ability to build a driver road rage emotion detection model, and a particle swarm optimization algorithm is used to optimize its parameters; the specific steps are as follows:
[0029] S1: Establish a training sample library containing more than 200 minutes of driving video, which includes driving videos of more than 40 drivers, and each driver's driving video is not more than 5 minutes, then use a face recognition module and a feature point positioning module to analyze, manually score the road rage emotion of different frames of face images, the score range is [0, 10], no road rage emotion is 0 points, full of road rage emotion is 10 points, and the minimum score is 0.1 points.
[0030] S2: Data preprocessing: in order to improve the convergence speed and accuracy of the model, the sample data, i.e. the driver's road rage emotion parameters, are normalized according to the following formula:
[0031]
[0032] Wherein, X min and X max are the minimum and maximum values of the sample data; X is the sample data, and X' is the normalized data, which is normalized to the range [0, 1].
[0033] The driver's road rage emotion parameters include eye opening, eyebrow spacing, eyebrow-eye spacing, nostril opening amplitude, mouth corner downcast amplitude, mouth opening and closing state, curse frequency, driver's speaking decibel and tone, accelerator pedal pressure, brake pedal pressure and steering wheel grip.
[0034] The eyebrow spacing is the distance between the two eyebrow feature points.
[0035] The nostril opening amplitude is the ratio of the distance between the outermost feature points of the driver's left and right alae nasi in the current frame to the distance in the previous frame.
[0036] The mouth corner downcast amplitude is the distance between the connecting line of the left and right mouth corner feature points and the parallel line passing through the upper lip midpoint feature point.
[0037] The mouth opening and closing state is a frequency that a ratio of a distance between midpoint feature points of upper and lower lips to a distance between left and right corner feature points exceeds a certain value in a unit time.
[0038] S3: Model training: a driver road rage emotion detection model is built based on a support vector machine (SVM) algorithm, and an optimization target is to find an optimal hyperplane to separate data of different categories, and a training process can be expressed as the following formula:
[0039]
[0040] where w represents a normal vector of the hyperplane, b represents a bias term, and represents a relaxation variable, C represents a regularization parameter, and n represents a sample quantity. i
[0041] S4: Parameter optimization: a particle swarm optimization (PSO) algorithm is used to optimize parameters of the SVM model, and an optimization process can be expressed as the following formula:
[0042] x i (t+1)=x i (t)+v i (t+1)
[0043] v i (t+1)=wvi(t)+c1r1(pi-x i )+c2r2(g-x i )
[0044] where x i represents a position vector of a particle, vi represents a velocity vector of the particle, w represents an inertia weight, c1 and c2 represent acceleration factors, r1 and r2 represent random number vectors, pi represents a historically best position vector of the particle, g represents a globally best position vector, and t represents a current iteration number.
[0045] S5: Model testing: the optimized model is applied to a road rage emotion recognition task, and a prediction result of a test data set is evaluated and analyzed.
[0046] The warning module takes corresponding measures when the road rage emotion detection module detects that the road rage emotion of the driver exceeds a preset value.
[0047] When the road rage emotion of the driver exceeds 6 points, one or more of the following measures is taken:
[0048] Measure 1: automatically playing soothing music;
[0049] Measure 2: voice prompting the driver to be calm and pay attention to driving safety;
[0050] Measure 3: Start the in-car fragrance device, spray fragrance that helps to relieve the driver's mood;
[0051] Measure 4: Smartly adjust the temperature and massage functions of the seat;
[0052] Measure 5: Change the air conditioning outlet temperature and air volume;
[0053] Measure 6: Start the ambient light, adjust the light in the car through soft light, create a more comfortable driving environment.
[0054] When the driver's road rage emotion is detected to be more than 8 points, the following measures are taken:
[0055] Measure 1: Start the active noise reduction system, use reverse sound waves to cancel the noise in the car, effectively reduce the noise interference and pressure of the driver, the specific steps are as follows:
[0056] S1: Detect noise interference level: use vehicle-mounted noise sensor or microphone to detect the noise level in the car, and express it as noise interference intensity I n ;
[0057] S2: Calculate reverse sound wave: according to the detected noise interference level, use reverse sound wave technology to calculate the reverse sound wave signal, that is, the sound wave signal S anti opposite to noise interference, use the following formula to calculate the reverse sound wave signal:
[0058] S anti (t)=-αI n S(t-τ)
[0059] Where S(t) is the original sound wave signal, α is the gain coefficient of the reverse sound wave, and τ is the delay time of the reverse sound wave;
[0060] S3: Output reverse sound wave: output the calculated reverse sound wave signal to the car speaker or earphone to cancel the noise interference in the car;
[0061] S4: Real-time adjustment of reverse sound wave parameters: according to the real-time change of noise interference in the car, use feedback control technology to adjust the gain coefficient and delay time of the reverse sound wave in real time, to maintain the best cancellation effect of the reverse sound wave.
[0062] Measure 2: Start the horn control system, if the driver honks for more than 3 seconds t honk , the horn will not sound, otherwise the horn will sound normally, set the output signal y of the horn as:
[0063]
[0064] Where y maxThe maximum output signal of a loudspeaker, i.e. the normal loudspeaker sound.
[0065] The beneficial effects of the present application are:
[0066] 1. A machine learning-based driver road rage emotion detection method is provided, which can effectively detect the driver's road rage emotion and reduce traffic accidents caused by road rage emotion.
[0067] 2. A variety of sensors are used to sample the driver's behavior, including infrared cameras, microphones, pressure sensors and grip sensors, which can comprehensively and accurately obtain the driver's behavior data.
[0068] 3. Face recognition and feature point positioning technologies are used to accurately locate the driver's facial expressions and specific organ movements, so as to more accurately determine the driver's emotional state.
[0069] 4. Based on the support vector machine machine learning algorithm, combined with the particle swarm optimization algorithm to optimize the parameters, it has strong generalization ability and accuracy, and can quickly and accurately judge the driver's road rage emotion.
[0070] 5. By monitoring and warning the driver's road rage emotion, the driver's behavior standardization and driving safety can be improved, providing strong support for traffic accident prevention. BRIEF DESCRIPTION OF DRAWINGS
[0071] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description.
[0072] Figure 1 The system framework diagram of the machine learning-based driver road rage emotion detection method of the present application. DETAILED DESCRIPTION
[0073] The embodiments of the technical solutions of the present application will be described in detail below with reference to the drawings, and the following embodiments are only used to more clearly illustrate the technical solutions of the present application, therefore only as an example, and cannot limit the protection scope of the present application.
[0074] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should be the usual meaning understood by the skilled in the art to which the present application belongs.
[0075] Reference Figure 1 , the embodiment of the present application provides a machine learning-based driver road rage emotion detection method, which comprises the following modules:
[0076] The sampling module, the face recognition module, the feature point positioning module, the road rage emotion detection module and the warning module.
[0077] The sampling module uses a 940nm infrared camera arranged on the instrument panel in the vehicle as a driver face sampling device; uses a microphone installed on the left side of the headrest of the driver's seat as a driver voice sampling device; and uses pressure sensors arranged on the accelerator pedal and the brake pedal and a grip sensor arranged on the steering wheel as driver force state sampling devices.
[0078] The face recognition module uses an AdaBoost algorithm and a Haar-Cascade algorithm to perform face detection on the images collected by the face sampling module, recognize the face position, and preliminarily position the local organs, including the eyebrows, eyes, nose and mouth, and the specific steps are as follows:
[0079] S1: Data preparation: obtaining the images collected by the face sampling module and converting them into grayscale images.
[0080] S2: Haar-like feature extraction: performing Haar-like feature extraction on each grayscale image to extract multiple features of different sizes and positions.
[0081] S3: AdaBoost classifier training: using the extracted Haar-like features as input to train the training set to obtain multiple AdaBoost classifiers.
[0082] S4: Cascade classifier construction: cascading the trained AdaBoost classifiers to form a cascade classifier.
[0083] S5: Image scanning: using a sliding window technique on the image to be detected to scan each position in the image, and using the cascade classifier to classify and judge whether each window contains a face.
[0084] S6: Face positioning: if a window is classified as containing a face, it is considered that there is a face at the center of the window, and according to the position and size of the window, the position of the face can be preliminarily positioned.
[0085] S7: Local organ positioning: according to the face position and size, the eyebrows, eyes, nose and mouth are preliminarily positioned.
[0086] The feature point positioning and tracking module is based on the preliminary positioning result of the face recognition module, uses a constrained local neural field model to position the face feature points, and establishes a constrained local neural field model containing n feature points, and the specific steps are as follows:
[0087] S1: According to the preliminary positioning position of eyebrows, eyes, nose and mouth obtained in the face recognition module, it is used as the initial position of the constrained local neural domain model, that is, the initial face feature point position is assumed to be x0=[x1, y1,..., x n , y n ] T .
[0088] S2: The offset of each feature point is estimated to obtain the offset matrix w, and each element w ij of the offset matrix represents the combination of the offset of feature point i in the x direction and the offset in the y direction, that is, w ij =[Δx i ,Δy i ].
[0089] S3: According to the offset matrix and the initial position x0, the estimated feature point position x=[x1+Δx1, y1+Δy1,..., x n +Δx n , y n +Δy n ] T .
[0090] S4: The feature point position is optimized by a conditional random field model, and the optimized feature point position is denoted as x * , and the conditional random field model can be defined as:
[0091]
[0092] wherein I is an input face image, Z is a normalization factor, E(x|I) is an energy function of CRF, including a global energy term E global (x) and a local energy term E loc (x * ,x) two parts:
[0093] E(x|I)=E global (x)+E loc (x * ,x)
[0094]
[0095]
[0096] wherein μ and Σ are the mean and covariance matrix of all feature points on the training data set, λ i , a i and b i represent the weight, major axis and minor axis of the i-th feature point, respectively, and x *The feature point position after global constraint is represented, and the CRF energy function is minimized by a gradient descent optimization algorithm to obtain the optimized feature point position x * .
[0097] S5: repeatedly performing S3 to S5 until the feature point position converges or a maximum iteration number is reached, and finally obtaining the key point position of the face.
[0098] The road rage emotion detection module is based on a support vector machine model with strong generalization ability to build a driver road rage emotion detection model, and a particle swarm optimization algorithm is used to optimize its parameters; the specific steps are as follows:
[0099] S1: Establish a training sample library containing more than 200 minutes of driving video, which includes driving videos of more than 40 drivers, and each driver's driving video is not more than 5 minutes, then use a face recognition module and a feature point positioning module to analyze, manually score the road rage emotion of different frames of face images, the score range is [0, 10], no road rage emotion is 0 points, full of road rage emotion is 10 points, and the minimum score is 0.1 points.
[0100] S2: Data preprocessing: in order to improve the convergence speed and accuracy of the model, the sample data, i.e. the driver's road rage emotion parameters, are normalized according to the following formula:
[0101]
[0102] Where X min and X max are the minimum and maximum values of the sample data respectively; X is the sample data, and X' is the normalized data, normalized to the range [0, 1].
[0103] The driver's road rage emotion parameters include eye opening, eyebrow spacing, eyebrow-eye spacing, nostril opening amplitude, mouth corner downcast amplitude, mouth opening and closing state, frequency of appearance of profanity, driver's speaking decibel and tone, accelerator pedal pressure, brake pedal pressure and steering wheel grip.
[0104] The eyebrow spacing is the distance between the two eyebrow feature points.
[0105] The nostril opening amplitude is the ratio of the distance between the outermost feature points of the left and right alae nasi in the current frame to the distance in the previous frame.
[0106] The mouth corner downcast amplitude is the distance between the connecting line of the left and right mouth corner feature points and the parallel line passing through the upper lip midpoint feature point.
[0107] The mouth opening and closing state is a frequency that a ratio of a distance between midpoint feature points of upper and lower lips to a distance between left and right corner feature points exceeds a certain value in a unit time.
[0108] S3: Model training: a driver road rage emotion detection model is built based on a support vector machine (SVM) algorithm, and an optimization target is to find an optimal hyperplane to separate data of different categories, and a training process can be expressed as the following formula:
[0109]
[0110] where w represents a normal vector of the hyperplane, b represents a bias term, and ξ i represents a relaxation variable, C represents a regularization parameter, and n represents a sample quantity.
[0111] S4: Parameter optimization: a particle swarm optimization (PSO) algorithm is used to optimize parameters of the SVM model, and an optimization process can be expressed as the following formula:
[0112] x i (t+1)=x i (t)+v i (t+1)
[0113] v i (t+1)=wvi(t)+c1r1(pi-x i )+c2r2(g-x i )
[0114] where x i represents a position vector of a particle, vi represents a velocity vector of the particle, w represents an inertia weight, c1 and c2 represent acceleration factors, r1 and r2 represent random number vectors, pi represents a historically best position vector of the particle, g represents a globally best position vector, and t represents a current iteration number.
[0115] S5: Model testing: the optimized model is applied to a road rage emotion recognition task, and prediction results of a test data set are evaluated and analyzed.
[0116] The warning module takes corresponding measures when the road rage emotion detection module detects that the road rage emotion of the driver exceeds a preset value:
[0117] When the road rage emotion of the driver exceeds 6 points, one or more of the following measures is taken:
[0118] Measure 1: automatically playing soothing music;
[0119] Measure 2: voice prompting the driver to be calm and pay attention to driving safety;
[0120] Measure 3: Start the in-car fragrance device, spray fragrance that helps to relieve the driver's mood;
[0121] Measure 4: Smartly adjust the temperature and massage functions of the seat;
[0122] Measure 5: Change the air conditioning outlet temperature and air volume;
[0123] Measure 6: Start the ambient light, adjust the light in the car through soft light, create a more comfortable driving environment.
[0124] When the driver's road rage emotion is detected to be more than 8 points, the following measures are taken:
[0125] Measure 1: Start the active noise reduction system, use reverse sound waves to cancel the noise in the car, effectively reduce the noise interference and pressure of the driver, the specific steps are as follows:
[0126] S1: Detect noise interference level: use vehicle-mounted noise sensor or microphone to detect the noise level in the car, and express it as noise interference intensity I n ;
[0127] S2: Calculate reverse sound wave: according to the detected noise interference level, use reverse sound wave technology to calculate the reverse sound wave signal, that is, the sound wave signal S anti opposite to noise interference, use the following formula to calculate the reverse sound wave signal:
[0128] S anti (t)=-αI n S(t-τ)
[0129] Where S(t) is the original sound wave signal, α is the gain coefficient of the reverse sound wave, and τ is the delay time of the reverse sound wave;
[0130] S3: Output reverse sound wave: output the calculated reverse sound wave signal to the car speaker or earphone to cancel the noise interference in the car;
[0131] S4: Real-time adjustment of reverse sound wave parameters: according to the real-time change of noise interference in the car, use feedback control technology to adjust the gain coefficient and delay time of the reverse sound wave in real time, to maintain the best cancellation effect of the reverse sound wave.
[0132] Measure 2: Start the horn control system, if the driver honks for more than 3 seconds t honk , the horn will not sound, otherwise the horn will sound normally, set the output signal y of the horn as:
[0133]
[0134] Where y maxThe maximum output signal of a speaker, i.e. the speaker sound under normal conditions.
[0135] The preferred embodiments of the present application are described in detail above with reference to the accompanying drawings, but the present application is not limited to the specific details of the above-described embodiments. Various simple modifications can be made to the technical solutions of the present application within the technical concept of the present application, and these simple modifications all belong to the protection scope of the present application.
[0136] In addition, it should be noted that each specific technical feature described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, various possible combinations are not described again by the present application.
Claims
1.A method for detecting driver road rage emotion based on machine learning, characterized in that, The sampling module, the face recognition module, the feature point positioning module, the road rage emotion detection module and the warning module are included. The sampling module uses a 940nm infrared camera arranged on the instrument panel in the vehicle as a driver face sampling device. A microphone installed on the left side of the headrest of the driver's seat is used as a driver voice sampling device. Pressure sensors arranged on the accelerator pedal and the brake pedal and a grip sensor arranged on the steering wheel are used as driver force state sampling devices. The face recognition module uses an AdaBoost algorithm and a Haar-Cascade algorithm to detect faces in the images collected by the face sampling module, identify the face positions, and preliminarily locate the local organs, including eyebrows, eyes, noses and mouths, as shown in the following specific steps: S1: Data preparation: Obtain the images collected by the face sampling module and convert them into grayscale images. S2: Haar-like feature extraction: Extract Haar-like features of different sizes and positions from each grayscale image. S3: AdaBoost classifier training: Train the training set using the extracted Haar-like features as input to obtain multiple AdaBoost classifiers. S4: Cascade classifier construction: Cascade the trained AdaBoost classifiers to form a cascade classifier. S5: Image scanning: Use a sliding window technique to scan each position in the image, and use the cascade classifier to classify and determine whether the window contains a face. S6: Face positioning: If a window is classified as containing a face, it is considered that there is a face at the center of the window. According to the position and size of the window, the position of the face can be preliminarily located. S7: Local organ positioning: According to the face position and size, the eyebrows, eyes, nose and mouth are preliminarily located. The feature point positioning and tracking module uses the preliminary positioning results of the face recognition module as the basis for positioning the feature points of the face using a constrained local neural domain model. A constrained local neural domain model containing n feature points is established. The specific steps are as follows: S1: According to the preliminary positioning position of eyebrows, eyes, nose and mouth obtained in the face recognition module, it is used as the initial position of the constrained local neural domain model, that is, the initial face feature point position is assumed to be x0=[x1, y1,..., x n ,y n ] T ; S2: estimating the offset amount for each feature point to obtain an offset amount matrix w, each element w ij represents the combination of the offset amount in the x direction and the offset amount in the y direction of the feature point i, i.e., w ij = [Δx i , Δy i ]; S3: Obtain the estimated feature point position x = [x1+Δx1, y1+Δy1,..., xN+ΔxN, yN+ΔyN]T according to the offset matrix and the initial position x0. n +Δx n ,y n +Δy n ] T ; S4: optimizing the feature point position through a conditional random field model, and recording the optimized feature point position as x * The conditional random field model can be defined as: where I is the input face image, Z is a normalization factor, E(x| I) is the energy function of the CRF, including a global energy term E global (x) and a local energy term E loc (x * (x, x) two parts: E(x|I) = E global (x) + E loc (x * ,x) where μ and Σ are the mean and covariance matrix of all feature points on the training dataset, λ i , a i and b i denote the weight, major axis and minor axis of the i-th feature point, respectively, x * denotes the feature point position after global constraint, and the optimized feature point position x * is obtained by minimizing the CRF energy function through gradient descent optimization algorithm. S5: Repeat S3 to S5 until the feature point position converges or the maximum number of iterations is reached. The final feature point position is the key point position of the face. The road rage emotion detection module uses a support vector machine model with strong generalization ability to build a driver road rage emotion detection model, and uses a particle swarm optimization algorithm to optimize its parameters. The specific steps are as follows: S1: Establish a training sample library containing more than 200 minutes of driving video, which includes driving videos of no less than 40 drivers, each driving video of a driver is no more than 5 minutes in length, and then use a face recognition module and a feature point positioning module for analysis, manually score the road rage emotions of different frames of face images, the score range is [0, 10], no road rage emotion is 0 points, full of road rage emotion is 10 points, the minimum score is 0.1 points; S2: Data preprocessing: In order to improve the convergence speed and accuracy of the model, the sample data, i.e. the driver's road rage emotion parameters, are normalized according to the following formula: where X min and X max are the minimum and maximum values of the sample data, respectively; X is the sample data, and X' is the normalized data to the range [0, 1]. S3: Model training: Based on the support vector machine SVM algorithm, a driver's road rage emotion detection model is built, and the optimization goal is to find an optimal hyperplane to separate different categories of data, and the training process can be represented by the following formula: where w denotes the normal vector of the hyperplane, b denotes the bias term, and i denotes the relaxation variable, C denotes the regularization parameter, and n denotes the number of samples. S4: Parameter optimization: The particle swarm optimization algorithm PSO is used to optimize the parameters of the SVM model, and the optimization process can be represented by the following formula: x i (t+1) = x i (t) + v i (t+1) v i (t+1) = wvi(t) + c1r1(pi-x i )+ c2r2(g-x i ) where x i represents the position vector of the particle, vi represents the velocity vector of the particle, w represents the inertia weight, c1 and c2 represent the acceleration factors, r1 and r2 represent the random number vectors, pi represents the best position vector in the history of the particle, g represents the global best position vector, and t represents the current iteration number; S5: Model testing: The optimized model is applied to the road rage emotion recognition task, and the prediction results of the test data set are evaluated and analyzed; The warning module takes corresponding measures when the road rage emotion detection module detects that the driver's road rage emotion exceeds the preset value. 2.The method of claim 1, wherein, The driver's road rage emotion parameters include eye opening, eyebrow spacing, eyebrow-eye spacing, nostril flaring amplitude, mouth corner downcast amplitude, mouth opening and closing state, frequency of appearance of profanity, driver's speaking decibel and tone, accelerator pedal pressure, brake pedal pressure, and steering wheel grip; The eyebrow spacing is the distance between the two eyebrow feature points; The nostril flaring amplitude is the ratio of the distance between the outermost feature points of the left and right alae nasi in the current frame to the distance in the previous frame; The mouth corner downcast amplitude is the distance between the parallel lines of the left and right corner feature points and the line passing through the upper lip midpoint feature point; The mouth opening and closing state is the frequency of the ratio of the distance between the upper and lower lip midpoint feature points to the distance between the left and right corner feature points exceeding a certain value within a unit time. 3.The method of claim 1, wherein, The warning module takes one or more of the following measures when the road rage emotion detection module detects that the driver's road rage emotion exceeds 6 points: Measure 1: Automatically play soothing music; Measure 2: Voice prompt the driver to be calm and pay attention to driving safety; Measure 3: Start the car's fragrance device and spray fragrance that helps to soothe the driver's mood; Measure 4: Intelligently adjust the temperature and massage function of the seat; Measure 5: Change the air outlet temperature and air volume of the air conditioner; Measure 6: Start the ambient light, adjust the light in the car through soft light, and create a more comfortable driving environment; When the driver's road rage emotion exceeds 8 points, the following measures are taken: Measure 1: Start the active noise reduction system, which effectively reduces the noise interference and pressure of the driver by canceling the noise in the car through reverse sound waves; Measure 2: Start the horn control system, if the driver presses the horn for a time t honk more than 3 seconds, the horn will not sound, otherwise the horn will sound normally, the output signal y of the horn is set as: where y max represents the maximum output signal of the loudspeaker, i.e. the loudspeaker sound under normal circumstances. 4.The method of claim 3, wherein, The active noise reduction system has the following specific steps: S1 : Detect noise disturbance level: Use the vehicle-mounted noise sensor or microphone to detect the noise level in the vehicle and represent it as noise disturbance intensity I n ; S2: Calculate the reverse sound wave: Calculate the reverse sound wave signal, i.e. the sound wave signal opposite to the noise disturbance, using the reverse sound wave technique according to the detected noise disturbance level S anti The reverse sound wave signal is calculated using the following formula: S anti (t) = -aI n S(t - τ) Where S(t) is the original sound wave signal, α is the gain coefficient of the reverse sound wave, and τ is the delay time of the reverse sound wave; S3: Outputting the reverse sound wave: outputting the calculated reverse sound wave signal to the in-vehicle speaker or earphone to cancel the noise interference in the vehicle; S4: Real-time adjustment of reverse sound wave parameters: according to the real-time change of the noise interference in the vehicle, using feedback control technology to real-time adjust the gain coefficient and delay time of the reverse sound wave, so as to maintain the best cancellation effect of the reverse sound wave.
Citation Information
Patent Citations
Method for distress and road rage detection
US10322728B1
Prompt method and system for driving behavior of driver, and vehicle
WO2022142571A1