Automatic driving safe driving cross-scene vigilance detection method and device based on EEG analysis
Through the pre-trained alertness detection network and selective multi-head attention mechanism, the comfort and noise problems of EEG detection in autonomous driving are solved, high-precision alertness detection across scenarios is achieved, and detection accuracy is improved.
Patent Information
- Application Number
- CN202411928036.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing EEG-based alertness detection methods have problems in autonomous driving, such as comfort level effects, large inter-individual differences, and sensor motion noise interference, resulting in insufficient detection precision and accuracy, especially during vehicle movement.
A pre-trained alertness detection network is used to achieve cross-scene alertness detection by fine-tuning and reconstructing the EEG information of missing channels, combining brain region information and selective multi-head attention mechanism.
It improves the accuracy of alertness detection, achieving an average accuracy of 86.20%, which is better than existing deep learning methods and adaptable to different driving scenarios and equipment.
Smart Images

Figure CN119807843B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of intelligent driving technology, and in particular to a method and device for detecting cross-scenario alertness of autonomous driving safety driving based on EEG analysis. Background Art
[0002] Autonomous driving, based on the fusion of computer systems and artificial intelligence, ultimately aims to significantly reduce the incidence of accidents caused by human error. Despite significant progress in autonomous vehicles (AVs) in recent years, accidents involving them highlight the persistent challenges of ensuring their safety and establishing liability. Current AV software systems lack the ability to quickly predict and assess potential risks, particularly in unexpected scenarios or "edge cases." Such autonomous vehicles must be monitored by a safety driver. To this end, ride-hailing platforms employ and train safety drivers for their vehicles. Driver distraction and difficulty concentrating during autonomous driving are not uncommon, which can lead to longer response times when taking control from a misjudged vehicle. Studies have shown that even a 30-minute monotonous driving task can affect driver alertness. Therefore, monitoring the safety driver's alertness is crucial.
[0003] Alertness is a quantitative measure of the cognitive state of a stimulus. Alertness detection systems can be divided into two categories based on the type of input information. One category assesses alertness by analyzing driving performance. One approach utilized 11 steering wheel parameters and achieved an alertness detection accuracy of 72.79%. Another approach used convolutional neural networks (CNNs) to learn the driver's hand posture and achieved an alertness detection accuracy of 85%. However, these methods typically detect decreased alertness only after the safety driver has become fatigued and are limited by low accuracy and high computational overhead.
[0004] In recent years, the combination of physiological information processing such as electrocardiogram (ECG), electromyogram (EMG) and electroencephalogram (EEG) has provided new opportunities to solve similar problems. Among these information, EEG provides the most direct and rapid physiological response.
[0005] EEG records electrical information from the brain, providing valuable insights into brain activity. It is often used as a reliable measure to estimate alertness. Changes in the power spectrum of EEG frequency bands are often used to assess alertness. In one related art scheme, the transient power synchronization characteristics of EEG information were used to determine that most neurons in the cerebral cortex are activated synchronously under fatigue conditions. In one related art scheme, EEG information from the driver's occipital lobe was used to assess distraction in a driving simulator. However, experiments based on scalp EEG are time-consuming and require careful preparation, such as skin cleaning and gel injection, as well as conducting experiments in a shielded room to ensure a high signal-to-noise ratio (SNR), which makes it challenging to conduct a large number of experiments. Therefore, a more versatile, convenient, and non-invasive method is needed to evaluate EEG alertness in realistic driving scenarios. Recently developed dry electrode portable EEG devices, including near-ear EEG and in-ear EEG, provide promising solutions for this purpose.
[0006] The EEG model needs to be trained separately for different numbers of EEG channels. Although portable dry electrode EEG with few channels has been verified in practice, the system still has three major problems:
[0007] 1) An EEG cap requires 32 to 256 wired electrodes to be placed on the driver's scalp, which affects wearer comfort. Furthermore, reducing the number of channels will result in decreased detection accuracy.
[0008] 2) The EEG data characteristics vary significantly between individuals, resulting in a decrease in classification accuracy in different scenarios.
[0009] 3) During the continuous motion of the vehicle, slight sensor movement may occur, resulting in unnecessary noise in the sensor information, which reduces the signal-to-noise ratio and accuracy of the method. Summary of the Invention
[0010] An embodiment of the present invention provides a method and device for detecting cross-scenario alertness for autonomous driving safety based on EEG analysis.
[0011] A first aspect of an embodiment of the present invention provides a method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis, the method comprising:
[0012] Obtaining a pre-trained alertness detection network, wherein the pre-trained alertness detection network is pre-trained using N-channel EEG information and corresponding brain region information, and has the function of reconstructing missing EEG information of multiple channels;
[0013] Obtaining EEG information and corresponding brain region information in a sample safe driving scenario, wherein the number of channels of the EEG information in the sample safe driving scenario is M channels compared to N channels;
[0014] Based on the EEG information and corresponding brain region information in the sample safe driving scenario, the pre-trained alertness detection network is fine-tuned to obtain a fine-tuned alertness detection network;
[0015] Obtaining EEG information in a new safe driving scenario, wherein the number of channels of the EEG information in the new safe driving scenario is missing at least one channel compared to N channels;
[0016] Based on the fine-tuned alertness detection network, the EEG information in the new safe driving scenario is classified to obtain a classification result, which represents whether the category of the EEG information in the new safe driving scenario is the driver in an alert state.
[0017] Optionally, based on EEG information and corresponding brain region information in a sample safe driving scenario, the pre-trained alertness detection network is fine-tuned to obtain a fine-tuned alertness detection network, including:
[0018] Based on the pre-trained alertness detection network, obtaining an alertness detection network to be fine-tuned;
[0019] Randomly fill the missing M channels of EEG information in the sample safe driving scenario with zeros;
[0020] Inputting the filled EEG information brain region information into the channel linear mapping layer to be trained of the alertness detection network to be fine-tuned to obtain sample information to be encoded;
[0021] Processing the sample information to be encoded by the encoder and decoder of the alertness detection network to be fine-tuned to obtain sample information to be classified;
[0022] Inputting the sample information to be classified into the classifier to be trained of the alertness detection network to be fine-tuned to obtain the sample classification result;
[0023] Based on the sample classification results and the classification labels of the EEG information in the sample safe driving scenario, the model parameters of the channel linear mapping layer to be trained and the classifier to be trained of the alertness detection network to be fine-tuned are updated to obtain a fine-tuned alertness detection network.
[0024] Optionally, obtaining a vigilance detection network to be fine-tuned based on the pre-trained vigilance detection network includes:
[0025] Initializing the model parameters of the encoder and decoder of the alertness detection network to be fine-tuned to the model parameters of the encoder and decoder in the pre-trained alertness detection network;
[0026] Randomly initializing the model parameters of the channel linear mapping layer in the pre-trained alertness detection network to obtain the channel linear mapping layer to be trained of the alertness detection network to be fine-tuned;
[0027] The model parameters of the classifier in the pre-trained alertness detection network are randomly initialized to obtain the classifier to be trained of the alertness detection network to be fine-tuned.
[0028] Optionally, the training process of the pre-trained alertness detection network includes:
[0029] Obtaining experimental EEG information and corresponding brain region information in an experimental safe driving scenario, wherein the number of channels of the experimental EEG information in the experimental safe driving scenario is N channels;
[0030] Randomly determine a plurality of channels that need to be masked from the N channels corresponding to the experimental EEG information;
[0031] Inputting the experimental EEG information and the corresponding brain region information, as well as the identifiers of the multiple channels to be masked, into the channel linear mapping layer to be trained of the alertness detection network to be trained, to obtain masked experimental EEG information with position information;
[0032] Processing the masked experimental EEG information with position information through an encoder and a decoder of the alertness detection network to be trained to obtain experimental EEG information to be classified;
[0033] Inputting the experimental EEG information to be classified into the classifier to be trained of the alertness detection network to be trained to obtain the experimental EEG classification result;
[0034] Based on the experimental EEG classification result and the classification label of the experimental EEG information, the model parameters of the alertness detection network to be trained are updated to obtain a pre-trained alertness detection network.
[0035] Optionally, the experimental EEG information and the corresponding brain region information, as well as the identifiers of multiple channels to be masked, are input into a channel linear mapping layer to be trained of a vigilance detection network to be trained, to obtain masked experimental EEG information with position information, including:
[0036] Processing the experimental EEG information and the corresponding brain region information through the channel linear mapping layer to be trained to obtain experimental EEG information with position information;
[0037] The experimental EEG information with position information is masked according to the identifiers of the multiple channels to be masked by the channel linear mapping layer to be trained, so as to obtain masked experimental EEG information with position information.
[0038] Optionally, the masked experimental EEG information with position information is processed by an encoder and a decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified, including:
[0039] encoding the masked experimental EEG information with position information through an encoder of the alertness detection network to be trained to obtain reconstructed experimental EEG information of the masked multiple channels;
[0040] Filling the reconstructed experimental EEG information of the masked multiple channels into the masked experimental EEG information with position information to obtain the reconstructed experimental EEG information;
[0041] The reconstructed experimental EEG information is processed by a decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
[0042] Optionally, encoding the masked experimental EEG information with position information by an encoder of the alertness detection network to be trained to obtain reconstructed experimental EEG information of the masked multiple channels includes:
[0043] performing selective multi-head attention calculation on the masked experimental EEG information with position information through an encoder of the alertness detection network to be trained, thereby obtaining a first selective multi-head attention calculation result;
[0044] The first selective multi-head attention calculation result is processed by the encoder of the alertness detection network to be trained to obtain the reconstructed experimental EEG information of the masked multiple channels.
[0045] Optionally, the reconstructed experimental EEG information is processed by a decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified, including:
[0046] Performing selective multi-head attention calculation on the reconstructed experimental EEG information through a decoder of the alertness detection network to be trained to obtain a second selective multi-head attention calculation result;
[0047] The second selective multi-head attention calculation result is processed by the decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
[0048] A second aspect of an embodiment of the present invention provides a device for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis, the device comprising:
[0049] a first acquisition module for obtaining a pre-trained alertness detection network, wherein the pre-trained alertness detection network is pre-trained using N-channel EEG information and corresponding brain region information, and has the function of reconstructing missing EEG information of multiple channels;
[0050] A second acquisition module is used to obtain EEG information and corresponding brain region information in a sample safe driving scene, wherein the number of channels of the EEG information in the sample safe driving scene is missing M channels compared to N channels;
[0051] A fine-tuning module is used to fine-tune the pre-trained alertness detection network based on EEG information and corresponding brain region information in sample safe driving scenarios to obtain a fine-tuned alertness detection network;
[0052] a third acquisition module, configured to obtain EEG information in a new safe driving scenario, wherein the number of channels of the EEG information in the new safe driving scenario is missing at least one channel compared to N channels;
[0053] The classification module is used to classify the EEG information in the new safe driving scenario based on the fine-tuned alertness detection network to obtain a classification result, wherein the classification result represents the category of the EEG information in the new safe driving scenario, namely whether the driver is in an alert state.
[0054] A third aspect of an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When executed, the processor implements the method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis as described in the first aspect of the present invention.
[0055] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis as described in the first aspect of the present invention is implemented.
[0056] The fifth aspect of an embodiment of the present invention provides a computer program product, including a computer program / instruction, which is used by a processor to implement the steps in the method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis as described in the first aspect of the present invention.
[0057] Driver alertness is a prerequisite for safe driving of autonomous vehicles. Compared to the high lag and low accuracy of vehicle behavior trajectory detection, alertness detection based on physiological information is currently the most reliable and accurate method. Although electroencephalogram (EEG)-based alertness detection methods have made some progress in experimental scenarios, due to the low signal-to-noise ratio of EEG information acquisition and the difficulty of real-time processing, it remains a challenging problem under the constraints of scenarios such as high-speed autonomous vehicles. In addition, the cumbersome data collection process and labeling difficulties also hinder progress in this field. Considering the successful application of EEG monitoring in experimental environments, the embodiments of the present invention believe that the scenario transfer of knowledge learned in experimental scenarios is reasonable and feasible. Therefore, the embodiments of the present invention aim to bridge the domain gap between experimental and new scenarios, while balancing the number of channels and accuracy. Specifically, the embodiments of the present invention propose a cross-scenario alertness detection method for safe autonomous driving based on EEG analysis. This method is based on a standard montage structure of EEG channels and reduces the number of channels by considering the common regions of EEG channels in different scenarios. The results show that the method proposed in the embodiment of the present invention has an average accuracy of 86.20% on the SEED-VIG dataset containing 12 subjects, which is higher than the 82.21% achieved by the most advanced deep learning method. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0059] Figure 1 This is a flowchart of the steps of a method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis provided by an embodiment of the present invention;
[0060] Figure 2 This is a flow chart of a method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0062] In the embodiment of the present invention, a method for detecting cross-scenario alertness of autonomous driving safety driving based on EEG analysis is proposed to achieve cross-scenario, cross-subject, and cross-device monitoring of driver alertness. Specifically, Figure 1, which shows a flowchart of a method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis provided by an embodiment of the present invention, the method comprising the following steps:
[0063] S101, obtaining a pre-trained alertness detection network, wherein the pre-trained alertness detection network is pre-trained using N-channel EEG information and corresponding brain region information, and has the function of reconstructing missing EEG information of multiple channels.
[0064] S102 , obtaining EEG information and corresponding brain region information in a sample safe driving scenario, wherein the number of channels of the EEG information in the sample safe driving scenario is missing M channels compared to N channels.
[0065] S103 , based on the EEG information and the corresponding brain region information in the sample safe driving scenario, fine-tuning the pre-trained alertness detection network to obtain a fine-tuned alertness detection network.
[0066] S104 : Obtain EEG information in a new safe driving scenario, wherein the number of channels of the EEG information in the new safe driving scenario is missing at least one channel compared to N channels.
[0067] S105 , based on the fine-tuned alertness detection network, classify the EEG information in the new safe driving scenario to obtain a classification result, wherein the classification result indicates whether the EEG information in the new safe driving scenario is in an alert state.
[0068] Specifically, in step S101, the pre-trained alertness detection network is obtained by training a Transformer network with a selective multi-head attention mechanism using N-channel EEG information, and its accuracy is better than the traditional multi-head attention Transformer network and SOTA.
[0069] In an embodiment of the present invention, the training process of the pre-trained alertness detection network includes:
[0070] S201 , obtaining experimental EEG information and corresponding brain region information in an experimental safe driving scenario, wherein the number of channels of the experimental EEG information in the experimental safe driving scenario is N channels.
[0071] S202 : Randomly determine a plurality of channels that need to be masked from the N channels corresponding to the experimental EEG information.
[0072] S203 , inputting the experimental EEG information and the corresponding brain region information, as well as the identifiers of the multiple channels that need to be masked, into the channel linear mapping layer to be trained of the alertness detection network to be trained, to obtain masked experimental EEG information with position information.
[0073] S204 , processing the masked experimental EEG information with position information through the encoder and decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
[0074] S205 , inputting the experimental EEG information to be classified into the classifier to be trained of the alertness detection network to be trained, and obtaining the experimental EEG classification result.
[0075] S206 , based on the experimental EEG classification result and the classification label of the experimental EEG information, updating the model parameters of the alertness detection network to be trained to obtain a pre-trained alertness detection network.
[0076] In an embodiment of the present invention, during the training process of the pre-trained alertness detection network, features can be extracted from EEG information to obtain EEG features, and features can be extracted from brain region information to obtain regional features. The EEG features and regional features are spliced and input into the pre-trained Transformer network, and some channels are randomly shielded to force the encoder and decoder of the Transformer to reconstruct the original EEG features, so that the pre-trained alertness detection network obtained by training has the function of reconstructing the missing EEG information of multiple channels.
[0077] In an embodiment of the present invention, the frequency-based features in the EEG information are extracted by calculating the power spectral density (PSD), and then the power spectral density is converted into differential entropy, and the brain region information is spliced to obtain the input features.
[0078] Specifically, in an embodiment of the present invention, first, the raw EEG information is preprocessed to remove noise and normalize it to eliminate the influence of the amplitude and range differences between the values of the indicators. Then, the power spectral density and differential entropy of the EEG information in different frequency bands are extracted. Secondly, since the EEG electrodes are placed according to the international 10-20 standard, the embodiment of the present invention encodes the two-dimensional position into the EEG feature based on the placement coordinates of the EEG channel. The encoded masked EEG information is then input into the encoding layer of the Transformer. In the multi-head attention mechanism, the average H divergence is used to calculate the correlation between each query and all keys to obtain the most critical top queries. Again, all slices are merged through global average pooling, and a simple fully connected network is used to predict the alertness state. Finally, the fine-tuning network is fine-tuned by sharing the weights of the pre-trained network trained on the experimental dataset, thereby obtaining better classification results on the real dataset.
[0079] Specifically, in an embodiment of the present invention, after obtaining experimental EEG information from an experimental safe driving scenario, the experimental EEG information needs to be preprocessed, including channel localization, re-referencing, independent component analysis (ICA), bandpass filtering, segmentation, and normalization. Specifically, all of these processes can be performed using a MATLAB toolbox called EEGLab.
[0080] In this embodiment of the present invention, the experimental EEG information in the experimental safe driving scenario refers to a standard dataset acquired in a laboratory setting. Specifically, the experimental EEG information in the experimental safe driving scenario can be derived from the SAD dataset, a publicly available sustained attention driving dataset acquired by volunteers completing a 90-minute sustained attention task in a driving simulator. This dataset includes 62 32-channel EEG data from 27 subjects driving on a four-lane highway. The volunteers were instructed to maintain the center of their lane. Lane departure events were randomly activated, causing the vehicle to drift from its original cruising lane to either the left or right lane. The entire trial included events of deviation onset, response onset, and response shift. The next trial began 5-10 seconds after the previous trial, with the volunteers instructed to return the vehicle to the original cruising lane. Reaction time (RT) is the time interval between deviation onset and response onset in each trial. For each driving trial, two types of RT were calculated: local RT and global RT. The local RT was defined as the RT for each trial. The global RT was the average of all local RTs within the 90-second window before the deviation occurred. Trials were labeled as "sleepy" or "vigilant" based on the difference between local and global RT times. "Vigilant RT," measured as the 5th percentile of local RT, represents the RT a subject can perform during vigilance. Trials in which both local and global RTs were less than 1.5 times the vigilance RT were labeled "vigilant," and trials in which both local and global RTs were greater than 2.5 times the vigilance RT were labeled "sleepy." After labeling all subjects in the dataset, each category for each subject was required to contain at least 50 samples to avoid overfitting. Because some subjects had smaller sample sizes in certain categories, data from subjects with fewer than 50 samples in a particular category were discarded. Finally, after data augmentation, 17,707 trials were selected from 13 subjects.
[0081] In the embodiment of the present invention, each EEG information is filtered using a 1-50 Hz bandpass filter to reduce the influence of environmental noise.
[0082] In the embodiment of the present invention, the filtered EEG information can also be standardized. Specifically, the EEG information is represented as EEG (C, T)where C is the number of channels of the EEG information, and T is the number of sample points of the EEG information. Then the EEG information is standardized by z-score to mitigate fluctuations and non-stationarity, as follows:
[0083] (1)
[0084] where, , , Z and X represent the standardized EEG information and the original EEG information, respectively, and represent the mean and variance of the preprocessed data, respectively, and the z-score provides a true representation of the relative standard distance of a score from the mean. All EEG information is scaled and falls into a specific interval, with a mean of 0 and a standard deviation of 1.
[0085] Power spectral density (PSD) defines the distribution of information power with frequency. In physics, the instantaneous power spectral density of a wave at a specific frequency is usually defined as the result of its frequency density multiplied by the corresponding coefficient. Since the collected EEG information is mostly time-domain information, it must be mapped to the frequency domain before calculating the power spectral density. Therefore, in the embodiments of the present application, the WELCH algorithm is used to obtain the power spectral density of the EEG information.
[0086] (2)
[0087] where U represents a normalization factor, d(n) is a data window with a length of N data x(n) is divided into L segments, each with a length of M . The spectrum of the EEG information is divided into δ (1-4Hz), θ (4-8Hz), α (8-13Hz), β (13-30Hz), and γ (30-50Hz). In this part, the differential entropy (DE) of each frequency band is calculated as follows:
[0088] (3)
[0089] In the embodiments of the present application, the EEG information collected by each channel is represented as the differential entropy of 5 frequency bands by formula (2) and formula (3).
[0090] In the embodiments of the present application, the problem of data imbalance can also be solved based on the sampling method, such as upsampling and downsampling:
[0091] (4)
[0092] in, represents the input vector selected from a small number of sample classes, that is, the corresponding differential entropy feature, express A sample is randomly selected from the K nearest neighbors of represents new samples randomly synthesized in sequence, Finally, the embodiment of the present invention uses this upsampling method to generate uniformly distributed samples.
[0093] In the embodiment of the present invention, step S203 includes the following sub-steps:
[0094] S2031, processing the experimental EEG information and the corresponding brain region information through the channel linear mapping layer to be trained to obtain experimental EEG information with position information;
[0095] S2032 , masking the experimental EEG information with position information according to the identifiers of the multiple channels to be masked by the channel linear mapping layer to be trained, to obtain masked experimental EEG information with position information.
[0096] In the embodiment of the present invention, since the alertness detection network to be trained does not include any recursive or convolutional process, in the embodiment of the present invention, position encoding is added to the input vector to provide the model with some information about the relative position of the features in the temporal information.
[0097] Specifically, in an embodiment of the present invention, the experimental EEG information in the experimental safe driving scenario is a composite of information from n-dimensional (e.g., 16, 32, 64, 128) electrode channels, following the internationally recognized EEG cap electrode placement rules, namely the 10-20 system. The 32-channel EEG cap only represents a subset of the denser 64-channel EEG cap. In addition, although the number of electrode channels in different EEG caps is different, each brain region (temporal lobe, occipital lobe, etc.) contains relatively fixed EEG channel names. Therefore, an embodiment of the present invention proposes to integrate 2D-based EEG coordinates into the original information through position encoding to enhance semantic similarity and temporal position in the d-dimensional space.
[0098] In the embodiment of the present invention, the calculation formula of the position code is as follows:
[0099] (5)
[0100] where x and y represent the coordinates of the EEG channels, j represents the dimension of the EEG channel, d represents the dimension of the position encoding vector, PE((x, y), 2j) and PE((x,y), 2 j +1 ) The coordinates are x and y The second position code j and (2 j +1) portion.
[0101] The position code is spliced with the experimental EEG information in the original experimental safe driving scenario to obtain the experimental EEG information with position information.
[0102] Step S204 includes the following sub-steps:
[0103] S2041, encoding the masked experimental EEG information with position information through an encoder of the alertness detection network to be trained to obtain reconstructed experimental EEG information of the masked multiple channels;
[0104] S2042, filling the masked experimental EEG information with position information with the reconstructed experimental EEG information of the plurality of channels to obtain the reconstructed experimental EEG information;
[0105] S2043 , processing the reconstructed experimental EEG information through the decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
[0106] In the embodiment of the present invention, S2041 specifically includes:
[0107] performing selective multi-head attention calculation on the masked experimental EEG information with position information through an encoder of the alertness detection network to be trained, thereby obtaining a first selective multi-head attention calculation result;
[0108] The first selective multi-head attention calculation result is processed by the encoder of the alertness detection network to be trained to obtain the reconstructed experimental EEG information of the masked multiple channels.
[0109] In the embodiment of the present invention, S2043 specifically includes:
[0110] Performing selective multi-head attention calculation on the reconstructed experimental EEG information through a decoder of the alertness detection network to be trained to obtain a second selective multi-head attention calculation result;
[0111] The second selective multi-head attention calculation result is processed by the decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
[0112] In an embodiment of the present invention, multiple channels that need to be masked are randomly determined from N channels corresponding to the experimental EEG information. During the pre-training process, the EEG information of the corresponding channels is masked, and the encoder reconstructs the masked EEG information. The prediction layer classifies the alertness state of the reconstructed information, so that the pre-trained alertness detection network has the function of reconstructing the missing EEG information of multiple channels.
[0113] In the embodiment of the present invention, considering that EEG information includes multiple brain regions such as the occipital lobe, temporal lobe and frontal lobe, the missing EEG information may lack complete information in a certain brain region, or the number of channels in the brain region is limited. To this end, the embodiment of the present invention proposes to input the brain region information corresponding to the EEG channel into the alertness detection network to be trained, so that the alertness detection network to be trained can refer to the brain region information and use part of the information of a brain region to reconstruct other EEG information in the brain region. In the embodiment of the present invention, the EEG channels are divided into 15 brain regions based on central symmetry. Specifically, Figure 2 FIG2 shows a flow chart of a method for detecting cross-scenario alertness for autonomous driving safety based on EEG analysis according to an embodiment of the present invention. Figure 2 The brain diagram in the lower left corner shows the 15 brain regions divided according to an embodiment of the present invention.
[0114] In the embodiment of the present invention, the region level mark is introduced As brain region information, they are appended to the end of the input sequence to represent the brain region information corresponding to each EEG channel. During the training process, the alertness detection network to be trained extracts localized information from the original channel through the attention mechanism, in which the determined attention mask is assigned to the encoder / decoder. This ensures accurate association between regional features and source features of the same brain region, as well as between features of different regions. Secondly, the encoder converts a series of tokens Map to , and the last 15 tokens form the implicit representation. Again, the decoder is identical to the encoder with N Transformer blocks and also employs selective multi-head attention. The decoder only accesses information contained in regional features and partial channels. This design enables the encoder to efficiently reconstruct EEG information through a unified topology.
[0115] In an embodiment of the present invention, regional-level labeling information representing brain region information is spliced with EEG information and combined with a selective multi-head attention mechanism to improve the model's ability to reconstruct EEG signals, so that the model can also reconstruct missing EEG information of multiple channels across scenarios and devices.
[0116] In this embodiment of the present invention, the EEG channels are divided into 15 regions based on the central symmetry of the brain. This division helps the model capture the characteristics of different brain regions during training and considers the spatial information of brain regions during feature extraction.
[0117] In this embodiment of the present invention, region-level markers are introduced at the end of the input sequence and fed into the model along with the original EEG signal features. This allows the model to understand the EEG signal from a regional perspective, thereby extracting richer features. Specifically, the encoder maps the input EEG signal and the region-level markers into a high-dimensional space containing hidden representations. In this process, the region-level markers help the model understand the regional characteristics of the EEG signal.
[0118] In this embodiment of the present invention, during the pre-training phase, portions of the input EEG signal are randomly masked, and the model's task is to attempt to reconstruct these masked portions. Region-level labels play a key role in this process, helping the model to account for the characteristics of different brain regions during reconstruction.
[0119] By considering the regional characteristics of EEG signals, the model is able to better generalize to different scenarios and devices. This is especially important for cross-scenario and cross-device alertness detection, as different environments and devices may have different effects on EEG signals.
[0120] In the embodiment of the present invention, in step 202, after determining the multiple channels that need to be masked, in the subsequent process, the part of the EEG information input to the encoder to be trained is masked, and the encoder to be trained attempts to reconstruct it using the remaining information.
[0121] In an embodiment of the present invention, the pre-training process is completed by reconstructing the input and predicting the information of the missing EEG channel, which is composed of the output embedding of the decoder. In an embodiment of the present invention, the mean squared error (MSE) loss is used to measure the difference between the predicted DE value and the true value. During the migration process, the mask of the missing channel is first randomly filled with 0 by analogy to meet the input dimension consistency. For the encoder and decoder, the weights are directly shared, and the intermediate layers are frozen to reconstruct the missing EEG channel information. For the final classifier, random initialization is used to allow the fine-tuning network to better adapt to new data.
[0122] In this embodiment of the present invention, a multi-head attention mechanism is used to learn long-term dependencies, allowing direct connections between each pair of positions. The average H-divergence is used to calculate the correlation between the query and all keys to obtain the most critical top queries.
[0123] In the attention mechanism, each past position h , all positions can be represented by multiple attention headsu :
[0124] (6)
[0125] in, It is k The result of the attention head is is the linear projection matrix. Considering efficiency and effectiveness, the scaled dot product is used as the attention function. is the weighted sum of all value vectors, where the weights are calculated by applying the attention function to a specific query and key.
[0126] Related research shows that the self-attention mechanism in traditional Transformers is a long-tail distribution of attention scores, with only a limited number of points strongly correlated with other points. To this end, the embodiments of the present invention search for the top few queries with the greatest impact. The difference between the distribution of relevant queries and the uniform distribution is so large that the difference between the probability distribution of each query and the uniform distribution can be used as a criterion for selecting top queries. In the embodiments of the present invention, a simple formula 7 is used to measure the difference between the query and the key to avoid a large amount of calculation before formula 8.
[0127] (7)
[0128] In formula 7, H(q i ,K) Indicates all keys q i The arithmetic mean of L K express k The number of vectors. If i queries to get a larger H(q i ,K) , then its attention probability is more “diverse” and has a high chance of containing the dominant dot product pairs in the head field of the long-tail self-attention distribution.
[0129] (8)
[0130] in, and v j They are q A subset of a vector, k Vector Sum v vector, d k yes k j The dimension of is obtained by projecting the input vector into Q space, K space and V space. q 、k i and v i .
[0131] = W q h i ,W k h i ,W v h i (9)
[0132] in, and is the projection matrix. Each attention set head has its own projection matrix, as shown in formula (9); where formula (8) represents the calculation of a head based on the extracted part q, and formula (9) represents the use of the values of multiple heads to perform projection calculation to obtain a new qkv.
[0133] Each attention head is h t is obtained by including all "past" positions in order to capture ℎ t and h i Any long-term dependencies between them are captured. In addition, different attention heads focus on different aspects of the dependencies. After obtaining a refined representation of each position through the multi-head attention mechanism, the embodiment of the present invention adds a fully connected feedforward network that can be applied independently and identically to each position. This feedforward network transforms the nonlinear function, which is defined as follows. Then, a residual layer and batch normalization are added:
[0134] (10)
[0135] in, b 1 ,b 2 represents the bias term, W 1 ,W 2 represents the weight matrix, m t Represents the input of the previous layer.
[0136] The full-attention transformer calculates self-attention by treating past features as a whole. This approach reduces the risk of losing or forgetting past information. However, some information in the input may introduce noise, resulting in reduced accuracy. By reducing the number of q calculations, embodiments of the present invention can improve computational efficiency and model space usage. It can be noted that algorithms using the selective attention mechanism have lower memory usage overhead, enabling embodiments of the present invention to simplify resource consumption issues in motion scenes.
[0137] In this embodiment of the present invention, the classifier is a fully connected layer that uses an activation function to ensure that the network predicts the alert state. The number of output neurons is equal to the probability. The predicted probability is then determined using a linear function. The objective function is optimized using binary cross entropy as follows:
[0138] (11)
[0139] in is a probability distribution where each element p i Indicates that the sample belongs to the category i The probability of is the sample label, if the sample belongs to the category i , y i =1, otherwise y i =0.
[0140] The following, combined Figure 2 Taking an exemplary embodiment as an example, the training process of the alertness detection network to be trained in the embodiment of the present invention is explained. Assuming that the experimental EEG information is 64 channels, the alertness detection network to be trained can randomly determine 32 channels that need to be masked. The channel linear mapping layer splices the experimental EEG information and the corresponding brain area information, and adds 2D position encoding to obtain experimental EEG information with position information, and submerges the channels that need to be masked to obtain masked experimental EEG information with position information corresponding to the remaining 32 EEG channels. The EEG information is input into the encoder, and the encoder performs selective multi-head attention calculation on the EEG information to obtain a first selective multi-head attention calculation result, and based on the first selective multi-head attention calculation result, the reconstructed experimental EEG information of the masked multiple channels is obtained (such as Figure 2The green oval frame output by the encoder represents that the EEG information is filled into the mask experimental EEG information with the position information of the band to obtain reconstructed experimental EEG information (EEG information of 64 channels). Then the encoder inputs the reconstructed experimental EEG information into the decoder, and the decoder processes the input to obtain experimental EEG information to be classified, which is input into the classifier to obtain the classification result of the experimental EEG. During the experiment, the model parameters are updated based on the classification result output by the classifier and the classification label of the experimental EEG information.
[0141] In the embodiment of the present application, considering that the standard EEG information follows the international standard of 10-20, the topological structure is consistent. The standard EEG channel position makes the transfer model from multiple channels to a limited number of EEG channels reasonable. Due to the reduction of channels, zero padding is usually used to maintain the consistency of the input dimension. However, this method will cause the loss of relevant information, and even fine-tuning will cause significant performance degradation.
[0142] Therefore, in the embodiment of the present application, the parameters of the encoder and the decoder of the pre-trained vigilance detection network which has learned the reconstruction ability of the missing EEG channel are frozen, and the parameters of the channel linear mapping layer and the classifier of the vigilance detection network are fine-tuned based on the data in the actual scene.
[0143] Specifically, in the embodiment of the present application, step S103 includes the following sub-steps:
[0144] S1031, obtaining a vigilance detection network to be fine-tuned based on the pre-trained vigilance detection network;
[0145] S1032, randomly filling the missing M-channel EEG information in the sample safe driving scene as zero;
[0146] S1033, inputting the EEG information and brain region information after filling into the channel linear mapping layer to be trained of the vigilance detection network to be fine-tuned to obtain sample information to be encoded;
[0147] S1034, processing the sample information to be encoded by the encoder and the decoder of the vigilance detection network to be fine-tuned to obtain sample information to be classified;
[0148] S1035, inputting the sample information to be classified into the classifier to be trained of the vigilance detection network to be fine-tuned to obtain a sample classification result;
[0149] S1036, updating the model parameters of the channel linear mapping layer to be trained and the classifier to be trained of the vigilance detection network to be fine-tuned based on the sample classification result and the classification label of the EEG information in the sample safe driving scene to obtain a fine-tuned vigilance detection network.
[0150] Taking into account the real driving environment, in an embodiment of the present invention, mask transfer pre-training is used to achieve cross-scene and cross-device modeling.
[0151] Wherein, S1031 includes the following sub-steps:
[0152] S10311, initializing the model parameters of the encoder and decoder of the alertness detection network to be fine-tuned to the model parameters of the encoder and decoder in the pre-trained alertness detection network;
[0153] S10312, randomly initializing the model parameters of the channel linear mapping layer in the pre-trained alertness detection network to obtain the channel linear mapping layer to be trained of the alertness detection network to be fine-tuned;
[0154] S10313: Randomly initialize the model parameters of the classifier in the pre-trained alertness detection network to obtain the classifier to be trained of the alertness detection network to be fine-tuned.
[0155] Specifically, such as Figure 2 As shown, in an embodiment of the present invention, during the fine-tuning process, further fine-tuning can be performed on the basis of the pre-trained alertness detection network. During the fine-tuning process, the parameters of the encoder and decoder are frozen, and the parameters of the channel linear mapping layer and the classifier of the alertness detection network are updated.
[0156] In an embodiment of the present invention, the EEG information in the sample safe driving scenario may be derived from sample EEG information collected in an actual application scenario, for example, from a SEED-VIG dataset or a SEED-VRW dataset.
[0157] The SEED-VIG dataset was collected using a simulated driving system to collect EEG, EOG, and eye movement data from 23 subjects. During the simulation, a highway scene was projected onto an LCD screen in front of a real-world modified vehicle. The test route was straight and monotonous to induce fatigue in the subjects. Both EEG and EOG were collected using an ESI NeuroScan system with a sampling rate of 1000 Hz. The EEG cap had 64 electrodes positioned using the international standard of 10-20. This dataset records 11 channels of posterior EEG (FT7, FT8, T7, T8, TP7, TP8, CP1, CP2, P1, P2, PO3, POZ, PO4, O1, and O2), and 4 channels of forehead EOG for further analysis. An infrared camera was deployed in SMI Eye Tracking Glasses 2 to record eye gaze and several eye movements, including blinks, eye closures (CLOS), saccades, and fixations. Labels in this dataset are the PERCLOS level measured by the eye tracker. If the PERCLOS score was less than 0.35, the subject was labeled as alert. If the PERCLOS score was greater than 0.70, the subject was labeled as exhausted. A sub-dataset containing 12 subjects was constructed. Each subject had more than 50 alertness and fatigue samples to ensure a balanced dataset.
[0158] The SEED-VRW dataset is based on driving in a four-seater electric vehicle. This dataset was collected on actual roads in a specific location. The roads are primarily straight, with few pedestrians and vehicles, providing a safer and more realistic simulation of real-world road driving conditions. Participants reacted to driving conditions in real time, turning the steering wheel for turns or braking when pedestrians crossed their path. The experiments were conducted after meals, a time that typically induces drowsiness. The length of time each participant spent in the drowsy driving experiment varied. The same preprocessing steps and label calculations were performed on this dataset as with SEED-VIG.
[0159] In an embodiment of the present invention, a pre-trained alertness detection network is used to have the ability to reconstruct accurate EEG information of multiple channels to solve the problem of inconsistent channel numbers between different EEG devices, so that the fine-tuned alertness detection network can reconstruct the missing EEG information based on the input EEG information of a few channels and the corresponding brain area information, and complete the classification task based on the reconstructed information.
[0160] Based on the same inventive concept, an embodiment of the present invention further provides a device for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis, the device comprising:
[0161] a first acquisition module for obtaining a pre-trained alertness detection network, wherein the pre-trained alertness detection network is pre-trained using N-channel EEG information and corresponding brain region information, and has the function of reconstructing missing EEG information of multiple channels;
[0162] a second acquisition module for obtaining EEG information and corresponding brain region information in a sample safe driving scenario, wherein the number of channels of the EEG information in the sample safe driving scenario is M channels compared to N channels;
[0163] A fine-tuning module is used to fine-tune the pre-trained alertness detection network based on EEG information and corresponding brain region information in sample safe driving scenarios to obtain a fine-tuned alertness detection network;
[0164] a third acquisition module, configured to obtain EEG information in a new safe driving scenario, wherein the number of channels of the EEG information in the new safe driving scenario is missing at least one channel compared to N channels;
[0165] The classification module is used to classify the EEG information in the new safe driving scenario based on the fine-tuned alertness detection network to obtain a classification result, wherein the classification result represents the category of the EEG information in the new safe driving scenario, namely whether the driver is in an alert state.
[0166] Based on the same inventive concept, an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes, the steps in the method for detecting cross-scene alertness for safe autonomous driving based on EEG analysis as described in any of the above embodiments are implemented.
[0167] Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for detecting cross-scene alertness for safe autonomous driving based on EEG analysis are implemented in any of the above embodiments.
[0168] Based on the same inventive concept, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis as described in any of the above embodiments.
[0169] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0170] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0171] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (apparatuses), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks 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 terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable terminal device generate instructions for implementing the process 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 that can direct a computer or other programmable terminal 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 The function specified in one or more boxes.
[0173] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0174] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0175] Finally, it is to be understood that the phraseology or terminology such as "first" and "second" etc. used herein is merely intended to differentiate one entity or operation from another entity or operation, without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0176] The above describes in detail the automatic driving safety driving cross-scene alertness detection method based on EEG analysis provided by the present application, and the principles and implementation manners of the present application are described by applying specific examples in the present application. The above description of the examples is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed, and the above description of the present application should not be understood as a limitation of the present application.
Claims
1. A method for detecting cross-scenario alertness in autonomous driving safety driving based on EEG analysis, characterized in that: The method comprises: Obtaining a pre-trained alertness detection network, wherein the pre-trained alertness detection network is pre-trained using N-channel EEG information and corresponding brain region information, and has the function of reconstructing missing EEG information of multiple channels; Obtaining EEG information and corresponding brain region information in a sample safe driving scenario, wherein the number of channels of the EEG information in the sample safe driving scenario is M channels compared to N channels; Based on the EEG information and corresponding brain region information in the sample safe driving scenario, the pre-trained alertness detection network is fine-tuned to obtain the fine-tuned alertness detection network; Obtaining EEG information in a new safe driving scenario, wherein the number of channels of the EEG information in the new safe driving scenario is missing at least one channel compared to N channels; classifying the EEG information in the new safe driving scenario based on the fine-tuned alertness detection network to obtain a classification result, wherein the classification result indicates whether the EEG information in the new safe driving scenario is in an alert state; Based on the EEG information and corresponding brain region information in the sample safe driving scenario, the pre-trained alertness detection network is fine-tuned to obtain the fine-tuned alertness detection network, including: Based on the pre-trained alertness detection network, obtaining an alertness detection network to be fine-tuned; Randomly fill the missing M channels of EEG information in the sample safe driving scenario with zeros; Inputting the filled EEG information brain region information into the channel linear mapping layer to be trained of the alertness detection network to be fine-tuned to obtain sample information to be encoded; Processing the sample information to be encoded by the encoder and decoder of the alertness detection network to be fine-tuned to obtain sample information to be classified; Input the sample information to be classified into the classifier to be trained of the alertness detection network to be fine-tuned to obtain the sample classification result; Based on the sample classification results and the classification labels of the EEG information in the sample safe driving scenario, updating the model parameters of the channel linear mapping layer to be trained and the classifier to be trained of the alertness detection network to be fine-tuned, thereby obtaining a fine-tuned alertness detection network; Based on the pre-trained alertness detection network, a vigilance detection network to be fine-tuned is obtained, including: Initializing the model parameters of the encoder and decoder of the alertness detection network to be fine-tuned to the model parameters of the encoder and decoder in the pre-trained alertness detection network; Randomly initializing the model parameters of the channel linear mapping layer in the pre-trained alertness detection network to obtain the channel linear mapping layer to be trained of the alertness detection network to be fine-tuned; Randomly initializing the model parameters of the classifier in the pre-trained alertness detection network to obtain the classifier to be trained of the alertness detection network to be fine-tuned; The training process of the pre-trained alertness detection network includes: Obtaining experimental EEG information and corresponding brain region information in an experimental safe driving scenario, wherein the number of channels of the experimental EEG information in the experimental safe driving scenario is N channels; Randomly determine a plurality of channels that need to be masked from the N channels corresponding to the experimental EEG information; Inputting the experimental EEG information and the corresponding brain region information, as well as the identifiers of the multiple channels to be masked, into the channel linear mapping layer to be trained of the alertness detection network to be trained, to obtain masked experimental EEG information with position information; Processing the masked experimental EEG information with position information through an encoder and a decoder of the alertness detection network to be trained to obtain experimental EEG information to be classified; Inputting the experimental EEG information to be classified into the classifier to be trained of the alertness detection network to be trained to obtain the experimental EEG classification result; Based on the experimental EEG classification result and the classification label of the experimental EEG information, the model parameters of the alertness detection network to be trained are updated to obtain a pre-trained alertness detection network.
2. The method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis according to claim 1, characterized in that: Inputting the experimental EEG information and the corresponding brain region information, as well as the identifiers of the multiple channels to be masked, into the channel linear mapping layer to be trained of the alertness detection network to be trained, to obtain masked experimental EEG information with position information, including: Processing the experimental EEG information and the corresponding brain region information through the channel linear mapping layer to be trained to obtain experimental EEG information with position information; The experimental EEG information with position information is masked according to the identifiers of the multiple channels to be masked by the channel linear mapping layer to be trained, so as to obtain masked experimental EEG information with position information.
3. The method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis according to claim 1, characterized in that: The masked experimental EEG information with position information is processed by the encoder and decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified, including: encoding the masked experimental EEG information with position information through an encoder of the alertness detection network to be trained to obtain reconstructed experimental EEG information of the masked multiple channels; Filling the reconstructed experimental EEG information of the masked multiple channels into the masked experimental EEG information with position information to obtain the reconstructed experimental EEG information; The reconstructed experimental EEG information is processed by a decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
4. The method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis according to claim 3 is characterized in that: The masked experimental EEG information with position information is encoded by an encoder of the alertness detection network to be trained to obtain reconstructed experimental EEG information of multiple masked channels, including: performing selective multi-head attention calculation on the masked experimental EEG information with position information through an encoder of the alertness detection network to be trained, thereby obtaining a first selective multi-head attention calculation result; The first selective multi-head attention calculation result is processed by the encoder of the alertness detection network to be trained to obtain the reconstructed experimental EEG information of the masked multiple channels.
5. The method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis according to claim 3 is characterized in that: The reconstructed experimental EEG information is processed by a decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified, including: Performing selective multi-head attention calculation on the reconstructed experimental EEG information through a decoder of the alertness detection network to be trained to obtain a second selective multi-head attention calculation result; The second selective multi-head attention calculation result is processed by the decoder of the alertness detection network to be trained to obtain the experimental EEG information to be classified.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis as described in any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for detecting cross-scenario alertness for safe autonomous driving based on EEG analysis as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Driver alertness monitoring method and system based on electroencephalogram information
CN105105774A
Driving risk monitoring method based on attention mechanism
CN113780385A