Depression screening method based on dynamic weighting of adaptive graph topology and timing characteristics

CN122320550BActive Publication Date: 2026-09-11JIANGSU BOYA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610724362.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-09-11
Estimated Expiration
2046-05-25

AI Technical Summary

Technical Problem

这种静态拓扑结构无法根据输入信号动态调整节点间的连接权重,导致模型难以精准捕获与抑郁症相关的异常功能连接模式,尤其在跨被试场景下表征能力受限

Benefits of technology

1、可学习邻接矩阵能够根据EEG信号自动调整脑区之间的连接权重,更精准地捕捉抑郁症相关的异常脑网络模式;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122320550B_ABST
    Figure CN122320550B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of depression risk screening, and provides a depression screening method based on adaptive graph topology and dynamic weighting of time sequence characteristics, which comprises the following steps: obtaining EEG data to be screened and performing pretreatment to extract an initial node characteristic sequence; initializing an independent learnable parameter matrix and generating an adaptive learnable adjacency matrix through nonlinear mapping; constructing a parallel double-branch network of a learnable graph topology module and a time sequence Transform module, inputting the initial node characteristic sequence and the learnable adjacency matrix into the network, and respectively extracting spatial topology dependent features and time features; splicing the spatial topology dependent features and the time features to obtain spliced features, performing weight distribution on the spliced features, and outputting final fusion features; and flattening the final fusion features and inputting them into a multilayer perception classifier to output a depression positive probability. The present application improves the accuracy of early screening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of depression risk screening technology, and in particular to a depression screening method based on adaptive graph topology and dynamic weighting of temporal features. Background Technology

[0002] Major Depressive Disorder (MDD), as a prevalent mental disorder, requires early objective screening for crucial intervention timing and efficacy assessment. Currently, clinical diagnosis primarily relies on subjective scales such as the Hamilton Depression Rating Scale-17 (HAMD-17), the Montgomery Depression Rating Scale (MADRS), and the Patient Health Questionnaire-9 (PHQ-9), combined with physician professional judgment. However, this process is susceptible to subjective influences, leading to inconsistencies in diagnosis among different practitioners and potentially affecting diagnostic accuracy. Therefore, exploring objective and reliable physiological indicators and developing effective identification methods are key to promoting early diagnosis and intervention for depression.

[0003] In recent years, with the widespread adoption of neurophysiological signal acquisition technologies such as electroencephalography (EEG), functional near-infrared spectroscopy (fNIRS), and resting-state functional magnetic resonance imaging (rs-fMRI), data-driven methods for assisting in the screening of depression have gradually become a research hotspot. Among these, EEG, with its advantages of high temporal resolution, low cost, and portability, has demonstrated unique value in revealing the neural mechanisms of depression and assisting in diagnosis. Studies have shown that resting-state EEG signals can effectively reflect abnormalities in brain functional networks related to depression, and graph theory analysis further reveals the close relationship between the severity of depression and changes in the topological structure of the whole brain network, making EEG testing a more reliable and objective tool compared to subjective assessment.

[0004] For EEG testing, existing research mainly follows two directions: one is the analysis path based on feature extraction combined with traditional machine learning classifiers; the other is to use deep learning models for end-to-end modeling of neural signals. Within the deep learning framework, Graph Convolutional Networks (GCNs) are widely used in brain network analysis because they can naturally represent the topological relationships between brain region nodes and functional connections. Meanwhile, temporal models such as Recurrent Neural Networks (RNNs), Long Short-Term Memory (LSTM) networks, and 1D Convolutional Neural Networks (1D-CNNs) are also used to capture the dynamic patterns of neural signals. To integrate spatial topology and temporal information, some studies attempt to improve the discriminative performance of screening models by using feature concatenation, multi-task learning, or basic attention mechanisms for multi-branch feature fusion.

[0005] However, existing methods still face several bottlenecks when applied to depression screening. Regarding graph topology construction, current methods largely rely on predefined static adjacency matrices, typically built based on average functional connectivity or fixed correlation coefficient thresholds, failing to adequately consider the significant individual heterogeneity and state dependence present in the brain networks of depressed patients. This static topology cannot dynamically adjust the connection weights between nodes based on input signals, making it difficult for the model to accurately capture abnormal functional connectivity patterns associated with depression, especially limiting its representational ability in cross-subject scenarios.

[0006] In terms of spatiotemporal feature modeling, existing architectures mostly use a single network path or a simple serial stacking approach to process graph features and temporal features, making it difficult to perform fine-grained collaborative modeling of the spatial topological dependencies of brain networks and the long-range dynamics of neural signals. Serial structures are prone to information attenuation or gradient interference in the transmission of deep features, while simple parallel structures lack effective feature interaction, causing key information to be lost before fusion, thus limiting the model's ability to analyze complex neural representations.

[0007] In terms of feature fusion strategies, existing methods generally adopt fixed weight addition, splicing, or static attention allocation. These static fusion strategies cannot adaptively evaluate the relative contribution of each branch feature according to the inherent distribution of the input samples, which can easily lead to feature information redundancy, thereby reducing the robustness of the model in depression screening and cross-subject generalization.

[0008] In summary, existing technologies have significant shortcomings in areas such as personalized dynamic graph topology construction, spatiotemporal feature co-modeling, and adaptive feature importance allocation. This results in limited ability of screening models to capture heterogeneous neural representations of depression, poor generalization ability across subject scenarios, and an inability to meet the clinical demand for highly specific auxiliary diagnostic tools. Therefore, there is an urgent need in this field to develop a depression screening method that can adaptively optimize brain network topology, achieve spatiotemporal feature co-modeling, and dynamically weight features. This would overcome the limitations of existing technologies, such as fixed graph topology, fragmented spatiotemporal modeling, and static fusion strategies, thereby improving the algorithm's discrimination accuracy and clinical applicability. Summary of the Invention

[0009] To address the above issues, this invention utilizes preprocessed multi-channel EEG data collected under closed-eye resting conditions to obtain relatively clean EEG data. Feature matrices are learned using a graph convolutional neural network based on a learnable adjacency matrix and a two-branch architecture of a temporal Transformer framework. A Squeeze-and-Excitation Module (SE) attention mechanism is used to dynamically assign weights to features in different branches. During training, a contrastive cross-entropy loss combining supervised contrastive loss and cross-entropy loss is used. Supervised contrastive loss is used in the projection space to effectively separate samples. Finally, a classifier outputs a diagnostic result for depression screening.

[0010] According to an embodiment of the present invention, a method for screening depression based on adaptive graph topology and dynamic weighting of temporal features is provided.

[0011] In a first aspect of the invention, a method for screening for depression based on adaptive graph topology and dynamic weighting of temporal features is provided. The method includes: Step S01: Obtain the EEG data to be screened and preprocess it to extract the initial node feature sequence; Step S02: Initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping; Step S03: Construct a parallel dual-branch network of a learnable graph topology module and a temporal Transformer module. Input the initial node feature sequence and the learnable adjacency matrix into this network to extract spatial topological dependency features and temporal features, respectively. Step S04: Concatenate the spatial topological dependency features and temporal features to obtain concatenated features. Use the SE attention mechanism to construct a dynamic weighting module at the feature channel level to assign weights to the concatenated features and output the final fused features. Step S05: Flatten the final fused features and input them into the multilayer perceptron classifier to output the positive probability of depression.

[0012] Furthermore, the preprocessing in step S01 includes filtering, denoising, ICA, rereference, segmentation, and normalization of the EEG signal, mapping each lead channel to graph nodes, and extracting the initial node feature sequence.

[0013] Furthermore, the specific steps of step S02 are as follows: The sum of the learnable parameter matrix and its transpose is calculated, and the matrix is ​​truncated to non-negativity using the ReLU function to obtain the activated matrix. Superimposing the identity matrix on the activated matrix yields the final learnable adjacency matrix used for graph convolution.

[0014] Furthermore, in step S03, the learnable graph topology module receives the initial node feature sequence and the learnable adjacency matrix as parallel inputs, performs feature flattening on the initial node feature sequence to obtain static node representations, which are then used as inputs to the initial graph convolutional layer. The residual graph learning framework introduces spatial topological dependency features at the output of the graph by incorporating residual connections into the graph convolutional layer through layer normalization, ELU activation function, graph convolutional layer, and addition.

[0015] Furthermore, the feature update steps for the graph convolutional layer are as follows: Step S031: Calculate the node degree matrix for the input learnable adjacency matrix and perform normalization to obtain the transition matrix; Step S032: Based on the transition matrix, perform matrix multiplication to complete the weighted aggregation of the neighbor information of all nodes in the graph, and obtain the neighbor representation matrix; Step S033: Concatenate the aggregated neighbor representations with the original representation of the current layer's center node along the feature channel dimension; Step S034: Dimensionally reduce the spliced ​​features using a trainable weight matrix and apply a non-linear activation function to obtain the next layer of node features.

[0016] Furthermore, the specific steps of the timing Transformer module in step S03 are as follows: The initial node feature sequence is processed by temporal and spatial convolution, then batch normalized and activated by ELU, and then input into a two-dimensional average pooling layer to obtain the pooled feature sequence input. The position encoding matrix is ​​added element by element to the pooled feature sequence to inject temporal order information, and a learnable embedding vector is concatenated at the beginning of the sequence to obtain the input sequence after initialization. After normalizing the input execution layer, the result is linearly projected to two subspaces to compute the query, key, and value matrices in parallel. These matrices are then added element-wise to the initialized input sequence to obtain the residual result. After performing layer normalization on the residual results again, the input is fed forward neural network for nonlinear feature transformation. The time features are obtained by adding the output of the feedforward neural network to the residual results.

[0017] Furthermore, the specific steps of the SE attention mechanism in step S04 are as follows: Global average pooling is used to compress the spatial dimension of the spliced ​​features; The non-linear relationship between channels is learned through two fully connected layers, generating a weight value for each channel; The weight values ​​of each channel are multiplied by the splicing features channel by channel.

[0018] In a second aspect of the invention, a depression screening device based on adaptive graph topology and dynamic weighting of temporal features is provided. The device includes: Feature extraction module: used to acquire the EEG data to be screened and preprocess it to extract the initial node feature sequence; Learnable Adjacency Matrix Module: Used to initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping; Dual-branch network module: Used to construct a parallel dual-branch network of learnable graph topology module and temporal Transformer module. The initial node feature sequence and learnable adjacency matrix are input into this network to extract spatial topological dependency features and temporal features respectively. Weight allocation module: It is used to concatenate spatial topological dependency features and temporal features to obtain concatenated features. It uses the SE attention mechanism to construct a dynamic weighting module at the feature channel level to allocate weights to the concatenated features and output the final fused features. Probability output module: Used to flatten the final fused features and input them into the multilayer perceptron classifier to output the positive probability of depression.

[0019] In a third aspect of the invention, an electronic device is provided. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the program to implement the method according to the first aspect of the invention.

[0020] In a fourth aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method according to a first aspect of the invention.

[0021] This invention is based on multi-channel EEG data collected under closed-eye resting state, which is preprocessed to obtain relatively pure EEG data. Feature matrices are learned through a graph convolutional neural network based on learnable adjacency matrices and a two-branch architecture of the temporal Transformer framework. The SE attention mechanism is used to dynamically assign weights to the features of different branches. During training, a contrastive cross-entropy loss combining supervised contrastive loss and cross-entropy loss is used. Supervised contrastive loss is used in the projection space to effectively separate samples. Finally, the classifier outputs the diagnostic results of depression screening.

[0022] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description.

[0023] The beneficial effects of this invention are: 1. The learnable adjacency matrix can automatically adjust the connection weights between brain regions based on EEG signals, and more accurately capture abnormal brain network patterns related to depression. 2. By extracting local features through convolution operations and then using Transformer to capture long-range time series dependencies, key details are preserved while avoiding the oversensitivity of complex models to the original signal, effectively improving the stability and computational efficiency of feature extraction. 3. By evaluating the importance of each feature channel through the SE mechanism, enhancing key features and suppressing redundant features, this dynamic weighting method allows the model to dynamically adjust its focus on different samples, significantly improving the accuracy of early screening. Attached Figure Description

[0024] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Wherein: Figure 1 A flowchart of a depression screening method based on adaptive graph topology and dynamic weighting of temporal features according to an embodiment of the present invention is shown; Figure 2 A flowchart illustrating an embodiment of the present invention is shown; Figure 3 A parallel dual-branch network structure diagram of a learnable graph topology module and a temporal Transformer module according to an embodiment of the present invention is shown. Figure 4 A block diagram of a depression screening device based on adaptive graph topology and dynamic weighting of temporal features according to an embodiment of the present invention is shown. Figure 5A schematic diagram of a depression screening device based on adaptive graph topology and dynamic weighting of temporal features according to an embodiment of the present invention is shown. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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.

[0026] According to an embodiment of the present invention, a depression screening method based on adaptive graph topology and dynamic weighting of temporal features is proposed. The method utilizes multi-channel EEG data collected under closed-eye resting conditions, which is preprocessed to obtain relatively clean EEG data. Feature matrices are learned using a graph convolutional neural network based on a learnable adjacency matrix and a dual-branch architecture of a temporal Transformer framework, respectively. The SE attention mechanism is used to dynamically assign weights to features in different branches. During training, a contrastive cross-entropy loss combining supervised contrastive loss and cross-entropy loss is used. Supervised contrastive loss is used in the projection space to effectively separate samples. Finally, a classifier outputs the diagnostic results for depression screening.

[0027] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.

[0028] Figure 1 This is a schematic flowchart of a depression screening method based on adaptive graph topology and dynamic weighting of temporal features according to an embodiment of the present invention. The method includes: Step S01: Obtain the EEG data to be screened and preprocess it to extract the initial node feature sequence; Step S02: Initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping; Step S03: Construct a parallel dual-branch network of a learnable graph topology module and a temporal Transformer module. Input the initial node feature sequence and the learnable adjacency matrix into this network to extract spatial topological dependency features and temporal features, respectively. Step S04: Concatenate the spatial topological dependency features and temporal features to obtain concatenated features. Use the SE attention mechanism to construct a dynamic weighting module at the feature channel level to assign weights to the concatenated features and output the final fused features. Step S05: Flatten the final fused features and input them into the multilayer perceptron classifier to output the positive probability of depression. It should be noted that although the operations of the method of the present invention have been described in a specific order in the above embodiments and figures, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0029] To provide a clearer explanation of the depression screening method based on adaptive graph topology and dynamic weighting of temporal features, a specific embodiment is described below. However, it is worth noting that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation of the present invention.

[0030] like Figure 2 As shown below, a specific example will be used to further illustrate the depression screening method based on adaptive graph topology and dynamic weighting of temporal features.

[0031] Step S01: Obtain the EEG data to be screened and preprocess it to extract the initial node feature sequence.

[0032] The resting-state electroencephalogram (EEG) time-series signal to be screened is acquired. The EEG signal is then filtered, denoised, subjected to ICA, rereferenced, segmented, and normalized. Each lead channel is mapped to a graph node, and the initial node feature sequence is extracted. ,in For the sample size, The channel dimension, For time step.

[0033] Specifically, a bandpass filter is used for time filtering in the 0.1Hz to 45Hz frequency band to minimize the effects of low-frequency drift and high-frequency physiological noise. Notch filtering is used to remove 50Hz frequency band interference, ensuring that power frequency interference is removed while minimizing the impact on neural signals in adjacent frequency bands.

[0034] Independent Component Analysis (ICA) using the FastICA algorithm was used to perform blind source separation on the multi-channel EEG signals, decomposing the mixed signal into several statistically independent components. Subsequently, a template matching strategy was used to identify non-brain-derived artifact components such as electrooculography (EOG), electrocardiography (ECG), and electromyography (EMG). Components with a correlation coefficient greater than 0.7 with the artifact template were removed, and the pure EEG components were retained and the signal was reconstructed.

[0035] By using a rereference to eliminate the spatial bias caused by the original reference electrode selection, the unipolar reference signal is converted into an average reference. That is, for each time point, the average value of all channels at that moment is subtracted from the signal of each channel. The formula is expressed as: , In the formula, For the first The instantaneous potential values ​​recorded by each target channel under the original unipolar reference. For the first The instantaneous potential values ​​recorded by each channel participating in the averaging calculation under the same original reference. The total number of effective channels participating in the average calculation. For important reference, the following is the first The new potential value of each channel relative to the average potential of the whole brain.

[0036] The signal is segmented by sliding the signal with a 5-second time window and a 1-second step size, converting the continuous signal into time periods of the same size, thus increasing the sample size while maintaining temporal resolution. During the segmentation process, time periods with amplitudes greater than 200μV are automatically removed to ensure the data quality of subsequent analysis.

[0037] Max-min normalization is used to eliminate inter-individual amplitude differences and channel sensitivity deviations. Max-min normalization is performed independently for each time segment, linearly mapping the signal to the [0, 1] interval. The specific calculation formula is as follows: , In the formula, Indicates the first The original signal of each sample, and They represent the first The maximum and minimum values ​​of each sample. Indicates the first The data is obtained by performing max-min normalization on each sample. The normalized signal is uniformly scaled to the range of [0, 1], which not only preserves the relative fluctuation pattern of the original signal, but also eliminates the difference in dimensions, which facilitates stable training and inference of the model across subjects.

[0038] After the above preprocessing, the raw continuous EEG data is converted into standardized node feature sequences. .

[0039] Step S02: Initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping.

[0040] Based on an initial, independently learnable parameter matrix, a parameterized learnable adjacency matrix is ​​constructed to represent the fully connected dense topology between EEG channels. Adaptive graph-structured connection weights are dynamically generated using end-to-end trainable parameters, replacing the predefined static adjacency matrix. Learnable adjacency matrix The topological dependency strength between nodes is automatically adjusted during training based on the distribution of input signal features, and is optimized by sparsity constraints and smooth regularization during training to characterize abnormal functional connectivity patterns specific to depression.

[0041] Specifically, in this embodiment, the adjacency matrix of the graph topology is directly defined as an end-to-end independently optimizable network parameter. The constructed original learnable parameter matrix is ​​as follows: ,in, Let be the number of graph nodes. The learnable parameter matrix is ​​initialized using a Xavier uniform distribution during model initialization to ensure consistent feature variance across nodes during forward propagation, thus avoiding gradient vanishing or exploding. The initial probability distribution formula is: , in, For row node index, For column node indexes, , Representing an interval The adjacency matrix is ​​uniformly distributed on the surface. This initialization strategy ensures that the adjacency matrix is ​​in a symmetric and numerically stable state during the early stages of training, effectively avoiding the vanishing or exploding gradient phenomena in deep graph networks.

[0042] During the forward propagation process, the original learnable parameter matrix It needs to undergo a structured transformation to generate a learnable adjacency matrix that conforms to graph computation constraints and has physical interpretability. The specific processing steps are as follows: Symmetryization and ReLU activation: To construct an undirected brain network topology and filter out physiologically unreasonable non-negative connections, the sum of the learnable parameter matrix and its transpose is first calculated. Then, a non-negative truncation is performed using the Modified Linear Unit (ReLU) function to obtain the activated matrix. : , The above operations forcefully ensure that the connection weight between any two nodes is non-negative, and at the same time achieve symmetric constraints for bidirectional connections through parameter sharing, which is consistent with the physiological characteristics of resting-state brain functional networks.

[0043] Adding self-loops: To prevent the features of nodes from being excessively smoothed or diluted during graph information transmission, in Based on the superposition of identity matrices This yields the final learnable adjacency matrix used for graph convolution. : , The introduction of self-loops ensures that each node retains at least one original feature representation when aggregating neighbor information, improving the model's sensitivity to independent abnormal discharges or rhythm disturbances in local brain regions.

[0044] Step S03: Construct a parallel dual-branch network of a learnable graph topology module and a temporal Transformer module. Input the initial node feature sequence and the learnable adjacency matrix into this network to extract spatial topological dependency features and temporal features, respectively.

[0045] like Figure 3 As shown, the learnable graph topology module branch: adopts a graph convolutional network architecture based on learnable adjacency matrices, which incorporates the learnable adjacency matrix... As a topological prior for spatial information transmission, multi-layer graph convolution operations are performed on node features. Through weighted aggregation of neighbor node information and nonlinear transformation, spatial topological dependency features between brain regions are extracted. ,in, The dimension of the spatial features; The temporal Transformer module branch: adopts the temporal Transformer architecture, and performs operations along the time dimension. Temporal modeling is performed, and after injecting positional encoding, a multi-head self-attention mechanism and a feedforward neural network are used to capture the global temporal features and long-range time series dependencies of neural signals, thereby extracting temporal features. ,in, The spatial feature dimension is denoted by . A convolutional module consisting of temporal and spatial convolutions is introduced before the Transformer encoder to extract local spatiotemporal features of the EEG signal and effectively reduce the time series dimension.

[0046] Specifically, the initial node feature sequence output by the branch receiving step S01 of the learnable graph topology module can be used. With the learnable adjacency matrix generated in step S02 As parallel input.

[0047] To adapt to dense graph convolution operations, firstly... Perform feature flattening to obtain static node representations. , as the input to the initial graph convolutional layer.

[0048] This branch uses dense graph SAGE convolution (DenseSAGEConv) instead of traditional sparse graph convolution to fully adapt to the fully connected dense topology output in step S02. layer The feature update process of a graph convolutional layer includes the following four computational steps: Step S031: Adjacency matrix row normalization: normalize the input learnable adjacency matrix. Calculate the node degree matrix diagonal elements ,in, For the learnable adjacency matrix, the th The node and the first The connection strength between nodes is normalized to obtain the transition matrix. This allows the contribution weights of adjacent nodes to be distributed proportionally according to their connection strength.

[0049] Step S032: Neighbor Feature Aggregation: Use matrix multiplication to perform weighted aggregation of neighbor information for all nodes in the graph, and obtain the neighbor representation matrix. This aggregation method is equivalent to performing aggregation on each node. Perform mean pooling of first-order neighborhood features to adapt global information broadcasting for dense topologies.

[0050] Step S033: Center-Neighbor Feature Concatenation: Combine the aggregated neighbor representations Original representation of the current layer center node splicing along the feature channel dimension Preserve independent information about the node's own state and its neighborhood context: , in, Let be the dimension of the hidden layer features.

[0051] Step S034: Linear Projection and Nonlinear Activation: Through a trainable weight matrix The spliced ​​features are dimensionality-reduced and mapped, and a non-linear activation function is applied. This yields the features of the next layer of nodes: .

[0052] The learnable graph topology module in this embodiment includes three stacked graph convolutional layers and filters. The number is set to 16. The residual graph learning framework is introduced by merging residual connections into graph convolutional layers in the following order: layer normalization, ELU activation function, graph convolutional layer, and addition. Transformed features are passed through a message-passing function. Provide residual diagram representation for the next layer. Finally, a node-by-node summation is performed to obtain the updated result. : .

[0053] The initial node feature sequence output from step S01 of the branch receiving step of the temporal Transformer module. As input. To adapt to two-dimensional convolution operations, an additional dimension is added between the sample dimension and the channel dimension of the input tensor to form a three-dimensional feature map. This facilitates parallel processing of temporal dynamics across different brain regions. The temporal dynamics branch is used to extract temporal features from the EEG sequence. The core components of this module include a convolutional module, a positional encoding matrix, and... A 3-layer temporal Transformer encoder is introduced. A convolutional module consisting of temporal and spatial convolutional layers is introduced before the Transformer encoder to extract the local spatiotemporal features of the EEG signal and effectively reduce the time series dimension.

[0054] Specifically, time filter The number of convolutional vectors is set to 64, and the kernel size is set to (1, 15). Two-dimensional temporal convolution is performed by sliding along the time axis. This operation captures local features spanning 15 consecutive time steps, and zero padding is used in the convolution operation to keep the temporal dimension length unchanged.

[0055] The number of spatial filters is the same as the number of time filters. The kernel size is set to ( 1) Perform full-channel convolution along the lead channel dimension to match the number of lead channels in the EEG data, ensuring a stride of (1,1). After spatial convolution, batch normalization and the ELU activation function are applied. This operation affects the output of the EEG data at a single time step. The features of each lead channel are weighted and fused to achieve local feature extraction across channels.

[0056] To reduce the computational complexity of subsequent Transformer modules and suppress high-frequency measurement noise, the spatiotemporal convolution output features are input into a two-dimensional average pooling layer. The pooling size is set to (1, 10), and the stride is set to (1, 10). This pooling operation performs non-overlapping local mean aggregation along the temporal dimension, reducing the original temporal resolution. Compress to This operation effectively reduces the dimensionality of temporal features, summarizing temporal information while preserving essential characteristics.

[0057] Pooled feature sequences Input timing Transformer encoder.

[0058] In order to incorporate feature vectors Position information at different time points is used to introduce a one-dimensional learnable position coding matrix into the encoder's input sequence. In EEG data, the position coding matrix is ​​used to encode the temporal order of the EEG signal and the relationship between different time points. The position coding matrix is ​​based on sine and cosine functions of different frequencies and is defined as follows: , in, This represents the feature dimension of the positional encoding and the input sequence. This represents the index of the current time step in the sequence. The channel index represents the feature channel dimension.

[0059] A learnable embedding vector is pre-defined at the beginning of the input sequence. This serves as the temporal representation extracted by the Transformer encoder. Essentially, It acts as an artificial "channel," unlike the actual EEG channel derived from electrodes. It is designed to aggregate global information from the EEG data of the entire Transformer model processing layer. The complete input sequence after initialization is represented as follows: .

[0060] First-level normalization: First, perform layer-level normalization on the input. Eliminate cross-sample feature distribution bias:

[0061] in, For the first The input feature tensor of the layer coding block, This is the mean vector calculated along the feature channel dimension. This is the corresponding standard deviation vector. To prevent numerical stability constants with a denominator of zero, and For learnable radiometric transformation parameters, This indicates element-wise multiplication.

[0062] The normalized input features are linearly projected into two subspaces, and the query, key, and value matrices are computed in parallel. Long-range temporal dependencies between global time steps are captured using the scaled dot product attention formula. The calculation formulas for scaled dot product attention and MHA are as follows: , , In the formula, This represents the output of each self-attention head. For EEG data, query... ,key Sum A linear transformation derived from the original EEG signal. Specifically, EEG features representing the current point in time, Corresponding to EEG characteristics at all time points, It also represents the EEG characteristics at all points in time. express dimensionality express The transpose of . This represents the operation used to concatenate the outputs of all attention heads. Finally, a linear transformation is applied. To obtain the final output of the MHA layer.

[0063] The first residual connection adds the attention output to the initialized complete original input element by element, preserving the original temporal baseline features and reducing the model's sensitivity to EEG noise fluctuations.

[0064] .

[0065] Second-layer normalization and feedforward network (FFN): Perform layer normalization again on the residual results: The input is then fed into a feedforward neural network for nonlinear feature transformation: , in, , For trainable weights, , This represents the trainable bias vector, and the activation function uses a Gaussian error linear unit (GELU) to enhance nonlinear representation capabilities. The Gaussian error linear unit function is defined as follows: , , in, The cumulative distribution function of the standard Gaussian distribution. It is the Gaussian error function.

[0066] Second residual connection: The output of the feedforward network is added to the residual result of the first residual connection to complete the forward propagation of a single-layer coded block. .

[0067] Step S04: Concatenate the spatial topological dependency features and temporal features to obtain concatenated features. Use the SE attention mechanism to construct a dynamic weighting module at the feature channel level to assign weights to the concatenated features and output the final fused features.

[0068] topological dependency features of graph space With time characteristics By concatenating along the feature channel dimension, the concatenated features are obtained. ;Use the SE attention mechanism to construct a dynamic weighting module at the feature channel level for... Weight allocation is performed as follows: First, a dynamic weight vector consistent with the number of concatenated feature channels is generated using a multilayer perceptron and a nonlinear activation function. Finally, the dynamic weight vector is multiplied with the concatenated features channel by channel to achieve sample-level adaptive weighting of multi-source fusion features, outputting the final fusion feature. This mechanism achieves dynamic synergy of bi-branch feature information by increasing the weight of feature channels that are sensitive to depression discrimination and suppressing redundant or noisy channels.

[0069] The SE attention mechanism consists of three key steps: Squeeze (compression): First, the spatial dimension of the input features is compressed using global average pooling. This results in a shape of (1, The vector of ) is calculated using the following formula: , in, For the first The spatial location of each channel eigenvalues, For the compressed number The global statistics for each channel are summarized into a global description by combining the two-dimensional spatial information of each channel, capturing the global distribution information of the channels.

[0070] Excitation: This process learns the non-linear relationship between channels through two fully connected layers, generating a weight value for each channel. The first fully connected layer increases the number of channels from... Dimensional reduction ( For the compression ratio, this embodiment takes... =4), and applies the ReLU activation function. The second fully connected layer restores the dimension to . And apply the Sigmoid activation function to output the weight values. The calculation formula is as follows: , in, and This is the weight matrix of the fully connected layer. For ReLU function, This is the Sigmoid function.

[0071] Scale (recalibrate): Apply the learned channel weights The features are recalibrated by multiplying them channel by channel with the spliced ​​features: , The final output features have the same size as the input, but the importance of each channel is dynamically adjusted. This mechanism enables the model to automatically enhance channels sensitive to depression detection and suppress redundant channels based on the signal characteristics of individual samples, achieving fine-grained feature selection.

[0072] Step S05: Flatten the final fused features and input them into a multilayer perceptron classifier. After nonlinear transformation and softmax activation, output the positive probability of depression.

[0073] The final fusion features After being flattened, the data is input into a multilayer perceptron classifier. After nonlinear transformation and softmax activation, the output is the positive probability of depression, thus completing the computer-aided screening.

[0074] The final fusion features The data are input into the classifier and the projection space, respectively. While calculating the contrastive cross-entropy loss, features from the classification space are used to predict the final result to evaluate the model's classification performance.

[0075] The classification space consists of two fully connected layers. An ELU activation function is applied after the first fully connected layer to enhance the model's non-linearity and improve classification performance. The hidden layer size is 32, and the output dimension is 2. This yields the classification space features. The projection space comprises two fully connected layers and two batch normalized layers. Furthermore, a nonlinear transformation is performed using the ELU activation function. The hidden layer size is 64, and the output dimension is 128. This yields the projection space features. .

[0076] To enhance the robustness and discriminative power of extracted features, contrastive cross-entropy loss is used during the feature extractor training process. Supervised contrastive loss is used in the projection space to effectively separate samples, while cross-entropy loss is used in the classification space to further align the feature representations with the corresponding labels.

[0077] The formula for calculating supervised comparison loss is as follows: , in, Indicates the relationship between the batch and the index The set of indices of all different positive samples This represents the cardinality of the set. It is the set of all possible comparison samples, including positive and negative samples, but excluding samples. itself. and These represent anchor point samples respectively. Positive samples And any comparison sample Feature representation, This is the temperature coefficient.

[0078] The CCE loss function is defined as follows: , , In the formula, For hyperparameters, Represents cross-entropy loss, Indicates the true label, This represents the predicted probability. By combining supervised contrastive loss and cross-entropy loss for feature extraction, and optimizing model parameters, the goal of improving feature representation and classification performance can be achieved.

[0079] To further verify the technical effects of the present invention, a comparative experiment was designed to evaluate the differences between the method of the present invention and existing methods.

[0080] This embodiment uses self-collected resting-state multichannel EEG data from 104 subjects, data from 50 physician-diagnosed patients with depression, and data from 54 healthy controls. Five minutes of resting-state EEG data were collected from each subject. All data preprocessing procedures are consistent with step S01 of this invention.

[0081] All experiments were implemented using a deep learning framework based on PyTorch 2.7.1 + CUDA 12.8. Model training employed the Adam optimizer with an initial learning rate of 5e-4, using a combination of supervised contrastive loss and cross-entropy loss as the loss function. The training batch size was set to 128, the maximum number of training epochs was set to 200, and an adaptive early stopping strategy was used to prevent overfitting. For data partitioning, the training and test sets were randomly divided according to the participant's ID at a ratio of 9:1 to ensure that data fragments from the same participant existed only in the training or validation set, preventing data leakage. Model performance was evaluated using a comprehensive analysis of multiple metrics, including accuracy, F1 score, precision, and recall.

[0082] The experimental results are shown in Table 1: Table 1

[0083] As can be seen from the comparison results in Table 1, the method proposed in this invention achieves optimal performance in the depression screening task, outperforming existing methods overall. Compared with traditional CNNs (such as DeprNet) and Transformer-based deep learning models (such as EDT), the dual-branch parallel architecture of this invention has stronger joint modeling capabilities for the spatial topological dependence and long-term temporal dynamics of high-dimensional EEG signals, more comprehensively characterizing the individualized neural representation of depression, and achieving more accurate classification results. In terms of graph-temporal fusion, although methods such as EDT and HEMAsNet have achieved certain improvements through mechanisms such as global self-attention and multi-scale feature weighting, their network structures mostly still rely on serial stacking or static splicing modes, which are insufficient in suppressing channel-level redundant features and do not adequately model the fine-grained correspondence between weak EEG rhythm disturbances and brain function coupling in patients with mild depression. MAST-GCN shares some similarities with the method of this invention, both employing a multi-branch feature extraction architecture. However, when processing the original multidimensional EEG sequences, MAST-GCN still uses a predefined static adjacency matrix and static concatenation for graph structure construction and information integration. This invention, on the other hand, directly performs end-to-end representation learning based on learnable graph topology and a temporal Transformer framework with parallel branches. Furthermore, it employs a dynamic weighting strategy for SE after concatenation during the fusion stage, resulting in more comprehensive spatiotemporal discriminative information retained by the model and a significant improvement in cross-subject generalization ability. The accuracy, F1 score, precision, and recall of this invention on self-collected data reached 86.54%, 86.27%, 84.62%, and 88.00%, respectively, all significantly outperforming existing methods.

[0084] Based on the same inventive concept, this invention also proposes a depression screening device based on adaptive graph topology and dynamic weighting of temporal features. The implementation of this device can be found in the implementation of the method described above; repeated details will not be repeated. Figure 4 As shown, the device 100 includes: Feature extraction module 101: used to acquire the EEG data to be screened and preprocess it to extract the initial node feature sequence; Learnable adjacency matrix module 102: used to initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping; Dual-branch network module 103: Used to construct a parallel dual-branch network of a learnable graph topology module and a temporal Transformer module. The initial node feature sequence and the learnable adjacency matrix are input into this network to extract spatial topological dependency features and temporal features, respectively. Weight allocation module 104: It is used to concatenate spatial topological dependency features and temporal features to obtain concatenated features. It uses the SE attention mechanism to construct a dynamic weighting module at the feature channel level to allocate weights to the concatenated features and output the final fused features. Probability output module 105: used to flatten the final fused features and input them into the multilayer perceptron classifier to output the positive probability of depression.

[0085] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0086] like Figure 5 As shown, the device includes a central processing unit (CPU), which can perform various appropriate actions and processes based on computer program instructions stored in read-only memory (ROM) or loaded from storage units into random access memory (RAM). The RAM can also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0087] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0088] The processing unit executes the various methods and processes described above, such as method steps S01 to S05. For example, in some embodiments, method steps S01 to S05 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of method steps S01 to S05 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute method steps S01 to S05 by any other suitable means (e.g., by means of firmware).

[0089] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.

[0090] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0091] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0092] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0093] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A depression screening method based on adaptive graph topology and dynamic weighting of temporal features, characterized in that, The method includes: Step S01: Obtain the EEG data to be screened and preprocess it to extract the initial node feature sequence; Step S02: Initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping; the specific steps are: calculate the sum of the learnable parameter matrix and its transpose matrix, perform non-negative truncation using the ReLU function to obtain the activated matrix; superimpose the identity matrix on the activated matrix to obtain the final learnable adjacency matrix used for graph convolution; Step S03: Construct a parallel dual-branch network of a learnable graph topology module and a temporal Transformer module. Input the initial node feature sequence and the learnable adjacency matrix into this network to extract spatial topological dependency features and temporal features, respectively. The feature update steps of the graph convolutional layer in the learnable graph topology module are as follows: Step S031: Calculate the node degree matrix for the input learnable adjacency matrix and perform normalization to obtain the transition matrix; Step S032: Based on the transition matrix, use matrix multiplication to perform weighted aggregation of the neighbor information of all nodes in the graph to obtain the neighbor representation matrix; Step S033: Concatenate the aggregated neighbor representations with the original representation of the current layer's center node along the feature channel dimension; Step S034: Dimensionality reduction mapping of the spliced ​​features is performed using a trainable weight matrix, and a non-linear activation function is applied to obtain the next layer of node features; Step S04: Concatenate the spatial topological dependency features and temporal features to obtain concatenated features. Use the SE attention mechanism to construct a dynamic weighting module at the feature channel level to assign weights to the concatenated features and output the final fused features. Step S05: Flatten the final fused features and input them into the multilayer perceptron classifier to output the positive probability of depression.

2. The depression screening method based on adaptive graph topology and dynamic weighting of temporal features according to claim 1, characterized in that, The preprocessing described in step S01 includes filtering, denoising, ICA, rereference, segmentation, and normalization of the EEG signal, mapping each lead channel to graph nodes, and extracting the initial node feature sequence.

3. The depression screening method based on adaptive graph topology and dynamic weighting of temporal features according to claim 1, characterized in that, The learnable graph topology module described in step S03 receives the initial node feature sequence and the learnable adjacency matrix as parallel inputs, performs feature flattening on the initial node feature sequence to obtain static node representations, which are then used as inputs to the initial graph convolutional layer. The residual graph learning framework introduces spatial topological dependency features at the output of the graph by incorporating residual connections into the graph convolutional layer through layer normalization, ELU activation function, graph convolutional layer, and addition.

4. The depression screening method based on adaptive graph topology and dynamic weighting of temporal features according to claim 1, characterized in that, The specific steps of the timing Transformer module described in step S03 are as follows: The initial node feature sequence is processed by temporal and spatial convolution, then batch normalized and activated by ELU, and then input into a two-dimensional average pooling layer to obtain the pooled feature sequence input. The position encoding matrix is ​​added element by element to the pooled feature sequence to inject temporal order information, and a learnable embedding vector is concatenated at the beginning of the sequence to obtain the input sequence after initialization. After normalizing the input execution layer, the result is linearly projected to two subspaces to compute the query, key, and value matrices in parallel. These matrices are then added element-wise to the initialized input sequence to obtain the residual result. After performing layer normalization on the residual results again, the input is fed forward neural network for nonlinear feature transformation. The time features are obtained by adding the output of the feedforward neural network to the residual results.

5. The depression screening method based on adaptive graph topology and dynamic weighting of temporal features according to claim 1, characterized in that, The specific steps of the SE attention mechanism described in step S04 are as follows: Global average pooling is used to compress the spatial dimension of the spliced ​​features; The non-linear relationship between channels is learned through two fully connected layers, generating a weight value for each channel; The weight values ​​of each channel are multiplied by the splicing features channel by channel.

6. A depression screening device based on adaptive graph topology and dynamic weighting of temporal features, characterized in that, The device implements the method as described in any one of claims 1 to 5, comprising: Feature extraction module: used to acquire the EEG data to be screened and preprocess it to extract the initial node feature sequence; The learnable adjacency matrix module is used to initialize independent learnable parameter matrices and generate adaptive learnable adjacency matrices through nonlinear mapping. The specific steps are as follows: calculate the sum of the learnable parameter matrix and its transpose matrix, perform non-negative truncation using the ReLU function to obtain the activated matrix; and superimpose the identity matrix on the activated matrix to obtain the final learnable adjacency matrix used for graph convolution. Dual-branch network module: Used to construct a parallel dual-branch network of learnable graph topology module and temporal Transformer module. The initial node feature sequence and learnable adjacency matrix are input into this network to extract spatial topological dependency features and temporal features respectively. The feature update steps of the graph convolutional layer in the learnable graph topology module are as follows: Step S031: Calculate the node degree matrix for the input learnable adjacency matrix and perform normalization to obtain the transition matrix; Step S032: Based on the transition matrix, use matrix multiplication to perform weighted aggregation of the neighbor information of all nodes in the graph to obtain the neighbor representation matrix; Step S033: Concatenate the aggregated neighbor representations with the original representation of the current layer's center node along the feature channel dimension; Step S034: Dimensionality reduction mapping of the spliced ​​features is performed using a trainable weight matrix, and a non-linear activation function is applied to obtain the next layer of node features; Weight allocation module: It is used to concatenate spatial topological dependency features and temporal features to obtain concatenated features. It uses the SE attention mechanism to construct a dynamic weighting module at the feature channel level to allocate weights to the concatenated features and output the final fused features. Probability output module: Used to flatten the final fused features and input them into the multilayer perceptron classifier to output the positive probability of depression.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 5.