An electroencephalogram depression recognition model and method thereof
By enhancing features with a three-dimensional time-frequency feature tensor and a cross-channel time-frequency attention module, and combining adversarial training of a task classifier and a domain discriminator, the problem of insufficient three-dimensional interactive feature capture and cross-subject generalization ability in existing EEG depression recognition methods is solved, achieving higher recognition accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUXI PROFESSIONAL COLLEGE OF SCI & TECH
- Filing Date
- 2026-03-31
- Publication Date
- 2026-07-14
AI Technical Summary
Existing deep learning-based EEG depression identification methods struggle to effectively capture the three-dimensional interactive features of EEG signals and have poor cross-subject generalization ability, failing to take into account both depression sensitivity and individual insensitivity.
A three-dimensional time-frequency feature tensor is used as the input feature extractor. Features are enhanced by a cross-channel time-frequency attention module. Joint adversarial training is performed by combining a task classifier and a domain discriminator. The feature extractor is optimized by a gradient inversion layer to generate a depression recognition model that is robust across subjects.
It significantly improves the robustness and recognition accuracy of the EEG depression recognition model across subject scenarios, enabling it to more accurately capture complex neural markers of depression, eliminate individual-specific interference, and retain universal depressive characteristics.
Smart Images

Figure CN122376129A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of biomedical signal processing and deep learning technology, and in particular to an EEG depression recognition model and method. Background Technology
[0002] Depression (MDD) has become a significant global mental health issue. Traditional diagnostic methods rely primarily on subjective assessments by clinicians, which suffer from poor diagnostic consistency and delayed intervention. Electroencephalography (EEG), as a non-invasive brain function testing tool, can reflect neurophysiological activity and has been widely used in objective auxiliary diagnostic research of depression. While existing deep learning-based EEG methods for depression identification have made some progress, they still have significant technical limitations: Firstly, depression-related neural markers exhibit complex coupling characteristics across spatial, temporal, and frequency dimensions. Existing methods often isolate and analyze a single dimension or only combine two dimensions, making it difficult to effectively capture three-dimensional interactive features. Secondly, due to differences in anatomical structures and fluctuations in physiological states among subjects, EEG signals exhibit significant domain drift, resulting in poor model generalization ability across subjects. Existing domain adaptation methods are mostly based on fixed feature distribution alignment, failing to consider feature transferability and thus unable to screen features that possess both depression sensitivity and insensitivity to individual differences. Summary of the Invention
[0003] To address the problems of existing methods failing to effectively capture multidimensional coupling features of EEG and having weak generalization ability across subjects, this invention proposes an EEG depression recognition model and method.
[0004] To achieve the above-mentioned technical effects, the technical solution of the present invention is as follows: A brainwave depression recognition model, comprising a feature extractor, a task classifier, and a domain discriminator; The three-dimensional time-frequency feature tensor is input into the feature extractor to obtain enhanced features. The enhanced features are input into the task classifier to obtain depression recognition results. The enhanced features are input into the domain discriminator to output the domain discrimination results and the gradient of the domain discriminator is backpropagated to the feature extractor.
[0005] The present invention also provides a method for identifying depression via electroencephalography (EEG), comprising the following steps: S1: Acquire the raw multichannel EEG signals to be identified and perform preprocessing; S2: Perform short-time Fourier transform on the preprocessed EEG signal to construct a three-dimensional time-frequency feature tensor containing channel dimension, time dimension and frequency dimension; S3: Input the three-dimensional time-frequency feature tensor into the feature extractor of the EEG depression recognition model to obtain enhanced features, and perform global aggregation on the enhanced features; S4: Input the global aggregated enhanced features into the task classifier and the domain discriminator respectively to obtain the depression recognition result and the domain source discrimination result; based on the depression recognition result and the domain source discrimination result, perform joint adversarial training on the feature extractor, the task classifier and the domain discriminator, and reverse the gradient of the domain discriminator through the gradient reversal layer to obtain the trained EEG depression recognition model; S5: Input the three-dimensional time-frequency feature tensor into the trained EEG depression recognition model, and output the depression recognition result through the task classifier.
[0006] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention proposes an EEG depression recognition model and method. The method involves acquiring raw multi-channel EEG signals to be identified and preprocessing them. A short-time Fourier transform is performed on the preprocessed EEG signals to construct a three-dimensional time-frequency feature tensor containing channel, time, and frequency dimensions. By simultaneously modeling the channel, time, and frequency dimensions, the complex neural markers of depression are captured more accurately. The three-dimensional time-frequency feature tensor is input into the feature extractor of the EEG depression recognition model to obtain enhanced features, which are then globally aggregated. The globally aggregated enhanced features are input into a task classifier and a domain discriminator, respectively, to obtain depression recognition results and domain source discrimination results. Based on the depression recognition results and domain source discrimination results, the feature extractor, task classifier, and domain discriminator are jointly adversarially trained, and the gradient of the domain discriminator is inverted through a gradient inversion layer to obtain a trained EEG depression recognition model. The three-dimensional time-frequency feature tensor is input into the trained EEG depression recognition model, and the depression recognition result is output through the task classifier, significantly improving the model's robustness and recognition accuracy across different subject scenarios. Attached Figure Description
[0007] Figure 1 This is a diagram of the EEG depression recognition model in this invention; Figure 2 This is a diagram of the cross-channel time-frequency attention module in this invention; Figure 3 This is a schematic diagram of the EEG depression recognition method in this invention. Detailed Implementation
[0008] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0009] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms “a,” “the,” and “the” used in this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0010] It should be understood that although the terms first, second, third, etc., may be used in this invention to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of this invention, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0011] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0012] Example 1 This embodiment proposes an EEG depression recognition model, the model diagram of which is shown below. Figure 1 As shown, the EEG depression recognition model consists of a feature extractor, a task classifier, and a domain discriminator. The three-dimensional time-frequency feature tensor is input into the feature extractor to obtain enhanced features. The enhanced features are input into the task classifier to obtain depression recognition results. The enhanced features are input into the domain discriminator to output the domain discrimination results and the gradient of the domain discriminator is backpropagated to the feature extractor.
[0013] In one alternative embodiment, the feature extractor includes a convolutional backbone network and a cross-channel time-frequency attention enhancement network connected in sequence; The three-dimensional time-frequency feature tensor is input into the convolutional backbone network to obtain the deep feature tensor. The deep feature tensor is input into the cross-channel time-frequency attention enhancement network to obtain the first cross-channel time-frequency attention feature. The enhanced feature is obtained based on the first cross-channel time-frequency attention feature and the deep feature tensor.
[0014] In this embodiment, the original 3D feature tensor S is first processed by a convolutional backbone network consisting of several sets of "convolutional layers + batch normalization + ReLU" to extract deep features. Then, it is sequentially processed by N cross-channel time-frequency attention modules for multi-dimensional attention enhancement. The output features of the cross-channel time-frequency attention modules are then global average pooled and fed into the task classifier and the domain discriminator, respectively.
[0015] In one optional embodiment, the convolutional backbone network includes a first combined module and a second combined module connected in sequence; The first combined module includes a first convolutional layer, a first batch of normalized layers, and a first ReLU activation layer connected in sequence. The second combined module includes a second convolutional layer, a second batch normalization layer, and a second ReLU activation layer connected in sequence. The cross-channel time-frequency attention enhancement network consists of N cascaded cross-channel time-frequency attention modules; Cross-channel time-frequency attention module diagram as shown Figure 2 As shown; The cross-channel time-frequency attention module consists of a time-frequency sub-module and a cross-channel sub-module; The deep feature tensor is input into the time-frequency submodule to obtain the first time-frequency feature, and the deep feature tensor is input into the cross-channel submodule to obtain the first channel feature. The enhanced feature is obtained based on the first time-frequency feature, the first channel feature, and the deep feature tensor.
[0016] In one optional embodiment, the time-frequency submodule consists of a first frequency average pooling layer, a first time average pooling layer, a first splicing layer, a third convolutional layer, a third batch normalization layer, a first Sigmoid activation function layer, a fourth convolutional layer, and a second Sigmoid activation function layer. A deep feature tensor is input into a first frequency-average pooling layer to obtain a time descriptor. The deep feature tensor is then input into a first time-average pooling layer to obtain a frequency descriptor. The frequency descriptor is transposed and input with the time descriptor into a first concatenation layer to obtain a first concatenated feature. The first concatenated feature is input into a third convolutional layer to obtain a first dimensionality-reduced feature. The first dimensionality-reduced feature is input into a third batch normalization layer to obtain a first batch of normalized features. The first batch of normalized features is input into a first sigmoid activation function layer to obtain intermediate features, which include a first time component feature and a first frequency component feature. The first time component feature is input into a fourth convolutional layer to obtain a first dimensionality-increasing feature. The first dimensionality-increasing feature is input into a second sigmoid activation function layer to obtain temporal attention weights. The first frequency component feature is input into a fourth convolutional layer to obtain a second dimensionality-increasing feature. The second dimensionality-increasing feature is input into a second sigmoid activation function layer to obtain frequency attention weights.
[0017] In one optional embodiment, the cross-channel submodule includes a fifth convolutional layer, a sixth convolutional layer, a first global average pooling layer, and a first fully connected layer connected in sequence. The deep feature tensor is input into the fifth convolutional layer to obtain the first projection feature. The first projection feature is multiplied element-wise with the first time part feature and the first frequency part feature output from the time-frequency submodule to obtain the modulation feature. The modulation feature is input into the sixth convolutional layer to obtain the first recovery feature. The first recovery feature is input into the first global average pooling layer to obtain the channel descriptor. The channel descriptor is input into the first fully connected layer to obtain the channel attention weight.
[0018] Furthermore, unlike existing Squeeze-and-Excitation (SE) attention methods that only model channel dimensions and Coordinate Attention (CA) methods that only model pairwise interactions, this invention designs a dual-path attention module. One path is the Time-Frequency Submodule (TF-Module), which captures time and frequency dependencies through dimensional pooling and interactions; the other path is the Cross-Channel Submodule (C-Module), which uses information from the TF-Module to guide the learning of spatial dependencies. Both work together to generate a unified 3D attention map that highlights key depressive pathological features. Its core innovation lies in the time-frequency intermediate features generated by the TF-Module. and During the channel projection process of the C-Module, time-frequency information guides spatial attention, thus constructing true three-dimensional coupled attention, rather than a simple series or parallel connection of three independent dimensional attentions. The cross-channel time-frequency attention module has the following specific structure: The cross-channel time-frequency attention module receives a three-dimensional feature tensor X of shape C×T×F as input, and includes a time-frequency sub-module (TF-Module) and a cross-channel sub-module (C-Module) that work in parallel. The structure of the TF-Module is as follows: Input X (C×T×F) → Average pooling along the frequency dimension to obtain the time descriptor P (C×T×1) → Average pooling along the time dimension to obtain the frequency descriptor Q (C×1×F) → Transpose Q and concatenate it with P along the spatial dimension to obtain O' (C×(T+F)×1) → 1×1 convolutional layer reduces the channel dimension from C to Cr=max(8,C / r) (dimensionality reduction ratio r) → Batch normalization (BN) → Sigmoid activation → Output intermediate feature O (Cr×(T+F)×1) → Segmented along the concatenation dimension into the first time part feature G (Cr×1×T) and the first frequency part feature H (Cr×1×F) → The channel is restored from Cr to C by 1×1 convolutional layer respectively → Sigmoid activation → Output time attention weight α (C×T×1) and frequency attention weight β (C×1×F). The C-Module structure is as follows: Input X (C×T×F) → 1×1 convolutional layer projects the channels from C to Cr, obtaining the first projected feature Z' (Cr×T×F) → Element-wise multiplication with the outputs G and H of the TF-Module (broadcast mechanism) to obtain the modulation feature Z'' (Cr×T×F) → 1×1 convolutional layer restores the channels from Cr to C, obtaining the first restored feature Z''' (C×T×F) → Global average pooling (along the T and F dimensions) to obtain the channel descriptor z (C×1×1) → Fully connected layer dimensionality reduction (C→C / r) + ReLU → Fully connected layer dimensionality increase (C / r→C) + Sigmoid → Output channel attention weight γ (C). The unified output is Y = X⊙α⊙β⊙γ, where ⊙ represents the element-wise multiplication under the broadcast mechanism.
[0019] In one optional embodiment, the EEG depression recognition model further includes a seventh convolutional layer, a fourth batch normalization layer, an eighth convolutional layer, and a second global average pooling layer connected in sequence. The enhanced features are input into the seventh convolutional layer to obtain the first convolutional feature. The first convolutional feature is input into the fourth batch normalization layer to obtain the second batch normalization feature. The second batch normalization feature is input into the eighth convolutional layer to obtain the second convolutional feature. The second convolutional feature is input into the second global average pooling layer to obtain the global aggregated enhanced feature. The global aggregated enhanced feature is output to the task classifier and the domain discriminator, respectively.
[0020] Unlike traditional domain adaptation methods (such as DANN and VREx) that perform domain alignment on fixed feature representations, this invention embeds a cross-channel time-frequency (CTF) attention module into the feature extractor of a domain adversarial neural network (DANN). The cross-channel time-frequency (CTF) attention module is designed to extract time-frequency dependencies and cross-channel spatial dependencies through parallel paths, generating unified three-dimensional attention weights to enhance the features. Finally, the enhanced feature input is combined with the domain discriminator and task classifier in the gradient inversion layer of the DANN to jointly optimize the depression classification loss and domain discriminant loss. This invention can effectively capture the deep coupling features of EEG signals in the spatial, temporal, and frequency dimensions.
[0021] Example 2 This embodiment proposes a method for identifying depression via electroencephalography (EEG), the flowchart of which is shown below. Figure 3 As shown, it includes the following steps: S1: Acquire the raw multichannel EEG signals to be identified and perform preprocessing; S2: Perform a short-time Fourier transform (STFT) on the preprocessed EEG signal to construct a structure including channel dimensions ( ), time dimension ( ) and frequency dimension ( The three-dimensional time-frequency feature tensor of ) ; Furthermore, the original EEG signal is converted into a three-dimensional channel-time-frequency (CTF) tensor using short-time Fourier transform (STFT), preserving the signal's local time-frequency characteristics. Unlike existing methods that employ static frequency domain features such as power spectral density (PSD) or differential entropy (DE), this invention preserves the complete local time-frequency structure, providing the necessary information foundation for three-dimensional joint attention modeling.
[0022] S3: Convert the three-dimensional time-frequency feature tensor Enhanced features are obtained by inputting them into the feature extractor of the EEG depression recognition model. And perform global aggregation of enhanced features; S4: Input the globally aggregated enhanced features into the task classifier and the domain discriminator respectively to obtain the depression recognition result and the domain source discrimination result; based on the depression recognition result and the domain source discrimination result, perform joint adversarial training on the feature extractor, task classifier and domain discriminator, and invert the gradient of the domain discriminator through a gradient inversion layer (GRL) to obtain the trained EEG depression recognition model. S5: Input the three-dimensional time-frequency feature tensor into the trained EEG depression recognition model, and output the depression recognition result through the task classifier.
[0023] In this embodiment, adversarial training is performed using a gradient inversion layer (GRL), forcing the attention features learned by the model to be consistently distributed across the source domain (training set) and the target domain (test set), thereby eliminating subject-specific interference and retaining universal depressive features. Its unique feature is that the gradient of the domain adversarial loss directly affects the learning process of the CTF attention weights through backpropagation, forcing the attention mechanism to simultaneously satisfy the dual constraints of "task relevance" and "domain invariance," automatically suppressing the weights of individual-specific features and amplifying the depressive pathological features shared across subjects.
[0024] In one optional embodiment, step S3 specifically includes the following steps: S31: Obtain the depth feature tensor from the three-dimensional time-frequency feature tensor. ; S32: Average pooling is performed along the frequency dimension of the depth feature tensor to obtain the time descriptor. The depth feature tensor is average-pooled along the time dimension to obtain the frequency descriptor. ; frequency descriptor Transposed and time descriptor The first concatenated feature is obtained by concatenating features along the spatial dimension; the first concatenated feature is then subjected to dimensionality reduction and feature interaction, and after processing by an activation function, intermediate features are generated. ; intermediate features Segment and reconstruct to generate temporal attention weights and frequency attention weight The intermediate features After segmentation, the first time component feature G and the first frequency component feature H are obtained; S33: Depth Feature Tensor Channel projection is performed to obtain the first projected feature. The first projected feature is then multiplied element-wise with the first temporal feature G and the first frequency feature H to obtain the modulation feature. The modulation feature is then convolved and projected to restore the channel dimension, followed by global average pooling to obtain the channel descriptor. The channel descriptor is then subjected to dimensionality reduction and expansion operations, and channel attention weights are generated by Sigmoid activation. ; S34: Enhanced features are obtained based on temporal attention weights, frequency attention weights, and channel attention weights.
[0025] Furthermore, the feature extractor consists of a convolutional backbone network and N cascaded cross-channel time-frequency (CTF) attention modules. The original 3D feature tensor S first passes through a convolutional backbone network composed of several sets of "convolutional layers + batch normalization + ReLU" to extract features, and then sequentially passes through N cross-channel time-frequency (CTF) attention modules for multi-dimensional attention enhancement. The output features of the cross-channel time-frequency (CTF) attention modules are sequentially processed by convolution, batch normalization, convolution, and global average pooling, and then fed into the task classifier and the domain discriminator, respectively.
[0026] Furthermore, exemplarily, after reweighting the features to obtain enhanced features, the subsequent Conv+BN (seventh convolutional layer + fourth batch normalization layer) first performs local fusion and distribution correction on the enhanced features: Conv (seventh convolutional layer) is used to recombine information between adjacent spatial locations and channels, transforming attention-prominent locations into more usable discriminative patterns; BN (fourth batch normalization layer) stabilizes the feature distribution, reducing training instability caused by numerical fluctuations after attention weighting, making subsequent optimization smoother. Then, the following Conv+GAP (eighth convolutional layer + second global average pooling layer) is mainly geared towards the final classification task: the second Conv (eighth convolutional layer) further maps the features to a semantic space more suitable for class discrimination, strengthening class-related responses; GAP (second global average pooling layer) compresses the entire feature map into a global representation, preserving overall evidence of "whether such a feature exists," while reducing the number of parameters and lowering the risk of overfitting. The advantage of this design is that the first half is responsible for "making the attention results stable, clean, and usable," while the second half is responsible for "transforming the processed features into final classification evidence." Therefore, the sequentially connected seventh convolutional layer, fourth batch normalization layer, eighth convolutional layer, and second global average pooling layer are not only buffer and refinement modules for the attention output, but also important bridges connecting high-level features and classification targets (domain discriminators and task classifiers).
[0027] In one optional embodiment, the enhanced features are obtained based on temporal attention weights, frequency attention weights, and channel attention weights; the expression for which is:
[0028] in, To enhance features, For depth feature tensors, This represents element-wise multiplication under a broadcast mechanism. , , Attention weights are given for time, frequency, and channel dimensions, respectively.
[0029] Furthermore, enhanced features are obtained based on the depth feature tensor, temporal attention weights, frequency attention weights, and channel attention weights. In one optional embodiment, the objective function of the joint adversarial training includes task classification loss and domain discrimination loss; the expression of the objective function is:
[0030] in, For the parameters of the cross-channel time-frequency attention module, For the parameters of the task classifier, For the parameters of the domain discriminator, Let the loss function be that of the task classifier. Let be the loss function of the domain discriminator.
[0031] Furthermore, task classification loss Used to measure the accuracy of a task classifier in predicting depression labels; Domain discrimination loss Used to measure the accuracy of the domain discriminator in distinguishing between the source and target domains; The overall optimization objective is to minimize ,in To control the hyperparameters of adversarial strength, during backpropagation, the gradient inversion layer inverts the gradient of the domain discrimination loss and applies it to the feature extractor.
[0032] Loss function design, task classification loss Binary cross-entropy loss is used to measure the accuracy of the task classifier in predicting the labels of depression (MDD) and healthy control (HC); domain discrimination loss is employed. Binary cross-entropy loss is used to measure the ability of the domain discriminator to distinguish between subjects in the source domain and subjects in the target domain. The optimization objective is as follows: λ is a hyperparameter controlling the adversarial strength of the domain. The training strategy involves embedding a gradient inversion layer (GRL) between the feature extractor and the domain discriminator. During forward propagation, the GRL performs an identity transformation; during backpropagation, the GRL applies the domain discriminant loss with respect to the feature extractor parameters. gradient multiplied by This forces the feature extractor to learn feature representations from which the domain discriminator cannot distinguish while optimizing task classification performance, thus achieving domain invariance. Each training batch contains samples from both the source domain (labeled) and the target domain (unlabeled), and the Adam optimizer is used to jointly update the three sets of parameters.
[0033] Example 3 This embodiment is an exemplary description based on Embodiments 1 and 2.
[0034] Step 1: Data Preprocessing and 3D Representation Generation The acquired multi-channel EEG signals underwent standard preprocessing such as denoising and filtering. Subsequently, the time-domain signal was converted to a time-frequency domain signal using Short-Time Fourier Transform (STFT). The formula for calculating STFT is:
[0035] in, It is the input signal. It is a window function. The STFT results from all channels are stacked to form a feature tensor. ,in, This refers to the number of channels (e.g., 128 in the MODMA dataset). For time points, The number of frequency components.
[0036] Step 2: Construct the cross-channel time-frequency (CTF) attention module The cross-channel time-frequency attention module is the core of the feature extractor, and it contains two working sub-modules: (1) Time-Frequency Submodule (TF-Module): This module is designed to capture time. and frequency Dimensionality dependency. Input features are First, apply average pooling along the frequency and time axes respectively:
[0037]
[0038] Get the time descriptor and frequency descriptor .Will After transpose and By piecing together elements, a distinctive feature is formed.
[0039] Next, through Convolutional layers are used for dimensionality reduction (the dimensionality reduction ratio is...). Following batch normalization (BN) and sigmoid activation Generate features :
[0040] Finally, Features re-segmented into corresponding time components and the characteristics of the corresponding frequency part And then expand the dimensions again through convolutional layers to generate the final attention weights:
[0041]
[0042] (2) Cross-channel submodule (C-Module): This module is designed to capture spatial dependencies. First, the input... Convolution projection is performed to obtain Generated using TF-Module and right Modulation (Element-wise multiplication):
[0043] This step demonstrates the interaction of information from different dimensions.
[0044] Subsequently, Global average pooling is used to obtain channel descriptors. .
[0045] The "squeeze-and-excitation" structure is applied, which involves dimensionality reduction through fully connected layers, ReLU activation, dimensionality increase through fully connected layers, and Sigmoid activation to generate channel attention weights. .
[0046] (3) Unified feature fusion: Final Enhancement Features The product of the original input and the attention weights in the three dimensions:
[0047] Step 3: Constructing and Training the Domain Adversarial Neural Network The network consists of three parts: Feature extractor Includes the aforementioned cross-channel time-frequency attention module, with the following parameters: The feature extractor employs a cascaded architecture of a convolutional backbone network and a cross-channel time-frequency attention module, comprising: (a) a convolutional backbone network, consisting of two sets of CBR (3D convolutional layers, batch normalization, and ReLU activation) modules connected in series. The first CBR module processes the input feature tensor... After being mapped to an intermediate feature map via 3D convolution, the second CBR further extracts deep features and outputs a depth feature tensor. (b) CTF attention enhancement layer, which enhances the output of the convolutional backbone network. The data is fed into N cascaded cross-channel time-frequency (CTF) attention modules, which perform three-dimensional attention weighting enhancement on the features step by step, and finally output the enhanced features. .
[0048] Furthermore, for enhanced features The process involves sequential convolution extraction, normalization stabilization, reconvolution refinement, and global pooling to ultimately obtain globally aggregated enhanced features.
[0049] Task classifier : Used to predict depression labels (MDD or HC), with the following parameters: The loss function is cross-entropy loss. .
[0050] Domain discriminator : Used to determine whether the input features come from the source domain (Source Subject) or the target domain (Target Subject), the parameter is The loss function is the binary cross-entropy loss. .
[0051] During training, a gradient reversal layer (GRL) is introduced. During forward propagation, the GRL performs an identity transformation; during backward propagation, the GRL multiplies the gradient flowing to the feature extractor by a negative constant. .
[0052] The overall objective function is:
[0053] This adversarial training forces the features generated by the feature extractor to be indistinguishable by the domain discriminator, thereby achieving domain invariance of the features.
[0054] Furthermore, a well-trained EEG depression recognition model was obtained.
[0055] Step 4: Model Testing During the testing phase, the domain discriminator was discarded, and only the trained feature extractor and task classifier were used to process the EEG data to output diagnostic results. Table 1 shows the comparative experiment based on ten-fold cross-validation, Table 2 represents the ablation experiment of the EEG depression recognition model based on the attention mechanism, and Table 3 represents the ablation experiment of the EEG depression recognition model based on domain adaptation. These experiments respectively verify the effectiveness of the attention mechanism proposed in this paper and the effectiveness of the domain adversarial domain adaptation method used in this paper. Table 1
[0056] Table 2
[0057] Table 3
[0058] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely exemplary. The modules described as separate components may or may not be physically separate. When implementing the present invention, the functions of each module can be implemented in one or more software and / or hardware. Alternatively, some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0059] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A brainwave depression recognition model, characterized in that, The EEG depression recognition model consists of a feature extractor, a task classifier, and a domain discriminator. The three-dimensional time-frequency feature tensor is input into the feature extractor to obtain enhanced features. The enhanced features are input into the task classifier to obtain depression recognition results. The enhanced features are input into the domain discriminator to output the domain discrimination results and the gradient of the domain discriminator is backpropagated to the feature extractor.
2. The EEG depression recognition model according to claim 1, characterized in that, The feature extractor comprises a convolutional backbone network and a cross-channel time-frequency attention enhancement network connected in sequence; The three-dimensional time-frequency feature tensor is input into the convolutional backbone network to obtain the deep feature tensor. The deep feature tensor is input into the cross-channel time-frequency attention enhancement network to obtain the first cross-channel time-frequency attention feature. The enhanced feature is obtained based on the first cross-channel time-frequency attention feature and the deep feature tensor.
3. The EEG depression recognition model according to claim 2, characterized in that, The convolutional backbone network includes a first combined module and a second combined module connected in sequence; The first combined module includes a first convolutional layer, a first batch of normalized layers, and a first ReLU activation layer connected in sequence. The second combined module includes a second convolutional layer, a second batch normalization layer, and a second ReLU activation layer connected in sequence. The cross-channel time-frequency attention enhancement network consists of N cascaded cross-channel time-frequency attention modules; The cross-channel time-frequency attention module consists of a time-frequency sub-module and a cross-channel sub-module; The deep feature tensor is input into the time-frequency submodule to obtain the first time-frequency feature, and the deep feature tensor is input into the cross-channel submodule to obtain the first channel feature. The enhanced feature is obtained based on the first time-frequency feature, the first channel feature, and the deep feature tensor.
4. The EEG depression recognition model according to claim 3, characterized in that, The time-frequency submodule consists of a first frequency average pooling layer, a first time average pooling layer, a first splicing layer, a third convolutional layer, a third batch normalization layer, a first Sigmoid activation function layer, a fourth convolutional layer, and a second Sigmoid activation function layer. A deep feature tensor is input into a first frequency-average pooling layer to obtain a time descriptor. The deep feature tensor is then input into a first time-average pooling layer to obtain a frequency descriptor. The frequency descriptor is transposed and input with the time descriptor into a first concatenation layer to obtain a first concatenated feature. The first concatenated feature is input into a third convolutional layer to obtain a first dimensionality-reduced feature. The first dimensionality-reduced feature is input into a third batch normalization layer to obtain a first batch of normalized features. The first batch of normalized features is input into a first sigmoid activation function layer to obtain intermediate features, which include a first time component feature and a first frequency component feature. The first time component feature is input into a fourth convolutional layer to obtain a first dimensionality-increasing feature. The first dimensionality-increasing feature is input into a second sigmoid activation function layer to obtain temporal attention weights. The first frequency component feature is input into a fourth convolutional layer to obtain a second dimensionality-increasing feature. The second dimensionality-increasing feature is input into a second sigmoid activation function layer to obtain frequency attention weights.
5. The EEG depression recognition model according to claim 4, characterized in that, The cross-channel submodule includes a fifth convolutional layer, a sixth convolutional layer, a first global average pooling layer, and a first fully connected layer connected in sequence; The deep feature tensor is input into the fifth convolutional layer to obtain the first projection feature. The first projection feature is multiplied element-wise with the first time part feature and the first frequency part feature output from the time-frequency submodule to obtain the modulation feature. The modulation feature is input into the sixth convolutional layer to obtain the first recovery feature. The first recovery feature is input into the first global average pooling layer to obtain the channel descriptor. The channel descriptor is input into the first fully connected layer to obtain the channel attention weight.
6. The EEG depression recognition model according to claim 1, characterized in that, The EEG depression recognition model also includes a seventh convolutional layer, a fourth batch normalization layer, an eighth convolutional layer, and a second global average pooling layer connected in sequence. The enhanced features are input into the seventh convolutional layer to obtain the first convolutional feature. The first convolutional feature is input into the fourth batch normalization layer to obtain the second batch normalization feature. The second batch normalization feature is input into the eighth convolutional layer to obtain the second convolutional feature. The second convolutional feature is input into the second global average pooling layer to obtain the global aggregated enhanced feature. The globally aggregated enhanced features are output to the task classifier and the domain discriminator, respectively.
7. A method for identifying depression based on the EEG depression identification model according to any one of claims 1 to 6, characterized in that, Includes the following steps: S1: Acquire the raw multichannel EEG signals to be identified and perform preprocessing; S2: Perform short-time Fourier transform on the preprocessed EEG signal to construct a three-dimensional time-frequency feature tensor containing channel dimension, time dimension and frequency dimension; S3: Input the three-dimensional time-frequency feature tensor into the feature extractor of the EEG depression recognition model to obtain enhanced features, and perform global aggregation on the enhanced features; S4: Input the global aggregated enhanced features into the task classifier and the domain discriminator respectively to obtain the depression recognition result and the domain source discrimination result; Based on the depression recognition results and domain source discrimination results, the feature extractor, task classifier and domain discriminator are jointly trained adversarially, and the gradient of the domain discriminator is reversed through a gradient inversion layer to obtain a trained EEG depression recognition model. S5: Input the three-dimensional time-frequency feature tensor into the trained EEG depression recognition model, and output the depression recognition result through the task classifier.
8. The EEG depression identification method according to claim 7, characterized in that, Step S3 specifically includes the following steps: S31: Obtain the depth feature tensor from the three-dimensional time-frequency feature tensor; S32: The depth feature tensor is average-pooled along the frequency dimension to obtain a time descriptor; the depth feature tensor is average-pooled along the time dimension to obtain a frequency descriptor; the frequency descriptor is transposed and concatenated with the time descriptor along the spatial dimension to obtain a first concatenated feature; the first concatenated feature is subjected to dimensionality reduction and feature interaction, and after being processed by an activation function, an intermediate feature is generated; the intermediate feature is segmented and reconstructed to generate time attention weights and frequency attention weights; the segmented intermediate feature yields a first time part feature and a first frequency part feature; S33: The depth feature tensor is projected onto the channels to obtain the first projected feature. The first projected feature is multiplied element-wise with the first time part feature and the first frequency part feature to obtain the modulation feature. The modulation feature is convolved and projected to restore the channel dimension and then global average pooling is performed to obtain the channel descriptor. The channel descriptor is subjected to dimensionality reduction and dimensionality increase operations and activated by Sigmoid to generate channel attention weights. S34: Enhanced features are obtained based on temporal attention weights, frequency attention weights, and channel attention weights.
9. The EEG depression identification method according to claim 8, characterized in that, The enhanced features are obtained based on temporal attention weights, frequency attention weights, and channel attention weights; Its expression is: in, To enhance features, For depth feature tensors, This represents element-wise multiplication under a broadcast mechanism. , , Attention weights are given for time, frequency, and channel dimensions, respectively.
10. The EEG depression identification method according to claim 7, characterized in that, The objective function of the joint adversarial training includes task classification loss and domain discrimination loss; the expression of the objective function is: in, For the parameters of the cross-channel time-frequency attention module, For the parameters of the task classifier, For the parameters of the domain discriminator, Let the loss function be that of the task classifier. Let the loss function be that of the domain discriminator. Hyperparameters for controlling the intensity of the confrontation.