A cross-subject electroencephalogram cognitive load evaluation method based on cross-attention network

By constructing a multi-dimensional EEG feature extraction and loss function based on a cross-attention network, the problem of individual differences in cross-subject EEG cognitive load assessment was solved, achieving more accurate cognitive load assessment and domain alignment, and improving assessment performance.

CN117195038BActive Publication Date: 2026-04-07Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively address individual differences in cross-subject EEG cognitive load assessment, leading to difficulties in cross-subject transfer network research and affecting the generalization of cognitive load assessment.

Method used

We employ a cross-attention network-based approach, constructing a three-branch network (source domain feature learning, feature alignment, and target domain feature learning) using a Swing Transformer block. We utilize cross-attention for feature extraction and alignment, and combine multi-dimensional EEG signal features to construct a multi-angle loss function to improve evaluation performance.

Benefits of technology

It achieves more accurate cross-subject cognitive load assessment, improves assessment performance and stability, enhances the ability of EEG signal feature extraction and domain alignment, and strengthens the accuracy and consistency of cognitive load assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117195038B_ABST
    Figure CN117195038B_ABST
Patent Text Reader

Abstract

This invention provides a cross-subject EEG cognitive load assessment method based on a cross-attention network. The method includes: Step 1: Acquiring EEG signals from all subjects in different levels of cognitive load tasks; Step 2: For each subject, converting their EEG signal into a three-dimensional input feature representation in the spatial, temporal, and frequency domains; Step 3: Constructing a cross-attention network based on a Swing Transformer block, comprising three branches: a source domain feature learning branch, a feature alignment branch, and a target domain feature learning branch; Step 4: Dividing all subject data into labeled source domain data and unlabeled target domain data, and training the cross-attention network using the source and target domain data to obtain a cognitive load assessment model; Step 5: Acquiring the feature representation of the three-dimensional input of the target subject's EEG signal and inputting it into the trained cognitive load assessment model to obtain the target subject's cognitive load level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of human-machine systems technology, and in particular to a cross-subject EEG cognitive load assessment method based on cross-attention networks. Background Technology

[0002] Cognitive load assessment is a crucial task in human-computer systems, significantly impacting safety, resource allocation, and initiative in the field of human-computer interaction. It helps prevent operator overload and maintain work efficiency and safety. Common methods for assessing cognitive load include subjective measurements (questionnaires and interviews, etc.), task performance (accuracy and reaction time, etc.), and physiological measurements. Currently, electroencephalogram (EEG) signals have significant advantages in monitoring mental states during human-computer interaction due to their ability to reflect neural activity, non-invasiveness, and low cost. However, the non-stationarity and randomness of EEG signals lead to individual differences in brain activity during the same task. This presents significant challenges to cross-subject cognitive load assessment. Therefore, cross-subject transfer network research is crucial for improving the generalization of cognitive load assessment.

[0003] Unsupervised domain adaptation (UDA) methods are frequently used as an effective measure to solve cross-subject classification, aiming to improve the performance of cross-domain classification. Shallow UDA methods aim to learn domain-invariant features by minimizing the distributional differences between the source and target domains. In shallow UDA methods, algorithms for measuring the distance between the source and target domains typically include KL divergence, JS divergence, maximum mean deviation (MMD), and Wasserstein distance. In recent years, deep unsupervised domain adaptation (D-UDA) networks have attracted increasing attention from researchers because they can learn more domain-invariant features than shallow networks. The main methods used in D-UDA include adversarial-based domain adaptation, difference-based domain adaptation, and reconstruction-based domain adaptation. Adversarial-based domain adaptation generates synthetic data related to the source domain through adversarial training in the network, and then uses this synthetic data to train the target model. Difference-based domain adaptation works by minimizing the divergence criterion between the source and target distributions to obtain domain-invariant features. Reconstruction-based domain adaptation commonly uses encoder-decoder networks and uses a discriminator to force the network to generate target domain data similar to the source domain.

[0004] Following the significant success of transformation mechanisms in Natural Language Processing (NLP), Computer Vision, and Brain-Computer Interfaces (BCIs), some studies have attempted to apply these mechanisms to solve domain adaptation problems. To better address domain alignment and feature learning in domain adaptation tasks, Xu et al. attempted to solve the UDA task using a three-branch cross-transformer framework, applying self-attention and cross-attention to feature learning and domain alignment in the source and target domains. Currently, most commonly used deep domain adaptation-based EEG methods place distributed adaptation strategies on task-specific layers of deep networks, which can better reduce inter-domain discrepancies. However, for more complex distributions, using only a single domain adaptation method cannot effectively obfuscate the source and target domains. Summary of the Invention

[0005] Due to the complex and variable nature of brain dynamics, existing methods for manual experience extraction in cognitive assessment still need improvement. Therefore, this invention provides a cross-subject EEG cognitive load assessment method based on cross-attention networks.

[0006] This invention provides a method for assessing cognitive load across subjects based on cross-attention networks, comprising:

[0007] Step 1: Acquire EEG signals from all subjects during cognitive load tasks at different levels;

[0008] Step 2: For each subject, convert the subject's EEG signal into a feature representation of the three-dimensional input in the spatial, temporal, and frequency domains;

[0009] Step 3: Construct a cross-attention network based on the Swing Transformer block, which includes three branches: source domain feature learning branch, feature alignment branch, and target domain feature learning branch;

[0010] Step 4: Divide all subject data into labeled source domain data and unlabeled target domain data, and train the cross-attention network using the source domain data and target domain data to obtain the cognitive load assessment model.

[0011] Step 5: Obtain the feature representation of the three-dimensional input of the target subject's EEG signal and input it into the trained cognitive load assessment model to obtain the cognitive load level of the target subject.

[0012] Furthermore, step 2 specifically includes:

[0013] Preprocessing of the subjects' electroencephalogram (EEG) signals;

[0014] The EEG data of each electrode channel were processed using short-time Fourier transform to obtain the time-frequency map of that electrode channel.

[0015] By superimposing the time-frequency maps of all electrode channels, a three-dimensional input tensor is obtained, which is the feature representation of the subject's EEG signal in the three dimensions of spatial, temporal, and frequency domains.

[0016] Furthermore, each of the three branches includes l concatenated Swing Transformer blocks; the three branches share weight parameters, and the Swing Transformer blocks on the corresponding layers of the three branches constitute the cross-attention Swing Transformer blocks of that layer, and l cross-attention Swing Transformer blocks constitute the cross-attention network.

[0017] Furthermore, the source domain feature learning branch performs feature extraction according to formula (1):

[0018]

[0019] The feature alignment branch performs feature extraction according to formula (2):

[0020]

[0021] The target domain feature learning branch extracts features according to formula (3):

[0022]

[0023] in, and Let represent the output feature representations of the i-th layer Swing Transformer block in the source domain feature learning branch, target domain feature learning branch, and feature alignment branch, respectively. and represents the output feature representation of the (i-1)th layer Swing Transformer block in the source domain feature learning branch, target domain feature learning branch, and feature alignment branch, respectively; LN represents layer normalization; MLP is a 2-layer fully connected neural network with GELU nonlinear activation function; WMSA represents in-window self-attention computation; WMCA represents in-window cross-attention computation; i = 1, 2, ..., l;

[0024] The WMSA in formula (1) is calculated according to formula (4):

[0025]

[0026] The WMSA in formula (3) is calculated according to formula (5):

[0027]

[0028] The WMCA in formula (2) is calculated according to formula (6):

[0029]

[0030] Among them, Q S ,K S V S These represent the query vector, key vector, and value vector obtained by weighting the input feature representations in the current layer of the Swin Transformer block within the source domain feature learning branch; Q T ,K T V T These represent the query vector, key vector, and value vector obtained by weighting the input feature representations in the current layer of the Swing Transformer block in the target domain feature learning branch, respectively; softmax(·) represents the softmax function.

[0031] Furthermore, in step 4, during the training process, the classification loss of the source domain feature learning branch is used as the total loss function.

[0032] Furthermore, in step 4, during the training process, formula (7) is used as the total loss function:

[0033] L CAST =L S +αL Cross (7)

[0034] Among them, L S L represents the classification loss of the source domain feature learning branch. Cross The loss represents the difference between the target domain feature learning branch and the feature alignment branch, where α is a hyperparameter.

[0035] Furthermore, in step 4, during the training process, formula (8) is used as the total loss function:

[0036] L CAST =L S +βL MMD (8)

[0037] Among them, L S L represents the classification loss of the source domain feature learning branch. MMD =L MMD1 +L MMD2 , MMD stands for Distance between two distributions, where β is a hyperparameter.

[0038] Furthermore, during the training process, formula (9) is used as the total loss function:

[0039] L CAST =L S +αL Cross +βLMMD (9)

[0040] Among them, L S L represents the classification loss of the source domain feature learning branch. Cross L represents the loss between the target domain feature learning branch and the feature alignment branch. MMD =L MMD1 +L MMD2 , MMD stands for Distance between two distributions, where α and β are hyperparameters.

[0041] Furthermore, the classification loss of the source domain feature learning branch adopts the cross-entropy loss function.

[0042] Furthermore, the loss L Cross The KL loss function is used.

[0043] The beneficial effects of this invention are:

[0044] (1) Based on the neural response of the brain to the task, the subject’s EEG signal is converted into a three-dimensional input feature representation in the spatial, temporal and frequency domains. In this way, the useful information of each dimension of the EEG signal can be fully utilized to present a more comprehensive and richer EEG feature, reflecting the neural activity in the cognitive task from multiple perspectives.

[0045] (2) Implement a three-branch cross-attention network on the Swin Transformer architecture, learn features within and between domains through self-attention and cross-attention respectively, and achieve feature alignment through cross-attention. Learn domain-invariant feature representations from the domain level or category level to achieve accurate domain alignment, thereby improving the performance of cross-subject cognitive load assessment.

[0046] (3) Three loss functions are constructed from three perspectives to adjust the data similarity between the source and target domains. One part is the loss L of the MMD distance between the source domain feature learning branch and the feature alignment branch. MMD The other part is the classification loss L of the source domain feature learning branch. S Another part consists of the KL loss from the target domain feature learning branch and the feature alignment branch. Cross The three loss functions are combined to construct the total loss function, thereby further improving the performance of cross-subject cognitive load assessment. Attached Figure Description

[0047] Figure 1 A flowchart illustrating a cross-subject EEG cognitive load assessment method based on a cross-attention network, provided in an embodiment of the present invention;

[0048] Figure 2 The data processing flow provided in the embodiments of the present invention;

[0049] Figure 3 This is a diagram of the overall network architecture of the cross-attention network provided in an embodiment of the present invention.

[0050] Figure 4 The cross-attention Swin-Transformer module provided in this embodiment of the invention;

[0051] Figure 5 The overall performance of the network provided in the embodiments of the present invention;

[0052] Figure 6 Feature visualization analysis provided for embodiments of the present invention;

[0053] Figure 7 Domain difference analysis provided for embodiments of the present invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0055] Example 1

[0056] like Figure 1 As shown, this embodiment of the invention provides a method for assessing cross-subject EEG cognitive load based on cross-attention networks, including the following steps:

[0057] S101: Acquire EEG signals from all subjects during cognitive load tasks at different levels;

[0058] S102: For each subject, the subject's EEG signal is converted into a three-dimensional input feature representation in the spatial, temporal, and frequency domains. In this way, the useful information in each dimension of the EEG signal can be fully utilized to present a more comprehensive and richer EEG feature, reflecting the neural activity in the cognitive task from multiple perspectives.

[0059] Specifically, this step includes the following sub-steps:

[0060] S1021: As Figure 2 As shown, the subjects' EEG signals were preprocessed, including filtering, rereference, artifact removal, and bad lead removal.

[0061] S1022: As Figure 2As shown, after preprocessing, the EEG data of each electrode channel is processed using short-time Fourier transform to obtain the time-frequency map of that electrode channel.

[0062] In this embodiment, the spectrum is obtained using MATLAB's built-in spectrum function. A single-channel time-frequency plot of size 70×81 is obtained by setting parameters of a Hamming window length of 16, an overlap window length of 13, and a Fourier transform point count of 256. This plot represents the frequency domain energy from 0 to 60 Hz and the time domain information from 0 to 1000 ms, respectively. The Hamming window is used to reduce spectral leakage and maintain good frequency resolution. It is understood that the parameter settings can be defined according to requirements.

[0063] S1023: As Figure 2 As shown, the time-frequency maps of all electrode channels are superimposed to obtain a three-dimensional input tensor, which is the feature representation of the subject's EEG signal in the spatial, temporal, and frequency domains.

[0064] In this embodiment, an EEG acquisition device with 62 electrode channels is used to acquire the subject's EEG signals. Therefore, by superimposing all electrode channels, a 62×70×81 three-dimensional input tensor can be obtained to represent the spatial, frequency, and temporal characteristics of EEG, which is beneficial for multi-angle feature fusion in network training.

[0065] S103: Construct a cross-attention network based on the Swing Transformer block, which includes three branches: source domain feature learning branch, feature alignment branch, and target domain feature learning branch;

[0066] In this embodiment, the constructed cross-attention network is as follows: Figure 3 As shown. Each of the three branches includes l concatenated SwinTransformer blocks; the three branches share weight parameters, and the SwinTransformer blocks on the corresponding layers of the three branches constitute the cross-attention SwinTransformer blocks of that layer. The l cross-attention SwinTransformer blocks constitute the cross-attention network. In this embodiment, l = 3.

[0067] like Figure 4 As shown, the cross-attention Swin Transformer block consists of two self-attention modules and one cross-attention module. The two self-attention modules are used for intra-domain feature learning in the source and target domains, respectively. In the cross-attention module, weight sharing is used to achieve feature alignment between domains. In the cross-attention network, the three branches in each layer share weights through the cross-attention Swin Transformer block of that layer; that is, the attention weights of the feature alignment branch come from the source domain feature learning branch and the target domain feature learning branch.

[0068] To better understand the feature extraction process at each level in the three branches, let's assume... As feature representations at each level in the source domain feature learning branch. As feature representations at each level in the target domain feature learning branch. This serves as the feature representation for each level in the feature alignment branch. The feature extraction formulas for different levels in each branch are as follows:

[0069] The source domain feature learning branch extracts features according to formula (1):

[0070]

[0071] The feature alignment branch performs feature extraction according to formula (2):

[0072]

[0073]

[0074] The target domain feature learning branch extracts features according to formula (3):

[0075]

[0076] in, and Let represent the output feature representations of the i-th layer Swing Transformer block in the source domain feature learning branch, target domain feature learning branch, and feature alignment branch, respectively. and represents the output feature representation of the (i-1)th layer Swing Transformer block in the source domain feature learning branch, target domain feature learning branch, and feature alignment branch, respectively; LN represents layer normalization; MLP is a 2-layer fully connected neural network with GELU nonlinear activation function; WMSA represents in-window self-attention computation; WMCA represents in-window cross-attention computation; and multiple attention heads are used; i = 1, 2, ..., l.

[0077] Furthermore, the WMSA in formula (1) is calculated according to formula (4):

[0078]

[0079] The WMSA in formula (3) is calculated according to formula (5):

[0080]

[0081] The WMCA in formula (2) is calculated according to formula (6):

[0082]

[0083] Among them, Q S ,K S V S These represent the query vector, key vector, and value vector obtained by weighting the input feature representations in the current layer of the Swin Transformer block within the source domain feature learning branch; Q T ,K T V T These represent the query vector, key vector, and value vector obtained by weighting the input feature representations in the current layer of the Swin Transformer block within the target domain feature learning branch; softmax(·) represents the softmax function. Query vector key vector and value vector N represents the number of data blocks within each window, d k and d v Indicate their dimensions.

[0084] It should be noted that cross-attention WMCA is derived from self-attention WMSA. The difference is that the query of cross-attention comes from the self-attention module of the source domain, while the key and value come from the self-attention module of the target domain, as shown in formula (6).

[0085] S104: Divide all subject data into labeled source domain data and unlabeled target domain data, and train the cross-attention network using the source domain data and target domain data to obtain a cognitive load assessment model.

[0086] Specifically, during training, the classification loss of the source domain feature learning branch is used as the total loss function. In this embodiment, the cross-entropy loss function is used to calculate the classification loss L of the source domain feature learning branch. S The formula is as follows:

[0087] L S =CE(F(x) s ),y s )

[0088] Where, assuming For source domain D s Data samples, The labels corresponding to the source domain data samples. As the target domain D T The sample; F represents the classification layer, and CE represents the cross-entropy loss.

[0089] During training, labeled source domain data is input into the source domain feature learning branch, and unlabeled target domain data is input into the feature alignment branch and the target domain feature learning branch, respectively. The three branches process the data according to the predetermined network connection relationship, and iterate continuously until the total loss function converges to obtain the cognitive load assessment model.

[0090] S105: Obtain the feature representation of the three-dimensional input of the target subject's EEG signal and input it into the trained cognitive load assessment model to obtain the target subject's cognitive load level.

[0091] This embodiment provides a multi-feature domain attention network architecture. First, a three-dimensional feature input is constructed based on the neural responses of the brain during task processing. Then, a diverse and multi-angle feature candidate set is built through multi-scale convolution. Low-level attention features are combined with high-level attention features in a leapfrog manner to learn diverse attention features of different sizes, facilitating high-level feature combination by the network to achieve effective evaluation of low, medium, and high workload levels. Results show that this network achieves the highest classification accuracy compared to four other popular networks, thus effectively improving the performance of cognitive workload evaluation.

[0092] Example 2

[0093] Based on the above embodiment 1, in order to further improve the performance of the cognitive load assessment model, this embodiment further improves the total loss function. During the training process, formula (7) is used as the total loss function:

[0094] L CAST =L S +αL Corss (7)

[0095] Among them, L S L represents the classification loss of the source domain feature learning branch. Cross The loss represents the difference between the target domain feature learning branch and the feature alignment branch, where α is a hyperparameter.

[0096] In this embodiment, the loss L cross The KL loss function is used, and the formula is as follows:

[0097]

[0098] Where KL represents the KL divergence.

[0099] The remaining steps are the same as in Example 1, and will not be repeated here.

[0100] Example 3

[0101] Based on the above embodiment 1, in order to further improve the performance of the cognitive load assessment model, this embodiment further improves the total loss function. During the training process, formula (8) is used as the total loss function:

[0102] L CAST =L S +βL MMD (8)

[0103] Among them, L S L represents the classification loss of the source domain feature learning branch. MMD =L MMD1 +L MMD2 , MMD stands for Distance between two distributions. It is calculated by projecting each sample onto the distribution and summing the results. The magnitude of the sum represents the difference between the two distributions. β is a hyperparameter.

[0104] The remaining steps are the same as in Example 1, and will not be repeated here.

[0105] In this embodiment, by embedding the MMD method into the deep layers of the source domain feature learning branch and feature alignment branch in the proposed network (in this embodiment, it is assumed that l=3, i.e., embedding the second and third layers), the MMD distance between the source domain feature learning branch and the feature alignment branch is constructed and used as part of the total loss function. This can further reduce the distribution difference between domains, thereby aligning the features in the source domain and the target domain. This part of the loss is used to adjust the data similarity between the source domain and the target domain, which can ultimately further improve the overall performance of the model.

[0106] Example 4

[0107] Based on the above embodiments, in order to further improve the performance of the cognitive load assessment model, this embodiment further improves the total loss function. During the training process, formula (9) is used as the total loss function:

[0108] L CAST =L S +αL Cross +βL MMD (9)

[0109] Among them, L S L represents the classification loss of the source domain feature learning branch. Cross L represents the loss between the target domain feature learning branch and the feature alignment branch. MMD =L MMD1 +L MMD2 , MMD stands for Distance between two distributions, where α and β are hyperparameters.

[0110] In this embodiment, the loss LCross The KL loss function is used, and the formula is as follows:

[0111]

[0112] Where KL represents the KL divergence.

[0113] In this embodiment, the data similarity between the source and target domains is mainly adjusted through three parts of loss. One part is the loss L of the MMD distance between the source domain feature learning branch and the feature alignment branch. MMD The other part is the classification loss L of the source domain feature learning branch. S Another part consists of the KL loss from the target domain feature learning branch and the feature alignment branch. Cross .

[0114] Example 5

[0115] Based on the above embodiments, in this embodiment of the invention, to test the overall performance of the network, 25 subjects are selected to participate in the test, 24 of whom are selected as the training set and the remaining subject as the validation set; among the 24 subjects in the training set, 23 subjects are used as the source domain and 1 subject is used as the target domain. The cognitive load assessment model of the method of the present invention is denoted as the CAST-Net network model.

[0116] (1) Overall network performance:

[0117] Cross-subject results were obtained for the training set. For example... Figure 5 As shown, the proposed CAST-Net network model performs well across the entire dataset, with the lowest accuracy (76.8%) in Sub25 and the highest accuracy (94.1%) in Sub9. The model's mean accuracy is 86.38% with a standard deviation of 4.85%. Nineteen subjects achieved accuracy exceeding the mean. These results demonstrate that the proposed CAST-Net network model is effective and stable for assessing cognitive load.

[0118] (2) Network comparison:

[0119] To further test the effectiveness of the network proposed in this invention, six mainstream networks were selected for performance comparison, including SVM, KNN, CNN, Swin-Transformer, DANN, and CDTrans. Compared with traditional classification algorithms, CNN and Swin-Transformer are commonly used deep learning methods in EEG signal classification in recent years. DANN is a commonly used deep algorithm in interdisciplinary EEG signal classification. CDTrans utilizes a weight-sharing transformer proposed in previous studies for domain alignment.

[0120] Table 1 shows the average accuracy and variance performance of different networks. The results indicate that the network proposed in this invention performs best compared to other methods, with an average accuracy of 86.38%. It was also found that deep learning methods generally outperform traditional methods, and the domain-adaptive method outperforms other networks in cross-disciplinary cognitive load assessment.

[0121] Table 1 Comparison of the methods

[0122]

[0123] (3) Ablation experiment:

[0124] To test the performance of different loss functions, we used L... MMD L S and L Cross Different combinations of loss functions were investigated using ablation methods. As shown in Table 2, the network with three loss functions simultaneously achieved higher classification accuracy than the network with other combinations. Furthermore, L... S +L MMD Networks with different loss function combinations achieve higher classification accuracy than L. S +L Cross The loss function combination method. It has L S The classification accuracy of networks with loss functions L is lower than that of networks with L. S +L Cross L S +L MMD and L S +L Cross +L MMD Networks with different loss function combinations.

[0125] Table 2 Ablation Experiment

[0126]

[0127] (4) Feature visualization analysis:

[0128] To verify the performance of feature extraction in the network, this paper uses the t-SNE method to visualize the output features of different modules in the network. For example... Figure 6 As shown, the visualization effects of the output features of each block in the network are presented. The results show that the clustering effect of the three classes of samples is significantly improved after passing through each layer of the network. Specifically, the inter-class center distance between low-load, medium-load, and high-load samples increases, the intra-class center distance decreases, and the sample distribution variance is smaller. Furthermore, the inter-class distance between medium-load and other loads is the largest.

[0129] (5) Domain difference analysis:

[0130] To further verify the effectiveness of the CAST-Net network in domain alignment, the bulldozer distance between the EEG feature distributions of all subjects before and after training was calculated, such as... Figure 7 As shown in the figure, since the network stabilizes after 600 epochs, the distribution differences of output features among all subjects in each block of the network at epoch 0 and epoch 60 are calculated respectively. The color in the figure is approximately yellow, indicating that the greater the difference in feature distribution between corresponding two subjects in that block. The results in the figure show that the difference in feature distribution among all subjects before and after training is significantly smaller, indicating that the network can effectively perform domain alignment between the source and target domains, achieve accurate domain confusion, and thus improve the domain adaptation effect.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for assessing cognitive load across subjects based on cross-subject EEG using cross-attention networks, characterized in that, include: Step 1: Acquire EEG signals from all subjects during cognitive load tasks at different levels; Step 2: For each subject, convert the subject's EEG signal into a feature representation of the three-dimensional input in the spatial, temporal, and frequency domains; Step 3: Construct a cross-attention network based on the Swing Transformer block, comprising three branches: a source domain feature learning branch, a feature alignment branch, and a target domain feature learning branch; each of the three branches includes... A series of concatenated Swing Transformer blocks; the three branches share weight parameters, and the Swing Transformer blocks on the corresponding layers of the three branches constitute the cross-attention Swing Transformer block of that layer. A cross-attention Swin Transformer block constitutes a cross-attention network; Step 4: Divide all subject data into labeled source domain data and unlabeled target domain data, and train the cross-attention network using the source domain data and target domain data to obtain the cognitive load assessment model. Step 5: Obtain the feature representation of the three-dimensional input of the target subject's EEG signal and input it into the trained cognitive load assessment model to obtain the cognitive load level of the target subject.

2. The method for assessing cross-subject EEG cognitive load based on cross-attention networks according to claim 1, characterized in that, Step 2 specifically includes: Preprocessing of the subjects' electroencephalogram (EEG) signals; The EEG data of each electrode channel were processed using short-time Fourier transform to obtain the time-frequency map of that electrode channel. By superimposing the time-frequency maps of all electrode channels, a three-dimensional input tensor is obtained, which is the feature representation of the subject's EEG signal in the three dimensions of spatial, temporal, and frequency domains.

3. The method for assessing cross-subject EEG cognitive load based on cross-attention networks according to claim 1, characterized in that, The source domain feature learning branch extracts features according to formula (1): (1) The feature alignment branch performs feature extraction according to formula (2): (2) The target domain feature learning branch extracts features according to formula (3): (3) in, , and These represent the first three branches in the source domain feature learning branch, the target domain feature learning branch, and the feature alignment branch, respectively. The output feature representation of the layered Swing Transformer block. , and These represent the first three branches in the source domain feature learning branch, the target domain feature learning branch, and the feature alignment branch, respectively. The output feature representation of the layer Swing Transformer block, LN represents layer normalization, MLP is a 2-layer fully connected neural network with GELU nonlinear activation function, WMSA represents in-window self-attention computation, and WMCA represents in-window cross-attention computation. =1,2,…, ; The WMSA in formula (1) is calculated according to formula (4): (4) The WMSA in formula (3) is calculated according to formula (5): (5) The WMCA in formula (2) is calculated according to formula (6): (6) in, These represent the query vector, key vector, and value vector obtained by weighting the input feature representations in the current layer of the Swing Transformer block in the source domain feature learning branch, respectively. These represent the query vector, key vector, and value vector obtained by weighting the input feature representations in the current layer of the Swing Transformer block within the target domain feature learning branch; softmax(·) represents the softmax function. Indicates the dimensions of the query vector and key vector.

4. The method for assessing cross-subject EEG cognitive load based on cross-attention networks according to claim 3, characterized in that, In step 4, during the training process, the classification loss of the source domain feature learning branch is used as the total loss function.

5. The method for assessing cross-subject EEG cognitive load based on cross-attention networks according to claim 3, characterized in that, In step 4, during the training process, formula (7) is used as the total loss function: (7) in, This represents the classification loss of the source domain feature learning branch. This represents the loss between the target domain feature learning branch and the feature alignment branch. This is a hyperparameter.

6. The method for assessing cross-subject EEG cognitive load based on cross-attention networks according to claim 3, characterized in that, In step 4, during the training process, formula (8) is used as the total loss function: (8) in, This represents the classification loss of the source domain feature learning branch. , , MMD represents calculating the distance between two distributions. This is a hyperparameter.

7. The method for assessing cross-subject EEG cognitive load based on cross-attention networks according to claim 3, characterized in that, During training, formula (9) is used as the total loss function: (9) in, This represents the classification loss of the source domain feature learning branch. This represents the loss between the target domain feature learning branch and the feature alignment branch. , , MMD represents calculating the distance between two distributions. and This is a hyperparameter.

8. A method for assessing cross-subject EEG cognitive load based on a cross-attention network according to any one of claims 4 to 7, characterized in that, The classification loss of the source domain feature learning branch adopts the cross-entropy loss function.

9. A method for assessing cross-subject EEG cognitive load based on a cross-attention network according to claim 5 or 7, characterized in that, loss The KL loss function is used.

Citation Information

Patent Citations

  • Electroencephalogram signal classification model training method, intention recognition method, equipment and medium

    CN115169384A

  • Monocular image depth estimation method based on multi-scale cross attention

    CN116258757A