Mental disease I auxiliary diagnosis method based on Transform sub-network asynchronous model

By using temporal segmentation and asynchronous capture based on the asynchronous model of the Transformer subnetwork, the shortcomings of existing technologies in the dynamic changes and asynchronous correlations of brain function are addressed, achieving high accuracy and high generalization ability in the diagnosis of mental illnesses and providing interpretable biological support.

CN121789959APending Publication Date: 2026-04-03NORTHEASTERN UNIV CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing fMRI-based diagnostic techniques for mental illnesses have limitations in diagnosing affective disorders, including the inability to capture dynamic changes in brain function and the temporal patterns of coordination within subnetworks, as well as the neglect of asynchronous associations. This results in insufficient diagnostic accuracy and generalization ability.

Method used

We employ a Transformer-based Subnetwork Asynchronous Model (SE-TAM) that uses a temporal blocker, an SNP-n subnetwork partitioning module, and an asynchronous capture module to accurately capture and asynchronously correlate dynamic activity patterns within brain functional subnetworks. This is combined with a self-attention mechanism and fully connected layers for classification.

Benefits of technology

It significantly improves the diagnostic accuracy and disease differentiation of bipolar disorder (BD) and major depressive disorder (MDD), enhances cross-sample generalization ability, provides a quantifiable biological diagnostic tool, and is consistent with brain physiological mechanisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121789959A_ABST
    Figure CN121789959A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of mental disease auxiliary diagnosis, and particularly relates to a mental disease I auxiliary diagnosis method based on a Transform sub-network asynchronous model. Based on a sub-network embedded Transform asynchronous model, taking fMRI data as input, and taking an evaluation result as output; the Transform asynchronous model based on sub-network embedding comprises a time sequence partitioning device, an SNP-n sub-network partitioning module, a self-attention module and an asynchronism capturing module, and is obtained by performing end-to-end supervised learning on the basis of a PyTorch framework in a three-level core architecture of time sequence partitioning, sub-network partitioning and asynchronous capturing. And finally, a result obtained through the sub-network embedded Transform asynchronous model is classified and evaluated through a classification module. The auxiliary diagnosis accuracy is remarkably improved through the method, and the method comprehensively exceeds static and traditional dynamic methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of auxiliary diagnosis technology for mental illnesses, and in particular to an auxiliary diagnosis method for mental illness I based on an asynchronous model of a Transformer subnetwork. Background Technology

[0002] Mood disorders can severely impair patients' cognitive function and physical health, and pose a high risk of suicide and disability. Early intervention is crucial. However, traditional diagnosis relies on subjective assessments such as interviews and scales, which have limitations such as inconsistency and a high risk of misdiagnosis. Therefore, there is an urgent need for quantitative diagnostic techniques based on objective biological data such as fMRI. fMRI can indirectly reflect neural activity through blood oxygen level-dependent (BOLD) signals, capturing brain regions and network features related to emotion regulation and cognitive control, providing objective data support for disease diagnosis. AI models can analyze and model fMRI data to uncover disease-related feature patterns and achieve automated diagnosis.

[0003] “Kawahara J, Brown CJ, Miller SP, et al. BrainNetCNN: Convolutionalneural networks for brain networks; towards predicting neurodevelopment[J].NeuroImage, 2017, 146: 1038-1049.” proposed the static brain network analysis method BrainNetCNN[1]. This technology belongs to the spatial domain CNN model, and related research has been applied to the disease diagnosis scenario driven by fMRI data. Its core function is to realize disease classification by mining the spatial topological relationship of brain network. The specific implementation process is as follows: with the help of three specially designed convolutional filters, the topological locality features of brain network are fully utilized to extract features of the brain region connection structure corresponding to fMRI data. Through the calculation and learning of multi-layer network, the disease diagnosis result is output. This method focuses on the static spatial connection pattern between brain regions and does not consider the dynamic changes of brain function over time and the collaborative temporal features within the sub-network. Therefore, its performance is significantly limited in the diagnosis of diseases related to emotional disorders and other dynamic brain function disorders.

[0004] BrainNetCNN, a static diagnostic method focusing on the spatial topology of brain networks, utilizes three types of convolutional filters to mine the topological locality of brain networks. It focuses solely on the spatial connectivity between brain regions, neglecting the mining and analysis of temporal information from fMRI data. This design leads to two major drawbacks: First, it completely ignores the dynamic changes in brain function over time, failing to capture the coordinated temporal patterns of brain subnetworks within different time windows. Since the neuropathological mechanisms of affective disorders are closely related to dynamic brain dysfunction, static spatial features cannot fully reflect the essence of the disease. Second, it lacks targeted analysis of functional subnetworks, extracting features only from a global brain topology perspective. It fails to focus on the internal activity patterns of key functional clusters such as the Default Mode Network (DMN) and Central Executive Network (CEN), resulting in insufficient feature discrimination. Therefore, this method performs poorly in core indicators such as accuracy and AUC in the diagnosis of BD and MDD, failing to meet the needs of precise clinical diagnosis.

[0005] "Deng X, Zhang J, Liu R, et al. Classifying ASD based on time-series fMRI using spatial–temporal transformer[J]. Computers in biology and medicine, 2022, 151: 106320." This paper proposes the St-transformer dynamic temporal analysis method. This technology is an end-to-end model based on Transformer and has been used in the diagnostic research of neurological diseases such as autism SD and its subtypes. Its core function is to capture the spatiotemporal features of fMRI data to improve diagnostic accuracy. The specific implementation process is as follows: LTSMA units are introduced on the basis of the Transformer model to supplement the temporal dimension information of fMRI data, while the GGDB strategy is used to solve the class imbalance problem in the dataset; the model captures the global topology and temporal dependencies of the brain network through a self-attention mechanism, extracts features and classifies the input fMRI data, and finally outputs the disease diagnosis results. Although this method can capture temporal dynamic features, it assumes that the BOLD signals between different sub-networks in the brain are transmitted synchronously. It does not take into account the physiological nature of the inherent time delay between different functional networks, and cannot model the asynchronous relationship between sub-networks. As a result, it is difficult to achieve the desired effect in distinguishing between affective disorders with similar symptoms (such as BD and MDD).

[0006] The St-transformer approach introduces LTMA units to supplement spatiotemporal features on top of the Transformer, and uses a data imbalance optimization strategy to build an end-to-end model. However, it assumes synchronous transmission of BOLD signals between brain subnetworks and does not design a module specifically to capture asynchronous connections between subnetworks. This design fundamentally conflicts with the physiological mechanisms of the brain, resulting in significant defects: First, it fails to model the inherent time delay between subnetworks, violating the physiological fact that neural signal transmission has a natural time delay—for example, there is a delay of about 150ms in the transmission of activation signals from the SN to the CEN, and a delay of 200-300ms in the CEN's inhibition signals to the DMN. This asynchronicity is a core feature of brain functional coordination, and ignoring this feature will cause the features extracted by the model to be disconnected from the real brain network interaction patterns. Second, it has insufficient generalization ability when distinguishing between emotional disorders with similar symptoms (such as BD and MDD). Because it does not capture asynchronous mechanisms such as the cascade response of the "salience-executive-default" network, it cannot accurately identify specific patterns of abnormal asynchronous behavior in brain networks under disease states, resulting in limited performance in terms of F1 score and cross-sample adaptability, making it difficult to meet the clinical needs for accurate differential diagnosis of diseases. Summary of the Invention

[0007] The purpose of this invention is to overcome the core deficiencies of existing fMRI diagnostic techniques for mental illnesses and provide a more accurate, stable, and physiologically aligned auxiliary diagnostic scheme for affective disorders. Specifically, it addresses the shortcomings of static methods (such as BrainNetCNN) that focus solely on the spatial topology of brain networks while neglecting the dynamic temporal characteristics of brain function and the collaborative temporal patterns within subnetworks, achieving precise capture of dynamic activity patterns within brain subnetworks. Secondly, it solves the problem of traditional subnetwork partitioning relying on healthy brain structures and exhibiting distortion in disease states, achieving precise subnetwork partitioning that matches pathological features. Thirdly, it overcomes the core bottlenecks of dynamic methods (such as St-transformer) that assume signal synchronization between subnetworks and fail to capture neural signal transmission delays and asynchronous associations, restoring the asynchronous mechanisms such as the cascading responses of the brain's "salience-execution-default" network. Ultimately, by constructing an integrated model, it improves the diagnostic accuracy, disease discrimination, and cross-sample generalization ability for bipolar disorder (BD) and major depressive disorder (MDD), providing objective and quantifiable biological diagnostic tools for clinical practice and compensating for the shortcomings of traditional subjective assessment methods.

[0008] The technical solution of this invention is as follows: A method for auxiliary diagnosis of mental illness I based on the Transformer Subnetwork Asynchronous Model (SE-TAM) is proposed, which takes fMRI data as input and evaluation results as output. The Transformer Subnetwork Asynchronous Model includes a temporal blocker, an SNP-n subnetwork partitioning module, a self-attention module, and an asynchronous capture module. It adopts a three-level core architecture of "temporal block-subnetwork partitioning-asynchronous capture" and is obtained through end-to-end supervised learning based on the PyTorch framework. Finally, the results obtained by the Transformer Subnetwork Asynchronous Model are classified and evaluated by the classification module.

[0009] In the Transformer-based asynchronous subnetwork model, the temporal segmenter segments and preprocesses long-term fMRI data to obtain segmented fMRI subsequences. The SNP-n subnetwork partitioning module divides the brain functional subnetworks under disease states according to the segmented fMRI subsequences and standardizes the features. The self-attention module captures the co-temporal patterns within the brain functional subnetworks, and the asynchronicity capture module captures the temporal patterns within the brain functional subnetworks and the asynchronous correlations between brain functional subnetworks. The output features of the two modules are fused by element-wise addition to achieve dual feature representation of internal temporal and external asynchronicity. The internal and asynchronous features of all brain functional subnetworks are concatenated and output as binary classification results through a fully connected layer and activation function.

[0010] The time-series blocker takes long-time fMRI data as input and obtains segmented fMRI subsequences. The timing blocker (TSB) employs a lightweight fixed-length segmentation mechanism without complex neural network layers, including a length setting unit and a patch splitting execution unit. The length setting unit presets the fMRI subsequence length L, and the patch splitting execution unit performs a slicing operation based on the set fMRI subsequence length to split the continuous long time series fMRI data in sequence without changing the node dimension features of the original data, and only performs segmentation processing on the time dimension. Input long-term fMRI data of a single sample, in the following format: Where T represents the total time step and C represents the number of brain nodes; output M consecutive fMRI subsequence fragments, each fMRI subsequence in the following format. Splitting follows the formula Data is extracted from the (m-1)L+1th time point to the mLth time point, keeping the C brain node dimensions unchanged, and finally outputting M fMRI subsequences of length L.

[0011] L=50.

[0012] The SNP-n subnetwork partitioning module includes a subnetwork partitioning unit and a feature unified mapping unit, which are connected in series. The sub-network partitioning unit has a built-in dual-strategy selection mechanism, including a prior knowledge-driven partitioning strategy and an unsupervised data-driven partitioning strategy. The sub-network partitioning unit first completes the basic partitioning through the prior knowledge-driven partitioning strategy. When the partitioning result conflicts with the actual data features or the prediction effect on the test set does not meet expectations, it switches to the unsupervised data-driven partitioning strategy. The prior knowledge-driven segmentation strategy calls on neuroscience-preset brain maps or functional connectivity rules to segment brain functional subnetworks; the unsupervised data-driven segmentation integrated clustering algorithm automatically clusters based on the statistical characteristics of fMRI data or node connection similarity. The feature unification mapping unit configures a linear transformation layer for each partitioned subnetwork. It is responsible for mapping the features of sub-networks of different node sizes to a unified dimension; Input: Segmented subsequence fragments; Output: Standardized subnetwork feature set after partitioning and mapping. Sub-network partitioning units will The C nodes are divided into n subnetworks, resulting in , Let be the number of nodes in the i-th subnetwork, and The feature unification mapping unit passes through a linear transformation layer. Perform the transformation and output. d represents the unified feature dimension, ultimately forming n sub-networks of dimension one.

[0013] The prior knowledge-driven partitioning strategy is based on the known functional localization of classic brain functional networks at the biological level, initially screening a candidate set of C brain nodes. The unsupervised data-driven partitioning strategy uses the K-means clustering algorithm, K=n=3, taking the temporal correlation matrix of the subsequence Xm as input, iteratively optimizing the cluster centers, and finally dividing the C nodes of each subsequence Xm into n subnetworks, obtaining the subnetwork features. Let be the number of nodes in the i-th subnetwork, satisfying ; Unsupervised data-driven partitioning verification: By calculating the mean temporal correlation of nodes within brain functional subnetworks and the mean correlation between brain functional subnetworks, the partitioning results are ensured to meet the biological characteristics of "high internal synergy and large external variability".

[0014] The asynchronous capture module is used to capture the time delay and asynchronous correlation between sub-networks, restoring the cascading response mechanism of the brain's "salience-execution-default" network; The asynchronous capture module includes a dedicated EncoderLayer group, an asynchronous feature aggregation unit, and a feature concatenation unit; Dedicated EncoderLayer Group: Configures an independent EncoderLayer for each partitioned subnetwork, which integrates Transformer's multi-head attention mechanism, residual connections, and layer normalization structure to capture the asynchronous interaction between a single subnetwork and other subnetworks; Asynchronous feature aggregation unit: concatenates the asynchronous features of all sub-networks in the first dimension to obtain comprehensive asynchronous features, which include dynamic latency and asynchronous interaction modes between all sub-networks; Feature splicing unit: responsible for splicing the standardized features of all subnetworks along the feature dimension to form a unified splicing tensor; The asynchronous capture module's feature processing flow is as follows: The asynchronous capture module uses a standardized sub-network feature set... As input, a dedicated EncoderLayer group captures the asynchronous interaction between the input sub-network and the other sub-networks, and outputs the asynchronous feature set of each sub-network. The asynchronous feature aggregation unit concatenates asynchronous features in the first dimension and restores them to the d-dimensional dimension via linear mapping, generating comprehensive asynchronous features that cover the dynamic latency and asynchronous interaction modes of all sub-networks. When it is necessary to obtain the corresponding subnet... If the original standardized features are not used, then the asynchronous features outside the sub-network are aggregated; the feature concatenation unit concatenates and maps the original standardized features along the feature dimension to obtain a unified concatenation tensor. Finally, and By fusing through methods such as concatenation mapping, element-wise addition, or attention weighting, the module features output contain both original features and asynchronous interactive information. .

[0015] The asynchronous correlation calculation is as follows: the temporal correlation between brain functional sub-networks is captured by EncoderLayer to determine the temporal correlation between the i-th brain functional sub-network and all other brain functional sub-networks, as shown in the following formula: ,in, For the asynchronous feature representation of the i-th brain functional sub-network in the m-th sub-sequence and other brain functional sub-networks, the EncoderLayer will model N×(N-1) asynchronous relationships, where N is the total number of sub-networks.

[0016] The self-attention module uses the normalized features of the m-th subsequence and the i-th subnetwork. For independent inputs, the corresponding query, key, and value are first generated through linear transformation. The matrix is ​​then used to calculate the global dependency attention weights between temporal positions within the subnetwork based on the scaling dot product attention mechanism. Subsequently, the features are divided into multiple independent attention heads for parallel computation, and the results of the multi-head attention are concatenated and linearly transformed. Finally, residual connections and layer normalization operations are combined to optimize the feature output, resulting in a feature with dimension [missing information]. Internal temporal characteristics This allows for the full capture of temporal correlation information within a single subnet.

[0017] The classification module first performs an element-wise addition and fusion operation, and for each sub-network, it extracts its internal temporal features through the self-attention layer. Asynchronous features between subnets in the asynchronous capture sublayer modeling Element-by-element addition yields the fusion features of individual subnetworks. The fusion feature dimension is maintained Perform global splicing to combine the fusion features of the N sub-networks. , By concatenating and integrating along the first dimension, a global fusion feature tensor is generated. Its dimensions are The global fusion feature tensor is input into the fully connected layer, and after linear transformation, it is mapped to a low-dimensional feature vector. Then, the output value is compressed to the [0,1] interval by the Sigmoid activation function to complete the binary classification judgment.

[0018] The beneficial effects of this invention are: Innovative temporal segmentation strategy: By using the patch operation of the TSB module, long-term fMRI data is divided into local subsequences, which reduces modeling complexity and solves the problem that traditional models cannot capture the dynamic changes in brain function within a short time window. Subnetwork partitioning: Integrating neuroscience priors and unsupervised clustering, it breaks through the limitations of traditional partitioning that relies on the structure of a healthy brain, achieving accurate subnetwork partitioning in disease states and providing a reliable benchmark for asynchronous analysis; Asynchronous-specific module design: For the first time, a dedicated asynchronous capture module is embedded in the Transformer encoder. By quantizing latency and modeling the lag correlation between subnets, the asynchronous collaboration mechanism of the brain's functional network is restored, solving the core bottleneck of default signal synchronization in existing dynamic methods. Dual feature fusion mechanism: Simultaneously capture the temporal patterns within subnetworks and the asynchronous correlations between subnetworks to form a dual feature representation of "internal + external", making the features extracted by the model more consistent with the neuropathological mechanisms of emotional disorders.

[0019] Precise processing strategy for temporal segmentation: The innovative temporal segmenter (TSB) divides long temporal fMRI data into local subsequences of appropriate length through patch operations. This not only significantly reduces the modeling complexity of long temporal data, but also focuses on the dynamic changes of brain function within different time windows. It solves the core pain point that traditional models cannot capture the collaborative temporal patterns within subnetworks, and lays a high-quality data foundation for subsequent feature extraction.

[0020] A disease-adaptive dynamic subnetwork partitioning scheme: Breaking away from the limitations of traditional subnetwork partitioning that relies on the anatomical structure of a healthy brain, this scheme integrates prior neuroscience knowledge with unsupervised clustering algorithms to achieve accurate partitioning of brain functional subnetworks in disease states. Simultaneously, by using linear transformations to map subnetworks of different sizes to a unified dimension, it ensures the integrity of temporal features within each subnetwork and resolves the incomparability of features between different subnetworks, providing a stable benchmark framework that aligns with pathological characteristics for asynchronous analysis.

[0021] Innovative Design of Asynchronous Modeling Module: For the first time, a dedicated asynchronous capture module is embedded in the Transformer encoder. Targeting the inherent time delay characteristics of neural signal transmission between brain subnetworks, it accurately captures complex hysteretic relationships between subnetworks by quantifying key indicators such as the peak time difference of BOLD signals and neural transmission delay, thus reconstructing the cascading response mechanism of the "salience-execution-default" network. This design completely solves the core defects of existing dynamic models, such as default signal synchronization that violates brain physiology, making the model features more closely resemble the dysfunctional patterns of brain networks in disease states.

[0022] The dual-feature fusion mechanism of "internal temporal + external asynchronous" captures global temporal dependencies within subnetworks through self-attention and mines asynchronous associations between subnetworks through asynchronous modules, forming dual feature representations. This fusion mode comprehensively covers the dynamic characteristics of brain functional networks, significantly improves the model's ability to distinguish between diseases with similar symptoms such as BD and MDD, and enhances cross-sample generalization performance, solving the problems of single feature representation and insufficient discriminative power in traditional models.

[0023] Physiological adaptation optimization of hyperparameters: Determining the optimal configuration of the number of subnetworks n=3, which is highly consistent with the cognition of the three core functional networks DMN, CEN and SN in neuroscience, ensures the biological rationality of the division and avoids feature loss and redundancy caused by overly coarse or overly fine division. It achieves precise matching between technical design and brain physiological structure, and further improves the reliability and interpretability of the model. Attached Figure Description

[0024] Figure 1 This is a block diagram of the overall architecture of the Transformer Subnetwork Asynchronous Model (SE-TAM) proposed in this invention. Figure 2 This describes the specific workflow of the Time Sequence Block (TSB), demonstrating the segmentation processing logic for long-time fMRI data.

[0025] Figure 3 This is a schematic diagram illustrating the working principle of the SNP-n subnetwork partitioning module, used to demonstrate the subnetwork partitioning logic and the unified mapping of features.

[0026] Figure 4 The diagrams for each module are as follows: (a) is the self-attention module, which is used to capture the cooperative timing patterns within a single subnetwork; (b) is a schematic diagram of the working principle of the asynchronous capture module, which is used to demonstrate the modeling logic of the time delay correlation between subnetworks. Detailed Implementation

[0027] The method of this invention can be applied to the diagnosis of affective disorders using functional magnetic resonance imaging (fMRI) data and artificial intelligence (AI) models. Its main purpose is to solve the problem of early and accurate identification of bipolar disorder (BD) and major depressive disorder (MDD).

[0028] This invention proposes a Transformer-based Subnetwork Asynchronous Model (SE-TAM), using fMRI data as input and classification results as output. Through a three-tiered core architecture of "temporal segmentation - subnetwork partitioning - asynchronous capture," it systematically addresses the key shortcomings of existing technologies, such as missing dynamic temporal features, distorted subnetwork partitioning, and failure to capture asynchronous associations. The model is based on end-to-end supervised learning using the PyTorch framework. The core technical solutions revolve around the design and collaborative work of the Temporal Block (TSB), SNP-n subnetwork partitioning module, and asynchronous capture module. Simultaneously, by optimizing the Transformer infrastructure, it achieves in-depth mining of the dynamic asynchronous features of brain functional networks.

[0029] I. Overall Technical Framework and Workflow 1. Overall Architecture Overview The core logic of the SE-TAM model is as follows: First, long-term fMRI data is segmented and preprocessed. Then, brain functional subnetworks in disease states are accurately divided and their features are standardized. Finally, a Transformer encoder with an embedded asynchronous module synchronously captures the temporal patterns within subnetworks and the asynchronous correlations between subnetworks, ultimately outputting diagnostic results. The overall architecture is as follows: Figure 1 As shown, it covers five major layers: data input layer, preprocessing layer, feature extraction layer, asynchronous modeling layer, and classification output layer, with each core module embedded within it to work collaboratively.

[0030] like Figure 1 The diagram visually illustrates the three-tiered core process of "time-sequence segmentation - subnetting - asynchronous capture". The meanings of the markings in the diagram are as follows: Data input layer: The receiving format is long-term fMRI data (T=950 time steps, C=116 brain nodes). Time Series Block (TSB): Divides long time series data into M short subsequences through patch operations. ; SNP-n subnetwork partitioning module: Combining neuroscience priors and unsupervised clustering, each subsequence is divided into n=3 subnetworks, and mapped to a unified dimension through linear layers. ; Transformer encoder layer: contains self-attention module and asynchronous capture module; Self-attention module: captures collaborative temporal patterns within a single subnetwork; Asynchronous module: Configures a dedicated EncoderLayer for each sub-network to capture the correlation between inter-sub-network latency and asynchronicity; Feature fusion layer: Combines features from within sub-networks with asynchronously related features to form a comprehensive feature layer. ; Classification output layer: Diagnostic results are output via a fully connected network and activation function. ; Training optimization module: Includes SGD optimizer, BCELoss loss function, and supports 10-fold hierarchical cross-validation.

[0031] 2. Core Workflow Data input and initialization: Input fMRI data preprocessed by AAL technology. The single sample data format is (T=950 for the number of time sampling points, C=116 for the number of brain nodes). At the same time, initialize the model hyperparameters (number of subnetworks n=3, subsequence length L, feature dimension d, etc.).

[0032] Temporal block preprocessing: The TSB module performs a patch operation on long time series data, dividing it into M short subsequences, reducing modeling complexity and focusing on local dynamic features.

[0033] Subnetwork partitioning and feature standardization: The SNP-n module combines neuroscience priors and unsupervised clustering to divide the 116 nodes of each subsequence into n subnetworks, and then maps them to a unified dimension through linear transformation to ensure feature comparability.

[0034] Joint extraction of asynchronous and internal features: The standardized sub-network features are input into the Transformer encoder, the self-attention mechanism captures the temporal dependencies within the sub-network, and the asynchronous module specifically models the time delay and asynchronous correlation between sub-networks to generate dual features.

[0035] Feature fusion and classification: The internal and asynchronous features of all sub-networks are concatenated and output as a binary classification diagnostic result (healthy / disease) through a fully connected layer and activation function.

[0036] Model training and optimization: The model was trained for 600 rounds using the SGD optimizer and binary cross-entropy loss (BCELoss). Generalization ability was ensured by 10-fold hierarchical cross-validation. The model parameters were evaluated and adjusted every 30 rounds.

[0037] II. Detailed Implementation Scheme of Core Modules 1. Time Sequence Block (TSB): Processes long time-series data into segments, such as... Figure 2 As shown in the figure, the meanings of the markings are as follows: Input: Raw fMRI long-term data ; Subsequence length setting: Set the length L of a single subsequence (the optimal value in this invention is 50); Patch partitioning operation: using formula Divide the long sequence into A short subsequence; Standardization: The mean of each subsequence is normalized to zero and the variance is normalized to one. Output: M normalized short subsequences This is used for subsequent subnetwork partitioning.

[0038] (1) Functional positioning This study addresses the challenges of high modeling complexity and difficulty in capturing local dynamic features when directly processing long-term fMRI data, laying the foundation for subsequent extraction of temporal patterns within subnetworks.

[0039] (2) Implementation process and algorithm formula The core operation of TSB is "sliding window patch partitioning", and the specific steps are as follows: Set the subsequence length L (determined based on data characteristics and model performance tuning) to divide the original long time series data into M continuous and non-overlapping local subsequences: , , (Rounding down ensures uniform subsequence length).

[0040] For each subsequence Standardization preprocessing (mean to zero, variance to one) is performed to eliminate the dimensional differences in data from different time windows and improve the model convergence speed.

[0041] The choice of subsequence length L needs to balance "local dynamic capture" and "information integrity". This scheme has been experimentally verified. When L=50 (corresponding to M=19), it can focus on brain activity changes within a short time window and avoid information fragmentation.

[0042] The partitioning method adopts a "continuous and non-overlapping" design to ensure that brain activity data at each time point belongs to only one subsequence, avoiding feature redundancy and duplicate calculations.

[0043] 2. SNP-n module: Subnetwork partitioning and feature mapping for disease adaptation (1) Functional positioning Breaking away from the limitations of traditional subnetting that relies on the structure of a healthy brain, this method achieves precise subnetting that matches disease states, while mapping features of subnets of different sizes to a unified dimension to support subsequent asynchronous correlation analysis.

[0044] (2) Implementation process and algorithm formula The SNP-n module comprises two core operations: "subnetwork partitioning" and "feature unification mapping," as detailed below: Subnetwork partitioning (n=3 is the optimal configuration); By combining prior knowledge from neuroscience with unsupervised clustering algorithms, data-driven subnetting is achieved: Prior knowledge constraints: Based on the known functional localization of the Default Mode Network (DMN), Central Executive Network (CEN), and Spontaneous Network (SN), a preliminary set of 116 brain nodes was screened for their affiliation. Unsupervised clustering optimization: The K-means clustering algorithm (K=n=3) is used to optimize the subsequences. Using the temporal correlation matrix as input, the cluster centers are iteratively optimized, and finally each subsequence is... The C=116 nodes are divided into n subnetworks, and the subnetwork characteristics are obtained ( Let be the number of nodes in the i-th subnetwork, satisfying ; Partitioning verification: By calculating the mean temporal correlation of nodes within subnetworks and the mean correlation between subnetworks, we ensure that the partitioning results meet the biological characteristics of "high internal coordination and large external differences".

[0045] Feature Unified Mapping; Due to the number of nodes in different sub-networks Since differences exist, they need to be mapped to a unified dimension d through a linear transformation, as shown in the following formula: in, It is the linear transformation matrix of the i-th subnetwork (adaptive learning during model training). Sub-network features The transpose (adjusting dimensions to adapt to linear transformation). These are the standardized features after mapping.

[0046] Optimization of the number of subnetworks n: Through hyperparameter experiments, the model performance is optimal when n=3, which not only conforms to the physiological structure of the three core functional networks, but also avoids the problems of overly coarse partitioning when n<3 and information redundancy when n>3. Unsupervised clustering initialization: Using candidate sets determined by prior neuroscience knowledge as initial cluster centers improves partitioning efficiency and biological rationality, and avoids local optima caused by random initialization.

[0047] 3. Asynchronousness Capture Module: Modeling Asynchronous Associations Between Subnets (1) Functional positioning As a core improvement to the model, it specifically captures the time delay and asynchronous relationship between sub-networks, restores the cascading response mechanism of the brain's "salience-execution-default" network, and solves the defect of default signal synchronization in existing dynamic methods.

[0048] (2) Implementation basis: Transformer encoder core structure The asynchronous module is embedded in the Transformer encoder. First, we need to clarify the basic computational logic of the Transformer: Self-attention computation: Input feature Z (containing Q, K, and V class vectors), calculate attention weights, and capture global dependencies: Where dk is the dimension of the key vector, and the softmax operation is regularized to avoid excessive numerical adaptation; Multi-head attention computation: This method learns features from different subspaces using multiple parallel attention heads, then outputs the results through concatenation and linear transformation. ,in Let WO be the linear transformation matrix, and WO be the output transformation matrix. Residual connectivity and layer normalization: Optimizing output and improving model stability. , where FFN is a feedforward neural network.

[0049] (3) Embedding and implementation of the asynchronous capture module After the multi-head attention layer of the Transformer encoder, an asynchronous capture module is added, such as... Figure 3 As shown in the figure, the meanings of the markings are as follows: Input: Normalized features of n=3 subnetworks (Feature dimension splicing); Dedicated EncoderLayer: Configure one EncoderLayer for each sub-network (3 in total) to calculate the asynchronous association between the sub-network and the other two sub-networks respectively; Delay Quantization Unit: Quantizes the inter-subnet delay by calculating the peak time difference of the BOLD signal and the peak position difference of the cross-correlation function. ; Asynchronous feature generation: Outputs asynchronous features for each sub-network. ; Feature concatenation: Concatenate all asynchronous features in the first dimension to obtain a comprehensive asynchronous feature. .

[0050] Specific implementation steps: Configure a dedicated EncoderLayer for each sub-network: Let the encoder of the i-th sub-network be Encoderi( The input is the standardized feature concatenation result of all subnetworks. (Feature dimension concatenation); Asynchronous correlation computation: The EncoderLayer captures the latency correlation between the i-th sub-network and all other sub-networks, as shown in the following formula: where, To represent the asynchronous characteristics of the i-th subnetwork in the m-th subsequence with other subnetworks, the EncoderLayer internally models N×(N-1) asynchronous relationships by quantifying indicators such as the peak time difference of the BOLD signal and the neural transmission delay. Asynchronous feature fusion: The asynchronous features of all sub-networks are concatenated in the first dimension to obtain a comprehensive asynchronous feature: This feature fully covers the dynamic latency and asynchronous interaction modes between all sub-networks.

[0051] The asynchronous module and the self-attention module work together: the self-attention layer focuses on the collaborative temporal patterns within the sub-network, while the asynchronous module focuses on the lag correlations between sub-networks. The output features of the two are fused by element-wise addition to achieve a dual feature representation of "internal temporal + external asynchronous". Delay quantization mechanism: The delay is determined by calculating the peak position difference of the cross-correlation function of the BOLD signals from different sub-networks. This is used as a modulatory factor for attention weights, making the model's capture of asynchronous associations more closely aligned with physiological mechanisms.

[0052] 4. Model Training and Validation Scheme (1) Training configuration Framework and Strategy: End-to-end training is implemented based on PyTorch, using a supervised learning mode, with labels as "healthy" or "sick" (BD / MDD are uniformly labeled as sick to distinguish them from normal controls). Optimizers and loss functions: SGD optimizer (learning rate 1e-3, momentum 0.99), binary cross-entropy loss (BCELoss), gradient descent optimization suitable for binary classification tasks; Training epochs and evaluation: There are a total of 600 training epochs, with model evaluation performed every 30 epochs. The learning rate is adjusted based on the performance on the validation set (using a learning rate decay strategy).

[0053] (2) Cross-validation scheme Stratified K-Fold cross-validation (10-fold) is used to ensure that the class ratio of each subset is consistent with the original data. The training set is batch-processed using DataLoader (batch size set to 32) and randomly shuffled to reduce the impact of data bias on the model's generalization ability.

[0054] (3) Evaluation indicators The model performance is quantified using multi-dimensional metrics, including: Accuracy (ACC): Overall prediction correctness, reflecting the model's basic diagnostic capability; Precision (PRE): The reliability of positive example predictions, avoiding misdiagnosis of healthy individuals as having the disease; Recall (REC): The ability to identify positive cases and avoid missing patients with the disease; F1 score: Harmonic average of precision and recall, balancing the two types of errors; AUC value: Area under the ROC curve, reflecting the overall discriminative power of the model.

[0055] The proposed Transformer Subnetwork Asynchronous Model (SE-TAM) in this invention, through an integrated design of "temporal block partitioning - disease adaptation subnetwork division - asynchronous association capture," significantly outperforms existing technologies in terms of diagnostic performance for mental illnesses, disease identification ability, generalization stability, interpretability, and physiological adaptability. Its core advantages and experimental verification are as follows: 1. Significantly improved accuracy in auxiliary diagnosis, surpassing both static and traditional dynamic methods. This invention achieves a significant improvement in core indicators for both BD and MDD diagnostic tasks through the dual capture of dynamic temporal features and asynchronous correlations. Validated on a large-scale clinical dataset (the Center-NMU dataset contains 573 samples, covering 181 MDD cases, 146 BD cases, and 246 healthy controls), its performance is stable and reliable. Specific data comparisons show: For BD diagnosis: SE-TAM achieved an accuracy (ACC) of 74.9% and an area under the ROC curve (AUC) of 78.3%. Compared to static methods (BrainNetCNN ACC 63.8%, AUC 63.8%; BrainGNN ACC 65.1%, AUC 63.7%), the ACC improved by over 15% and the AUC improved by over 14%. Compared to traditional dynamic methods (St-transformer ACC 73.5%, AUC 73.1%; TRL ACC 71.8%, AUC 72.5%), the ACC improved by 1.4%-3.1% and the AUC improved by 5.2%-5.8%.

[0056] For MDD diagnosis: SE-TAM achieved an ACC of 75.6% and an AUC of 74.9%, far exceeding the static methods ASD-DiagNet (ACC 53.2%) and ST-GCN (ACC 60.9%), and was also superior to the dynamic methods BiLSTM (ACC 69.2%) and SwiFUN (AUC 73.2%).

[0057] Table 1. Performance comparison of SE-TAM with state-of-the-art methods on MDD and BD datasets.

[0058] Ablation experiments further verified the synergistic gains of the core modules: when using only the Baseline model, the BD diagnostic ACC was only 67.0% and AUC was 66.1%; after adding the Time Sequence Block (TSB), the ACC improved to 68.2% and AUC to 67.1%; after integrating the TSB and SNP-3 sub-network partitioning modules, the ACC and AUC improved to 69.3% and 75.0%, respectively; and after fully integrating the three core modules, the ACC exceeded 74.9% and the AUC reached 78.3%, which is an improvement of 11.9% and 18.5% compared to the Baseline, fully demonstrating the key supporting role of the technical path designed in this invention in diagnostic performance.

[0059] Table 2 Comparison of model performance for different module combinations in ablation experiments

[0060] 2. Outstanding disease identification capabilities, solving the challenge of accurately distinguishing between BD and MDD. Bipolar disorder (BD) and major depressive disorder (MDD) share highly similar symptoms, and traditional methods struggle to differentiate them due to their inability to capture disease-specific brain network abnormalities. This invention utilizes an asynchronous capture module to reconstruct the cascade response mechanism of the brain's "salience-executive-default" network, extracting more specific pathological features and significantly improving the ability to differentiate between the two disorders. SE-TAM achieves an F1 score of 71.3% for BD and 75.3% for MDD, representing an 8.8%-12.8% improvement over traditional dynamic methods (BiLSTM's BDF1 score is 62.5%, and TRL's is below 70.1%). Even compared to the currently superior SwiFUN (BDF1 175.6%), SE-TAM's AUC (78.3% vs 73.2%) is still superior, indicating that the model achieves a better balance between "accurate identification" and "low false positives".

[0061] The core reason is that traditional dynamic methods (such as St-transformer and BiLSTM) assume signal synchronization between sub-networks, which violates the natural time delay characteristics of neural signal transmission and cannot distinguish the subtle differences between BD and MDD in the asynchronous mode of brain networks. On the other hand, SE-TAM captures the specific abnormalities in the "salience-execution-default" network interaction delay of the two types of diseases by quantifying indicators such as the peak time difference of BOLD signals and neural transmission delay, which significantly improves the feature discrimination.

[0062] 3. Strong generalization stability, adaptable to heterogeneous clinical data. This invention effectively improves the model's cross-sample generalization ability by using disease-adapted subnetwork partitioning and a 10-fold hierarchical cross-validation strategy, thus solving the problem that traditional models, which rely on healthy brain structure partitioning, have poor adaptability to pathological states. Using 10-fold stratified cross-validation (ensuring that the proportion of each subset category is consistent with the original data), SE-TAM exhibits minimal performance fluctuations across different data subsets (AUC standard deviation of only 5.06 for BD diagnosis and 4.25 for MDD diagnosis), while traditional dynamic methods (such as St-transformer) show AUC fluctuations of over 7.3 in cross-subset validation. This indicates that the model of this invention has stronger adaptability to clinically heterogeneous data (such as patient samples of different ages, genders, and disease courses).

[0063] Hyperparameter experiments show that when the number of subnetworks n=3 (which matches the physiological structure of the three core functional networks DMN, CEN, and SN in neuroscience), the model achieves optimal results in all indicators. This avoids the feature loss caused by overly coarse subnetwork division (n<3) or information redundancy caused by overly fine subnetwork division (n>3) in traditional methods, and further improves the model's stable generalization ability.

[0064] 4. It has strong interpretability, providing a solid biological basis for clinical diagnosis. Many existing AI diagnostic models suffer from the "black box" problem, making them difficult to accept clinically. This invention, through multi-dimensional interpretability analysis, closely links the model's decision-making logic with brain physiological mechanisms, providing intuitive and quantifiable biological support for diagnostic results. Time step metric analysis showed that the average time delay between subnetworks in the disease group (BD+MDD) was 35.56, which was significantly higher than that in the healthy group (29.72). Furthermore, the delay variance in the disease group (25.61) was much greater than that in the healthy group (18.07). This quantitatively revealed the pathological characteristics of decreased connectivity efficiency and disordered asynchronous patterns in brain functional networks under disease conditions, which is highly consistent with clinical cognition.

[0065] Attention visualization and asynchronous time period analysis show that the feature values ​​of the asynchronous time periods of the healthy group subnetwork are distributed in a flat strip pattern, indicating stable functional activities and consistent interaction patterns; while the feature values ​​of the disease group are distributed in a scattered radial pattern, which intuitively reflects the disordered state of asynchronous interaction of the subnetwork, making the diagnostic logic of the model clinically understandable.

[0066] Compared to traditional models (such as BrainGNN and ASD-DiagNet) which can only output diagnostic results and cannot explain "why the diagnosis was made", the quantitative latency indicators and asynchronous mode visualization results provided by this invention can help clinicians to deeply understand the neuropathological mechanisms of diseases and provide a reference for the formulation of treatment plans.

Claims

1. A method for auxiliary diagnosis of mental illness I based on an asynchronous model of a Transformer subnetwork, characterized in that, A Transformer-based asynchronous subnetwork model is proposed, using fMRI data as input and evaluation results as output. The Transformer-based asynchronous subnetwork model includes a temporal blocker, an SNP-n subnetwork partitioning module, a self-attention module, and an asynchronous capture module, with a three-level core architecture of "temporal block-subnetwork partitioning-asynchronous capture". It is obtained through end-to-end supervised learning based on the PyTorch framework. Finally, the results obtained by the Transformer-based asynchronous subnetwork model are classified and evaluated by a classification module.

2. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 1, characterized in that, In the Transformer-based asynchronous subnetwork model, the temporal segmenter segments and preprocesses long-term fMRI data to obtain segmented fMRI subsequences. The SNP-n subnetwork partitioning module divides the brain functional subnetworks under disease states according to the segmented fMRI subsequences and standardizes the features. The self-attention module captures the co-temporal patterns within the brain functional subnetworks, and the asynchronicity capture module captures the temporal patterns within the brain functional subnetworks and the asynchronous correlations between brain functional subnetworks. The output features of the two modules are fused by element-wise addition to achieve dual feature representation of internal temporal and external asynchronicity. The internal and asynchronous features of all brain functional subnetworks are concatenated and output as binary classification results through a fully connected layer and activation function.

3. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 2, characterized in that, The time-series blocker takes long-time fMRI data as input and obtains segmented fMRI subsequences. The timing blocker (TSB) employs a lightweight fixed-length segmentation mechanism without complex neural network layers, including a length setting unit and a patch splitting execution unit. The length setting unit presets the fMRI subsequence length L, and the patch splitting execution unit performs a slicing operation based on the set fMRI subsequence length to split the continuous long time series fMRI data in sequence without changing the node dimension features of the original data, and only performs segmentation processing on the time dimension. Input long-term fMRI data of a single sample, in the following format: Where T represents the total time step and C represents the number of brain nodes; output M consecutive fMRI subsequence fragments, each fMRI subsequence in the following format. Splitting follows the formula Data is extracted from the (m-1)L+1th time point to the mLth time point, keeping the C brain node dimensions unchanged, and finally outputting M fMRI subsequences of length L.

4. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 2, characterized in that, L=50。 5. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 2, characterized in that, The SNP-n subnetwork partitioning module includes a subnetwork partitioning unit and a feature unified mapping unit, which are connected in series. The sub-network partitioning unit has a built-in dual-strategy selection mechanism, including a prior knowledge-driven partitioning strategy and an unsupervised data-driven partitioning strategy. The sub-network partitioning unit first completes the basic partitioning through the prior knowledge-driven partitioning strategy. When the partitioning result conflicts with the actual data features or the prediction effect on the test set does not meet expectations, it switches to the unsupervised data-driven partitioning strategy. The prior knowledge-driven segmentation strategy calls on neuroscience-preset brain maps or functional connectivity rules to segment brain functional subnetworks; the unsupervised data-driven segmentation integrated clustering algorithm automatically clusters based on the statistical characteristics of fMRI data or node connection similarity. The feature unification mapping unit configures a linear transformation layer for each partitioned subnetwork. It is responsible for mapping the features of sub-networks of different node sizes to a unified dimension; Input: Segmented subsequence fragments; Output: Standardized subnetwork feature set after partitioning and mapping. Sub-network partitioning units will The C nodes are divided into n subnetworks, resulting in , Let be the number of nodes in the i-th subnetwork, and The feature unification mapping unit passes through a linear transformation layer. Perform the transformation and output. d represents the unified feature dimension, ultimately forming n sub-networks of dimension one.

6. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 5, characterized in that, The prior knowledge-driven partitioning strategy is based on the known functional localization of classic brain functional networks at the biological level, and initially screens a candidate set of C brain nodes; the unsupervised data-driven partitioning strategy uses the K-means clustering algorithm, K=n=3, with subsequence X m Using the temporal correlation matrix as input, the cluster centers are iteratively optimized, and finally, the C nodes of each subsequence Xm are divided into n subnetworks, yielding the subnetwork features. Let be the number of nodes in the i-th subnetwork, satisfying ; Unsupervised data-driven partitioning verification: By calculating the mean temporal correlation of nodes within brain functional subnetworks and the mean correlation between brain functional subnetworks, the partitioning results are ensured to meet the biological characteristics of "high internal synergy and large external variability".

7. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 2, characterized in that, The asynchronous capture module is used to capture the time delay and asynchronous association between sub-networks, restoring the cascading response mechanism of the brain's "salience-execution-default" network; The asynchronous capture module includes a dedicated EncoderLayer group, an asynchronous feature aggregation unit, and a feature concatenation unit; Dedicated EncoderLayer Group: Configures an independent EncoderLayer for each partitioned subnetwork, which integrates Transformer's multi-head attention mechanism, residual connections, and layer normalization structure to capture the asynchronous interaction between a single subnetwork and other subnetworks; Asynchronous feature aggregation unit: concatenates the asynchronous features of all sub-networks in the first dimension to obtain comprehensive asynchronous features, which include dynamic latency and asynchronous interaction modes between all sub-networks; Feature splicing unit: responsible for splicing the standardized features of all subnetworks along the feature dimension to form a unified splicing tensor; The asynchronous capture module's feature processing flow is as follows: The asynchronous capture module uses a standardized sub-network feature set... As input, a dedicated EncoderLayer group captures the asynchronous interaction between the input sub-network and the other sub-networks, and outputs the asynchronous feature set of each sub-network. ; The asynchronous feature aggregation unit concatenates asynchronous features in the first dimension and restores them to the d-dimensional dimension via linear mapping, generating a comprehensive asynchronous feature that covers the dynamic latency and asynchronous interaction modes of all sub-networks. When it is necessary to obtain the corresponding subnetwork If so, then it should be changed to aggregate other asynchronous features outside of this sub-network; feature The concatenation unit concatenates and maps the original standardized features along the feature dimension to obtain a unified concatenation tensor. Finally, and By fusing through methods such as concatenation mapping, element-wise addition, or attention weighting, the module features output contain both original features and asynchronous interactive information. .

8. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 7, characterized in that, The asynchronous correlation calculation is as follows: the temporal correlation between brain functional sub-networks is captured by EncoderLayer to determine the temporal correlation between the i-th brain functional sub-network and all other brain functional sub-networks, as shown in the following formula: ,in, For the asynchronous feature representation of the i-th brain functional sub-network in the m-th sub-sequence with other brain functional sub-networks, the EncoderLayer will model N×(N-1) asynchronous relationships, where N is the total number of sub-networks.

9. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 1, characterized in that, The self-attention module uses the normalized features of the m-th subsequence and the i-th subnetwork. For independent inputs, the corresponding query, key, and value are first generated through linear transformation. The matrix is ​​then used to calculate the global dependency attention weights between temporal positions within the subnetwork based on the scaling dot product attention mechanism. Subsequently, the features are divided into multiple independent attention heads for parallel computation, and the results of the multi-head attention are concatenated and linearly transformed. Finally, residual connections and layer normalization operations are combined to optimize the feature output, resulting in a feature with dimension [missing information]. Internal temporal characteristics This allows for the full capture of temporal correlation information within a single subnet.

10. The method for auxiliary diagnosis of mental illness I based on the asynchronous model of Transformer subnetworks according to claim 1, characterized in that, The classification module first performs an element-wise addition and fusion operation, and for each sub-network, it extracts its internal temporal features through the self-attention layer. Asynchronous features between subnets in the asynchronous capture sublayer modeling Element-by-element addition yields the fusion features of individual subnetworks. The fusion feature dimension is maintained ; Perform global stitching to combine the fusion features of the N sub-networks. , By concatenating and integrating along the first dimension, a global fusion feature tensor is generated. Its dimensions are The global fusion feature tensor is input into the fully connected layer, and after linear transformation, it is mapped to a low-dimensional feature vector. Then, the output value is compressed to the [0,1] interval by the Sigmoid activation function to complete the binary classification judgment.

Citation Information

Cited By

  • A brain network dynamic analysis method and system based on sub-network alignment

    CN122335856A