A method for classifying driver fatigue levels based on decision trees
By collecting driver's facial expressions and car status information, building a B-spline curve for interpolation and measurement unification, combined with rule base matching, the problem of long calculation time in the existing technology is solved, and the rapid and accurate assessment of driver fatigue level is achieved.
Patent Information
- Application Number
- CN202111213233.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-10-19
AI Technical Summary
The prior art has a long calculation time in driver fatigue detection, making it difficult to quickly and accurately evaluate the driver's fatigue level.
By collecting driver's facial expressions, voices and car status information, 11 3-order B-spline curves are constructed, interpolation fitting and measurement unification are performed, and rule base matching is combined to reduce the number of judgments in decision tree classification and quickly output fatigue levels.
It realizes rapid and accurate assessment of driver fatigue levels, reduces the calculation time of decision tree classification, and improves decision speed and accuracy.
Smart Images

Figure CN113963403B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image and sensor data acquisition and processing, and relates to the technology of driver fatigue data detection and classification. Specifically, it relates to a method for classifying driver fatigue levels based on a decision tree. Background Art
[0002] With the development of social economy, the number of motor vehicles is increasing day by day. Fatigue driving has always been one of the important factors affecting driving safety. According to the statistics of China's transportation department, traffic accidents caused by fatigue driving account for about 20% of the total traffic accidents, 40% of the major traffic accidents, and 83% of the traffic fatalities. Among them, the proportion of accidents caused by driver fatigue driving is as high as 73%. At present, the main method for detecting driving behavior is to detect some specific indicators of the driver's physiology and psychology during driving. When a large amount of physiological data is involved, a decision tree method is used to comprehensively evaluate the driver's fatigue level. However, this method has the problems of long operation time and difficult control, and the processing results are not ideal. Summary of the Invention
[0003] To solve the above problems, the present invention discloses a method for classifying driver fatigue levels based on a decision tree, which is simple in calculation and high in flexibility.
[0004] To achieve the above object, the technical solution of the present invention is as follows:
[0005] A method for classifying driver fatigue levels based on a decision tree, comprising the following steps:
[0006] Step 1, data acquisition: Collect the facial expressions, voices, and vehicle driving state information of the driver during driving. After obtaining a total of 11 attribute information, upload them;
[0007] Step 2, interpolation fitting: Obtain the fatigue level thresholds of each attribute, and construct 11 third-order B-spline curves;
[0008] Step 3, metric unification: Map the 11 fitting functions to the function y = x. When new data is received, unify the measurement of the data to achieve the metric unification of the fatigue levels of different attributes;
[0009] Step 4, rule base matching: According to the special rule base set by the user, count the fatigue levels in the case of special situation combinations, and then count the fatigue levels under the non-special rule base; when counting the fatigue levels under the non-special rule base, adopt the method of taking the average value of the corresponding maximum attributes. After sorting the 11 unified measurement data from large to small, combine them to obtain each fatigue level combination containing different numbers of driving attributes;
[0010] Step 5, Fatigue level feedback: comprehensively evaluate the driver's fatigue state based on these 11 attributes, and return the maximum fatigue level that matches the special and non-special rule bases as the final fatigue level output.
[0011] Furthermore, step 1 includes the following sub-steps:
[0012] Step 1-1, Data collection and upload: obtain the driver's facial information during driving through a camera, and extract the basic facial information normal, call attribute information talk_phone, talk to passenger attribute talk_passenger, play with phone attribute use_phone, and drowsiness attribute information drowsiness; obtain the driver's voice information during driving through a voice collection device, and extract the basic voice information normal and emotional attribute information of the language; obtain the driving state of the vehicle through a positioning device, including sharp turn information sharp_turn, abrupt brake information abrupt_brake, vehicle speed information speeding, and abnormal driving operation information abnormal. Each attribute information is of numerical type, ranging from 0 to 1, and is transmitted to the processing layer in tcp mode.
[0013] Step 1-2, Data preprocessing: after the processing layer receives the data, preprocess the data: remove outliers and fill in missing values; after the preprocessing is completed, summarize the data to obtain a set of score value data.
[0014] Furthermore, when filling in the missing values, take the average of the corresponding attribute values in the previous set of data and the next set of data.
[0015] Furthermore, step 3 includes the following sub-steps:
[0016] Step 3-1, Scale the 11 attributes so that the fatigue state thresholds of the scaled attributes are in the same metric range;
[0017] Step 3-2, Map the 11 fitting functions to the function y = x to achieve the unification of the measurement of fatigue levels of different attributes;
[0018] Step 3-3, After obtaining a set of data collected in step 1, obtain the corresponding fatigue level level according to the 11 functions.
[0019] Furthermore, among the 11 attributes, the fatigue state threshold vector of talk_phone is The fatigue level before scaling is as follows:
[0020]
[0021] After scaling, the fatigue state threshold becomes The fatigue level is as follows:
[0022]
[0023] The scaling principle for the other 10 attributes is the same as that of talk_phone.
[0024] Furthermore, step 4 specifically includes the following sub-steps:
[0025] Step 4-1: Count the fatigue levels in the special rule library and determine whether there is any content in the uniformly measured data that conforms to the special rule library set by the user; if so, evaluate the corresponding fatigue level according to the rule content.
[0026] Step 4-2: Count the fatigue levels under non-special rules. For each combination of fatigue levels of each quantity, take the first few of the 11 data for calculation, divide the sum of the fatigue levels of each attribute in the combination by the number of attributes, obtain the fatigue level combinations including 1 driving attribute to 11 driving attributes, and a total of 11 cases of fatigue levels, and obtain the fatigue levels corresponding to the threshold judgments of the 11 cases in the database, resulting in 11 cases of fatigue levels.
[0027] Furthermore, the final fatigue level output includes 4 levels.
[0028] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0029] The technical solution provided by the present invention can quickly and accurately output the fatigue level of the driver, and reduces the number of judgments in decision tree classification by means of interpolation fitting and unified measurement, featuring fast decision-making speed and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the overall process of the driver fatigue level classification method based on decision tree provided by the present invention.
[0031] Figure 2 It is a schematic diagram of the interpolation fitting curve in the embodiment of the present invention.
[0032] Figure 3 It is a detailed flowchart of the driver fatigue level classification method based on decision tree provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] The present invention will be further clarified below in conjunction with the drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and not to limit the scope of the present invention.
[0034] The present invention provides a driver fatigue level classification method based on a decision tree, and its overall process is as follows: Figure 1 The detailed process is as shown in Figure 3 As shown, the specific steps include:
[0035] Step 1: Data collection and upload, collect the driver's facial expressions, voice and vehicle driving status information during driving. Each type of status information has corresponding detailed driving attribute information (including the data transmission time and the key score of the corresponding attribute), a total of 11, which are transmitted to the background through TCP and processed; including the following specific steps:
[0036] Step 1-1, data collection and upload, obtain the driver's facial information during driving through the camera, extract normal (basic facial information), talk_phone (making a phone call), talk_passenger (talking to passengers), use_phone (playing with mobile phones), drowsiness (drowsiness) attribute information; obtain the driver's voice information during driving through the sound collection device, extract normal (basic voice information) and emotional (emotional language) attribute information; obtain the car's driving status through the positioning device, including sharp_turn (sharp turn), abrupt_brake (sudden brake), speeding (vehicle speed), abnormal (abnormal driving operation). These key scores are numerical types, ranging from 0 to 1, and are transmitted to the processing layer via TCP;
[0037] Step 1-2, data preprocessing. After the processing layer receives the data, it preprocesses the data: removes outliers and fills in missing values (for example, takes the average of the corresponding attribute values in the previous set of data and the next set of data); after the preprocessing is completed, the data is summarized to obtain a set of score data.
[0038] Step 2, interpolation and fitting: Obtain 11 fatigue level thresholds manually set for each attribute, and construct 11 third-order B-spline curves through interpolation and fitting. In this example, the fatigue level thresholds set for each attribute are pre-set by the user and stored in the database. When data needs to be predicted, the thresholds of each attribute in the database and the thresholds in 11 cases are obtained, and the interp1d function of the interpolate module in Python is used to implement the interpolation and fitting of the third-order B-spline curve, obtaining 11 functions. There are 22 thresholds set in this example. In addition to the 11 thresholds for interpolation and fitting corresponding to 11 attributes (each threshold contains a set of thresholds for this attribute, and in this embodiment, a set of thresholds is 3), there are also 11 thresholds for counting the fatigue level under the non-special rule library. In this example, the user's setting of the thresholds is before all steps. It should be noted that there is no obvious sequence between Step 1 and Step 2, and their order can be reversed arbitrarily. It is also possible to perform interpolation and fitting first and then collect data, or perform them simultaneously.
[0039] Step 3, metric unification: Map the 11 fitted functions onto the function y = x. When new data is received, the data is uniformly measured to achieve the metric unification of the fatigue levels of different attributes and reduce the amount of computation. The specific process includes the following sub-steps:
[0040] Step 3-1, scale the 11 attributes so that the fatigue state thresholds of the scaled attributes are in the same metric: As Figure 2 In a specific example, assume that the fatigue state threshold vector of talk_phone is The fatigue level of talk_phone is as shown in Equation (3), where the range of the fatigue state score is between 0 and 1.
[0041]
[0042] Among them, G represents Green (green safety), Y represents Yellow (yellow reminder), R represents Red (red alarm), and RR represents exceeding the upper limit, severe alarm.
[0043] After scaling, the fatigue state threshold becomes The fatigue level is as shown in Equation (4).
[0044]
[0045] Step 3-2, perform scaling processing on the other 10 attributes and unify them to Under the metric.
[0046] Step 3-3, let G = 0.25, Y = 0.5, R = 0.75, the threshold of score is equal to that of level (grade). Map the 11 fitting functions onto the function y = x to unify the measurement of fatigue grades with different attributes.
[0047] Step 3-4, after obtaining a set of data collected in Step 1, according to the 11 functions, obtain the corresponding fatigue grade level.
[0048] Step 4, rule base matching. According to the special rule base set by the user, count the fatigue grades in special case combinations, and then count the fatigue grades in non-special rule bases; specifically, it includes the following sub-steps:
[0049] Step 4-1, count the fatigue grades of the special rule base, and determine whether the data after unified measurement conforms to the content of the special rule base set by the user. If so, according to the rule content, evaluate and obtain the fatigue grade corresponding to the rule. The special rule refers to when different driving attributes are combined, due to the existence of correlation, the corresponding fatigue grade combination value is the weighted average sum of the driving attributes, and the corresponding weights and fatigue grade thresholds are set by the user in the database. The fatigue grade under non-special rules is the average value of the driving attributes.
[0050] Step 4-2, count the fatigue grades under non-special rules. In this way, it is assumed that the data is independent and has no association with special rules. By taking the mean of the corresponding maximum attributes, after sorting the 11 unified measurement data from largest to smallest, then combining them, fatigue grade combinations containing only one driving attribute, fatigue grade combinations containing two driving attributes... fatigue grade combinations containing 11 driving attributes are obtained (the fatigue grade combination value of k driving attributes is equal to the average of the first k data after sorting), and a total of 11 cases of fatigue grades are obtained (1 attribute combination, 2 attribute combinations... 11 attribute combinations). Compare with the 11 cases of non-special rule judgment thresholds set manually in the database to determine the corresponding fatigue grades, and obtain the fatigue grades in 11 cases. Strictly speaking, different fatigue grades will be obtained for different combinations of different numbers of attributes. The total number of existing cases is The final result takes the maximum value of the fatigue grades in all cases. However, due to the use of the unified measurement method, the differences of the 11 attributes are eliminated, and because the data is sorted from largest to smallest, the total number of cases that need to be concerned is reduced to only 11 comparisons, reducing the time consumption.
[0051] Step 5, fatigue level feedback. The system comprehensively evaluates the driver's fatigue state based on these 11 attributes, and returns the maximum fatigue level that matches the special and non-special rule bases as the final fatigue level output of the system. In this example, the severity can be divided into 4 levels, from low to high as G (representing Green), Y (representing Yellow), R (representing Red), RR, and the maximum fatigue level under all attribute combinations is output.
[0052] When new data is received, execute Step 3 and repeat in a loop.
[0053] It should be noted that the above content only illustrates the technical idea of the present invention and cannot limit the protection scope of the present invention. For those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements all fall within the protection scope of the claims of the present invention.
Claims
1. A method for classifying driver fatigue levels based on decision trees, characterized in that, The following steps are involved: Step 1: Data collection: collect the driver's facial expressions, voice and vehicle driving status information during driving, and upload a total of 11 attribute information; Step 2: interpolation fitting, obtaining the fatigue level threshold of each attribute and constructing 11 3rd order B-spline curves; Step 3, measurement unification, mapping the 11 fitting functions to the function of y=x, and when new data is received, the data is measured uniformly to achieve measurement unification of fatigue levels of different attributes; including the following sub-steps: Step 3-1, scale the 11 attributes so that the fatigue state thresholds of the scaled attributes are on the same metric ; among the 11 attributes, the fatigue state threshold vector of talk_phone is The fatigue level before scaling is as follows: After scaling, the fatigue state threshold becomes The fatigue level is given by the following formula: The scaling principles of the other 10 attributes are the same as talk_phone; Step 3-2, mapping the 11 fitting functions to the function of y=x to achieve the unified measurement of fatigue levels of different attributes; Step 3-3, after obtaining a set of data collected in step 1, obtain the corresponding fatigue level according to 11 functions; Step 4, rule base matching, according to the special rule base set by the user, the fatigue level under the special situation combination is counted, and then the fatigue level under the non-special rule base is counted; when counting the fatigue level under the non-special rule base, the average of the corresponding maximum attribute is taken, and the 11 data after unified measurement are sorted from large to small, and then combined to obtain various fatigue level combinations containing different numbers of driving attributes; Step 5, fatigue level feedback, comprehensively evaluates the driver's fatigue status based on these 11 attributes, and returns the maximum fatigue level matched by the special and non-special rule bases as the final fatigue level output.
2. The method for classifying driver fatigue levels based on a decision tree according to claim 1, wherein The step 1 includes the following sub-steps: Step 1-1, data collection and upload, obtain the driver's facial information during driving through the camera, extract the basic facial information normal, the attribute information talk_phone for making a phone call, the attribute talk_passenger for talking to a passenger, the attribute use_phone for playing with a mobile phone, and the attribute information drowsiness; obtain the driver's voice information during driving through the sound collection device, extract the basic voice information normal, and the emotional attribute information emotional of the language; obtain the driving status of the car through the positioning device, including the sharp turn information sharp_turn, the emergency brake information abrupt_brake, the speed information speeding, and the abnormal driving operation information abnormal. Each attribute information is a numerical type, ranging from 0 to 1, and is transmitted to the processing layer in TCP mode; Step 1-2, data preprocessing. After receiving the data, the processing layer preprocesses the data: remove outliers and fill in missing values; After the preprocessing is completed, the data is summarized to obtain a set of score data.
3. The method for classifying driver fatigue levels based on a decision tree according to claim 2, characterized in that, When filling in missing values, take the average value of the corresponding attribute in the previous set of data and the next set of data.
4. The method for classifying driver fatigue levels based on a decision tree according to claim 1, characterized in that The step 4 specifically includes the following sub-steps: Step 4-1: Count the fatigue levels in the special rule library, and determine whether there is any content in the uniformly measured data that conforms to the special rule library set by the user; if so, evaluate the fatigue level corresponding to the rule according to the rule content. Step 4-2: Count the fatigue levels under non-special rules. For each combination of fatigue levels of each quantity, take several of the top-ranked data among 11 data for calculation. Divide the sum of the fatigue levels of each attribute in the combination by the number of attributes to obtain fatigue level combinations including 1 driving attribute to 11 driving attributes, and a total of 11 fatigue levels in 11 cases. Compare with the fatigue levels corresponding to the thresholds of 11 cases in the database to obtain the fatigue levels in 11 cases.
5. The method for classifying driver fatigue levels based on a decision tree according to claim 1, characterized in that, The final fatigue level output includes 4 levels.
Citation Information
Patent Citations
Early-warning method and system for preventing fatigue driving
CN106080194A
Driver fatigue state detecting and reminding method based on multi-source data
CN110728824A