EEG signal feature extraction method, system and device based on frequency band to attention mapping mechanism

By constructing a Transformer model and introducing a frequency band to attention mapping mechanism, the problem of insufficient frequency band feature differentiation in EEG signal processing is solved, which improves the recognition accuracy of EEG signals and the interpretability of the model, and is suitable for applications such as fatigue detection and cognitive state recognition.

CN121667720BActive Publication Date: 2026-08-04INNER MONGOLIA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INNER MONGOLIA UNIV OF TECH
Filing Date
2025-12-15
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing EEG signal processing methods cannot explicitly distinguish the feature contributions of different frequency bands, which limits the interpretability and identification accuracy of the model at the spectral level, and ignores the coupling and complementary relationships between different frequency bands.

Method used

A Transformer model is constructed, employing a frequency embedding generation module, a frequency coding module, and a multi-encoder module. A frequency band to attention mapping mechanism is introduced to decompose the EEG signal into multiple embedded frequency band features. These features are then extracted and fused using an attention head to form full-band features.

Benefits of technology

It improves the accuracy of EEG signal recognition, realizes the structured correspondence between the frequency domain and the attention space, enhances the model's recognition ability and interpretability, and is suitable for applications such as fatigue detection, cognitive state recognition, and brain-computer interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121667720B_ABST
    Figure CN121667720B_ABST
Patent Text Reader

Abstract

This application discloses a method, system, and device for EEG signal feature extraction based on a frequency band to attention mapping mechanism, relating to the field of EEG signal processing. The method includes: constructing a Transformer model, which includes: a frequency embedding generation module performing multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features; a frequency encoding module introducing a frequency band to attention mapping mechanism, inputting each embedded frequency band feature into different attention heads, calculating attention weights, and then fusing and outputting full-band features; training the Transformer model using a training sample set to obtain an EEG signal feature extraction model; and using the multi-channel EEG signal segment to be analyzed as input data, feeding it into the EEG signal feature extraction model to obtain the corresponding risk awareness level. This application can improve EEG recognition accuracy while maintaining computational efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electroencephalogram (EEG) signal processing, and in particular to a method, system, and device for extracting EEG signal features based on a frequency band to attention mapping mechanism. Background Technology

[0002] Electroencephalogram (EEG) signals are high-dimensional, low signal-to-noise ratio (SNR) non-stationary temporal signals that simultaneously contain important neural information in both time and frequency. The spectral components of EEG signals reflect different neural activity patterns in the brain and are often divided into standard frequency bands such as delta, theta, alpha, beta, and gamma, each carrying different physiological meanings. However, existing EEG signal processing methods mostly employ wideband input or full-frequency domain modeling, failing to explicitly distinguish the feature contributions of different frequency bands, thus limiting the interpretability and identification accuracy of the models at the spectral level. Furthermore, traditional methods only mix frequency information in the latent space, neglecting the coupling and complementary relationships between different frequency bands. Summary of the Invention

[0003] The purpose of this application is to provide a method, system, and device for EEG signal feature extraction based on a frequency band to attention mapping mechanism, which can improve EEG recognition accuracy while maintaining computational efficiency.

[0004] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for EEG signal feature extraction based on a frequency band to attention mapping mechanism, including: A Transformer model is constructed; the Transformer model includes a frequency embedding generation module, a frequency encoding module, a multi-encoder module, and a classification module arranged sequentially; the frequency embedding generation module is used to perform multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features; the frequency encoding module is used to introduce a frequency band to attention mapping mechanism, input each embedded frequency band feature into different attention heads respectively, calculate the attention weights, and then fuse and output the full-band features; The Transformer model is trained using a training sample set to obtain an EEG signal feature extraction model; each training sample in the training sample set includes a multi-channel EEG signal sample and a corresponding risk awareness level label. The multi-channel EEG signal segments to be analyzed are used as input data and sent to the EEG signal feature extraction model to obtain the corresponding risk perception level.

[0005] Secondly, this application provides an EEG signal feature extraction system based on a frequency band to attention mapping mechanism, which applies an EEG signal feature extraction method based on a frequency band to attention mapping mechanism, including: The model building module is used to build a Transformer model. The Transformer model includes a frequency embedding generation module, a frequency encoding module, a multi-encoder module, and a classification module arranged sequentially. The frequency embedding generation module is used to perform multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features. The frequency encoding module is used to introduce a frequency band to attention mapping mechanism, input each embedded frequency band feature into different attention heads respectively, calculate the attention weights, and then fuse and output the full-band features. The model training module is used to train the Transformer model using a training sample set to obtain an EEG signal feature extraction model; each training sample in the training sample set includes a multi-channel EEG signal sample and a corresponding risk awareness level label. The data acquisition and model application module is used to take the multi-channel EEG signal segments to be analyzed as input data and send them to the EEG signal feature extraction model to obtain the corresponding risk perception level.

[0006] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement an EEG signal feature extraction method based on a frequency band to attention mapping mechanism.

[0007] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application constructs a Transformer model, which introduces a frequency band to attention mapping mechanism to obtain an EEG signal feature extraction model after training. The multi-channel EEG signal segments to be analyzed are sent as input data to the EEG signal feature extraction model, which performs multi-frequency band decomposition to obtain sub-signals of different frequency components. Then, frequency band feature representations are generated for each frequency band sub-signals. Using the frequency band to attention mapping mechanism, each frequency band feature is input into different attention heads of the deep learning model, and after calculating attention weights, the full-frequency band features are fused and output. Thus, this application can realize the structured correspondence between EEG signals in the frequency domain and attention space, improving the model's ability to identify and interpret EEG time-frequency features. Finally, through processing by a multi-encoder module and a classification module, the final risk perception level is obtained, significantly improving EEG recognition accuracy and applicable to various scenarios such as fatigue detection, cognitive state recognition, and brain-computer interfaces. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 This is an application environment diagram of the EEG signal feature extraction method based on the frequency band to attention mapping mechanism in one embodiment of this application.

[0010] Figure 2 This is a flowchart illustrating an EEG signal feature extraction method based on a frequency band to attention mapping mechanism in one embodiment of this application.

[0011] Figure 3 This is a schematic diagram of a Transformer model in one embodiment of this application.

[0012] Figure 4 This is a schematic diagram of the frequency band to attention mapping mechanism.

[0013] Figure 5 This is a schematic diagram showing the changes in loss and accuracy between the training and validation sets during the training phase.

[0014] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0016] This application implements the decomposition, embedding, and one-to-one mapping of multi-band signals within the Transformer model, enabling each frequency band to have an independent attention head for feature learning, thereby enhancing the model's frequency domain focus capability and feature interpretability while maintaining computational efficiency.

[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] The EEG signal feature extraction method based on the frequency band to attention mapping mechanism provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 101 communicates with server 102 via a network. A data storage system can store the data that server 102 needs to process. The data storage system can be set up independently, integrated into server 102, or placed in the cloud or on another server. Terminal 101 can send multi-channel EEG signal segments to be analyzed to server 102. After receiving the data, server 102 inputs it into the EEG signal feature extraction model to obtain the corresponding risk perception level. The server can then feed back the obtained risk perception level to terminal 101. Furthermore, in some embodiments, the EEG signal feature extraction method based on a frequency band to attention mapping mechanism can also be implemented independently by server 102 or terminal 101.

[0019] The terminal 101 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. The server 102 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.

[0020] In one exemplary embodiment, such as Figure 2 As shown, a method for EEG signal feature extraction based on a frequency band to attention mapping mechanism is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking server 102 as an example, the explanation includes the following steps 201 to 203.

[0021] Step 201, construct a Transformer model; the Transformer model includes a frequency-wise embedding generator, a frequency-attentive encoder, a multi-encoder module, and a classification module, arranged sequentially, as follows: Figure 3 As shown; the frequency embedding generation module is used to perform multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features; the frequency encoding module is used to introduce a frequency band to attention mapping mechanism, input each embedded frequency band feature into different attention heads respectively, calculate the attention weights and then fuse and output the full-band features.

[0022] The frequency embedding generation module includes multiple finite impulse response (FIR) filters and multiple learnable embedding layers, with one FIR filter corresponding to one learnable embedding layer. The FIR filters are used to decompose the input data into feature components under multiple EEG frequency bands. The learnable embedding layers are used to project the feature components under each EEG frequency band onto the latent representation space through an embedding function to obtain the corresponding embedding frequency band features.

[0023] The calculation formula for the finite impulse response filter is as follows: .

[0024] in, , for input data The characteristic components in the i-th EEG band For the finite impulse response filter corresponding to the i-th EEG frequency band, ; , is the input data; The input data X has the number of channels, and t is the time step. In this application, a filter is used... The input data is divided into eight frequency bands. , , , , , , and This is used to describe brain activity that describes a driver's risk perception level at different frequency bands.

[0025] The calculation formula for the learnable embedding layer is: .

[0026] in, , which represents the embedded frequency band feature corresponding to the i-th EEG frequency band. A learnable embedding layer for the linear transformation corresponding to the i-th EEG frequency band; This represents the hidden dimension of the frequency embedding generation module and is shared with the hidden dimension of the F-Enc module.

[0027] In a practical application, the frequency coding module includes multiple attention heads, a first connection unit, a second connection unit, and a feedforward fully connected unit; one finite impulse response filter corresponds to one attention head.

[0028] The attention head is used to extract and map the embedded frequency band features corresponding to any EEG frequency band to obtain the attention features of the corresponding frequency band; this process is the key band-to-head attention (BMM) mechanism of this application, which can effectively utilize the band-specific spectral features exhibited by EEG signals at different levels of driving cognitive alertness, such as... Figure 4 As shown. The formula for calculating the attention head is: .

[0029] in, For the first attention feature corresponding to the i-th EEG band, For the i-th EEG band to the i-th i Mapping function for each attention head, This refers to the embedded frequency band features corresponding to the i-th EEG frequency band.

[0030] The first connection unit is used to concatenate the attention features of all attention heads and then perform dimensionality reduction through linear transformation projection to obtain the first comprehensive attention feature; the calculation formula of the first connection unit is: .

[0031] in, As the first comprehensive attention feature, The number of attention heads is set to 8 in this application; , is the linear transformation projection matrix. .

[0032] The second connection unit is used to stitch together the embedded frequency band features corresponding to all EEG frequency bands, and then perform dimensionality reduction through linear transformation projection to obtain the second comprehensive attention feature.

[0033] The feedforward fully connected unit is used to combine the first integrated attention feature and the second integrated attention feature to obtain full-band features.

[0034] In a practical application, the multi-encoder module includes N canonical encoder layers; for any canonical encoder layer, it follows the structure of the standard Transformer encoder, and the calculation formula is: .

[0035] in, For the output of the j-th standard encoder layer, For the output of the (j-1)th standard encoder layer, It is a feedforward layer. This indicates a residual connection with layer normalization, used to mitigate the vanishing gradient problem and accelerate model convergence.

[0036] In a practical application, the classification module is used to classify the EEG signal features output by the multi-encoder module. The classification module, which converts the data into a fixed-dimensional representation, includes a global pooling layer and two fully connected layers arranged sequentially. Specifically, a global average pooling (GAP) operation is first applied in the time dimension, calculated as follows: .

[0037] The resulting vector The data is then fed into a classification unit consisting of two fully connected layers, which includes a non-linear activation function and dropout regularization.

[0038] Finally, the predicted category probability of risk perception level The calculation is as follows: .

[0039] in, and This is the weight matrix. and The bias matrix, Represents the ReLU activation function. This represents the softmax function. For the hidden dimension of the classification module, This represents the number of categories.

[0040] In summary, the Transformer model described can also be named the Band-to-head-attention-mechanism-based Transformer (Trans-BAM), which uses a stacked multi-encoder block structure to construct a band-to-attention mapping mechanism. Its calculation formula is as follows: .

[0041] .

[0042] in, , is the input data; and These are the frequency embedding generation module and the frequency encoding module, respectively. For the j-th standard encoder layer, N is the number of stacked standard encoder layers; Indicates the stacking process; The characteristics of the EEG signal output by the multi-encoder module, i.e., the hidden dimension in the C-Enc module. EEG signal below; For classification modules; The level of risk perception as predicted.

[0043] Step 202: The Transformer model is trained using a training sample set to obtain an EEG signal feature extraction model; each training sample in the training sample set includes a multi-channel EEG signal sample and a corresponding risk perception level label.

[0044] In a practical application, the process of constructing the training sample set includes: (21) On the Human-in-the-Loop (HITL) driving simulation test platform, three risk scenarios of low, medium and high risk were constructed, corresponding to normal, alert and emergency braking states respectively. Then, driver braking response test was carried out to collect original multi-channel EEG signal samples under different risk scenarios.

[0045] The driving simulation test platform consists of a driver's cockpit, a surround display system, and co-simulation control software. The driver's cockpit includes a steering wheel, accelerator, and brake pedal, while the surround display system comprises three high-definition projectors with a field of view of approximately 180°. The test scenario uses PreScan 8.5.0 and CarSim 2020.0 for co-simulation, simulating a 10 km long, three-lane, two-way highway with each lane 3.75 m wide.

[0046] The subject (i.e., the driver) drove their own vehicle at a constant speed of 30 m / s, following the vehicle in front. Three risk scenarios were constructed by controlling the maximum deceleration of the vehicle in front: low, medium, and high risk scenarios were constructed by controlling the maximum deceleration of the vehicle in front to -0.35 g, -0.50 g, and -0.75 g, corresponding to normal, alert, and emergency braking states, respectively. The vehicle in front randomly triggered a deceleration event, and the driver had to brake immediately upon sensing it to avoid a rear-end collision. Raw multi-channel EEG signal samples were acquired using an Enobio-32 system with a sampling frequency of 500 Hz. The electrode arrangement followed a 10–10 system, covering the frontal, central, parietal, and occipital lobes. Parameters such as vehicle speed, acceleration, master cylinder pressure, and relative distance were recorded simultaneously. The moment the subject pressed the brake pedal was taken as the event time. ,extract The EEG fragments were used as experimental samples.

[0047] (22) Preprocess any of the original multi-channel EEG signal samples to obtain the multi-channel EEG signal samples to be analyzed.

[0048] Specifically, the original multi-channel EEG signal samples were bandpass filtered from 0.5 Hz to 45 Hz to retain frequency components relevant to driving cognitive activities while suppressing power frequency and high-frequency noise. Baseline correction and channel potential balancing were then performed to eliminate the effects of DC drift and reference electrode offset. After filtering and baseline correction, Independent Component Analysis (ICA) was used to separate artifact signals such as eye movement, electromyography, and electrode contact, and artifact components were removed based on component power spectra and time-domain characteristics. After artifact removal, for channels with heavy noise or poor contact, signal continuity was restored through interpolation between adjacent channels. Finally, normalization was performed to ensure that the mean of each channel signal was 0 and the variance was 1. The resulting multi-channel EEG signal segments were stored in matrix form with a data structure of [C, T], where C is the number of channels and T is the number of time sampling points.

[0049] (23) For any multi-channel EEG signal sample to be analyzed, a training sample is constructed using the corresponding risk situation as the risk cognition level label; multiple training samples constitute a training sample set.

[0050] After completing the above process of constructing the training sample set, 1230 training samples are obtained. Each sample contains EEG signal samples extracted by event tagging and corresponding risk perception level labels. The training sample set is proportionally divided into a training set (738 sets), a validation set (246 sets), and a test set (246 sets). During training, the Cross-Entropy Loss function is used as the objective function, and the Adam optimizer is selected as the optimization algorithm, with a learning rate set to 1×10⁻⁶. -4 The batch size was 128, and the total number of iterations was 500. Training was based on the PyTorch 3.10 framework, with the following hardware configuration: Intel(R) Core(TM) i9-9900 processor (3.10 GHz), 32 GB of memory, and NVIDIA RTX 4090 Ti GPU.

[0051] During the training phase, the loss and accuracy curves of both the training and validation sets are monitored simultaneously, such as... Figure 5 As shown, training is terminated when the validation loss stabilizes and the accuracy converges. Training results indicate that the model used in this application converges after 90 epochs, with stable loss and accuracy.

[0052] As shown in Table 1, the model performance was evaluated using four standard metrics: precision, recall, F1 score, and accuracy. Test results show that the model in this application achieves high performance in driver cognitive alertness state recognition, with an overall accuracy of 0.9325 and good recognition stability.

[0053] Table 1 Performance Evaluation

[0054] Step 203: The multi-channel EEG signal segment to be analyzed is used as input data and sent to the EEG signal feature extraction model to obtain the corresponding risk perception level.

[0055] In a practical application, the acquisition process of the multi-channel EEG signal segment to be analyzed includes: in the application of driving braking, taking the moment when the target person presses the brake pedal as the event moment, collecting EEG activity signals detected through multiple electrode channels within a preset time period starting from the event moment to obtain the original multi-channel EEG signal segment; performing bandpass filtering, baseline correction, and channel potential balancing on the original multi-channel EEG signal segment to obtain the intermediate multi-channel EEG signal segment; and performing independent component analysis to separate artifact signals from the intermediate multi-channel EEG signal segment, removing artifact components based on component power spectrum and time domain characteristics, and then performing normalization processing to obtain the multi-channel EEG signal segment to be analyzed.

[0056] During the inference phase, new multi-channel EEG signal segments are input into the trained model. The signals are sequentially processed through frequency embedding generation, frequency band-to-attention mapping, and multi-encoder processing. After Global Average Pooling (GAP) and a two-layer fully connected classifier, the predicted driver's cognitive alertness state is output. The output is a probability distribution of each alertness level, and the one with the highest probability is selected as the final prediction.

[0057] In summary, this application establishes a mapping relationship between "frequency bands and attention heads" in the model, enabling the features of different EEG frequency bands (δ, θ, α, β, γ, etc.) to be independently modeled in the attention space. This achieves frequency domain separation and feature focus, effectively avoids cross-frequency interference, and improves the model's accuracy in recognizing changes in cognitive alertness.

[0058] Based on the same inventive concept, this application also provides a system. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more system embodiments provided below can be found in the limitations of the method above, and will not be repeated here.

[0059] In an exemplary embodiment, an EEG signal feature extraction system based on a frequency band to attention mapping mechanism is provided, which applies the above-described EEG signal feature extraction method based on a frequency band to attention mapping mechanism. The system includes: The model building module is used to build a Transformer model. The Transformer model includes a frequency embedding generation module, a frequency encoding module, a multi-encoder module, and a classification module arranged sequentially. The frequency embedding generation module is used to perform multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features. The frequency encoding module is used to introduce a frequency band to attention mapping mechanism, input each embedded frequency band feature into different attention heads respectively, calculate the attention weights, and then fuse and output the full-band features.

[0060] The model training module is used to train the Transformer model using a training sample set to obtain an EEG signal feature extraction model; each training sample in the training sample set includes a multi-channel EEG signal sample and a corresponding risk awareness level label.

[0061] The data acquisition and model application module is used to take the multi-channel EEG signal segments to be analyzed as input data and send them to the EEG signal feature extraction model to obtain the corresponding risk perception level.

[0062] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an EEG signal feature extraction method based on a frequency band to attention mapping mechanism.

[0063] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0064] In one exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the above-described method embodiments.

[0065] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0066] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0067] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0068] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0069] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0070] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0071] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for extracting EEG signal features based on a frequency band to attention mapping mechanism, characterized in that, The method includes: A Transformer model is constructed; the Transformer model includes a frequency embedding generation module, a frequency encoding module, a multi-encoder module, and a classification module arranged sequentially; the frequency embedding generation module is used to perform multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features; the frequency encoding module is used to introduce a frequency band to attention mapping mechanism, input each embedded frequency band feature into different attention heads respectively, calculate the attention weights, and then fuse and output the full-band features; The frequency embedding generation module includes multiple finite impulse response filters and multiple learnable embedding layers; the frequency encoding module includes multiple attention heads, a first connection unit, a second connection unit, and a feedforward fully connected unit; one finite impulse response filter corresponds to one attention head; The attention head is used to extract and map the embedded frequency band features corresponding to any EEG frequency band to obtain the attention features of the corresponding frequency band; the first connection unit is used to stitch together the attention features of all attention heads and then perform dimensionality reduction through linear transformation projection to obtain the first comprehensive attention feature; the second connection unit is used to stitch together the embedded frequency band features corresponding to all EEG frequency bands and then perform dimensionality reduction through linear transformation projection to obtain the second comprehensive attention feature; the feedforward fully connected unit is used to combine the first comprehensive attention feature and the second comprehensive attention feature to obtain the full-band features; The calculation formula for the finite impulse response filter is as follows: ; in, For input data The characteristic components in the i-th EEG band, For the finite impulse response filter corresponding to the i-th EEG frequency band, Input data; The calculation formula for the learnable embedding layer is: ; in, For the embedded frequency band features corresponding to the i-th EEG frequency band, A learnable embedding layer for the linear transformation corresponding to the i-th EEG frequency band; The formula for calculating the attention head is: ; in, For the first attention feature corresponding to the i-th EEG band, For the i-th EEG band to the i-th i Mapping function for each attention head, This refers to the embedded frequency band features corresponding to the i-th EEG frequency band; The calculation formula for the first connection unit is: ; in, As the first comprehensive attention feature, For the number of attention heads, The projection matrix is ​​a linear transformation. The multi-encoder module includes N standard encoder layers; The calculation formula for the Transformer model is as follows: ; ; in, Input data; and These are the frequency embedding generation module and the frequency encoding module, respectively. This is the j-th standard encoder layer; Indicates the stacking process; Characteristics of the EEG signal output by the multi-encoder module; For classification modules; To predict the level of risk perception; For any standard encoder layer, the calculation formula is: ; in, For the output of the j-th standard encoder layer, For the output of the (j-1)th standard encoder layer, It is a feedforward layer. This represents a residual connection with layer normalization. The Transformer model is trained using a training sample set to obtain an EEG signal feature extraction model; each training sample in the training sample set includes a multi-channel EEG signal sample and a corresponding risk awareness level label. The multi-channel EEG signal segments to be analyzed are used as input data and sent to the EEG signal feature extraction model to obtain the corresponding risk perception level.

2. The EEG signal feature extraction method based on frequency band to attention mapping mechanism according to claim 1, characterized in that, A finite impulse response filter corresponds to a learnable embedding layer; The finite impulse response filter is used to decompose the input data into feature components under multiple EEG frequency bands; the learnable embedding layer is used to project the feature components under each EEG frequency band to the latent representation space through an embedding function to obtain the corresponding embedded frequency band features.

3. The EEG signal feature extraction method based on frequency band to attention mapping mechanism according to claim 1, characterized in that, The classification module is used to convert the EEG signal features output by the multi-encoder module into a fixed-dimensional representation. The classification module includes a global pooling layer and two fully connected layers arranged sequentially.

4. The EEG signal feature extraction method based on frequency band to attention mapping mechanism according to claim 1, characterized in that, The acquisition process of the multi-channel EEG signal segment to be analyzed includes: In the application of driving braking, the moment when the target person presses the brake pedal is taken as the event moment. Brain activity signals detected by multiple electrode channels within a preset time period starting from the event moment are collected to obtain the original multi-channel EEG signal segment. The original multi-channel EEG signal segments are subjected to bandpass filtering, baseline correction, and channel potential balancing to obtain intermediate multi-channel EEG signal segments. For the intermediate multi-channel EEG signal segment, independent component analysis is used to separate artifact signals, and artifact components are removed based on component power spectrum and time domain characteristics. Then, normalization processing is performed to obtain the multi-channel EEG signal segment to be analyzed.

5. The EEG signal feature extraction method based on frequency band to attention mapping mechanism according to claim 1, characterized in that, The process of constructing the training sample set includes: On the human-in-the-environment driving simulation test platform, three risk scenarios of low, medium and high risk were constructed, corresponding to normal, alert and emergency braking states, respectively. Then, driver braking response tests were carried out to collect original multi-channel EEG signal samples under different risk scenarios. Preprocess any of the original multi-channel EEG signal samples to obtain the multi-channel EEG signal sample to be analyzed. For any multi-channel EEG signal sample to be analyzed, a training sample is constructed using the corresponding risk scenario as a label for the level of risk awareness; multiple training samples constitute a training sample set.

6. A system for extracting EEG signal features based on a frequency band to attention mapping mechanism, employing the EEG signal feature extraction method based on a frequency band to attention mapping mechanism as described in any one of claims 1-5, characterized in that, The system includes: The model building module is used to build a Transformer model. The Transformer model includes a frequency embedding generation module, a frequency encoding module, a multi-encoder module, and a classification module arranged sequentially. The frequency embedding generation module is used to perform multi-band decomposition and linear transformation on the input data to obtain multiple embedded frequency band features. The frequency encoding module is used to introduce a frequency band to attention mapping mechanism, input each embedded frequency band feature into different attention heads respectively, calculate the attention weights, and then fuse and output the full-band features. The model training module is used to train the Transformer model using a training sample set to obtain an EEG signal feature extraction model; each training sample in the training sample set includes a multi-channel EEG signal sample and a corresponding risk awareness level label. The data acquisition and model application module is used to take the multi-channel EEG signal segments to be analyzed as input data and send them to the EEG signal feature extraction model to obtain the corresponding risk perception level.

7. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the EEG signal feature extraction method based on the frequency band to attention mapping mechanism according to any one of claims 1-5.