Depression detection method based on channel attention and state space model
By combining channel attention with a state-space model, adaptive learning of EEG channel weights and capture of long-term dependencies solves the problems of information loss and long sequence processing in depression diagnosis, achieving efficient and accurate depression identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies for the diagnosis of depression suffer from problems such as strong subjectivity, easy loss of multi-channel EEG signal features, and difficulty in efficiently capturing long-term dependencies in long sequences.
We employ a channel attention module to adaptively learn the importance weights of each EEG channel, and combine it with a state-space sequence model to capture long-term dependencies. This leads to a depression detection method that constructs a channel attention and state-space model, including preprocessing, channel feature weighting, deep temporal feature extraction, and end-to-end training of the classifier module.
It significantly improves the accuracy of depression identification and cross-subject generalization ability, provides more objective and reliable clinical auxiliary diagnostic support, and avoids the shortcomings of traditional methods.
Smart Images

Figure CN121730822A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electroencephalogram (EEG) signal processing and pattern recognition technology, specifically to a method for detecting depression based on channel attention and state space models. Background Technology
[0002] Depression is a prevalent and serious mental disorder that not only causes low mood and impaired cognitive function, but can also affect physiological functions such as sleep and appetite. In extreme cases, it can even lead to suicidal behavior, significantly impacting patients' physical and mental health and social stability. Early and accurate diagnosis is crucial for improving the effectiveness of depression treatment and reducing its harm. Electroencephalography (EEG), as a non-invasive detection method that reflects brain electrical activity, has advantages such as low cost, ease of operation, and real-time performance, providing important technical support for the objective auxiliary diagnosis of depression. Research on related identification methods has significant clinical value and practical significance.
[0003] Traditional diagnosis of depression relies primarily on questionnaires and clinical assessments by physicians. Diagnostic results are highly dependent on the accuracy of patient self-reports and physician experience, making them susceptible to subjective biases. With the development of artificial intelligence, deep learning models have begun to be applied to EEG signal classification tasks, attempting to achieve intelligent identification of depression through automatic feature extraction. However, existing technologies still have significant shortcomings: firstly, for multi-channel EEG signals, traditional methods often employ rigid channel selection to extract features, making it difficult to comprehensively retain the potential value information of each channel; secondly, EEG signals are typical long-sequence data, and traditional recurrent neural networks are prone to gradient vanishing or exploding problems when processing them, while graph convolutional networks suffer from high computational complexity and low efficiency when capturing global long-term dependencies.
[0004] Therefore, how to enable the model to adaptively focus on the key channel features of EEG signals without losing channel information, while efficiently and accurately modeling their long-term temporal dependencies, thereby improving the accuracy and generalization ability of depression recognition, has become a core problem that urgently needs to be solved in the current intelligent depression recognition technology based on EEG signals. Summary of the Invention
[0005] To address the aforementioned problems, one aspect of the present invention provides a method for detecting depression based on channel attention and a state-space model, comprising: constructing and training a depression recognition model; inputting EEG data to be identified into the trained depression recognition model to obtain a recognition result; the depression recognition model includes a channel attention module, a state-space sequence model module, and a classifier module; the training process of the depression recognition model includes the following steps:
[0006] S1: Acquire multi-channel EEG signals and perform preprocessing to obtain preprocessed EEG time-series data;
[0007] S2: Input the preprocessed EEG time series data into the channel attention module, calculate the weight of each channel and adaptively weight the channel features to obtain the weighted EEG feature sequence;
[0008] S3: Input the weighted EEG feature sequence into the state space sequence model module to capture long-term dependencies in the signal and output deep temporal features;
[0009] S4: Perform global average pooling on deep temporal features to aggregate the sequence dimensions into a global feature vector;
[0010] S5: Input the global feature vector into the classifier module to classify and obtain the depression detection result. Based on the depression detection result and the true label of the multi-channel EEG signal, construct the cross-entropy loss function to train the depression recognition model until the model parameters converge to obtain the trained depression recognition model.
[0011] Another aspect of the present invention provides a depression detection system based on a channel attention and state space model, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the depression detection method based on the channel attention and state space model.
[0012] Another aspect of the present invention provides a computer storage medium storing a remote monitoring program, which, when executed by a processor, implements the aforementioned method for detecting depression based on a channel attention and state space model.
[0013] The present invention has at least the following beneficial effects:
[0014] This invention addresses the problems of strong subjectivity in traditional depression diagnosis, the tendency of existing deep learning models to lose valuable information when processing multi-channel EEG signals, and the difficulty in efficiently capturing long-term dependencies in long sequences. By adaptively learning the importance weights of each EEG channel through a channel attention module, it accurately focuses on key features without discarding channel information. Combined with a structured state-space model, it efficiently and accurately models the long-term temporal dependencies of EEG signals, avoiding the shortcomings of gradient vanishing / exploding in traditional recurrent neural networks and the computational complexity of graph convolutional networks. At the same time, the end-to-end training method eliminates complex manual feature engineering, significantly improving the accuracy, cross-subject generalization ability, and robustness of depression identification, providing more objective and reliable clinical auxiliary diagnostic technology support for depression. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Please see Figure 1 One aspect of the present invention provides a method for detecting depression based on channel attention and a state space model, comprising: constructing and training a depression recognition model, inputting EEG data to be recognized into the trained depression recognition model to obtain a recognition result; the depression recognition model includes a channel attention module, a state space sequence model module, and a classifier module, and the training process of the depression recognition model includes the following steps:
[0018] S1: Acquire multi-channel EEG signals and perform preprocessing to obtain preprocessed EEG time-series data;
[0019] Preferably, the preprocessing of the multi-channel EEG signals includes:
[0020] S11: Apply an infinite impulse response (IIR) filter to perform bandpass filtering of the original multichannel EEG signal at 1–40 Hz. The filter order is 6, which filters out low-frequency baseline drift and 50 Hz power frequency interference.
[0021] S12: Independent component analysis (ICA) was used to remove physiological artifacts from eye movement (EOG) and electromyography (EMG), the integrity of each recording channel was checked, and spherical interpolation was used to compensate for invalid channels.
[0022] S13: A 2-second non-overlapping sliding window was used to segment the continuous EEG signal, and segments that were easily interfered with in the early and late stages of the experiment were removed. Standardized multi-channel EEG time series samples were constructed to obtain preprocessed EEG time series data.
[0023] In this embodiment, multi-channel EEG signals from publicly available MODMA and EDRA datasets were first acquired (MODMA includes resting-state EEG recordings from 24 patients with major depressive disorder and 29 healthy controls, while EDRA includes EEG data from 26 high-risk individuals and 24 low-risk controls). Systematic preprocessing was then performed: first, a 6th-order infinite impulse response (IIR) filter was used to apply a 1–40Hz bandpass filter to the raw signals, precisely filtering out low-frequency baseline drift and 50Hz power line interference, ensuring that the signal frequency range matched the EEG activity characteristics related to depression; then, independent component analysis (ICA) was used to separate and remove physiological artifacts such as eye movement (EOG) and electromyography (EMG), while simultaneously checking the integrity of each electrode channel. Invalid channels were compensated using spherical interpolation to avoid missing channel data affecting feature extraction; finally, non-overlapping sliding window segmentation was performed in 2-second increments to remove signal segments susceptible to environmental or subject state interference at the beginning and end of the experiment, constructing standardized multi-channel EEG time-series samples. The core effect of this step is that, through operations such as denoising, artifact removal, missing data completion, and format unification, the original chaotic EEG signals are transformed into clean, consistent, and high-quality time-series data. This not only preserves the key EEG features related to depression but also eliminates irrelevant interference factors, providing a reliable data foundation for the subsequent weight learning of the channel attention module and the long-term dependency capture of the state space model, thus ensuring the accuracy and stability of the model's recognition from the source.
[0024] S2: Input the preprocessed EEG time series data into the channel attention module, calculate the weight of each channel and adaptively weight the channel features to obtain the weighted EEG feature sequence;
[0025] Preferably, the channel attention module is a SeNet network, which explicitly models the importance of different channels through a squeeze-excitation operation, specifically including:
[0026] S21: Perform global average pooling on the input EEG time-series data to extract global information for each channel:
[0027]
[0028] in, For the first Global information for each channel; This represents the total number of time steps in the EEG timing data. For EEG time-series data in the first The first channel Eigenvalues at each time step;
[0029] S22: The activation operation learns the dependencies between channels through two fully connected layers:
[0030]
[0031] in, This is the channel weight vector; Use the Sigmoid activation function; This is the channel weight vector of the first fully connected layer; The GELU nonlinear activation function; The number of channels representing the timing data of electroencephalogram (EEG). This is the channel weight vector for the second fully connected layer; Global information for all channels;
[0032] S23: Multiply the channel weight vector with the input EEG time-series data to obtain a weighted EEG feature sequence:
[0033]
[0034] in, This represents a weighted sequence of EEG features; This represents the input EEG timing data; This represents the channel weight vector.
[0035] In this embodiment, the SeNet network is used as the channel attention module to perform adaptive feature enhancement on the preprocessed EEG time-series data. Specifically, this is achieved through a two-step core operation of squeezing and activation: First, global information for each channel is extracted through global average pooling. Based on the total number of time steps L of the EEG time-series data, the first... The mean of the feature values at all time steps of each channel is used to obtain the global information descriptor for that channel. This achieves the compression of channel features; subsequently, a channel dependency learning network is constructed through two fully connected layers. The first fully connected layer reduces the channel dimension from... Down to To reduce computational complexity, a nonlinear expression is introduced using the GELU nonlinear activation function, and then the original channel dimension is restored by the second fully connected layer. Then, the output is compressed to the [0,1] interval by the Sigmoid activation function to generate the weight vector for each channel. The "incentive" process is completed; finally, the learned channel weight vector is... Compared with raw EEG time-series data Channel-by-channel feature multiplication yields a weighted EEG feature sequence. The core effect of this step is that it eliminates the need for manual intervention or rigid channel selection. Instead, the model adaptively learns the contribution of different channels to depression identification, fully preserving the original information of all channels while strengthening the effective features of key channels and suppressing redundant interference from irrelevant channels through weight allocation. This significantly improves the discriminative and targeted nature of EEG features, laying a high-quality feature foundation for the subsequent state-space model module to accurately capture long-term dependencies.
[0036] S3: Input the weighted EEG feature sequence into the state space sequence model module to capture long-term dependencies in the signal and output deep temporal features;
[0037] Preferably, the state-space sequence model module is a structured state-space sequence model S4D, and the specific processing steps include:
[0038] S31: Describing the evolution of characteristic sequences using a continuous-time system:
[0039]
[0040]
[0041] in, express The continuous hidden state vector at each time step; Represents the state transition matrix; Represents the input matrix; express Continuous input feature vectors at each time step; express The continuous output vector at each time step; Indicates the output matrix; Represents a directly connected matrix;
[0042] S32: Discretizing the continuous-time system using the zero-order hold method:
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049] in, This represents the discretized state transition matrix; This represents the discretized input matrix; This represents the output matrix after discretization and remains unchanged; This represents the discretized direct-connected matrix and remains unchanged; Δ is the discretization step size, which is equal to the EEG signal sampling period. Indicates the first Hidden state vectors at discrete time steps; Indicates the first Hidden state vectors at discrete time steps; Indicates the first Input feature vectors at discrete time steps; Indicates the first The output vector for each discrete time step;
[0050] S33: Convert the discretized state-space model into an equivalent convolutional form:
[0051]
[0052]
[0053] in, Represents the convolution kernel matrix; This is a two-dimensional convolution operation; Represents the convolution output matrix; This represents a weighted sequence of EEG features.
[0054] Preferably, the state transition matrix Initialize using the HiPPO-LegS matrix, the formula is:
[0055]
[0056]
[0057] in, Represents the state transition matrix The Line 1 Column elements; Representation matrix a diagonal matrix; It is a low-rank matrix; It is the conjugate transpose of a low-rank matrix.
[0058] Preferably, in the convolution output matrix Then, layer normalization and GELU activation function processing are performed sequentially to obtain deep temporal features:
[0059]
[0060]
[0061] in, The output matrix after layer normalization; Presentation layer normalization layer; Indicates the activation function; It represents deep temporal characteristics.
[0062] In this embodiment, a structured state-space sequence model (S4D) is used to extract deep temporal features from the weighted EEG feature sequence. The specific process is as follows: First, the evolution process of the feature sequence is described by the continuous-time system equations, and the dynamic changes of the signal are characterized by the hidden state vector. The mapping relationship between the input features and the output vector is established with the help of parameters such as the state transition matrix and the input matrix. Then, the continuous-time system is discretized using the zero-order preservation method. The discretization step size is consistent with the EEG signal sampling period to ensure the feasibility and accuracy of numerical calculation. The state transition matrix is initialized with the HiPPO-LegS matrix, and the computational complexity is simplified by using diagonal addition of low-rank parameterization. To achieve efficient parallel processing, the discretized state-space model is converted into an equivalent convolution form. Convolution operation is performed on the weighted EEG feature sequence by constructing a convolution kernel matrix. Finally, the convolution output matrix is processed by layer normalization and GELU activation function in sequence to further optimize the feature representation. The core effect of this step is that it effectively avoids the gradient vanishing / exploding problem when traditional recurrent neural networks process long sequences, as well as the shortcomings of graph convolutional networks, such as computational complexity and weak global dependency capture ability. It can efficiently and accurately mine long-term temporal dependencies in EEG signals. At the same time, it enhances the discriminative ability of features through normalization and nonlinear activation, providing high-quality deep feature support rich in key temporal information for subsequent global feature aggregation and classification tasks.
[0063] S4: Perform global average pooling on deep temporal features to aggregate the sequence dimensions into a global feature vector;
[0064] S5: Input the global feature vector into the classifier module to classify and obtain the depression detection result. Based on the depression detection result and the true label of the multi-channel EEG signal, construct the cross-entropy loss function to train the depression recognition model until the model parameters converge to obtain the trained depression recognition model.
[0065] Preferably, the classifier module includes a fully connected layer and a SoftMax function.
[0066] Preferably, the cross-entropy loss function includes:
[0067]
[0068] in, This represents the cross-entropy loss function, where N represents the number of samples. Indicates the first The true label value of each sample Indicates the first The prediction results for each sample.
[0069] Another aspect of the present invention provides a depression detection system based on a channel attention and state space model, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the depression detection method based on the channel attention and state space model.
[0070] Another aspect of the present invention provides a computer storage medium storing a remote monitoring program, which, when executed by a processor, implements the aforementioned method for detecting depression based on a channel attention and state space model.
[0071] Those skilled in the art will understand that all or part of the processes in the methods of 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 of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0072] In summary, this invention addresses the problems of strong subjectivity in traditional depression diagnosis, the tendency of existing deep learning models to lose valuable information when processing multi-channel EEG signals, and the difficulty in efficiently capturing long-term dependencies in long sequences. By adaptively learning the importance weights of each EEG channel through a channel attention module, it accurately focuses on key features without discarding channel information. Combined with a structured state-space model, it efficiently and accurately models the long-term temporal dependencies of EEG signals, avoiding the shortcomings of gradient vanishing / exploding in traditional recurrent neural networks and the computational complexity of graph convolutional networks. Furthermore, the end-to-end training method eliminates complex manual feature engineering, significantly improving the accuracy, cross-subject generalization ability, and robustness of depression identification, providing more objective and reliable clinical auxiliary diagnostic technology support for depression.
[0073] The conventional techniques and solutions not described in detail in the above embodiments are all well known in the art, and therefore will not be elaborated upon here. The above embodiments and / or experimental examples describe the preferred embodiments of the present invention in detail. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical solutions of the present invention, and these simple modifications all fall within the protection scope of the present invention.
Claims
1. A method for detecting depression based on channel attention and state space model, characterized in that, include: A depression recognition model was constructed and trained. The EEG data to be recognized was input into the trained depression recognition model to obtain the recognition result. The depression recognition model includes a channel attention module, a state-space sequence model module, and a classifier module. The training process of the depression recognition model includes the following steps: S1: Acquire multi-channel EEG signals and perform preprocessing to obtain preprocessed EEG time-series data; S2: Input the preprocessed EEG time series data into the channel attention module, calculate the weight of each channel and adaptively weight the channel features to obtain the weighted EEG feature sequence; S3: Input the weighted EEG feature sequence into the state space sequence model module to capture long-term dependencies in the signal and output deep temporal features; S4: Perform global average pooling on deep temporal features to aggregate the sequence dimensions into a global feature vector; S5: Input the global feature vector into the classifier module to classify and obtain the depression detection result. Based on the depression detection result and the true label of the multi-channel EEG signal, construct the cross-entropy loss function to train the depression recognition model until the model parameters converge to obtain the trained depression recognition model.
2. The depression detection method based on channel attention and state space model according to claim 1, characterized in that, The channel attention module is a SeNet network, which explicitly models the importance of different channels through a squeeze-excitation operation, specifically including: S21: Perform global average pooling on the input EEG time-series data to extract global information for each channel: in, For the first Global information for each channel; This represents the total number of time steps in the EEG timing data. For EEG time-series data in the first The first channel Eigenvalues at each time step; S22: The activation operation learns the dependencies between channels through two fully connected layers: in, This is the channel weight vector; Use the Sigmoid activation function; This is the channel weight vector of the first fully connected layer; The GELU nonlinear activation function; The number of channels representing the timing data of electroencephalogram (EEG). This is the channel weight vector for the second fully connected layer; Global information for all channels; S23: Multiply the channel weight vector with the input EEG time-series data to obtain a weighted EEG feature sequence: in, This represents a weighted sequence of EEG features; This represents the input EEG timing data; This represents the channel weight vector.
3. The depression detection method based on channel attention and state space model according to claim 1, characterized in that, The state-space sequence model module is a structured state-space sequence model S4D, and the specific processing steps include: S31: Describing the evolution of characteristic sequences using a continuous-time system: in, express The continuous hidden state vector at each time step; Represents the state transition matrix; Represents the input matrix; express Continuous input feature vectors at each time step; express The continuous output vector at each time step; Indicates the output matrix; Represents a directly connected matrix; S32: Discretizing the continuous-time system using the zero-order hold method: in, This represents the discretized state transition matrix; This represents the discretized input matrix; This represents the output matrix after discretization and remains unchanged; This represents the discretized direct-connected matrix and remains unchanged; Δ is the discretization step size, which is equal to the EEG signal sampling period. Indicates the first Hidden state vectors for each discrete time step; Indicates the first Hidden state vectors for each discrete time step; Indicates the first Input feature vectors at discrete time steps; Indicates the first The output vector for each discrete time step; S33: Convert the discretized state-space model into an equivalent convolutional form: in, Represents the convolution kernel matrix; This is a two-dimensional convolution operation; Represents the convolution output matrix; This represents a weighted sequence of EEG features.
4. The method for detecting depression based on channel attention and state space model according to claim 3, characterized in that, The state transition matrix Initialize using the HiPPO-LegS matrix, the formula is: in, Represents the state transition matrix The Line 1 Column elements; Representation matrix a diagonal matrix; It is a low-rank matrix; It is the conjugate transpose of a low-rank matrix.
5. The method for detecting depression based on channel attention and state space model according to claim 3, characterized in that, In the convolution output matrix Then, layer normalization and GELU activation function processing are performed sequentially to obtain deep temporal features: in, The output matrix after layer normalization; Presentation layer normalization layer; Indicates the activation function; It represents deep temporal characteristics.
6. The depression detection method based on channel attention and state space model according to claim 1, characterized in that, Preprocessing of multichannel EEG signals includes: S11: Apply an infinite impulse response (IIR) filter to perform bandpass filtering of the original multichannel EEG signal at 1–40 Hz. The filter order is 6, which filters out low-frequency baseline drift and 50 Hz power frequency interference. S12: Independent component analysis (ICA) was used to remove physiological artifacts from eye movement (EOG) and electromyography (EMG), the integrity of each recording channel was checked, and spherical interpolation was used to compensate for invalid channels. S13: A 2-second non-overlapping sliding window was used to segment the continuous EEG signal, and segments that were easily interfered with in the early and late stages of the experiment were removed. Standardized multi-channel EEG time series samples were constructed to obtain preprocessed EEG time series data.
7. The depression detection method based on channel attention and state space model according to claim 1, characterized in that, The cross-entropy loss function includes: in, This represents the cross-entropy loss function, where N represents the number of samples. Indicates the first The true label value of each sample Indicates the first The prediction results for each sample.
8. The method for detecting depression based on channel attention and state space model according to claim 1, characterized in that, The classifier module includes a fully connected layer and a SoftMax function.
9. A depression detection system based on channel attention and state space model, characterized in that, The system includes a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute a depression detection method based on a channel attention and state space model as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The computer storage medium stores a remote monitoring program, which, when executed by a processor, implements a depression detection method based on a channel attention and state space model as described in any one of claims 1 to 8.