Blink category determination method and device
By sliding the window on a vertical ophthalmic signal of a conductor and obtaining the center of blinking centers using the K-Means algorithm, combining the correlation coefficient and specific angle angles for correction, the problem of inability to distinguish short blinks and long blinks in the prior art is solved, and the accurate judgment of the dozing state is achieved.
Patent Information
- Application Number
- CN202410525171.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-04-29
AI Technical Summary
The prior art cannot effectively distinguish short blinks from long blinks from blink signals, resulting in inaccurate judgment of the sleepy state.
A sliding window with preset time and step length is used to slide on a guide vertical ophthalmic signal sample to obtain sample data of different windows, and short blink, long blink and non-blink centroids are obtained using the K-Means algorithm. By calculating the correlation coefficient between real-time ophthalmic window data and different centroids, the initial category label is obtained and corrected by the minimum blink peak and the average angle of inclusion to distinguish short blinks and long blinks.
Accurate detection of blink types is achieved, and the accuracy of judgment of blink categories is improved, making dozing detection based on blink categories more stable and accurate.
Smart Images

Figure CN118427711B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the interdisciplinary field of biomedical engineering and machine learning, and in particular to a blink category determination method and device. Background Art
[0002] Fatigue driving is a serious safety hazard in road traffic. It may cause the driver's functional decline, thereby increasing the risk of traffic accidents. Nearly 80% of crashes and 65% of near crashes are related to the driver's lack of concentration. Drivers often ignore the early signs of fatigue, which leads to the continuous accumulation of sleep pressure, which easily induces drowsiness. Studies have shown that the early signs of fatigue are mainly manifested as a significant increase in the length of blinking, which later develops into short-term drowsiness. Especially in the absence of external stimulation and a monotonous driving environment, drivers are more likely to fall into a drowsy state. In order to prevent serious traffic accidents that may be caused by fatigue driving, it is necessary to accurately detect the drowsy state and provide timely warnings.
[0003] Physiological signals are widely believed to reveal the physiological mechanisms of driver drowsiness. Among them, blink duration is considered to be an important physiological indicator. Blink duration can indicate the early fatigue level of the driver. Studies have shown that in the case of fatigue or long-term driving, the driver's blinking frequency usually increases, the blinking pattern may also change, the duration of long blinks may increase, and the duration of short blinks may decrease. These changes in blink characteristics can be used by the blink classification detection system as an indicator for real-time monitoring of fatigue driving, providing timely fatigue warnings for drivers. In addition, electrooculographic signals are easier to apply in practical environments because they are easy to collect and have a high signal-to-noise ratio.
[0004] Although the methods of eye blink classification in the early sleep field provide a basis for understanding the sleepy state, there are some limitations. Nolan et al. proposed a threshold-based method, which uses a threshold of ±3 for the Z-score of five features including channel, epoch, independent component, single channel single epoch and aggregated data (i.e., across subjects) to detect eye blinks; however, the threshold-based method is highly sensitive to the selected features and preset thresholds, resulting in poor detection of eye blink signals. Chang et al. proposed the multi-window summation of window derivatives (MSDW), in which eye blinks are modeled as triangular pulses, sliding windows of different sizes are used to fit different wave widths, and the sum of first-order derivatives is calculated to find the duration of eye blinks; however, the method based on the eye blink waveform fails to fully consider the complexity of the eye blink signal and cannot accurately identify the eye blink signal. The method of using Dynamic Time Warping (DWT) combined with blind source separation (BSS) can be used to detect blink artifacts in signals. The signal is decomposed into wavelet coefficients of different scales and frequencies through DWT, and the BSS technology is used to extract the blink artifact components from the wavelet coefficients. The blink artifacts are detected by analyzing the time-frequency characteristics of these components. However, the method of combining discrete wavelet transform with blind source separation is highly complex, requires parameter adjustment, and is highly dependent on signal characteristics.
[0005] In summary, most of the existing methods for detecting electrooculogram signals are based on direct thresholds, have strict restrictions on blink waveforms, or require empirical adjustment of parameters; and the existing technology can only distinguish between blinks and non-blinks, and cannot effectively distinguish short blinks from long blinks from blink signals, which may have significant differences in the physiological mechanisms and behavioral manifestations of the sleepy state. The lack of distinction between short blinks and long blinks may limit the in-depth understanding of the sleepy state. Therefore, the existing blink classification methods have advantages in simplicity and feasibility, but are insufficient in the accuracy of judging blink types and the ability to distinguish them. Summary of the invention
[0006] Therefore, the technical problem to be solved by the present invention is to overcome the problem in the prior art that short blinks and long blinks cannot be effectively distinguished from blink signals, thereby causing inaccurate judgment of the sleepy state.
[0007] In order to solve the above technical problems, the present invention provides a method for determining the type of blinking, comprising:
[0008] A sliding window with preset time and step length is used to slide on a vertical electrooculogram signal sample to obtain different window sample data; according to the blink duration corresponding to each window sample data, all window sample data are divided into a short blink sample data set, a long blink sample data set and a non-blink sample data set;
[0009] Using the K-Means algorithm, a short blink centroid is obtained in the short blink sample data set, a long blink centroid is obtained in the long blink sample data set, and multiple non-blink centroids are obtained in the non-blink sample data set;
[0010] Obtain the maximum peak values of all window sample data in the short blink sample data set and the long blink sample data set respectively, and take the minimum value of all maximum peak values as the minimum blink peak value;
[0011] Respectively obtain the specific angles of all window sample data in the short blink sample data set and the long blink sample data set, and calculate the average of the maximum specific angle in the short blink sample data set and the minimum specific angle in the long blink sample data set as the average angle;
[0012] Use a sliding window with preset time and step length to slide on a vertical electrooculogram signal collected in real time to obtain real-time electrooculogram window data;
[0013] Calculate the correlation coefficients between the real-time electrooculogram window data and the short blink centroid, the long blink centroid and multiple non-blink centroids respectively, and obtain the category of the sample data set to which the centroid corresponding to the maximum correlation coefficient belongs, as the initial category label of the real-time electrooculogram window data; the initial category label of the real-time electrooculogram window data is any one of long blink, short blink and non-blink;
[0014] For each real-time electrooculogram window data with an initial category label of long blink or short blink, the maximum peak value of the real-time electrooculogram window data is calculated and compared with the minimum blink peak value:
[0015] If the maximum peak value of the real-time electrooculogram window data is less than the minimum blink peak value, then the actual category label of the real-time electrooculogram window data is determined to be non-blink;
[0016] If the maximum peak value of the real-time electrooculogram window data is not less than the minimum blink peak value, the actual category label of the real-time electrooculogram window data is determined to be a short blink or a long blink; the real-time specific angle of the real-time electrooculogram window data is calculated and compared with the average angle: if the real-time specific angle is greater than the average angle, the actual category label of the real-time electrooculogram window data is determined to be a long blink; otherwise, the actual category label of the real-time electrooculogram window data is determined to be a short blink.
[0017] Preferably, after obtaining the actual category label of the real-time electrooculogram window data, the method further includes: obtaining the maximum peak point, the pre-peak stable point and the post-peak stable point of the real-time electrooculogram window data whose actual category label is a long blink or a short blink, and calculating the blink duration of the real-time electrooculogram window data, which includes:
[0018] Get the maximum peak point (x) corresponding to the maximum peak in the data point sequence set {1,2,…,p,…,N} of the real-time electrooculogram window data p ,y p ); p represents the pth data point in the data point sequence set, and there are N data points in the data point sequence set;
[0019] Starting from the maximum peak point, obtain the left sampling point sequence set {p-β, p-2β, …, p-kβ} in the left data point sequence set {p, …, 2, 1} with a preset moving step length β, and calculate the left slope of each left sampling point based on the two-dimensional coordinates of the current left sampling point and the two-dimensional coordinates of the data points at a preset number n to the left of the current left sampling point; β<n, n<p-kβ<2n; β and k are both non-negative integers;
[0020] Obtain the left sampling point sequence number l corresponding to the left slope with the largest absolute value, obtain the left sampling point corresponding to the left slope with the smallest absolute value among all the left sampling points with sequence numbers less than ln, as the first left stable point; take the nth data point to the left of the first left stable point as the second left stable point; round down the average of the sequence numbers of the first left stable point and the second left stable point, and take the data point represented by the sequence number corresponding to the rounded-down result as the pre-peak stable point;
[0021] Starting from the maximum peak point, obtain the right sampling point sequence set {p+β, p+2β, …, p+kβ} in the right data point sequence set {p, p+1, …, N} with a preset moving step length β, and calculate the right slope of each right sampling point based on the two-dimensional coordinates of the current right sampling point and the two-dimensional coordinates of the data points n to the right of the current right sampling point; N-2n<p+kβ<Nn;
[0022] Get the right sampling point sequence number r corresponding to the right slope with the largest absolute value, get the right sampling point corresponding to the right slope with the smallest absolute value among all the right sampling points with sequence numbers greater than r+n, as the first right stable point; take the nth data point to the right of the first right stable point as the second right stable point; round down the average of the sequence numbers of the first right stable point and the second right stable point, and take the data point represented by the sequence number corresponding to the rounded-down result as the post-peak stable point;
[0023] The duration between the stable point before the peak and the stable point after the peak is calculated as the blink duration of the real-time electrooculogram window data.
[0024] Preferably, calculating the left slope of each left sampling point includes:
[0025] Left Slope It is expressed as:
[0026] Where b is a non-negative integer, (x a ,y a ) represents the two-dimensional coordinates of the left sampling point, (x a-n ,y a-n ) represents the two-dimensional coordinates of the preset number of data points to the left of the left sampling point, n represents the preset number; a represents the maximum peak point (x p ,y p ) is the total step length of moving to the left. Let the preset moving step length be β, then the value range of a is a=p-βk,βk≤l left ,n<p-kβ<2n,l left Indicates the total number of data points to the left of the maximum peak point.
[0027] Preferably, calculating the right side slope of each right side sampling point includes:
[0028] Right slope It is expressed as:
[0029] Where b is a non-negative integer, (x' a , y' a ) represents the two-dimensional coordinates of the right sampling point, (x' a+n , y' a+n ) represents the two-dimensional coordinates of the preset number of data points on the right side of the right sampling point, n represents the preset number; a represents the maximum peak point (x p ,y p ) is the total step length of moving to the right. Let the preset moving step length be β, then the value range of a is a=p+βk,βk≤l right , N-2n<p+kβ<Nn, N represents the length of the sliding window, l right Indicates the total number of data points to the right of the maximum peak point.
[0030] Preferably, the method of dividing all window sample data into a short blink sample data set, a long blink sample data set and a non-blink sample data set according to the blink duration corresponding to each window sample data, includes:
[0031] The window sample data with a blink duration of 0.3 seconds to 0.6 seconds is regarded as short blink samples and divided into the short blink sample data set A1;
[0032] The window sample data with blink duration between 0.6 seconds and 1.2 seconds are regarded as long blink samples and divided into the long blink sample data set A2;
[0033] The remaining window sample data are divided into the non-blink sample data set A3 as non-blink samples;
[0034] For the short blink sample data set, the long blink sample data set and the non-blink sample data set, the short blink waveform and the long blink waveform are centered in the window sample data respectively, and all the window sample data are downsampled to obtain the short blink sample data set, the long blink sample data set and the non-blink sample data set.
[0035] Preferably, the step of respectively obtaining the maximum peak values of all window sample data in the short blink sample data set and the long blink sample data set, and taking the minimum value of all maximum peak values as the minimum blink peak value, comprises:
[0036] Get the maximum peak value V of each short blink sample data in the short blink sample data set A1 pi , expressed as:
[0037] V pi ,i=1,2,…,l1, i represents the i-th short blink sample data in the short blink sample data set A1, l1 represents the length of the short blink sample data set A1;
[0038] Get the maximum peak value V of each long blink sample data in the long blink sample data set A2 pj , expressed as:
[0039] V pj ,j=1,2,…,l2,j represents the jth long blink sample data in the long blink sample data set A2, and l2 represents the length of the long blink sample data set A2;
[0040] Get the minimum value of the maximum peak value of all short blink sample data in the short blink sample data set A1 and the maximum peak value of all long blink sample data in the long blink sample data set A2 as the minimum blink peak value V pmin , expressed as: V pmin =min(V pi ,V pj ).
[0041] Preferably, the step of respectively obtaining specific angles of all window sample data in the short blink sample data set and the long blink sample data set, and calculating the average of the maximum specific angle in the short blink sample data set and the minimum specific angle in the long blink sample data set as the average angle includes:
[0042] For each short blink sample data in the short blink sample data set A1 and each long blink sample data in the long blink sample data set A2;
[0043] Obtain the maximum peak point of the sample data and the pre-peak data points and post-peak data points at a preset time interval before and after the maximum peak point; connect the maximum peak point with the pre-peak data points and post-peak data points respectively to obtain a first line segment L1 and a second line segment L2; and take the angle between the first line segment and the second line segment as a specific angle;
[0044] Based on the first line segment slope K1 and the second line segment slope K2, calculate the arc angle θ of the specific angle h , and converted into a specific angle θ;
[0045] Obtain the angle with the largest angle value among the specific angles of all short blink sample data in the short blink sample data set A1 as the maximum specific angle θ of the short blink waveform max , expressed as:
[0046] θ max =maxθ i ,i=1,2,…,l1;θ i represents the specific angle of the i-th short blink sample data in the short blink sample data set A1, and l1 represents the length of the short blink sample data set A1;
[0047] Obtain the angle with the smallest angle value among the specific angles of all long blink sample data in the long blink sample data set A2 as the minimum specific angle θ of the long blink waveform min , expressed as:
[0048] θ min =minθ j ,j=1,2,…,l2;θ j represents the specific angle of the j-th long blink sample data in the long blink sample data set A2, and l2 represents the length of the long blink sample data set A2;
[0049] Calculate the maximum specific angle θ of the short blink waveform max The minimum specific angle θ with the long blink waveform min The average value of , as the average angle, is expressed as:
[0050] Preferably, the arc angle θ of the specific angle is calculated based on the first line segment slope K1 and the second line segment slope K2. h , and converted to a specific angle θ, including:
[0051] The radian angle of the specific angle θ h , expressed as:
[0052] The radian angle θ h Converted to a specific angle θ, the conversion formula is:
[0053] Among them, arctan is the inverse tangent function, and the function value represents the radian value, and the value range is K1 represents the slope of the first line segment, K2 represents the slope of the second line segment; θ∈(0,360).
[0054] Preferably, the correlation coefficient between the real-time electrooculogram window data and the centroid is expressed as:
[0055]
[0056] Among them, cov(X,Y) represents the covariance of X and Y, σX and σY represent the standard deviations of X and Y respectively; X represents the real-time electrooculogram window data, and Y represents the centroid;
[0057] Let Y be the centroid of short blinks, the centroid of long blinks and multiple non-blinks respectively, and calculate the correlation coefficients between the real-time electrooculogram window data and the centroid of short blinks, the centroid of long blinks and multiple non-blinks respectively.
[0058] The embodiment of the present invention further provides a blink category determination device, comprising:
[0059] An electrooculogram signal acquisition device, used for acquiring a vertical electrooculogram signal;
[0060] A host computer is connected to the electrooculogram signal acquisition device for acquiring a vertical electrooculogram signal, executing the blink category determination method described above, and acquiring an actual category label of the real-time electrooculogram window data;
[0061] The display device is connected to the host computer for displaying the actual category label of the real-time electrooculogram window data.
[0062] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0063] The blink category judgment method described in the present invention is based on a single-channel vertical electrooculogram signal that is easy to collect and has a high signal-to-noise ratio to judge the blink category; K-Means clustering is used to automatically cluster sample data of the same mode into one category to obtain the centroids of short blinks, long blinks and non-blinks, and the initial category label of the real-time electrooculogram window data is obtained by calculating the correlation coefficient between the real-time electrooculogram window data and different centroids, thereby realizing unsupervised blink category judgment. After obtaining the initial category label of the real-time electrooculogram window data, the present invention constructs a minimum blink peak to judge the correctness of the initial category label and corrects the wrong label; and obtains the average angle, and uses the specific angle of the blink waveform to accurately distinguish short blinks from long blinks, thereby realizing accurate detection of blink types, improving the accuracy of blink category judgment, and making sleepiness detection based on blink categories more stable and accurate.
[0064] The present invention filters and calculates the slope of real-time electrooculogram window data with category labels of long blinks or short blinks, finds the pre-peak stable point and post-peak stable point of the real-time electrooculogram window data, and obtains the blink duration, so as to accurately detect the driver's drowsiness state according to the blink duration. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein
[0066] Figure 1 is a flowchart of the steps of the blink category determination method provided by the present invention;
[0067] Figure 2 is a schematic diagram of eye electrode signals provided by the present invention;
[0068] Figure 3 It is a schematic diagram of a process for making a preliminary judgment on test data using K-Means clustering and correlation provided by the present invention;
[0069] Figure 4 It is a schematic diagram of a process of removing misjudgment items by using blink peak value provided by the present invention;
[0070] Figure 5 It is a schematic diagram of a process of distinguishing long blinks from short blinks by using the average angle provided by the present invention;
[0071] Figure 6 It is a flow chart of obtaining blink duration by using stable points provided by the present invention. DETAILED DESCRIPTION
[0072] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0073] In the analysis and processing of bioelectric signals, digital signal processing methods and machine learning methods have been widely used. The increase in blink duration indicates an increase in fatigue, and short blinks and long blinks differ in waveform. It is observed that short blinks are more similar to Gaussian waveforms than long blinks, and long blinks are more similar to matrix waves than short blinks. For the blink waveform, this embodiment proposes a pattern matching algorithm for the electrooculogram signal waveform based on the K-Means clustering algorithm in machine learning. The extracted features are clustered using the K-Means clustering algorithm to obtain a centroid of the blink waveform and multiple centroids of the non-blink waveform. Through iterative calculation, the correlation coefficient is calculated, and the data samples are divided into categories represented by different centroids to determine whether there is a blink waveform, and the blink peak is used to remove the misjudged item label, and the specific angle of the blink waveform is used to accurately distinguish long blinks from short blinks, thereby realizing accurate detection of the blink type. In addition, by filtering and slope calculation of the window data sample whose category label is the blink feature, the stable point of the current window data sample is found to obtain the blink duration.
[0074] Reference Figure 1 As shown, the flowchart of the blink category determination method of the present invention includes the following steps:
[0075] S101: Slide a sliding window with preset time and step length on a vertical electrooculogram signal sample to obtain different window sample data; divide all window sample data into a short blink sample data set, a long blink sample data set and a non-blink sample data set according to the blink duration corresponding to each window sample data;
[0076] S102: using a K-Means algorithm, obtaining a short blink centroid in the short blink sample data set, obtaining a long blink centroid in the long blink sample data set, and obtaining multiple non-blink centroids in the non-blink sample data set;
[0077] S103: Obtain the maximum peak values of all window sample data in the short blink sample data set and the long blink sample data set respectively, and take the minimum value of all maximum peak values as the minimum blink peak value;
[0078] S104: obtaining specific angles of all window sample data in the short blink sample data set and the long blink sample data set respectively, and calculating an average value of the maximum specific angle in the short blink sample data set and the minimum specific angle in the long blink sample data set as the average angle;
[0079] S105: using a sliding window with preset time and step length to slide on a vertical electrooculogram signal collected in real time to obtain real-time electrooculogram window data;
[0080] S106: respectively calculating the correlation coefficients between the real-time electrooculogram window data and the short blink centroid, the long blink centroid and multiple non-blink centroids, obtaining the category of the sample data set to which the centroid corresponding to the maximum correlation coefficient belongs, as the initial category label of the real-time electrooculogram window data; the initial category label of the real-time electrooculogram window data is any one of long blink, short blink and non-blink;
[0081] S107: For each real-time electrooculogram window data with an initial category label of long blink or short blink, calculate the maximum peak value of the real-time electrooculogram window data and compare it with the minimum blink peak value:
[0082] S108: If the maximum peak value of the real-time electrooculogram window data is less than the minimum blink peak value, then
[0083] Determine that the actual category label of the real-time electrooculogram window data is non-blink;
[0084] S109: If the maximum peak value of the real-time electrooculogram window data is not less than the minimum blink peak value, the actual category label of the real-time electrooculogram window data is determined to be a short blink or a long blink; the real-time specific angle of the real-time electrooculogram window data is calculated and compared with the average angle: if the real-time specific angle is greater than the average angle, the actual category label of the real-time electrooculogram window data is determined to be a long blink; otherwise, the actual category label of the real-time electrooculogram window data is determined to be a short blink.
[0085] The blink category judgment method described in the present invention is based on a single-channel vertical electrooculogram signal that is easy to collect and has a high signal-to-noise ratio to judge the blink category; K-Means clustering is used to automatically cluster sample data of the same mode into one category to obtain the centroids of short blinks, long blinks and non-blinks, and the initial category label of the real-time electrooculogram window data is obtained by calculating the correlation coefficient between the real-time electrooculogram window data and different centroids, thereby realizing unsupervised blink category judgment. After obtaining the initial category label of the real-time electrooculogram window data, the present invention constructs a minimum blink peak to judge the correctness of the initial category label and corrects the wrong label; and obtains the average angle, and uses the specific angle of the blink waveform to accurately distinguish short blinks from long blinks, thereby realizing accurate detection of blink types, improving the accuracy of blink category judgment, and making sleepiness detection based on blink categories more stable and accurate.
[0086] Specifically, in step S101, the window sample data with a blink duration of 0.3 seconds to 0.6 seconds is divided into the short blink sample data set A1 as a short blink sample; the window sample data with a blink duration of 0.6 seconds to 1.2 seconds is divided into the long blink sample data set A2 as a long blink sample; the remaining window sample data is divided into the non-blink sample data set A3 as a non-blink sample; for the short blink sample data set, the long blink sample data set and the non-blink sample data set, the short blink waveform and the long blink waveform are centered in the window sample data respectively, and all the window sample data are downsampled to obtain the short blink sample data set, the long blink sample data set and the non-blink sample data set.
[0087] Specifically, in an embodiment of the present invention, after obtaining the initial category label of the real-time electrooculogram window data, for each real-time electrooculogram window data whose initial category label is a long blink or a short blink, the maximum peak value of the real-time electrooculogram window data is calculated and compared with the minimum blink peak value, specifically including:
[0088] ① If the maximum peak value of the real-time electrooculogram window data is less than the minimum blink peak value, the actual category label of the real-time electrooculogram window data is not equal to the initial category label, that is, the actual category label of the real-time electrooculogram window data is determined to be non-blink;
[0089] ② Similarly, if the maximum peak value of the real-time electrooculogram window data is not less than the minimum blink peak value, the actual category label of the real-time electrooculogram window data is equal to the initial category label, that is, the actual category label of the real-time electrooculogram window data is determined to be a long blink or a short blink;
[0090] For real-time electrooculogram window data whose actual category label is a long blink or a short blink, the real-time specific angle of the real-time electrooculogram window data is calculated and compared with the average angle: if the real-time specific angle is greater than the average angle, then the actual category label of the real-time electrooculogram window data is determined to be a long blink; otherwise, the actual category label of the real-time electrooculogram window data is determined to be a short blink.
[0091] Specifically, the acquisition of the minimum blink peak value includes:
[0092] Get the maximum peak value V of each short blink sample data in the short blink sample data set A1 pi , expressed as: V pi ,i=1,2,…,l1, i represents the i-th short blink sample data in the short blink sample data set A1, l1 represents the length of the short blink sample data set A1;
[0093] Get the maximum peak value V of each long blink sample data in the long blink sample data set A2 pj , expressed as: V pj,j=1,2,…,l2,j represents the jth long blink sample data in the long blink sample data set A2, and l2 represents the length of the long blink sample data set A2;
[0094] Get the minimum value of the maximum peak value of all short blink sample data in the short blink sample data set A1 and the maximum peak value of all long blink sample data in the long blink sample data set A2 as the minimum blink peak value V pmin , expressed as: V pmin =min(V pi ,V pj ).
[0095] Specifically, the acquisition of the average angle includes:
[0096] For each short blink sample data in the short blink sample data set A1 and each long blink sample data in the long blink sample data set A2;
[0097] Obtain the maximum peak point of the sample data and the pre-peak data points and post-peak data points at a preset time interval before and after the maximum peak point; connect the maximum peak point with the pre-peak data points and post-peak data points respectively to obtain a first line segment L1 and a second line segment L2; and take the angle between the first line segment and the second line segment as a specific angle;
[0098] Based on the first line segment slope K1 and the second line segment slope K2, calculate the arc angle θ of the specific angle h , and converted into a specific angle θ;
[0099] Obtain the angle with the largest angle value among the specific angles of all short blink sample data in the short blink sample data set A1 as the maximum specific angle θ of the short blink waveform max , expressed as:
[0100] θ max =maxθ i ,i=1,2,…,l1;θ i represents the specific angle of the i-th short blink sample data in the short blink sample data set A1, and l1 represents the length of the short blink sample data set A1;
[0101] Obtain the angle with the smallest angle value among the specific angles of all long blink sample data in the long blink sample data set A2 as the minimum specific angle θ of the long blink waveform min , expressed as:
[0102] θ min =minθ j ,j=1,2,…,l2;θ jrepresents the specific angle of the j-th long blink sample data in the long blink sample data set A2, and l2 represents the length of the long blink sample data set A2;
[0103] Calculate the maximum specific angle θ of the short blink waveform max The minimum specific angle θ with the long blink waveform min The average value of , as the average angle, is expressed as:
[0104] The arc angle θ of the specific included angle is calculated based on the first line segment slope K1 and the second line segment slope K2. h , and converted to a specific angle θ, including:
[0105] The radian angle of the specific angle θ h , expressed as:
[0106] The radian angle θ h Converted to a specific angle θ, the conversion formula is:
[0107] Among them, arctan is the inverse tangent function, and the function value represents the radian value, and the value range is K1 represents the slope of the first line segment, K2 represents the slope of the second line segment; θ∈(0,360).
[0108] Specifically, the correlation coefficient is used to measure the strength and direction of the linear relationship between two variables. The correlation coefficient between the real-time electrooculogram window data and the centroid is expressed as:
[0109]
[0110] Among them, cov(X,Y) represents the covariance of X and Y, σX and σY represent the standard deviations of X and Y respectively; X represents the real-time electrooculogram window data, and Y represents the centroid;
[0111] Let Y be the centroid of short blinks, the centroid of long blinks and multiple non-blinks respectively, and calculate the correlation coefficients between the real-time electrooculogram window data and the centroid of short blinks, the centroid of long blinks and multiple non-blinks respectively.
[0112] Based on the above embodiment, in this embodiment, the maximum peak point, the pre-peak stable point and the post-peak stable point of the real-time electrooculogram window data with the actual category label of long blink or short blink are obtained, and the blink duration of the real-time electrooculogram window data is calculated, which includes:
[0113] Get the maximum peak point (x) corresponding to the maximum peak in the data point sequence set {1,2,…,p,…,N} of the real-time electrooculogram window data p ,y p); p represents the pth data point in the data point sequence set, and there are N data points in the data point sequence set;
[0114] Starting from the maximum peak point, obtain the left sampling point sequence set {p-β, p-2β, …, p-kβ} in the left data point sequence set {p, …, 2, 1} with a preset moving step length β, and calculate the left slope of each left sampling point based on the two-dimensional coordinates of the current left sampling point and the two-dimensional coordinates of the data points at a preset number n to the left of the current left sampling point; β<n, n<p-kβ<2n; β and k are both non-negative integers;
[0115] Obtain the left sampling point sequence number l corresponding to the left slope with the largest absolute value, obtain the left sampling point corresponding to the left slope with the smallest absolute value among all the left sampling points with sequence numbers less than ln, as the first left stable point; take the nth data point to the left of the first left stable point as the second left stable point; round down the average of the sequence numbers of the first left stable point and the second left stable point, and take the data point represented by the sequence number corresponding to the rounded-down result as the pre-peak stable point;
[0116] Starting from the maximum peak point, obtain the right sampling point sequence set {p+β, p+2β, …, p+kβ} in the right data point sequence set {p, p+1, …, N} with a preset moving step length β, and calculate the right slope of each right sampling point based on the two-dimensional coordinates of the current right sampling point and the two-dimensional coordinates of the data points n to the right of the current right sampling point; N-2n<p+kβ<Nn;
[0117] Get the right sampling point sequence number r corresponding to the right slope with the largest absolute value, get the right sampling point corresponding to the right slope with the smallest absolute value among all the right sampling points with sequence numbers greater than r+n, as the first right stable point; take the nth data point to the right of the first right stable point as the second right stable point; round down the average of the sequence numbers of the first right stable point and the second right stable point, and take the data point represented by the sequence number corresponding to the rounded-down result as the post-peak stable point;
[0118] The duration between the stable point before the peak and the stable point after the peak is calculated as the blink duration of the real-time electrooculogram window data.
[0119] The left slope It is expressed as: b is a non-negative integer, (x a ,y a ) represents the two-dimensional coordinates of the left sampling point, (x a-n ,y a-n) represents the two-dimensional coordinates of the preset number of data points to the left of the left sampling point, n represents the preset number; a represents the maximum peak point (x p ,y p ) is the total step length of moving to the left. Let the preset moving step length be β, then the value range of a is a=p-βk,βk≤l left ,n<p-kβ<2n,l left Indicates the total number of data points to the left of the maximum peak point.
[0120] The right slope It is expressed as: b is a non-negative integer, (x' a , y' a ) represents the two-dimensional coordinates of the right sampling point, (x' a+n , y' a+n ) represents the two-dimensional coordinates of the preset number of data points on the right side of the right sampling point, n represents the preset number; a represents the maximum peak point (x p ,y p ) is the total step length of moving to the right. Let the preset moving step length be β, then the value range of a is a=p+βk,βk≤l right , N-2n<p+kβ<Nn, N represents the length of the sliding window, l right Indicates the total number of data points to the right of the maximum peak point.
[0121] The present invention filters and calculates the slope of real-time electrooculogram window data with category labels of long blinks or short blinks, finds the pre-peak stable point and post-peak stable point of the real-time electrooculogram window data, and obtains the blink duration, so as to accurately detect the driver's drowsiness state according to the blink duration.
[0122] Based on the above embodiment, in an embodiment of the present invention, the driver's drowsiness onset state is detected based on the detection of blink classification. This embodiment conducts a simulated driving experiment and recruits drivers who are accustomed to taking naps as experimental subjects. This experiment aims to study drivers with nap habits, and invites 12 drivers who have a habit of taking naps for at least one year to participate. In order to assess their daytime sleepiness, they were asked to complete the Epworth Sleepiness Scale, and the average score was 10.2±1.3, which indicates that they have a high degree of sleepiness tendency during the day. During the experiment, the vertical electrooculogram signals of the driver in a simulated driving environment are collected. The main goal is to detect the driver's drowsiness onset state in order to better understand their attention and alertness during driving. The specific steps include:
[0123] S201: Simulated driving experiment setup;
[0124] In the simulated driving experiment environment, the driver sits in a real car without an engine, and the LCD screen in front of the car can display the virtual driving conditions; the driver can control the virtual car through the steering wheel to drive in the virtual driving conditions;
[0125] S202: using two electrodes disposed above and below the driver's eyes to collect a vertical and horizontal electrooculogram signal;
[0126] Reference Figure 2 As shown, it is a schematic diagram of eye electrode signals; two electrode signals Vu and Vd located above and below the eyes at the traditional vertical electrooculogram position are collected, and a vertical electrooculogram signal VEOG is obtained by subtracting the two electrode signals Vu and Vd;
[0127] S203: performing noise reduction processing on the collected vertical electrooculogram signal VEOG using a median filter method;
[0128] S204: marking short blink window data samples, long blink window data samples, and non-blink window data samples using a traditional visual inspection method in the electrooculogram according to the frequency and amplitude characteristics of the blink signal itself;
[0129] Set the signal waveform of the blink duration between 0.3s-0.6s as the short blink waveform, and the signal waveform between 0.6s-1.2s as the long blink waveform; collect a vertical electrooculogram signal containing the blink signal waveform, perform preprocessing, and mark the short blink window data sample, the long blink window data sample and the non-blink window data sample;
[0130] Processing the short blink window data samples into window data samples with a preset duration and a short blink waveform centered therein, downsampling each window data sample to obtain an electrooculogram signal branch with a lower resolution, and obtaining a short blink window data sample set A1;
[0131] Processing the long blink window data samples into window data samples with a preset duration and a long blink waveform centered therein, downsampling each window data sample to obtain an electrooculogram signal branch with a lower resolution, and obtaining a long blink window data sample set A2;
[0132] Slide the sliding window with preset time length and step length on the non-blink window data samples to obtain the non-blink window data sample set A0;
[0133] The short blink window data sample set A1, the long blink window data sample set A2 and the non-blink window data sample set A0 are used as training sets.
[0134] S205: Using a sliding window with a fixed duration of 1.2 seconds and a window data sample centered on the blink waveform, sliding on all blink window data samples with a sliding step length of 0.1 seconds, obtaining the window data of each sliding, and forming a short blink window sample set A1 and a long blink window sample set A2;
[0135] A sliding window with a fixed duration of 1.2 seconds is used, and a sliding step length of 0.1 seconds is used to slide on all non-blinking window data samples, and the window data of each sliding is obtained to form a non-blinking window sample set A0;
[0136] The data sampling rate is 1000 Hz, so each window data sample of A1, A2, and A0 is 1200 data points;
[0137] Each sample in the two types of blink window data sample sets A1 and A2 is downsampled, so that the original data samples are downsampled from the original 1200 data points to 100 points as the training data set A1 + and A2 + ;
[0138] S206: Reference Figure 3 As shown in the figure, it is a schematic diagram of the process of using K-Means clustering and correlation to make a preliminary judgment on the test data; K-Means clustering algorithm is used to calculate the distance from each sample to the centroid using the Euclidean distance, and the short blink window sample set A1 + Find a centroid C1 and a long blink window sample set A2 + Find 1 centroid C2, and for the non-blink window sample set A0, find k = 7 centroids: C i ,i=3,4,…,3+k-1; setting k=7 is based on the number of distinguishable patterns that can be observed by naked eyes on the vertical electrooculogram signal;
[0139] S207: Using the peak function, assume that the length of the short blink window data sample set A1 is l1, and the length of the long blink window data sample set A2 is l2; calculate the maximum peak value V of each window data sample in A1 pi ,i=1,2,…,l1 and the maximum peak value V of each window data sample in A2 pj ,j=1,2,…,l2;
[0140] S208: Obtain the minimum peak value V among the maximum peak values of all window data samples in A1 and the maximum peak values of all window data samples in A2 pmin =min(V pi ,V pj );
[0141] S209: Traverse A1 + and A2+ The maximum peak value of each window data sample in the window is recorded, and the coordinates of the maximum peak point of the current window data sample and the two points 0.12s before and after the maximum peak point are recorded, and the two points are connected into two line segments L1 and L2 with the maximum peak point as the starting point, and the angle between the two line segments is recorded as θ; the slopes K1 and K2 of L1 and L2 are calculated respectively by the coordinates of the two points at the maximum peak point and the specific time points before and after the maximum peak point; the angle θ between the two line segments L1 and L2 is calculated by using the slopes K1 and K2 h , and convert it into angle θ; obtain the angle θ of the blink waveform in the short blink window data sample set A1 i , i=1,2,…,l1 and the angle θ of the blink waveform in the long blink window data sample set A2 j ,j=1,2,…,l2;
[0142] S210: The maximum angle of the blink waveform in all the short blink window data sample sets A1 is the maximum specific angle θ of the blink waveform. max =maxθ i , i=1,2,…,l1, the minimum angle in all long blink window data sample set A2 is the minimum specific angle θ of the blink waveform min =minθ j ,j=1,2,…,l2; take the maximum specific angle θ of the blink waveform in A1 max and the minimum specific angle θ of the blink waveform in A2 min The average angle is θ mean ;
[0143] S211: For the continuous test data of a vertical electrooculogram signal, a sliding window with a fixed duration of 1.2 seconds is used and a sliding step length of 0.1 seconds is used. Assuming the test data length is l, the window data sample S is obtained at each sliding. i ,i=1,2,…,l;
[0144] S212: Calculate the window data samples S obtained during each sliding operation i , i = 1, 2, ..., l and the short blink centroid C1, the long blink centroid C2 and multiple non-blink centroids C i , i=3,4,…,3+k-1, and assign a clustering category label H to each window data sample according to the size of the correlation coefficient. i ;
[0145] S213: Reference Figure 4 As shown in FIG. 1 , it is a flow chart of removing misjudgment items by using the blink peak value; the window data sample S obtained during each sliding is calculated. i,i=1,2,…,l,maximum peak value V pi , i=1,2,…,l1, compare the maximum peak value of the window data samples with category labels H1 and H2 obtained at each slide with the minimum blink peak value V obtained above pmin If the maximum peak value of the window data samples with the current category labels H1 and H2 is less than the minimum blink peak value V obtained above, pmin , the category label H of the window data sample i It is recorded as a misjudgment and the correction label is marked as H 10 ;
[0146] S214: Reference Figure 5 As shown in FIG. 1 , it is a schematic diagram of the process of distinguishing long blinks from short blinks by using the average angle; the window data sample S obtained during each sliding is calculated. i , i=1,2,…,l, the specific angle θ of the blink waveform i , i = 1, 2, ..., l, compare the specific angle of the blink waveform in the window data samples with the category labels H1 and H2 obtained at each slide with the average angle θ obtained above mean If the specific angle of the window data samples with the current category labels H1 and H2 is greater than θ mean And the category label is H1, the category label of the window data sample is marked as H2, that is, recorded as a long blink label; or less than θ mean And the category label is H2, the category label of the window data sample is marked as H1, that is, recorded as a short blink label;
[0147] S215: Smoothing the window data samples with category labels H1 and H2 by filtering;
[0148] S216: If there are continuous time series whose category labels are all H1 or H2, then take the window data samples at the middle time point for processing;
[0149] S217: Use a function to find the maximum peak point in the window data sample;
[0150] S218: For each window data sample selected maximum peak point, calculate the stable points on the left and right sides thereof;
[0151] S219: For the left side, start from the maximum peak point and traverse to the left, moving in steps of 3 data points each time, taking a line segment of 5 data points to calculate the slope, until the data starting point is reached or the length of the window is less than 5 data points. In this process, record the slope of the left side and coordinates (x a ,y a );
[0152] Assume the current maximum peak point position is (p, y p ), the slope can be expressed as:
[0153] Where b is a non-negative integer, It represents the left slope calculated by moving from the maximum peak point to the left. a represents the step length of moving from the current maximum peak point to the left, and the step length β is 3 data points. The value range of a can be expressed as: a=p-3k,3k≤l left ;
[0154] Where k is a non-negative integer and satisfies p-3k>5, ensuring that the value range of a does not exceed the range of the data sequence, and the step length β of each movement is 3 data points. If 0<p-3k<5 is satisfied, the slope is expressed as:
[0155] S220: For the right side, traverse from the maximum peak point to the right, move the step size of 3 data points each time, take 5 data points to calculate the slope, until the data end point is reached or the length of the window is less than 5 data points. In this process, record the slope of the right side and coordinates (x' a , y' a );
[0156] Assume the current maximum peak point position is (p, y p ), the window length is N, and the slope can be expressed as:
[0157] Where b is a non-negative integer, It represents the right slope calculated by moving rightward from the maximum peak point. a represents the step length of moving rightward from the current maximum peak point, and the step length β is 3 data points. The value range of a can be expressed as: a=p+3k,3k≤l right ;
[0158] Where k is a non-negative integer and satisfies p+3k≤N-5, ensuring that the value range of a does not exceed the range of the data sequence, and each move step is β data points. If N-5<p+3k≤N is satisfied, the slope is expressed as:
[0159] S221: For the left slope, find the two points with the maximum absolute slope (x a ,y a ) and (x a-5 ,y a-5 ), take the left point of the two points on the left (x a-5 ,y a-5 ), find the two points with the minimum absolute slope to the left of this point (xa' ,y a' ) and (x a'-5 ,y a'-5 ), take (x a' ,y a' ) and (x a'-5 ,y a'-5 ), which is the left stable point.
[0160] S222: For the right slope, find the two points with the maximum absolute slope (x' a , y' a ) and (x' a+5 , y' a+5 ), the right side takes the point on the right side of the two points (x' a+5 , y' a+5 ), find two points with the minimum absolute slope to the right of this point (x' a' , y' a' ) and (x' a+5 , y' a+5 ), take (x' a' , y' a' ) and (x' a+5 , y' a+5 ) is the center point on the right.
[0161] If no stable point is found on the left or right side, the stable point is set to the point with the minimum value on the left or right side.
[0162] Reference Figure 6 As shown, it is a schematic diagram of the process of obtaining the blink duration by using stable points. After obtaining two stable points, the embodiment of the present invention uses the acquisition time interval of the two stable points as the blink duration.
[0163] The present invention automatically clusters samples of the same pattern into one category through K-Means clustering to obtain the centroids of short blinks, long blinks and non-blinks, and generates cluster labels by comparing the correlation between window data samples and the centroids on the test data, thereby realizing an unsupervised blink classification detection method. By using the blink peak to remove misjudged item labels and using the specific angle of the blink waveform, short blinks and long blinks can be accurately distinguished, thereby realizing accurate detection of the blink type. By filtering and slope calculation of the window data samples whose category labels are blink features, the stable point of the current window data samples is found to obtain the blink duration. In addition, a single-channel vertical electrooculogram signal has the characteristics of being easy to collect and having a high signal-to-noise ratio. The present invention uses a single-channel vertical electrooculogram signal to detect blink classification, and data acquisition is simple and the detection accuracy is high.
[0164] Based on the above embodiments, an embodiment of the present invention provides a blink category determination device, which specifically includes:
[0165] An electrooculogram signal acquisition device, used for acquiring a vertical electrooculogram signal;
[0166] A host computer is connected to the electrooculogram signal acquisition device for acquiring a vertical electrooculogram signal, executing the blink category determination method described above, and acquiring an actual category label of the real-time electrooculogram window data;
[0167] The display device is connected to the host computer for displaying the actual category label of the real-time electrooculogram window data.
[0168] In an embodiment of the present invention, the blink category determination device provided in the embodiment of the present invention further includes an early warning device, which is communicatively connected to the host computer and is used to work according to the detection result of the host computer on the electrooculogram signal data sample.
[0169] The blink category judgment method and device described in the present invention judges the blink category based on a single-channel vertical electrooculogram signal that is easy to collect and has a high signal-to-noise ratio; uses K-Means clustering to automatically cluster sample data of the same mode into one category to obtain the centroids of short blinks, long blinks, and non-blinks; obtains the initial category label of the real-time electrooculogram window data by calculating the correlation coefficient between the real-time electrooculogram window data and different centroids, thereby realizing unsupervised blink category judgment. After obtaining the initial category label of the real-time electrooculogram window data, the present invention constructs a minimum blink peak to judge the correctness of the initial category label and corrects the wrong label; and obtains the average angle, and uses the specific angle of the blink waveform to accurately distinguish short blinks from long blinks, thereby realizing accurate detection of blink types, improving the accuracy of blink category judgment, and making sleepiness detection based on blink categories more stable and accurate. The present invention filters and calculates the slope of real-time electrooculogram window data with category labels of long blinks or short blinks, finds the pre-peak stable point and post-peak stable point of the real-time electrooculogram window data, and obtains the blink duration, so as to accurately detect the driver's drowsiness state according to the blink duration.
[0170] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0171] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0172] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0174] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. A method for determining the type of blinking, characterized in that: include: Using a sliding window with preset time and step length to slide on a vertical electrooculogram signal sample, different window sample data are obtained; According to the blink duration corresponding to each window sample data, all window sample data are divided into a short blink sample data set, a long blink sample data set and a non-blink sample data set; Using the K-Means algorithm, a short blink centroid is obtained in the short blink sample data set, a long blink centroid is obtained in the long blink sample data set, and multiple non-blink centroids are obtained in the non-blink sample data set; Obtain the maximum peak values of all window sample data in the short blink sample data set and the long blink sample data set respectively, and take the minimum value of all maximum peak values as the minimum blink peak value; The specific angles of all window sample data in the short blink sample data set and the long blink sample data set are obtained respectively, and the average of the maximum specific angle in the short blink sample data set and the minimum specific angle in the long blink sample data set is calculated as the average angle; wherein the specific angle is obtained, including: for each short blink sample data in the short blink sample data set A1 and each long blink sample data in the long blink sample data set A2; obtaining the maximum peak point of the sample data and the pre-peak data point and the post-peak data point at a preset time interval before and after the maximum peak point; connecting the maximum peak point with the pre-peak data point and the post-peak data point respectively to obtain the first line segment L1 and the second line segment L2; taking the angle between the first line segment and the second line segment as the specific angle; and calculating the radian angle θ of the specific angle based on the slope K1 of the first line segment and the slope K2 of the second line segment h , and converted into a specific angle θ; Use a sliding window with preset time and step length to slide on a vertical electrooculogram signal collected in real time to obtain real-time electrooculogram window data; Calculate the correlation coefficients between the real-time electrooculogram window data and the short blink centroid, the long blink centroid and multiple non-blink centroids respectively, and obtain the category of the sample data set to which the centroid corresponding to the maximum correlation coefficient belongs, as the initial category label of the real-time electrooculogram window data; the initial category label of the real-time electrooculogram window data is any one of long blink, short blink and non-blink; For each real-time electrooculogram window data with an initial category label of long blink or short blink, the maximum peak value of the real-time electrooculogram window data is calculated and compared with the minimum blink peak value: If the maximum peak value of the real-time electrooculogram window data is less than the minimum blink peak value, then the actual category label of the real-time electrooculogram window data is determined to be non-blink; If the maximum peak value of the real-time electrooculogram window data is not less than the minimum blink peak value, the actual category label of the real-time electrooculogram window data is determined to be a short blink or a long blink; the real-time specific angle of the real-time electrooculogram window data is calculated and compared with the average angle: if the real-time specific angle is greater than the average angle, the actual category label of the real-time electrooculogram window data is determined to be a long blink; otherwise, the actual category label of the real-time electrooculogram window data is determined to be a short blink.
2. The blink category determination method according to claim 1, characterized in that: After obtaining the actual category label of the real-time electrooculogram window data, the method further includes: obtaining the maximum peak point, the pre-peak stable point, and the post-peak stable point of the real-time electrooculogram window data whose actual category label is a long blink or a short blink, and calculating the blink duration of the real-time electrooculogram window data, which includes: Get the maximum peak point (x) corresponding to the maximum peak in the data point sequence set {1,2,…,p,…,N} of the real-time electrooculogram window data p ,y p ); p represents the pth data point in the data point sequence set, and there are N data points in the data point sequence set; Starting from the maximum peak point, obtain the left sampling point sequence set {p-β, p-2β, …, p-kβ} in the left data point sequence set {p, …, 2, 1} with a preset moving step length β, and calculate the left slope of each left sampling point based on the two-dimensional coordinates of the current left sampling point and the two-dimensional coordinates of the data points at a preset number n to the left of the current left sampling point; β<n, n<p-kβ<2n; β and k are both non-negative integers; Obtain the left sampling point sequence number l corresponding to the left slope with the largest absolute value, obtain the left sampling point corresponding to the left slope with the smallest absolute value among all the left sampling points with sequence numbers less than ln, as the first left stable point; take the nth data point to the left of the first left stable point as the second left stable point; round down the average of the sequence numbers of the first left stable point and the second left stable point, and take the data point represented by the sequence number corresponding to the rounded-down result as the pre-peak stable point; Starting from the maximum peak point, obtain the right sampling point sequence set {p+β, p+2β, …, p+kβ} in the right data point sequence set {p, p+1, …, N} with a preset moving step length β, and calculate the right slope of each right sampling point based on the two-dimensional coordinates of the current right sampling point and the two-dimensional coordinates of the data points n to the right of the current right sampling point; N-2n<p+kβ<Nn; Get the right sampling point sequence number r corresponding to the right slope with the largest absolute value, get the right sampling point corresponding to the right slope with the smallest absolute value among all the right sampling points with sequence numbers greater than r+n, as the first right stable point; take the nth data point to the right of the first right stable point as the second right stable point; round down the average of the sequence numbers of the first right stable point and the second right stable point, and take the data point represented by the sequence number corresponding to the rounded-down result as the post-peak stable point; The duration between the stable point before the peak and the stable point after the peak is calculated as the blink duration of the real-time electrooculogram window data.
3. The blink category determination method according to claim 2, characterized in that: Calculate the left slope of each left sampling point, including: Left Slope It is expressed as: Where b is a non-negative integer, (x a ,y a ) represents the two-dimensional coordinates of the left sampling point, (x a-n ,y a-n ) represents the two-dimensional coordinates of the preset number of data points to the left of the left sampling point, n represents the preset number; a represents the maximum peak point (x p ,y p ) is the total step length of moving to the left. Let the preset moving step length be β, then the value range of a is a=p-βk,βk≤l left ,n<p-kβ<2n,l left Indicates the total number of data points to the left of the maximum peak point.
4. The blink category determination method according to claim 2, characterized in that: Calculate the right side slope of each right side sampling point, including: Right slope It is expressed as: Where b is a non-negative integer, (x' a , y' a ) represents the two-dimensional coordinates of the right sampling point, (x' a+n , y' a+n ) represents the two-dimensional coordinates of the preset number of data points on the right side of the right sampling point, n represents the preset number; a represents the maximum peak point (x p ,y p ) is the total step length of moving to the right. Let the preset moving step length be β, then the value range of a is a=p+βk,βk≤l right , N-2n<p+kβ<Nn, N represents the length of the sliding window, l right Indicates the total number of data points to the right of the maximum peak point.
5. The blink category determination method according to claim 1, characterized in that: According to the blink duration corresponding to each window sample data, all window sample data are divided into a short blink sample data set, a long blink sample data set and a non-blink sample data set, including: The window sample data with a blink duration of 0.3 seconds to 0.6 seconds is regarded as short blink samples and divided into the short blink sample data set A1; The window sample data with blink duration between 0.6 seconds and 1.2 seconds are regarded as long blink samples and divided into the long blink sample data set A2; The remaining window sample data are divided into the non-blink sample data set A3 as non-blink samples; For the short blink sample data set, the long blink sample data set and the non-blink sample data set, the short blink waveform and the long blink waveform are centered in the window sample data respectively, and all the window sample data are downsampled to obtain the short blink sample data set, the long blink sample data set and the non-blink sample data set.
6. The blink category determination method according to claim 1, characterized in that: The method of respectively obtaining the maximum peak values of all window sample data in the short blink sample data set and the long blink sample data set, and taking the minimum value of all maximum peak values as the minimum blink peak value, includes: Get the maximum peak value V of each short blink sample data in the short blink sample data set A1 pi , expressed as: V pi ,i=1,2,…,l1, i represents the i-th short blink sample data in the short blink sample data set A1, l1 represents the length of the short blink sample data set A1; Get the maximum peak value V of each long blink sample data in the long blink sample data set A2 pj , expressed as: V pj ,j=1,2,…,l2,j represents the jth long blink sample data in the long blink sample data set A2, and l2 represents the length of the long blink sample data set A2; Get the minimum value of the maximum peak value of all short blink sample data in the short blink sample data set A1 and the maximum peak value of all long blink sample data in the long blink sample data set A2 as the minimum blink peak value V pmin , expressed as: V pmin =min(V pi ,V pj ).
7. The blink category determination method according to claim 1, characterized in that: The specific angles of all window sample data in the short blink sample data set and the long blink sample data set are obtained respectively, and the average of the maximum specific angle in the short blink sample data set and the minimum specific angle in the long blink sample data set is calculated as the average angle, including: Obtain the angle with the largest angle value among the specific angles of all short blink sample data in the short blink sample data set A1 as the maximum specific angle θ of the short blink waveform max , expressed as: θ max =maxθ i ,i=1,2,…,l1;θ i represents the specific angle of the i-th short blink sample data in the short blink sample data set A1, and l1 represents the length of the short blink sample data set A1; Obtain the angle with the smallest angle value among the specific angles of all long blink sample data in the long blink sample data set A2 as the minimum specific angle θ of the long blink waveform min , expressed as: θ min =minθ j ,j=1,2,…,l2;θ j represents the specific angle of the j-th long blink sample data in the long blink sample data set A2, and l2 represents the length of the long blink sample data set A2; Calculate the maximum specific angle θ of the short blink waveform max The minimum specific angle θ with the long blink waveform min The average value of , as the average angle, is expressed as:
8. The blink category determination method according to claim 1, characterized in that: The arc angle θ of the specific included angle is calculated based on the first line segment slope K1 and the second line segment slope K2. h , and converted to a specific angle θ, including: The radian angle of the specific angle θ h , expressed as: The radian angle θ h Converted to a specific angle θ, the conversion formula is: Among them, arctan is the inverse tangent function, and the function value represents the radian value, and the value range is K1 represents the slope of the first line segment, K2 represents the slope of the second line segment; θ∈(0,360).
9. The blink category determination method according to claim 1, characterized in that: The correlation coefficient between the real-time electrooculogram window data and the centroid is expressed as: Among them, cov(X,Y) represents the covariance of X and Y, σX and σY represent the standard deviations of X and Y respectively; X represents the real-time electrooculogram window data, and Y represents the centroid; Let Y be the centroid of short blinks, the centroid of long blinks and multiple non-blinks respectively, and calculate the correlation coefficients between the real-time electrooculogram window data and the centroid of short blinks, the centroid of long blinks and multiple non-blinks respectively.
10. A blink category determination device, characterized in that: include: An electrooculogram signal acquisition device, used for acquiring a vertical electrooculogram signal; A host computer, which is in communication connection with the electrooculogram signal acquisition device, is used to obtain a vertical electrooculogram signal, execute the blink category determination method according to any one of claims 1 to 9, and obtain the actual category label of the real-time electrooculogram window data; The display device is connected to the host computer for displaying the actual category label of the real-time electrooculogram window data.
Citation Information
Patent Citations
Attention recognition-oriented electro-oculogram signal classifier based on machine learning
CN112890834A
Driver sleepiness starting state detection method, device and equipment
CN116807478A