Driver fatigue state recognition method based on multi-scale convolution kernel size CNN
Through the multi-scale convolution kernel size hybrid CNN model and data enhancement technology, the problem of low accuracy of driver fatigue state recognition in the existing technology is solved, higher classification performance and generalization ability are achieved, and the fatigue state recognition is improved. accuracy.
Patent Information
- Application Number
- CN202211488681.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-11-25
AI Technical Summary
In the existing technology, in driver fatigue state recognition, the convolutional neural network with a single convolution scale cannot adapt to the EEG signals of different subjects at the same time, resulting in a low fatigue EEG state recognition accuracy of the model, and due to the EEG The amount of signal data is limited, and over-fitting is prone to occur, making it difficult to improve classification accuracy.
Design a convolutional neural network with mixed multi-scale convolution kernel sizes, combined with frequency masking and data enhancement methods of adding frequency domain noise, to improve the classification performance and generalization ability of the model.
Through the multi-scale convolution kernel size hybrid CNN model and data enhancement method, the classification performance of the driver fatigue state recognition model is improved, the accuracy is increased by 2%, and the generalization ability of the model is enhanced.
Smart Images

Figure CN115836868B
Abstract
Description
Technical Field
[0001] The invention relates to a driver fatigue state recognition method based on multi-scale convolution kernel size CNN, belonging to the technical field of electroencephalogram signal processing. Background Art
[0002] With the frequent occurrence of various vicious traffic accidents, people are paying more and more attention to driving safety. Among them, driving fatigue can directly lead to traffic accidents, causing serious harm to the safety of people's lives and property. Driving fatigue refers to the phenomenon that the driver's physical function declines due to insufficient rest or long-term continuous driving. This phenomenon usually manifests as physical and mental fatigue of the driver. Accurately identifying the driver's fatigue state can effectively reduce the occurrence of traffic accidents.
[0003] Studies have shown that the EEG of drivers in a fatigued state is significantly different from that in a non-fatigued state. The use of deep learning methods to identify fatigue states from EEG signals has been widely studied. However, due to the large differences in EEG signals between different subjects and at different recording periods, convolutional neural networks with a single convolution scale cannot adapt to the EEG signals of different subjects at the same time, and the accuracy of the model's fatigue EEG state recognition needs to be further improved. In the recognition of fatigue states in EEG signals across subjects, it is extremely important to fully extract the temporal, frequency, and spatial features of EEG signals to accurately identify fatigue states.
[0004] For deep learning algorithms, the accuracy of EEG signal classification is not only related to the performance of the designed network structure, but also to a large extent to the amount of EEG signal training data available. When the amount of training data is limited, the neural network model is prone to overfitting during the training process, resulting in a relatively low classification accuracy of the model on the test set. In order to solve the overfitting phenomenon of the neural network model caused by the limited amount of EEG signal data, the first solution that comes to mind is to collect as much training data as possible. However, in most cases, it is very difficult to collect more EEG signals, or even impossible to complete. Therefore, it is particularly important to make full use of the EEG signal data that has been collected and generate more data through data enhancement methods. Summary of the invention
[0005] In order to solve the shortcomings of the above-mentioned prior art, the present invention provides a driver fatigue state recognition method based on multi-scale convolution kernel size CNN, designs a convolutional neural network with a mixed multi-scale convolution kernel size to recognize the driver fatigue state, thereby improving the classification performance of the fatigue state recognition model. At the same time, by integrating the data enhancement method of frequency masking and adding frequency domain noise with the multi-scale convolution kernel size CNN model, the classification performance and generalization ability of the model are further improved.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] The driver fatigue state recognition method based on multi-scale convolution kernel size CNN includes the following steps:
[0008] S1. Data preparation: pre-process the collected EEG signals to obtain standard format data;
[0009] S2, data enhancement: frequency masking or adding frequency domain noise algorithm to enhance the original data;
[0010] S3: Model training, using a multi-scale convolution kernel size mixed CNN model to train the data set consisting of original data and enhanced data to obtain a classifier;
[0011] S4. State recognition: Input the preprocessed EEG data into the classifier model to obtain the state label of the sample and the interpretable model classification basis.
[0012] A further improvement of the technical solution of the present invention is that the specific operation of step S1 is:
[0013] S11, reduce the sampling rate of the original data set to 128 Hz, and extract the EEG samples of each track 3 seconds before the deviation event;
[0014] S12. Calculate the local reaction time R of each sample t :
[0015] R t =t d -t r (1)
[0016] Among them, t d is the moment when the car drifts, t r The moment when the subject operates the car to return to the original lane;
[0017] S13, calculate the global response time GR of each sample t :
[0018]
[0019] Where N is the number of samples in the 90s window before the drift event of each sample car, GR t It is the local reaction time R within the 90-second window before the car drift event occurs. t The average value of
[0020] S14. Define baseline wakefulness reaction time R t alert :
[0021] The fifth percentile of the local reaction time in each session was taken as the baseline wakefulness reaction time R t alert , as the basis for marking samples in the next step;
[0022] S15. Label each sample:
[0023] When the local reaction time and global reaction time of a sample are both less than 1.5 times the baseline wakefulness time, the sample is marked as being in an alert state; when the local reaction time and global reaction time of a sample are both greater than 2.5 times the baseline wakefulness reaction time, the sample is marked as being in a fatigued state.
[0024] A further improvement of the technical solution of the present invention is that after the marking in step S15 is completed, 2022 samples are obtained, each sample containing 3s of EEG data.
[0025] A further improvement of the technical solution of the present invention is that the specific operation of frequency masking enhancement data in step S2 is:
[0026] S21. Perform fast Fourier transform on the original signal x(t) to obtain the frequency domain signal X(jw)
[0027] X(jw)=F(x(t)) (3),
[0028] Where F(·) represents fast Fourier transform;
[0029] S22. Determine hyperparameters s and t, where s represents the number of masked points and t represents the number of masked areas. Set 20 frequency points of a randomly selected area to zero to obtain enhanced data.
[0030] A further improvement of the technical solution of the present invention is that the specific operation of adding the frequency domain noise algorithm to enhance the data in step S2 is:
[0031] H(jw)e jωt =F[x(t)] (21),
[0032] where H(jw)=|X(jw)|, e jωt =Arg[X(jw)] (i.e. the phase of the frequency domain signal), the amplitude and phase add noise G i (λ)~(0,σ i 2 )(i=1,2):
[0033]
[0034] After inverse Fourier transform, the enhanced time domain signal is obtained:
[0035] xnoise (t) = F -1 (X noise ) (twenty three).
[0036] A further improvement of the technical solution of the present invention is that the specific operation of step S3 is:
[0037] S31, data filtering: Assume that the original EEG signal recorded by m electrodes is X = {x i} i=1,2,...m , bandpass filter X to obtain three EEG signals of different frequency bands, namely, 4-7Hz EEG signal X1, 8-13Hz EEG signal X2, and 13-32Hz EEG signal X3;
[0038] S32. Determine the convolution kernel size:
[0039] Let the convolution kernel size be K = {K1, K2, K3}, where K i (i=1,2,3) is the convolution kernel size of the Depthwise convolution of the i-th branch;
[0040] S33. Network structure design:
[0041] The first branch of the network structure, the input signal is the first frequency band X of the original EEG signal 1(m,n) , where m is the number of EEG channels, which is 30, and n is the number of sampling points for each sample, which is 384;
[0042] The following appears Represents the parameters of the xth layer of the network;
[0043] The output of the first layer Pointwise is:
[0044]
[0045] Where i = 1, 2, 3, ..., N1, N1 = 16, is the number of Pointwise convolutions, represents the weight of the pth channel of the i-th Pointwise convolution, x p,j represents the pth channel of the jth sample point of the input EEG signal sample, Represents the bias of the i-th Pointwise convolution; after the Pointwise layer, the output is obtained The dimension is (16, 384);
[0046] The first branch of the second layer Depthwise, the output signal dimension of the first layer is (16, 384), the signal obtained by the first layer has 16 channels, each channel uses two Depthwise convolutions, so the number of channels output by the first branch is 32, and the number of sampling points output by the first branch is j (2) It can be calculated by the following formula
[0047]
[0048] Among them, the convolution kernel size K1 = 36, the step length stride = 1, and the padding = 0, and we get j (2) =349;
[0049] When i is an odd number, the output of the second layer Depthwise is:
[0050]
[0051] When i is an even number, the output of the second layer Depthwise is:
[0052]
[0053] Where K1 is the depthwise convolution kernel size, i is the number of input channels, and j is the number of sampling points.
[0054] The third activation layer:
[0055]
[0056] The fourth batch normalization layer:
[0057]
[0058] The fifth global average pooling layer:
[0059]
[0060] The second branch of the depthwise layer has a convolution kernel size of K2 = 51, and repeats formula (5) and subsequent steps, wherein the j of the second branch is calculated by formula (5) (2) =334;
[0061] The third branch of the Depthwise layer has a convolution kernel size of K3 = 80, and repeats formula (5) and subsequent steps, wherein the j of the third branch is calculated by formula (5) (2) =305;
[0062] The above describes the network structure of the first branch of the network structure. This branch processes the EEG signal X1 in the 4-7Hz frequency band, and repeats the operation of the first branch of the network for the EEG signal X2 in the 8-13Hz frequency band and the EEG signal X3 in the 13-32Hz frequency band to obtain the outputs of the second and third branches of the network. Finally, the outputs of the three branches of the network are fully connected and then processed as follows:
[0063] Sixth hidden layer:
[0064]
[0065] In the above formula, c=0 or c=1. When c=0, it represents the awake state; when c=1, it represents the fatigue state.
[0066] Seventh floor
[0067]
[0068] Obtain classification results.
[0069] A further improvement of the technical solution of the present invention is that the specific operation of step S4 is:
[0070] S41, using 11-fold cross validation
[0071] The first subject was selected as the test set, and the EEG data except the first subject was used as the training set. The recognition accuracy of the model on the first subject was calculated as ACC1. The above steps were applied to the remaining subjects, and finally the recognition accuracy of the 11 subjects was obtained as ACC1. i (i=1,2...11);
[0072] S42. Calculate the average accuracy:
[0073]
[0074] Where n = 11, indicating the number of subjects;
[0075] S43. Interpretability Analysis
[0076] Using the class activation mapping method, locate the discriminative region of each input sample of the CNN model used to solve the classification task;
[0077] Assume that a given EEG sample X(m,n) is classified with label c, where c is 0 for awake state and c is 1 for fatigue state. This input sample generates activation h in the sixth layer of the network. c (6) , from formula (9) we can get:
[0078]
[0079] in
[0080] Further neglecting the constant (n-K+1), we get
[0081]
[0082] M i,j It can be seen as the final activation layer of class c in a map of size 2N1×(n-K+1) Distribution of
[0083]
[0084] In the above formula, σ is a constant that determines the radius of the influence area of each discriminant point in the input signal; Further normalized to the range of (-1,1) for visualization;
[0085] According to (3), (5), (6), when i k When odd
[0086]
[0087] when i k Even number
[0088]
[0089] when i k When it is an even number, ignore By time point j k to k +K-1 local area input signal is generated, that is, the convolution signal of m = 30 channels The weighted sum of , the weight of the pth channel is (i k is an odd number), or (i k is an even number); therefore, The discriminant position in k ,j k ), can be traced back to the center of the strongest contributing set in the input signal (p k ,q k ), when i k When p is an odd number, k The expression is as follows:
[0090]
[0091] when i k When p is an even number, k The expression is as follows:
[0092]
[0093] And q k =j k +(l-1) / 2
[0094] Assume that in formula (17) In order to highlight the entire set of the strongest contributing signals at the discriminant position of the input signal.
[0095] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is:
[0096] The present invention designs a convolutional neural network with a mixed multi-scale convolution kernel size to identify the driver's fatigue state. In the sustained attention fatigue driving data set, a 2% classification performance improvement is achieved, which improves the classification performance of the fatigue state recognition model. At the same time, by integrating the data enhancement method of frequency masking and adding frequency domain noise with the multi-scale convolution kernel size CNN model, the classification performance and generalization ability of the model are further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1 It is a schematic diagram of the process of the present invention;
[0098] Figure 2 is a schematic diagram of frequency masking of the present invention;
[0099] Figure 3 It is a structural diagram of the CNN model of multi-scale convolution kernel sizes of the present invention;
[0100] Figure 4 It is an overall schematic diagram of the present invention;
[0101] Figure 5 It is a t-SNE visualization diagram of the classification result of the EEG data of subject 1 in Example 2 of the present invention after the CNN model with multi-scale convolution kernel size at the output layer;
[0102] Figure 6 It is a t-SNE visualization diagram of the output layer of the classification result of the EEG data of subject 1 in Example 2 of the present invention after the interpretable CNN model. DETAILED DESCRIPTION
[0103] The present invention is further described in detail below in conjunction with embodiments:
[0104] Embodiment 1:
[0105] A driver fatigue state recognition method based on multi-scale convolution kernel size CNN, such as Figure 1 The flow chart of this method is as follows: Figure 4 This is a schematic diagram of the overall method.
[0106] The specific steps are as follows:
[0107] S1. Data preparation: The collected EEG signals were preprocessed to obtain a total of 11 subjects and 2022 samples, as shown in Table 1:
[0108]
[0109] Table 1
[0110] It will be divided into the following 5 sub-steps:
[0111] S11. Reduce the sampling rate of the original dataset to 128 Hz and extract the EEG samples of each trajectory 3 seconds before the deviation event.
[0112] S12. Calculate the local reaction time R of each sample t :
[0113] R t =t d -t r (1)
[0114] where t d is the time when the car drifts, t r It is the moment when the subject operates the car to return to the original lane.
[0115] S13, calculate the global response time GR of each sample t :
[0116]
[0117] Where N is the number of samples in the 90s window before the drift event of each sample car, GR t It is the local reaction time R within the 90-second window before the car drift event occurs. t The average value of .
[0118] S14. Define baseline wakefulness reaction time R t alert :
[0119] The fifth percentile of the local reaction time in each session was taken as the baseline wakefulness reaction time R t alert , as the basis for marking samples in the next step.
[0120] S15. Label each sample:
[0121] When the local reaction time and global reaction time of the sample are both less than 1.5 times the baseline wakefulness time, the sample is marked as alert; when the local reaction time and global reaction time of the sample are both greater than 2.5 times the baseline wakefulness reaction time, the sample is marked as fatigued. After marking, 2022 samples are obtained, each containing 3s of EEG data.
[0122] S2. Data enhancement: This example uses frequency masking to enhance the original data.
[0123] Perform fast Fourier transform on the original signal x(t) to obtain the frequency domain signal X(jw)
[0124] X(jw)=F(x(t)) (3),
[0125] Where F(·) represents fast Fourier transform.
[0126] The schematic diagram of frequency masking is as follows Figure 2 shown.
[0127] Determine the hyperparameters s and t, where s represents the number of masked points and t represents the number of masked areas. In this example, t=1 and s=20 are taken. Set 20 frequency points of a randomly selected area to zero, perform inverse Fourier transform to obtain the time domain signal, and obtain the enhanced data.
[0128] S3, model training: a multi-scale convolution kernel size mixed CNN model is used to train the dataset consisting of original data and enhanced data to obtain a classifier
[0129] S31, data filtering: Assume that the original EEG signal recorded by m electrodes is X = {x i} i=1,2,...m , X is bandpass filtered to obtain three EEG signals of different frequency bands, namely, 4-7Hz EEG signal X1, 8-13Hz EEG signal X2, and 13-32Hz EEG signal X3.
[0130] S32. Determine the convolution kernel size:
[0131] Let the convolution kernel size be K = {K1, K2, K3}, where K i (i=1,2,3) is the convolution kernel size of the depthwise convolution of the i-th branch. The convolution kernel size used in this example is K1=36, K2=51, K3=80
[0132] S33. Network structure design:
[0133] The first branch of the network structure, the input signal is the first frequency band X of the original data EEG signal 1(m,n), where m = 30, is the number of EEG channels, and n = 384, is the number of sampling points for each sample. All the numbers in the following superscript brackets represent the number of network layers, such as Represents the parameters of the first layer of the network.
[0134] The output of the first layer Pointwise is:
[0135]
[0136] Where i = 1, 2, 3, ..., N1, N1 = 16, is the number of Pointwise convolutions, represents the weight of the pth channel of the i-th Pointwise convolution, x p,j represents the pth channel of the jth sample point of the input EEG signal sample, Represents the bias of the i-th Pointwise convolution. After the Pointwise layer, the output is The dimension is (16,384).
[0137] The first branch of the second layer Depthwise, the output signal dimension of the first layer is (16, 384), the signal obtained by the first layer has 16 channels, each channel uses two Depthwise convolutions, so the number of channels output by the first branch is 32, and the number of sampling points output by the first branch is j (2) It can be calculated by the following formula
[0138]
[0139] Among them, the convolution kernel size K1 = 36, the step length stride = 1, and the padding = 0, and we get j (2) =349
[0140] When i is an odd number, the output of the second layer Depthwise is:
[0141]
[0142] When i is an even number, the output of the second layer Depthwise is:
[0143]
[0144] Where K1 is the depthwise convolution kernel size, i is the number of input channels, and j is the number of sampling points.
[0145] The third activation layer:
[0146]
[0147] The fourth batch normalization layer:
[0148]
[0149] The fifth global average pooling layer:
[0150]
[0151] The second branch of the depthwise layer has a convolution kernel size of K2 = 51, and repeats formula (5) and subsequent steps, wherein the j of the second branch is calculated by formula (5) (2) =334.
[0152] The third branch of the Depthwise layer has a convolution kernel size of K3 = 80, and repeats formula (5) and subsequent steps, wherein the j of the third branch is calculated by formula (5) (2) =305.
[0153] like Figure 3 As shown, the three branches of Depthwise are fully connected.
[0154] The above describes the network structure of the first branch of the network structure. This branch processes the EEG signal X1 in the 4-7Hz frequency band, and repeats the operation of the first branch of the network for the EEG signal X2 in the 8-13Hz frequency band and the EEG signal X3 in the 13-32Hz frequency band to obtain the outputs of the second and third branches of the network. Finally, the outputs of the three branches of the network are fully connected and then processed as follows:
[0155] Sixth hidden layer
[0156]
[0157] In the above formula, c=0 or c=1. When c=0, it represents the awake state; when c=1, it represents the fatigue state.
[0158] Seventh floor
[0159]
[0160] Obtain classification results.
[0161] S4, state recognition: input the preprocessed EEG data into the classifier model to obtain the state label of the sample and the interpretable model classification basis;
[0162] S41, using 11-fold cross validation
[0163] The first subject was selected as the test set, and the EEG data except the first subject was used as the training set. The recognition accuracy of the model on the first subject was calculated as ACC1. The above steps were applied to the remaining subjects, and finally the recognition accuracy of the 11 subjects was obtained as ACC1. i (i=1,2...11).
[0164] S42. Calculate the average accuracy:
[0165]
[0166] Where n=11, indicating the number of subjects.
[0167] S43. Interpretability Analysis
[0168] The class activation mapping method is used to locate the discriminative region of each input sample of the CNN model used to solve the classification task.
[0169] Suppose a given EEG sample X(30,384) is classified with label c, where c is 0 for awake state and c is 1 for fatigue state. This input sample generates activation h in the sixth layer of the network. c (6) , from formula (9) we can get:
[0170]
[0171] in
[0172] Further neglecting the constant (n-K+1), we get
[0173]
[0174] M i,j It can be seen as the final activation layer of class c in a map of size 2N1×(n-K+1) distribution.
[0175]
[0176] In the above formula, σ is a constant that determines the radius of the influence area of each decision point in the input signal. They are further normalized to the range of (-1, 1) for visualization.
[0177] According to (3), (5), (6), when i k When odd
[0178]
[0179] when i k Even number
[0180]
[0181] when i k When it is an even number, ignore By time point j k to k +K-1 local area input signal is generated, that is, the convolution signal of m = 30 channels The weighted sum of , the weight of the pth channel is (i k is an odd number), or (i k is an even number). Therefore, The discriminant position in k ,j k ), can be traced back to the center of the strongest contributing set in the input signal (p k ,q k ), when i k When p is an odd number, k The expression is as follows:
[0182]
[0183] when i k When p is an even number, k The expression is as follows:
[0184]
[0185] And q k =j k +(l-1) / 2
[0186] Assume that in formula (17) In order to highlight the entire set of the strongest contributing signals at the discriminant position of the input signal.
[0187] Embodiment 2:
[0188] This example introduces a data enhancement method for adding frequency domain noise in a fatigue state recognition task. The processing steps of steps S1, S3 and S4 are the same as those in Example 1:
[0189] S2. Data enhancement: This example uses the frequency domain reconstruction algorithm to enhance the original data.
[0190] Perform fast Fourier transform on the original signal x(t) to obtain the frequency domain signal
[0191] H(jw)e jωt =X(jw)=F[x(t)] (21),
[0192] where H(jw)=|X(jw)|, ejωt =Arg[X(jw)] (i.e. the phase of the frequency domain signal), the amplitude and phase add noise G i (λ)~(0,σ i 2 )(i=1,2):
[0193]
[0194] After inverse Fourier transform, the enhanced time domain signal is obtained:
[0195] x noise (t) = F -1 (X noise ) (twenty three),
[0196] In order to reflect the algorithm performance of the present invention, the experimental results of the multi-scale convolution kernel size CNN of the present invention are compared with the results of three network structures: Conv-ShallowNet, EEGNet, and InterpretableCNN, as shown in Table 2, where the bold numbers are the optimal recognition accuracy of each experimental object.
[0197] The classification results of the EEG data of subject 1 after the multi-scale convolution kernel size CNN and the interpretable CNN model are visualized in the t-SNE of the output layer as follows Figure 5 , Figure 6 As shown, it can be seen that the multi-scale convolution kernel size CNN model has significant advantages in classification effect.
[0198]
[0199] Table 2
[0200] Finally, it should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A driver fatigue state recognition method based on multi-scale convolution kernel size CNN is characterized by: The steps include: S1. Data preparation: pre-process the collected EEG signals to obtain standard format data; The specific operations of step S1 are: S11, reduce the sampling rate of the original data set to 128 Hz, and extract the EEG samples of each track 3 seconds before the deviation event; S12. Calculate the local reaction time R of each sample t : R t =t d -t r (1), Among them, t d is the moment when the car drifts, t r The moment when the subject operates the car to return to the original lane; S13, calculate the global response time GR of each sample t : Where N is the number of samples in the 90s window before the drift event of each sample car, GR t It is the local reaction time R within the 90-second window before the car drift event occurs. t The average value of S14. Define baseline wakefulness reaction time R t alert : The fifth percentile of the local reaction time in each session was taken as the baseline wakefulness reaction time R t alert , as the basis for marking samples in the next step; S15. Label each sample: When the local reaction time and global reaction time of the sample are both less than 1.5 times the baseline wakefulness time, the sample is marked as alert; when the local reaction time and global reaction time of the sample are both greater than 2.5 times the baseline wakefulness reaction time, the sample is marked as fatigued; S2, data enhancement: frequency masking or adding frequency domain noise algorithm to enhance the original data; S3: Model training, using a multi-scale convolution kernel size mixed CNN model to train the data set consisting of original data and enhanced data to obtain a classifier; The specific operations of step S3 are: S31, data filtering: Assume that the original EEG signal recorded by m electrodes is X = {x i } i=1,2,...m , bandpass filter X to obtain three EEG signals of different frequency bands, namely, 4-7Hz EEG signal X1, 8-13Hz EEG signal X2, and 13-32Hz EEG signal X3; S32. Determine the convolution kernel size: Let the convolution kernel size be K = {K1, K2, K3}, where K i is the convolution kernel size of the Depthwise convolution of the i-th branch, i=1,2,3; S33. Network structure design: The first branch of the network structure, the input signal is the first frequency band X of the original data EEG signal 1(m,n) , where m is the number of EEG channels, which is 30, and n is the number of sampling points for each sample, which is 384; The following appears Represents the parameters of the xth layer of the network; The output of the first layer Pointwise is: Where i = 1, 2, 3, ..., N1, N1 = 16, is the number of Pointwise convolutions, represents the weight of the pth channel of the i-th Pointwise convolution, x p,j represents the pth channel of the jth sample point of the input EEG signal sample, Represents the bias of the i-th Pointwise convolution; after the Pointwise layer, the output is obtained The dimension is (16, 384); The first branch of the second layer Depthwise, the output signal dimension of the first layer is (16, 384), the signal obtained by the first layer has 16 channels, each channel uses two Depthwise convolutions, so the number of channels output by the first branch is 32, and the number of sampling points output by the first branch is j (2) It can be calculated by the following formula Among them, the convolution kernel size K1 = 36, the step length stride = 1, and the padding = 0, and we get j (2) =349; When i is an odd number, the output of the second layer Depthwise is: When i is an even number, the output of the second layer Depthwise is: Where K1 is the depthwise convolution kernel size, i is the number of input channels, and j is the number of sampling points. The third activation layer: The fourth batch normalization layer: The fifth global average pooling layer: The second branch of the depthwise layer has a convolution kernel size of K2 = 51, and repeats formula (5) and subsequent steps, wherein the j of the second branch is calculated by formula (5) (2) =334; The third branch of the Depthwise layer has a convolution kernel size of K3 = 80, and repeats formula (5) and subsequent steps, wherein the j of the third branch is calculated by formula (5) (2) =305; The above describes the network structure of the first branch of the network structure. This branch processes the EEG signal X1 in the 4-7Hz frequency band, and repeats the operation of the first branch of the network for the EEG signal X2 in the 8-13Hz frequency band and the EEG signal X3 in the 13-32Hz frequency band to obtain the outputs of the second and third branches of the network. Finally, the outputs of the three branches of the network are fully connected and then processed as follows: Sixth hidden layer: In the above formula, c=0 or c=1. When c=0, it represents the awake state; when c=1, it represents the fatigue state. Seventh floor Obtain classification results; S4. State recognition: Input the preprocessed EEG data into the classifier model to obtain the state label of the sample and the interpretable model classification basis.
2. The driver fatigue state recognition method based on multi-scale convolution kernel size CNN according to claim 1 is characterized in that: After the step S15 is marked, 2022 samples are obtained, each of which contains 3 seconds of EEG data.
3. The driver fatigue state recognition method based on multi-scale convolution kernel size CNN according to claim 1 is characterized in that: The specific operation of frequency masking enhancement data in step S2 is: S21. Perform fast Fourier transform on the original signal x(t) to obtain the frequency domain signal X(jw) X(jw)=F(x(t)) (3), Where F(·) represents fast Fourier transform; S22. Determine hyperparameters s and t, where s represents the number of masked points and t represents the number of masked areas. Set 20 frequency points of a randomly selected area to zero to obtain enhanced data.
4. The method for identifying driver fatigue status based on multi-scale convolution kernel size CNN according to claim 1, characterized in that: The specific operation of adding the frequency domain noise algorithm to enhance the data in step S2 is: H(jw)e jωt =F[x(t)] (21), where H(jw)=|X(jw)|, e jωt =Arg[X(jw)] (i.e. the phase of the frequency domain signal), the amplitude and phase add noise G i (λ)~(0,σ i 2 )(i=1,2): After inverse Fourier transform, the enhanced time domain signal is obtained: x noise (t)=F -1 (X noise ) (23)。
