Driver drunk driving and fatigue state intelligent detection method and system
By combining alcohol detection sensors and cameras, the system monitors drivers' drunk driving and fatigue status in real time, and constructs a dynamic threshold adaptive detection mechanism. This solves the problems of single function and poor real-time performance in existing technologies, and achieves efficient dual detection and a safety closed loop, thereby improving traffic safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF MINING & TECH
- Filing Date
- 2026-04-17
- Publication Date
- 2026-05-19
AI Technical Summary
In the existing technology, the detection systems for drunk driving and fatigued driving have problems such as limited functionality, poor real-time performance, high cost, susceptibility to environmental interference, and lack of dual-risk collaborative monitoring. Moreover, the existing systems fail to effectively intervene after detecting fatigue.
By combining alcohol collection sensors and cameras, the system monitors drivers' drunk driving and fatigue status in real time through multiple sensors and computer vision detection algorithms. It constructs a dynamic threshold adaptive detection mechanism to achieve real-time dual detection of "alcohol + fatigue" and provides early warning and intervention through voice prompts and mandatory intervention measures.
It enables real-time dual detection of driver drunk driving and fatigue, reduces system cost and power consumption, improves the continuity and stability of detection, and constructs a safety closed-loop detection-judgment-early warning-intervention mechanism, thereby improving traffic safety and reducing law enforcement costs.
Smart Images

Figure CN122058745A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic safety detection technology, and in particular to an intelligent method and system for detecting drunk driving and driver fatigue. Background Technology
[0002] Current status of breathalyzer testing: Non-contact methods primarily collect driving behavior data (such as steering wheel and accelerator pedal input) using onboard sensors and utilize machine learning models to determine the driver's intoxication status. However, due to its reliance on complex algorithms and the need for high-performance computing platforms, its real-time performance is poor. Contact-based alcohol concentration detection mainly uses the MQ-3 alcohol sensor to directly detect alcohol concentration.
[0003] Current status of fatigue driving detection: Mainstream solutions in the market rely on the driver's physiological, visual, or behavioral characteristics for detection. However, relying on a single characteristic results in a high false alarm rate and is easily affected by environmental interference, making it impractical.
[0004] Existing technological bottlenecks: ① Existing systems only detect drunk driving or fatigued driving independently, lacking collaborative monitoring of dual risks. ② High-precision solutions rely on complex algorithms or expensive hardware, making them difficult to deploy and promote on in-vehicle embedded platforms. ③ Most solutions do not forcibly prevent the vehicle from starting during drunk driving detection, and do not provide early warning intervention after detecting driver fatigue.
[0005] In the area of drunk driving detection, Hasanin Harkous and Hassan Artail of the American University of Beirut proposed a two-stage machine learning method that uses onboard sensor data to detect drunk driving behavior with high precision. Chen Ya used laser detection technology to obtain the absorption spectrum of alcohol and tested the alcohol concentration based on the intensity of the absorption spectrum, thus achieving drunk driving detection. Regarding fatigue driving detection, Shahzeb Ansari proposed a driver fatigue detection method based on body posture, using an adaptive algorithm to process time-series data, providing a new technology for real-time monitoring of driver fatigue. Xu Lisheng et al. proposed a fatigue driving detection algorithm based on short-term electrocardiogram signals, which improved the accuracy and efficiency of detection by combining traditional time-domain / frequency-domain analysis and deep learning techniques.
[0006] Literature review reveals that while domestic and international scholars have achieved some results in research on drunk driving and fatigued driving, the research lacks systematicity and has largely focused on theoretical studies with limited application and promotion. Furthermore, there is a lack of research specifically on drunk driving compared to fatigued driving, and a safety system that integrates both factors is also lacking. Summary of the Invention
[0007] This solution addresses the problems and needs raised above by proposing an intelligent detection method and system for driver drunk driving and fatigue. The system achieves the aforementioned technical objectives and brings about several other technical benefits by adopting the following technical features.
[0008] One objective of this invention is to provide an intelligent method for detecting drunk driving and driver fatigue, comprising the following steps: S10: When the driver sits down and starts the vehicle, the alcohol sensor collects the driver's blood alcohol concentration and compares it with the threshold blood alcohol concentration. If the blood alcohol concentration exceeds the limit, the vehicle ignition circuit is forcibly disconnected; if the detected blood alcohol concentration does not reach the calibrated value, the vehicle starts normally. S20: The camera captures images of the driver's facial features and behavioral state. Based on the facial features and behavioral state, the driver's drinking status and fatigue level are identified. If the driver is determined to be driving while fatigued, the driver is alerted via voice prompt. The system continues to repeatedly detect the driver's facial features and head posture until it is determined that the driver is no longer driving while fatigued.
[0009] In addition, the intelligent detection method and system for driver drunk driving and fatigue state according to the present invention may also have the following technical features: In one example of the present invention, the facial features and behavioral state of the driver acquired by the camera include: facial eye aspect ratio EAR, mouth aspect ratio MAR, skin color change after drinking, pupil / iris area ratio, and head posture angle.
[0010] In one example of the present invention, step S20, which involves acquiring images of the driver's facial features and behavioral state using a camera, and identifying the driver's drinking status and fatigue level based on these facial features and behavioral state, specifically includes the following steps: S21: Image Processing and Adaptation: Preprocess and optimize the driver's facial images captured by the camera, and accurately assess the current lighting environment; S22: Core Feature Extraction: Accurately extract four major categories of core features: eye, mouth, head posture, and alcohol consumption association; S23: Status Determination and Threshold Adjustment: By constructing a multi-dimensional weighted determination model, fatigue status classification and alcohol consumption status identification are achieved, and the determination threshold is dynamically adjusted based on the driver's real-time status to ensure the accuracy and adaptability of the detection results.
[0011] In one example of the present invention, in step S21, the driver's facial image captured by the camera is preprocessed and optimized, and the current lighting environment is accurately assessed. Specifically, this includes the following steps: S211: Frame preprocessing: The image is sequentially mirrored, then gamma corrected, and then enhanced with CLAHE to solve problems such as image viewing angle deviation, brightness imbalance, and insufficient contrast, ensuring that key facial features can still be clearly identified under complex lighting conditions. S212: Lighting Environment Assessment: Based on the grayscale image after frame preprocessing, the lighting environment is classified into multiple types by calculating three-dimensional assessment indicators such as average brightness, contrast, and highlight ratio.
[0012] In one example of the present invention, step S212 involves calculating three-dimensional evaluation indicators of average brightness, contrast, and highlight ratio, specifically including the following steps: S2121: Average brightness reflects the overall brightness of the image, and its expression is as follows: In the formula, Coordinates of the enhanced grayscale image after CLAHE The grayscale value; W and H are the length and width dimensions of the image, with values ranging from 0 to 255; S2122: Contrast ratio reflects the magnitude of the difference between brightness and darkness, and its expression is as follows: S2123: Highlight ratio reflects the scale of overexposed areas, and its expression is as follows: In the formula, This represents the number of pixels with a grayscale value exceeding 220, ranging from 0 to 1. S2124: Based on the above three-dimensional evaluation indicators, the lighting environment is divided into four types: low light environment, strong light environment, backlight environment and normal light environment.
[0013] In one example of the present invention, step S22 involves accurately extracting four core feature categories: eye, mouth, head posture, and alcohol consumption association. Specifically, this includes the following steps: S221: Eye Feature Extraction: Calculate the EAR values for the left and right eyes respectively, and take the average of the two as the final EAR result; set up a historical EAR queue of length L to realize failure compensation. When the key point detection of a single eye fails, the data of the other eye is used. When both eyes fail, the historical average of the queue is called to ensure feature continuity. S222: Oral cavity feature extraction: Based on the key point index of the mouth, the mouth aspect ratio (MAR) is obtained by calculating the ratio of the vertical to horizontal distance of the mouth, and the yawning state is determined. S223: Head pose feature extraction: Construct a 3D reference model through key head feature points, solve the PnP equation with camera intrinsic parameters to obtain the head pitch angle, and identify abnormal head-down / head-up postures. S224: Drinking-related feature extraction: Calculate two types of features based on the corresponding ROI region: the proportion of skin color Cr channel and the pupil / iris area ratio.
[0014] In one example of the present invention, in step S23, a multi-dimensional weighted judgment model is constructed to classify fatigue state and identify alcohol consumption state, and the judgment threshold is dynamically adjusted based on the driver's real-time state to ensure the accuracy and adaptability of the detection results. Specifically, this includes the following: S231: It adopts a composite judgment mechanism of basic weighted scoring and continuous fatigue penalty, combined with three core features of eye, mouth and head posture, to quantify the abstract degree of fatigue into a fatigue score of 10-100 points, and achieve a precise four-level classification of awake, mild fatigue, moderate fatigue and severe fatigue. S232: The alcohol consumption status determination module constructs a three-dimensional weighted confidence model based on feature statistics within a time window, including fatigue frequency, skin color features, and pupil features. When the confidence level is ≥0.6, the user is determined to be in an alcohol consumption state. S233: Based on the driver's real-time status of drinking, fatigue accumulation, and no sustained fatigue, the judgment thresholds of EAR, MAR, PERCLOS, and head posture angle are adaptively adjusted so that the detection model can adapt to the physiological characteristics and real-time status changes of different drivers.
[0015] In one example of the present invention, step S231 specifically includes the following steps: S2311: Core Judgment Indicators and Weight Allocation: Eye fatigue index: The eye aspect ratio (EAR) is the core. When the average eye aspect ratio (EAR) is lower than the current dynamic threshold, it is judged as eye fatigue, which reflects the fatigue characteristics of the driver's eye muscles relaxation and increased frequency of closing the eyes. Yawning indicator: Based on the mouth aspect ratio (MAR), when the mouth aspect ratio (MAR) is higher than the current dynamic threshold, it is judged as yawning behavior, which reflects the driver's abnormal breathing rhythm and fatigue. Abnormal head posture index: Based on the head pitch angle and yaw angle, when the absolute value of the angle exceeds the current dynamic threshold, it is judged as an abnormal head posture, reflecting the driver's lack of concentration and fatigue state of reduced body control ability. S2312: Scoring Calculation Formula: i. Basic weighted scoring formula: In the formula, The eye fatigue score is calculated as follows: ,when hour, ; To score points for yawning, the calculation method is as follows: ,when hour, ; Scoring for abnormal head postures is calculated as follows: ,in The absolute value of the nose pitch angle or yaw angle, when hour, The highest score shall not exceed 30 points; ii. Formula for continuous fatigue penalty: in, The continuous fatigue frame count is the number of consecutive frames in which eye fatigue, yawning, or abnormal head posture are detected. A penalty of 0.5 points is added for each frame to enhance the sensitivity to continuous fatigue. iii. Final fatigue fraction formula: The formula sets 10 points for being fully awake and 100 points for being extremely fatigued to avoid distorted judgments caused by score overflow. S2313: Fatigue Level Classification Standard: Based on fatigue scores and risk assessments of actual driving scenarios, four levels of fatigue level classification thresholds are set. All thresholds are optimized through extensive driving test data to ensure the scientific validity and practicality of the classification. Awake: Fatigue score <30, driver's eye condition is normal, no yawning, head posture is stable, and attention is focused; Mild fatigue: 30 points ≤ fatigue score < 50 points. Drivers experience mild eye fatigue or occasional yawning, and their head posture may occasionally be abnormal. Be alert to the accumulation of fatigue. Moderate fatigue: 50 points ≤ fatigue score < 80 points, the driver has persistent eye fatigue, increased yawning frequency, and frequent abnormal head posture, and needs to stop and rest as soon as possible; Severe fatigue: Fatigue score ≥ 80 points, driver has severe eye fatigue, frequent and prolonged yawning, and severely abnormal head posture, posing an extremely high driving risk, and must stop immediately; S2314: Continuous fatigue frame update rule: When any feature such as eye fatigue, yawning, or abnormal head posture is detected, the continuous fatigue frame count is incremented by 1; when all features are normal, the continuous fatigue frame count is decremented frame by frame to ensure that the penalty mechanism can respond to changes in fatigue status in real time.
[0016] In one example of the present invention, step S233 specifically includes the following steps: S2331: Threshold adjustment parameter definition: Initial thresholds: EAR_INIT=0.2, MAR_INIT=0.5, PERCLOS_INIT=0.2, HEAD_ANGLE_THRESH_INIT=15°, which are the standard thresholds for judging a conscious state; Adjustment parameters: Reduce the percentage by 10% for first-time alcohol consumption, reduce the percentage by 3% for cumulative fatigue, and reduce the percentage by 10% for no fatigue recovery. Lower threshold: 70% of the initial threshold, to avoid false judgments due to an excessively low threshold; S2332: Threshold Adjustment Rules and Formulas: i. Initial downgrade triggered by alcohol consumption: When the confidence level for alcohol consumption is ≥0.6, if the current threshold is still the initial threshold, the first downward adjustment is triggered, and the adjustment formula is as follows: This adjustment aims to adapt to changes in the physiological state of drivers after drinking alcohol and improve the sensitivity of fatigue detection; ii. Fatigue accumulation triggers a second downward adjustment: If the drinking state continues and the cumulative number of moderate fatigue events is greater than 0, and the current threshold is higher than 70% of the initial threshold, a secondary fine-tuning is triggered, and the adjustment formula is as follows: Each time fatigue accumulation triggers an adjustment, the number of moderate fatigue counts is reset to 0 to avoid excessively lowering the threshold; iii. Threshold recovery triggered by no fatigue state: When the driver is in a "conscious" state and has ≥30 consecutive fatigue-free frames, if the current threshold is lower than the initial threshold, the threshold will be gradually restored, and the adjustment formula is as follows: This rule ensures that once the driver's condition recovers, the threshold returns to the standard level, maintaining the accuracy of the detection; S2333: Threshold adjustment constraint: During all threshold adjustments, the following must be met: To avoid frequent misjudgments due to excessively low thresholds; at the same time, the threshold should not be lowered than the initial threshold when it is restored to ensure the consistency of the detection standards. S2334: Module collaborative working mechanism: When alcohol consumption or fatigue accumulation is detected, the threshold is lowered; when a persistent sobriety state is detected, the threshold is restored, forming a closed-loop workflow of "detection-judgment-adjustment-redetection".
[0017] Another objective of this invention is to provide an intelligent detection system for driver drunk driving and fatigue, comprising: The alcohol detection and processing module is configured to collect the driver's alcohol concentration by an alcohol collection sensor when the driver sits down and starts the vehicle, compare the obtained alcohol concentration with a threshold alcohol concentration, and forcibly disconnect the vehicle's ignition circuit if the alcohol concentration exceeds the standard; if the detected alcohol concentration does not reach the calibrated value, the vehicle can be started normally. The fatigue detection and processing module is configured to acquire images of the driver's facial features and behavioral state through a camera, identify the driver's drinking status and assess fatigue level based on facial features and behavioral state, and if the driver is determined to be driving while fatigued, prompt the driver with a voice prompt; and continue to repeatedly detect the driver's facial features and head posture until it is determined that the driver is no longer driving while fatigued.
[0018] Compared with the prior art, the present invention has the following beneficial effects: ① Technological breakthrough: A real-time dual detection system for "alcohol + fatigue" was proposed, breaking through the bottleneck of single function.
[0019] ② Engineering practicality: The entire system has low power consumption, low cost, does not rely on deep learning model training, has lightweight algorithms, and high engineering deployability.
[0020] ③ System robustness: The system has shifted from the traditional "static judgment" to a "dynamic threshold adaptive detection mechanism", making the technology more suitable for individual situations and ensuring continuous and stable detection.
[0021] ④ Safety closed loop: Construct a complete closed loop of "detection-judgment-early warning-intervention", and improve the accuracy of intervention through a graded early warning mechanism, and continuously monitor and provide feedback.
[0022] ⑤ Social benefits: It can effectively improve traffic safety and reduce law enforcement costs, resulting in significant social and economic benefits.
[0023] The preferred embodiments of the invention will be described in more detail below with reference to the accompanying drawings, so as to facilitate an understanding of the features and advantages of the invention. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments of the present invention will be briefly described below. The drawings are merely illustrative of some embodiments of the present invention and are not intended to limit the scope of the present invention to all embodiments.
[0025] Figure 1 A flowchart of a driver's drunk driving and fatigue state intelligent detection method according to an embodiment of the present invention; Figure 2 This is a logic block diagram of the intelligent detection method for drunk driving and fatigue state of drivers according to an embodiment of the present invention; Figure 3 This is a sample distribution diagram of an experiment according to an embodiment of the present invention; Figure 4 This is a performance index diagram according to an embodiment of the present invention; Figure 5 This is a schematic diagram of fatigue detection in women and men according to an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. The same reference numerals in the drawings represent the same components. It should be noted that the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0027] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms “first,” “second,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, “an” or “a” and similar terms do not necessarily indicate a quantity limitation. Terms such as “comprising” or “including” mean that the element or object preceding the word encompasses the element or object listed following the word and its equivalents, without excluding other elements or objects. Terms such as “connected” or “linked” are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as “upper,” “lower,” “left,” and “right” are used only to indicate relative positional relationships; these relative positional relationships may change accordingly when the absolute position of the described object changes.
[0028] According to a first aspect of the present invention, a method for intelligent detection of driver drunk driving and fatigue is provided, such as... Figure 1 and Figure 2 As shown, it includes the following steps: S10: When the driver sits down and starts the vehicle, the alcohol sensor collects the driver's blood alcohol concentration and compares it with the threshold blood alcohol concentration. If the blood alcohol concentration exceeds the limit, the vehicle ignition circuit is forcibly disconnected; if the detected blood alcohol concentration does not reach the calibrated value, the vehicle starts normally. S20: The camera captures images of the driver's facial features and behavioral state. Based on the facial features and behavioral state, the driver's drinking status and fatigue level are identified. If the driver is determined to be driving while fatigued, the driver is alerted via voice prompt. The system continues to repeatedly detect the driver's facial features and head posture until it is determined that the driver is no longer driving while fatigued.
[0029] This detection method combines drunk driving detection and fatigue driving detection, using multiple sensors and computer vision detection algorithms to dynamically monitor the driver's driving behavior and provide feedback through a real-time early warning mechanism. It effectively eliminates the two highly dangerous driving behaviors of drunk driving and fatigue driving in an efficient, economical and practical way, and is of great significance for promoting the development of driver assistance safety systems.
[0030] This detection method is a technological breakthrough: it proposes a real-time dual detection system for "alcohol + fatigue", overcoming the bottleneck of single-function limitations.
[0031] This detection method is practical for engineering applications: the entire system has low power consumption and low cost, does not rely on deep learning model training, the algorithm is lightweight, and it is highly deployable in engineering.
[0032] This detection method has system robustness: it changes from the traditional "static judgment" to a "dynamic threshold adaptive detection mechanism", the technology is more in line with individual realities, and the detection is continuous and stable.
[0033] This detection method features a safety closed loop: it constructs a complete closed loop of "detection-judgment-early warning-intervention" and improves the accuracy of intervention through a graded early warning mechanism, while continuously monitoring and providing feedback.
[0034] This detection method has social benefits: it can effectively improve traffic safety, reduce law enforcement costs, and has significant socio-economic benefits.
[0035] In one example of the present invention, step S10 specifically includes the following steps: When the alcohol sensor is working, it outputs a linearly related voltage signal based on the detected alcohol concentration. After amplification, the voltage signal is converted into a digital signal by an A / D converter and transmitted to the microcontroller for logical judgment. The microcontroller compares the received alcohol concentration value with the equivalent sensor output threshold of 20mg / 100ml blood alcohol content. If the alcohol concentration exceeds the limit, the buzzer sounds a continuous alarm, and the microcontroller controls a relay to forcibly disconnect the vehicle's ignition circuit. If the detected alcohol concentration does not reach the calibrated value, the vehicle can be started normally.
[0036] The core of the MQ-3 alcohol sensor is a gas-sensitive semiconductor material. After system startup, the alcohol sensor, in conjunction with an air pump, draws in an air sample and transmits it to the sensor's detection chamber. Alcohol vapor in the air sample comes into contact with the heated gas-sensitive semiconductor material, causing a redox reaction that alters the material's resistance. This change in resistance is converted into an electrical signal, amplified, and then converted into a digital signal by a digital-to-digital converter before being fed into the microcontroller for logical processing.
[0037] The microcontroller compares the received blood alcohol concentration (BAC) value with a preset drunk driving threshold (20mg / 100ml) according to a pre-programmed sequence. If the BAC exceeds the threshold, the microcontroller controls a buzzer to sound an alarm continuously. Simultaneously, the microcontroller sends a signal through a pull-down resistor and a transistor to energize and close a relay, thereby cutting off the vehicle's starting circuit and forcibly intervening in drunk driving. When the BAC is below the calibrated value, it remains normal.
[0038] In one example of the present invention, the facial features and behavioral state of the driver acquired by the camera include: facial eye aspect ratio EAR, mouth aspect ratio MAR, skin color change after drinking, pupil / iris area ratio, and head posture angle.
[0039] In one example of the present invention, step S20, which involves acquiring images of the driver's facial features and behavioral state using a camera, and identifying the driver's drinking status and fatigue level based on these facial features and behavioral state, specifically includes the following steps: S21: Image Processing and Adaptation: Preprocess and optimize the driver's facial images captured by the camera, and accurately assess the current lighting environment to provide high-quality data support for subsequent core feature extraction and dynamic threshold adaptation. S22: Core Feature Extraction: Accurately extract four major categories of core features: eye, mouth, head posture, and alcohol consumption association, providing highly reliable data support for subsequent fatigue state determination and alcohol consumption state recognition; S23: Status Determination and Threshold Adjustment: By constructing a multi-dimensional weighted determination model, fatigue status classification and alcohol consumption status identification are achieved, and the determination threshold is dynamically adjusted based on the driver's real-time status to ensure the accuracy and adaptability of the detection results.
[0040] In one example of the present invention, in step S21, the driver's facial image captured by the camera is preprocessed and optimized, and the current lighting environment is accurately assessed. Specifically, this includes the following steps: S211: Frame preprocessing: The image is sequentially mirrored, then gamma corrected, and then enhanced with CLAHE to solve problems such as image viewing angle deviation, brightness imbalance, and insufficient contrast, ensuring that key facial features (eyes, mouth, skin color) can still be clearly identified under complex lighting conditions. S212: Lighting Environment Assessment: Based on the grayscale image after frame preprocessing, the lighting environment is classified into multiple types by calculating three-dimensional assessment indicators such as average brightness, contrast, and highlight ratio.
[0041] In one example of the present invention, in step S211, the image is sequentially subjected to mirror flipping → gamma correction → CLAHE enhancement processing, specifically including the following steps: S2111: Mirror Flip: Based on OpenCV's cv2.flip() function, using horizontal flip mode (function parameter set to 1), this function adjusts the pixel arrangement of a captured 640×480 resolution image. For any pixel (x, y) in the image, the coordinate mapping relationship after flipping is as follows: ,in, The image width is constant, while the vertical pixel coordinate y remains unchanged. S2112: Gamma Correction: First, convert the mirrored color image to grayscale, then adaptively select the gamma coefficient based on the average brightness. Based on the selected A pre-constructed gamma mapping table is used to map pixel values between the grayscale image and the gamma mapping table, and the output image is brightness-equalized. The grayscale value mapping relationship is constructed based on a power function, and the dynamic range of image brightness is changed by adjusting the gamma coefficient. The core formula is as follows: Where I is the grayscale value of the input pixel (range 0-255). Gamma coefficient ( Increase image brightness at the same time (When reducing image brightness), O is the grayscale value of the output pixel (after calculation, it is converted to uint8 type, with a value range of 0-255); The specific process of gamma correction is as follows: (a) First, convert the mirrored color image to grayscale. The calculation formula is: Calculate the average brightness of the image, where W=640 and H=480 are the image width and height, respectively. This represents the grayscale value at coordinates (x, y). (b) Adaptive selection of gamma coefficient based on average brightness: when In low-light environments, set To significantly improve brightness; when In a bright light environment, set To suppress overexposed areas; when (At normal brightness) no gamma correction is performed; (c) Pre-built gamma mapping table: based on the selected Value, expressed by the formula: Where i is a gray level of 0-255, a mapping table of 256 gray levels is constructed to avoid real-time calculation per pixel and improve the processing frame rate; (d) Using OpenCV's cv2.LUT() function, the grayscale image is mapped to the gamma map to obtain the pixel values, and the image with equal brightness is output.
[0042] S2113: Enhancement Processing: The CLAHE algorithm is used for block equalization and contrast limitation to avoid noise amplification. Key parameters in the code are clipLimit=2.0 and tileGridSize=(8,8) (the 640×480 image is divided into 64 80×60 sub-blocks). Through sub-block histogram cropping, CDF mapping pixel value calculation, and stitching output, over-enhancement of large areas is avoided, key details are enhanced, and the accuracy of keypoint detection is improved.
[0043] In one example of the present invention, step S212 involves calculating three-dimensional evaluation indicators of average brightness, contrast, and highlight ratio, specifically including the following steps: S2121: Average brightness reflects the overall brightness of the image, and its expression is as follows: In the formula, Coordinates of the enhanced grayscale image after CLAHE The grayscale value; W and H are the length and width dimensions of the image (e.g., ), with values ranging from 0 to 255; S2122: Contrast ratio reflects the magnitude of the difference between brightness and darkness, and its expression is as follows: S2123: Highlight ratio reflects the scale of overexposed areas, and its expression is as follows: In the formula, This represents the number of pixels with a grayscale value exceeding 220, ranging from 0 to 1. S2124: Based on the above three-dimensional evaluation indicators, the lighting environment is divided into four types (thresholds optimized through actual testing in driving scenarios): Low-light environment Overall dimness and blurry details); strong light environment (High risk of overall overexposure and overlighting); Backlighting environment Large differences in brightness and darkness, bright background and dark face; normal lighting environment (not meeting the above conditions, moderate brightness and clear details).
[0044] In one example of the present invention, step S22 involves accurately extracting four core feature categories: eye, mouth, head posture, and alcohol consumption association. Specifically, this includes the following steps: S221: Eye Feature Extraction: Calculate the EAR values for the left and right eyes separately, and take the average of the two as the final EAR result; set up a historical EAR queue of length L (e.g., 5) to implement failure compensation. When single-eye keypoint detection fails, the data from the other eye is used; when both eyes fail, the historical average from the queue is called to ensure feature continuity. The expression for the eye aspect ratio (ERA) is: In the formula, The EAR value for the left eye; The EAR value for the right eye; The expressions for the EAR values of the left and right eyes are as follows: In the formula, x pi and ypi Represent the x-coordinate and y-coordinate of point Pi, respectively; S222: Oral cavity feature extraction: Based on the key point index of the mouth, the mouth aspect ratio (MAR) is obtained by calculating the ratio of the vertical to horizontal distance of the mouth, and the yawning state is determined. The vertical distance is the straight-line distance between key points 51 to 59, 52 to 58, 53 to 57, and 48. The horizontal distance is the straight-line distance between key point 54 at the left corner of the mouth and key point 48 at the right corner of the mouth, multiplied by a correction factor. The expression is as follows: In the formula, The vertical coordinates of the i-th feature point Let be the horizontal coordinate of the i-th feature point; S223: Head pose feature extraction: Construct a 3D reference model through key head feature points, solve the PnP equation with camera intrinsic parameters to obtain the head pitch angle, and identify abnormal head-down / head-up postures. The coordinates of the reference point for the 3D model are set, and the camera intrinsic parameter matrix is set based on the image size (focal length = image width, center is the image midpoint). The rotation vector is obtained by solving the PnP equation using an iterative method, converted to Euler angles, and then the pitch angle is extracted. The core formula is as follows: Camera intrinsic parameter matrix = Pitch angle = In the formula, Focal length Image size, Let be the rotation vector. These are the converted Euler angles; S224: Drinking-related feature extraction: Calculate two types of features based on the corresponding ROI region: the proportion of skin color Cr channel and the pupil / iris area ratio; Among them, the percentage of the Cr channel in skin tone is: Extract the facial ROI region (based on key points of the nose tip, chin, and tragus), convert it to the YCrCb color space, and only count effective pixels in the Y channel (brightness) range of 50-200. Calculate the ratio of the Cr channel mean to 255 using the following formula: In the formula, For the number of effective pixels, This represents the Cr channel value for the corresponding pixel; Among them, the pupil / iris area ratio: The ROI regions for both eyes were extracted (based on the range of key points around the eyes), converted to grayscale, and then segmented into pupils and irises using the Otsu thresholding method. Noise was removed through morphological processing, and the area ratio of the two was calculated using the following formula: In the formula, These are binarized images of the pupil and iris, respectively. The extraction logic is to take the average of the pupil ratios of both eyes; if a single eye's ROI is invalid, the data from the other eye is used; if both eyes are invalid, a value of 0 is output.
[0045] In one example of the present invention, in step S23, a multi-dimensional weighted judgment model is constructed to classify fatigue state and identify alcohol consumption state, and the judgment threshold is dynamically adjusted based on the driver's real-time state to ensure the accuracy and adaptability of the detection results. Specifically, this includes the following: S231: It adopts a composite judgment mechanism of basic weighted scoring and continuous fatigue penalty, combined with three core features of eye, mouth and head posture, to quantify the abstract degree of fatigue into a fatigue score of 10-100 points, and achieve a precise four-level classification of awake, mild fatigue, moderate fatigue and severe fatigue. S232: The alcohol consumption determination module constructs a three-dimensional weighted confidence model of fatigue frequency, skin color features, and pupil features based on feature statistics within a 3-minute time window (90 frames, 30fps). When the confidence level is ≥0.6, it is determined to be an alcohol consumption state. S233: Based on the driver's real-time status of drinking, fatigue accumulation, and no sustained fatigue, the judgment thresholds of EAR, MAR, PERCLOS, and head posture angle are adaptively adjusted so that the detection model can adapt to the physiological characteristics and real-time status changes of different drivers.
[0046] In one example of the present invention, step S231 specifically includes the following steps: S2311: Core Judgment Indicators and Weight Allocation: Eye fatigue index (70% weight): Based on the eye aspect ratio (EAR), when the average eye aspect ratio (EAR_avg) is lower than the current dynamic threshold (current_EAR), it is judged as eye fatigue, reflecting the fatigue characteristics of the driver's eye muscles relaxation and increased frequency of closing the eyes. Yawning indicator (weight 30%): Based on the mouth aspect ratio (MAR), when the mouth aspect ratio (MAR) is higher than the current dynamic threshold (current_MAR), it is judged as yawning behavior, which reflects the driver's abnormal breathing rhythm and fatigue. Abnormal head posture index (bonus points): Based on the pitch and yaw angles, when the absolute value of the angle exceeds the current dynamic threshold, it is judged as an abnormal head posture, reflecting the driver's lack of concentration and fatigue due to decreased body control. S2312: Scoring Calculation Formula: i. Basic weighted scoring formula: In the formula, The eye fatigue score is calculated as follows: ,when hour, ; To score points for yawning, the calculation method is as follows: ,when hour, ; Scoring for abnormal head postures is calculated as follows: ,in The absolute value of the nose pitch angle or yaw angle, when hour, The highest score shall not exceed 30 points; ii. Formula for continuous fatigue penalty: in, The continuous fatigue frame count is the number of consecutive frames in which eye fatigue, yawning, or abnormal head posture are detected. A penalty of 0.5 points is added for each frame to enhance the sensitivity to continuous fatigue. iii. Final fatigue fraction formula: The formula sets 10 points as the lowest score (fully conscious) and 100 points as the highest score (extremely fatigued) to avoid score overflow that could lead to distorted judgment. S2313: Fatigue Level Classification Standard: Based on fatigue scores and risk assessments of actual driving scenarios, four levels of fatigue level classification thresholds are set. All thresholds are optimized through extensive driving test data to ensure the scientific validity and practicality of the classification. Awake: Fatigue score <30, driver's eye condition is normal, no yawning, head posture is stable, and attention is focused; Mild fatigue: 30 points ≤ fatigue score < 50 points. Drivers experience mild eye fatigue or occasional yawning, and their head posture may occasionally be abnormal. Be alert to the accumulation of fatigue. Moderate fatigue: 50 points ≤ fatigue score < 80 points, the driver has persistent eye fatigue, increased yawning frequency, and frequent abnormal head posture, and needs to stop and rest as soon as possible; Severe fatigue: Fatigue score ≥ 80 points, driver has severe eye fatigue, frequent and prolonged yawning, and severely abnormal head posture, posing an extremely high driving risk, and must stop immediately; S2314: Continuous fatigue frame update rule: When any feature such as eye fatigue, yawning, or abnormal head posture is detected, the continuous fatigue frame count (consec_fatigue_frames) is incremented by 1; when all features are normal, the continuous fatigue frame count is decremented frame by frame (minimum 0) to ensure that the penalty mechanism can respond to changes in fatigue status in real time.
[0047] In one example of the present invention, step S232 specifically includes the following steps: S2321: Time Window and Feature Queue: The module relies on alcohol_fatigue_queue (3-minute fatigue marker queue), skin_r_queue (3-minute skin color R ratio queue), and pupil_ratio_queue (3-minute pupil / iris ratio queue) to store historical feature data, ensuring that the judgment results are based on continuous and stable feature statistics and avoiding misjudgments caused by abnormal single-frame data; S2322: The confidence level calculation formula is: in: For fatigue frequency scoring, when the total number of fatigue markers within 3 minutes (fatigue_freq = sum(alcohol_fatigue_queue)) is ≥ 8, ,otherwise The weighting is 45%, because drivers are prone to persistent fatigue after drinking, and this indicator reflects the impact of drinking on energy. To score skin color features, calculate the mean R-value of facial skin color over 3 minutes (skin_r_mean = np.mean(skin_r_queue)). hour, ,otherwise The weighting is 35%. Because facial redness is caused by vasodilation after drinking, the proportion of R increases significantly. This indicator is a characteristic specific to drinking. To score pupil features, calculate the mean pupil / iris ratio over 3 minutes (pupil_ratio_mean = np.mean(pupil_ratio_queue)). hour, ,otherwise The weighting is 20%, because the pupil’s ability to adjust to light decreases after drinking, and the pupil / iris ratio increases abnormally. This indicator helps to enhance the recognition of drinking status. S2323: Rules for determining drinking status: When the alcohol confidence is ≥0.6, the person is determined to be in a state of drinking. This threshold was optimized by comparing a large number of drunk driving and normal driving samples. It ensures that no drunk driving is missed while effectively reducing the false positive rate of normal driving. When the confidence is <0.6, the person is determined to be in a state of not drinking.
[0048] In one example of the present invention, step S233 specifically includes the following steps: S2331: Threshold adjustment parameter definition: Initial thresholds: EAR_INIT=0.2, MAR_INIT=0.5, PERCLOS_INIT=0.2, HEAD_ANGLE_THRESH_INIT=15°, which are the standard thresholds for judging a conscious state; Adjust the following ratio parameters: reduce the percentage by 10% for the first time drinking alcohol (THRESH_DOWN_RATIO_FIRST=0.9), reduce the percentage by 3% for cumulative fatigue (THRESH_DOWN_RATIO_FATIGUE=0.97), and reduce the percentage by 10% for no fatigue recovery (THRESH_RECOVER_RATIO=0.1). Lower threshold: 70% of the initial threshold (THRESH_LOWER_LIMIT=0.7) to avoid false judgments due to an excessively low threshold; S2332: Threshold Adjustment Rules and Formulas: i. Initial downgrade triggered by alcohol consumption: When the confidence level for alcohol consumption is ≥0.6, if the current threshold is still the initial threshold, the first downward adjustment is triggered, and the adjustment formula is as follows: This adjustment aims to adapt to changes in the physiological state of drivers after drinking alcohol and improve the sensitivity of fatigue detection; ii. Fatigue accumulation triggers a second downward adjustment: If the drinking state continues and the cumulative number of moderate fatigue counts (fatigue_count) > 0, a secondary fine-tuning is triggered if the current threshold is higher than 70% of the initial threshold. The adjustment formula is as follows: After each fatigue accumulation triggers an adjustment, the number of moderate fatigue events (fatigue_count) is reset to 0 to avoid excessively lowering the threshold.
[0049] iii. Threshold recovery triggered by no fatigue state: When the driver is in a "conscious" state and has no fatigue frames (no_fatigue_frames) for ≥30 frames (1 second), if the current threshold is lower than the initial threshold, the threshold will be gradually restored, and the adjustment formula is as follows: This rule ensures that once the driver's condition recovers, the threshold returns to the standard level, maintaining the accuracy of the detection; S2333: Threshold adjustment constraint: During all threshold adjustments, the following must be met: To avoid frequent misjudgments due to excessively low thresholds; at the same time, the threshold should not be lowered than the initial threshold when it is restored to ensure the consistency of the detection standards. S2334: Module Collaborative Working Mechanism: The fatigue state determination module and the alcohol consumption state determination module operate in parallel, synchronously outputting determination results based on the same batch of core feature data; the dynamic threshold adjustment module receives the output status of the first two modules in real time, triggering a threshold reduction when alcohol consumption or accumulated fatigue is detected, and triggering a threshold restoration when a sustained sobriety state is detected, forming a closed-loop workflow of "detection-determination-adjustment-re-detection". This collaborative mechanism ensures that the detection model can adapt to changes in driver state in real time, maintaining high accuracy in complex driving scenarios and providing a reliable decision-making basis for subsequent warning outputs.
[0050] According to a second aspect of the present invention, a driver's drunk driving and fatigue state intelligent detection system includes: The alcohol detection and processing module is configured to collect the driver's alcohol concentration by an alcohol collection sensor when the driver sits down and starts the vehicle, compare the obtained alcohol concentration with a threshold alcohol concentration, and forcibly disconnect the vehicle's ignition circuit if the alcohol concentration exceeds the standard; if the detected alcohol concentration does not reach the calibrated value, the vehicle can be started normally. The fatigue detection and processing module is configured to acquire images of the driver's facial features and behavioral state through a camera, identify the driver's drinking status and assess fatigue level based on facial features and behavioral state, and if the driver is determined to be driving while fatigued, prompt the driver with a voice prompt; and continue to repeatedly detect the driver's facial features and head posture until it is determined that the driver is no longer driving while fatigued.
[0051] In other words, the alcohol detection processing module employs an active sampling alcohol detection mechanism. It uses an alcohol sensor to quantitatively detect alcohol vapor in the driver's exhaled breath, and an embedded control unit determines the threshold. When the detection result exceeds the threshold, the system forcibly cuts off the vehicle's starting circuit via a relay, thus actively preventing drunk driving. Regarding fatigue detection, the fatigue detection processing module uses an in-vehicle camera to capture facial images of the driver. It utilizes lightweight computer vision algorithms to extract and statistically analyze multi-dimensional behavioral features such as eye closure, mouth opening, and head posture in real time. Through rule-based judgment and a weighted scoring mechanism, it continuously assesses and classifies the driver's fatigue state, triggering audible, visual, or voice warnings when fatigue risk is detected.
[0052] This detection system is a technological breakthrough: it proposes a real-time dual detection system for "alcohol + fatigue", overcoming the bottleneck of single-function limitations.
[0053] The detection system is practical for engineering applications: it has low power consumption, low cost, does not rely on deep learning model training, has lightweight algorithms, and is highly deployable in engineering.
[0054] The detection system is robust: it has shifted from the traditional "static judgment" to a "dynamic threshold adaptive detection mechanism", making the technology more suitable for individual situations and ensuring continuous and stable detection.
[0055] The detection system features a secure closed loop: it constructs a complete closed loop of "detection-judgment-early warning-intervention" and improves the accuracy of intervention through a graded early warning mechanism, while continuously monitoring and providing feedback.
[0056] This detection system has social benefits: it can effectively improve traffic safety, reduce law enforcement costs, and has significant socio-economic benefits.
[0057] In one example of the present invention, the fatigue detection processing module includes: The image processing and adaptation layer is configured to preprocess and optimize the driver's facial image captured by the camera, and accurately assess the current lighting environment to provide high-quality data support for subsequent core feature extraction and dynamic threshold adaptation. Its features include a frame preprocessing module and a lighting environment assessment module. The modules work together to achieve the technical effects of resisting light interference and improving feature recognition. The core feature extraction layer is configured to accurately extract four major categories of core features: eyes, mouth, head posture, and alcohol consumption association. This provides highly reliable data support for subsequent fatigue state determination and alcohol consumption state recognition. Its key feature is that it ensures the accuracy and stability of feature extraction through standardized key point mapping, precise geometric calculation, and anti-interference optimization. The state determination and threshold adjustment layer is configured to achieve fatigue state classification and alcohol consumption state identification by constructing a multi-dimensional weighted determination model, and dynamically adjust the determination threshold based on the driver's real-time state to ensure the accuracy and adaptability of the detection results. Its features include a fatigue state determination module, an alcohol consumption state determination module, and a dynamic threshold adjustment module, and each module works together to achieve real-time and accurate assessment of the driving state.
[0058] In one example of the present invention, the image processing and adaptation layer includes: The frame preprocessing unit is configured to sequentially perform image mirroring, gamma correction, and CLAHE enhancement on the image to solve problems such as image viewing angle deviation, brightness imbalance, and insufficient contrast, and to ensure that key facial features (eyes, mouth, and skin color) can still be clearly identified under complex lighting conditions. The lighting environment assessment unit is configured to classify lighting environments into multiple types based on the grayscale image after frame preprocessing by calculating three-dimensional assessment indicators such as average brightness, contrast, and highlight ratio.
[0059] In one example of the present invention, the frame preprocessing unit includes: The mirror flip subunit is configured using the OpenCV-based cv2.flip() function, employing a horizontal flip mode (function parameter set to 1), to adjust the pixel arrangement of the acquired 640×480 resolution image. For any pixel (x, y) in the image, its coordinate mapping after flipping is as follows: ,in, The image width is constant, while the vertical pixel coordinate y remains unchanged. The gamma correction subunit is configured to construct a grayscale value mapping relationship based on a power function, and change the dynamic range of image brightness by adjusting the gamma coefficient. The enhancement processing subunit is configured to use the CLAHE algorithm for block equalization and contrast limitation to avoid noise amplification. Key parameters in the code are clipLimit=2.0 and tileGridSize=(8,8) (the 640×480 image is divided into 64 80×60 sub-blocks). Through sub-block histogram cropping, CDF mapping pixel value calculation, and stitching output, it avoids over-enhancement of large areas, enhances key details, and improves keypoint detection accuracy.
[0060] It should be noted that the intelligent detection system for drunk driving and fatigue of drivers of the present invention can also perform any of the processes described in the previously described intelligent detection method for drunk driving and fatigue of drivers, and the specific details are not repeated here.
[0061] Specific examples: This paper evaluates and analyzes the performance of driver fatigue detection algorithms based on the YawDD dataset. YawDD (Yawning Detection Dataset) is a publicly available driver fatigue detection dataset widely used in research on behavior recognition and fatigue state analysis. This dataset includes facial videos of drivers in natural states within a simulated driving environment, focusing on fatigue-related behaviors such as yawning, providing realistic and diverse training and testing samples for fatigue detection algorithms. Figure 3 , Figure 5 As shown, this experiment used a total of 320 videos, including 164 videos of men (57 of which were fatigue videos) and 156 videos of women (58 of which were fatigue videos). The algorithm showed good detection performance on the YawDD dataset.
[0062] like Figure 4 As shown, the overall accuracy rate in the dataset is 96.56%, with 98.17% for the male group and 94.87% for the female group, indicating that the algorithm has a high ability to identify the fatigue state of drivers of different genders.
[0063] The detection method uses an MQ-3 alcohol sensor and an air pump for active sampling to reduce environmental interference by actively extracting air samples; while the aforementioned patent only uses the MQ-3 alcohol sensor and does not have an active sampling design.
[0064] The fatigue detection method relies on computer vision detection algorithms (MediaPipe library and OpenCV) for high accuracy; while the aforementioned patent only relies on a pulse sensor at the steering wheel to detect physiological signals, comparing the pulse rate with historical averages. The two methods represent non-contact and contact detection, respectively.
[0065] This detection method represents a systematic innovation based on traditional fatigue detection: it proposes a joint inference model for drinking status based on multimodal temporal features, enhancing specificity through a weighted fusion of skin tone redness, pupil dynamics, and fatigue frequency (45% / 35% / 20%). An adaptive dual-layer threshold mechanism is introduced, combining the initial drop triggered by drinking with a secondary adjustment based on accumulated fatigue, and a fatigue-free recovery logic is designed to significantly enhance individual adaptability. Furthermore, a fatigue event statistical framework based on time windows is constructed to achieve tiered voice warnings. Overall, this represents a leap from single physiological indicators to multi-dimensional dynamic collaborative discrimination.
[0066] The foregoing description, with reference to preferred embodiments, details an exemplary implementation of the intelligent detection method and system for drunk driving and driver fatigue proposed by the present invention. However, those skilled in the art will understand that various modifications and alterations can be made to the above specific embodiments without departing from the concept of the present invention, and various combinations can be made to the various technical features and structures proposed by the present invention without exceeding the protection scope of the present invention, which is determined by the appended claims.
Claims
1. A method for intelligent detection of drunk driving and driver fatigue, characterized in that, Includes the following steps: S10: When the driver sits down and starts the vehicle, the alcohol sensor collects the driver's blood alcohol concentration and compares it with the threshold blood alcohol concentration. If the blood alcohol concentration exceeds the limit, the vehicle ignition circuit is forcibly disconnected; if the detected blood alcohol concentration does not reach the calibrated value, the vehicle starts normally. S20: The camera captures images of the driver's facial features and behavioral state. Based on the facial features and behavioral state, the driver's drinking status and fatigue level are identified. If it is determined that the driver is driving while fatigued, the driver is alerted through voice prompts. The system continues to repeatedly detect the driver's facial features and head posture until it is determined that the driver is no longer in a state of fatigue.
2. The intelligent detection method for driver drunk driving and fatigue state according to claim 1, characterized in that, The camera captures the driver's facial features and behavioral state, including: eye aspect ratio (EAR), mouth aspect ratio (MAR), changes in skin color after drinking, pupil / iris area ratio, and head posture.
3. The intelligent detection method for driver drunk driving and fatigue state according to claim 1, characterized in that, In step S20, the process of acquiring images of the driver's facial features and behavioral state using a camera, and then identifying the driver's drinking status and assessing their fatigue level based on these features and behavioral state, specifically includes the following steps: S21: Image Processing and Adaptation: Preprocess and optimize the driver's facial images captured by the camera, and accurately assess the current lighting environment; S22: Core Feature Extraction: Accurately extract four major categories of core features: eye, mouth, head posture, and alcohol consumption association; S23: Status Determination and Threshold Adjustment: By constructing a multi-dimensional weighted determination model, fatigue status classification and alcohol consumption status identification are achieved, and the determination threshold is dynamically adjusted based on the driver's real-time status to ensure the accuracy and adaptability of the detection results.
4. The intelligent detection method for driver drunk driving and fatigue state according to claim 3, characterized in that, In step S21, the driver's facial image captured by the camera is preprocessed and optimized, and the current lighting environment is accurately assessed. This includes the following steps: S211: Frame preprocessing: The image is sequentially mirrored, then gamma corrected, and then enhanced with CLAHE to solve problems such as image viewing angle deviation, brightness imbalance, and insufficient contrast, ensuring that key facial features can still be clearly identified under complex lighting conditions. S212: Lighting Environment Assessment: Based on the grayscale image after frame preprocessing, the lighting environment is classified into multiple types by calculating three-dimensional assessment indicators such as average brightness, contrast, and highlight ratio.
5. The intelligent detection method for driver drunk driving and fatigue state according to claim 4, characterized in that, In step S212, the three-dimensional evaluation indicators of average brightness, contrast, and highlight ratio are calculated, specifically including the following steps: S2121: Average brightness reflects the overall brightness of the image, and its expression is as follows: In the formula, Coordinates of the enhanced grayscale image after CLAHE The grayscale value; W and H are the length and width dimensions of the image, with values ranging from 0 to 255; S2122: Contrast ratio reflects the magnitude of the difference between brightness and darkness, and its expression is as follows: S2123: Highlight ratio reflects the scale of overexposed areas, and its expression is as follows: In the formula, This represents the number of pixels with a grayscale value exceeding 220, ranging from 0 to 1. S2124: Based on the above three-dimensional evaluation indicators, the lighting environment is divided into four types: low light environment, strong light environment, backlight environment and normal light environment.
6. The intelligent detection method for driver drunk driving and fatigue state according to claim 2, characterized in that, In step S22, four core feature categories are accurately extracted: eye, mouth, head posture, and alcohol consumption association. Specifically, this includes the following steps: S221: Eye Feature Extraction: Calculate the EAR values for the left and right eyes respectively, and take the average of the two as the final EAR result; set up a historical EAR queue of length L to realize failure compensation. When the key point detection of a single eye fails, the data of the other eye is used. When both eyes fail, the historical average of the queue is called to ensure feature continuity. S222: Oral cavity feature extraction: Based on the key point index of the mouth, the mouth aspect ratio (MAR) is obtained by calculating the ratio of the vertical to horizontal distance of the mouth, and the yawning state is determined. S223: Head pose feature extraction: Construct a 3D reference model through key head feature points, solve the PnP equation with camera intrinsic parameters to obtain the head pitch angle, and identify abnormal head-down / head-up postures. S224: Drinking-related feature extraction: Calculate two types of features based on the corresponding ROI region: the proportion of skin color Cr channel and the pupil / iris area ratio.
7. The intelligent detection method for driver drunk driving and fatigue state according to claim 2, characterized in that, In step S23, a multi-dimensional weighted judgment model is constructed to classify fatigue state and identify alcohol consumption state. The judgment threshold is dynamically adjusted based on the driver's real-time state to ensure the accuracy and adaptability of the detection results. Specifically, this includes the following: S231: It adopts a composite judgment mechanism of basic weighted scoring and continuous fatigue penalty, combined with three core features of eye, mouth and head posture, to quantify the abstract degree of fatigue into a fatigue score of 10-100 points, and achieve a precise four-level classification of awake, mild fatigue, moderate fatigue and severe fatigue. S232: The alcohol consumption status determination module constructs a three-dimensional weighted confidence model based on feature statistics within a time window, including fatigue frequency, skin color features, and pupil features. When the confidence level is ≥0.6, the user is determined to be in an alcohol consumption state. S233: Based on the driver's real-time status of drinking, fatigue accumulation, and no sustained fatigue, the judgment thresholds of EAR, MAR, PERCLOS, and head posture angle are adaptively adjusted so that the detection model can adapt to the physiological characteristics and real-time status changes of different drivers.
8. The intelligent detection method for driver drunk driving and fatigue state according to claim 7, characterized in that, Step S231 specifically includes the following steps: S2311: Core Judgment Indicators and Weight Allocation: Eye fatigue index: The eye aspect ratio (EAR) is the core. When the average eye aspect ratio (EAR) is lower than the current dynamic threshold, it is judged as eye fatigue, which reflects the fatigue characteristics of the driver's eye muscles relaxation and increased frequency of closing the eyes. Yawning indicator: Based on the mouth aspect ratio (MAR), when the mouth aspect ratio (MAR) is higher than the current dynamic threshold, it is judged as yawning behavior, which reflects the driver's abnormal breathing rhythm and fatigue. Abnormal head posture index: Based on the head pitch angle and yaw angle, when the absolute value of the angle exceeds the current dynamic threshold, it is judged as an abnormal head posture, reflecting the driver's lack of concentration and fatigue state of reduced body control ability. S2312: Scoring Calculation Formula: i. Basic weighted scoring formula: In the formula, The eye fatigue score is calculated as follows: ,when hour, ; To score points for yawning, the calculation method is as follows: ,when hour, ; Scoring for abnormal head postures, calculated as follows: ,in The absolute value of the head pitch angle or yaw angle, when hour, The highest score shall not exceed 30 points; ii. Formula for continuous fatigue penalty: in, The continuous fatigue frame count is the number of consecutive frames in which eye fatigue, yawning, or abnormal head posture are detected. A penalty of 0.5 points is added for each frame to enhance the sensitivity to continuous fatigue. iii. Final fatigue fraction formula: The formula sets 10 points for being fully awake and 100 points for being extremely fatigued to avoid distorted judgments caused by score overflow. S2313: Fatigue Level Classification Standard: Based on fatigue scores and risk assessments of actual driving scenarios, four levels of fatigue level classification thresholds are set. All thresholds are optimized through extensive driving test data to ensure the scientific validity and practicality of the classification. Awake: Fatigue score <30, driver's eye condition is normal, no yawning, head posture is stable, and attention is focused; Mild fatigue: 30 points ≤ fatigue score < 50 points. Drivers experience mild eye fatigue or occasional yawning, and their head posture may occasionally be abnormal. Be alert to the accumulation of fatigue. Moderate fatigue: 50 points ≤ fatigue score < 80 points, the driver has persistent eye fatigue, increased yawning frequency, and frequent abnormal head posture, and needs to stop and rest as soon as possible; Severe fatigue: Fatigue score ≥ 80 points, driver has severe eye fatigue, frequent and prolonged yawning, and severely abnormal head posture, posing an extremely high driving risk, and must stop immediately; S2314: Continuous fatigue frame update rule: When any feature such as eye fatigue, yawning, or abnormal head posture is detected, the continuous fatigue frame count is incremented by 1; when all features are normal, the continuous fatigue frame count is decremented frame by frame to ensure that the penalty mechanism can respond to changes in fatigue status in real time.
9. The intelligent detection method for driver drunk driving and fatigue state according to claim 7, characterized in that, Step S233 specifically includes the following steps: S2331: Threshold adjustment parameter definition: Initial thresholds: EAR_INIT=0.2, MAR_INIT=0.5, PERCLOS_INIT=0.2, HEAD_ANGLE_THRESH_INIT=15°, which are the standard thresholds for judging a conscious state; Adjustment parameters: Reduce the percentage by 10% for first-time alcohol consumption, reduce the percentage by 3% for cumulative fatigue, and reduce the percentage by 10% for no fatigue recovery. Lower threshold: 70% of the initial threshold, to avoid false judgments due to an excessively low threshold; S2332: Threshold Adjustment Rules and Formulas: i. Initial downgrade triggered by alcohol consumption: When the confidence level for alcohol consumption is ≥0.6, if the current threshold is still the initial threshold, the first downward adjustment is triggered, and the adjustment formula is as follows: This adjustment aims to adapt to changes in the physiological state of drivers after drinking alcohol and improve the sensitivity of fatigue detection; ii. Fatigue accumulation triggers a second downward adjustment: If the drinking state continues and the cumulative number of moderate fatigue events is greater than 0, and the current threshold is higher than 70% of the initial threshold, a secondary fine-tuning is triggered, and the adjustment formula is as follows: Each time fatigue accumulation triggers an adjustment, the number of moderate fatigue counts is reset to 0 to avoid excessively lowering the threshold; iii. Threshold recovery triggered by no fatigue state: When the driver is in a "conscious" state and has ≥30 consecutive fatigue-free frames, if the current threshold is lower than the initial threshold, the threshold will be gradually restored, and the adjustment formula is as follows: This rule ensures that once the driver's condition recovers, the threshold returns to the standard level, maintaining the accuracy of the detection; S2333: Threshold adjustment constraint: During all threshold adjustments, the following must be met: To avoid frequent misjudgments due to excessively low thresholds; at the same time, the threshold should not be lowered than the initial threshold when it is restored to ensure the consistency of the detection standards. S2334: Module collaborative working mechanism: When alcohol consumption or fatigue accumulation is detected, the threshold is lowered; when a persistent sober state is detected, the threshold is restored, forming a closed-loop workflow of detection-judgment-adjustment-re-detection.
10. An intelligent detection system for driver drunk driving and fatigue, characterized in that, include: The alcohol detection and processing module is configured to collect the driver's alcohol concentration by an alcohol collection sensor when the driver sits down and starts the vehicle, compare the obtained alcohol concentration with a threshold alcohol concentration, and forcibly disconnect the vehicle's ignition circuit if the alcohol concentration exceeds the standard; if the detected alcohol concentration does not reach the calibrated value, the vehicle can be started normally. The fatigue detection and processing module is configured to acquire images of the driver's facial features and behavioral state through a camera, identify the driver's drinking status and assess fatigue level based on facial features and behavioral state, and prompt the driver with voice prompts if the driver is determined to be driving while fatigued. The system continues to repeatedly detect the driver's facial features and head posture until it is determined that the driver is no longer in a state of fatigue.