A minimally simplified Transformer method for brain network learning and classification
By using the minimally simplified Transformer method Miniformer, the problems of large number of parameters and poor interpretability in functional brain network learning and classification are solved, achieving efficient training and improved result interpretability in medical scenarios. In particular, the introduction of sparsity and temporal smoothness priors improves the model's adaptability in new scenarios.
Patent Information
- Application Number
- CN202411198248.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2044-08-29
AI Technical Summary
Existing functional brain network learning and classification methods in medical scenarios suffer from problems such as large number of parameters, insufficient training data leading to overfitting, poor model interpretability, and insufficient adaptability and flexibility in new scenarios.
We employ the Miniformer method, a minimal Transformer approach. By simplifying the projection matrix to a diagonal matrix and incorporating sparsity and temporal smoothness priors, we design Miniformer(SM) and Miniformer(SP) variants. These variants directly use the self-attention matrix as input to the classification module, reducing the number of parameters and enhancing model interpretability.
It reduces model parameters, lowers the risk of overfitting, improves the training efficiency and interpretability of the model with limited data, can identify brain regions or connections that contribute to the final classification results, and enhances the model's adaptability and interpretability.
Smart Images

Figure CN119129650B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of biomedical information processing technology, specifically a simplified Transformer method for brain network learning and classification. Background Technology
[0002] Brain functional networks, as a method for simulating neural pathways on a macroscopic scale, are playing an increasingly important role in the early identification of neurological or psychiatric abnormalities such as autism spectrum disorder, Alzheimer's disease, and major depressive disorder. In mathematics, a functional brain network can be described by a graph, where nodes represent regions of interest in the brain, and edges reflect the relationships with functional magnetic resonance imaging (fMRI) signals of the corresponding brain regions. Unlike traditional graphs, which may be unknown or well-defined, such as molecular formulas, functional brain networks lack a precise, real-world definition and generally require estimation based on fMRI signal data. High-quality functional brain network estimation is crucial for downstream tasks.
[0003] Over the past few decades, numerous methods have been proposed for estimating functional brain networks. Classical methods include Pearson correlation, sparse representation, and mutual information. Pearson correlation is the first and simplest method for estimating functional brain networks. While popular, it only computes perfect correlations between brain regions, easily leading to spurious connections in the estimated network. In contrast, sparse representation, as a method for building partially correlated models, can obtain more reliable connections by regressing confounding effects from unrelated brain regions. Unlike Pearson correlation and sparse representation, which only capture linear relationships, mutual information provides a method for modeling complex nonlinear interactions between different brain regions. Furthermore, many other schemes, such as higher-order correlations, dynamic causal models, and Granger causality, can be used to estimate functional brain networks.
[0004] Based on the obtained functional brain networks, brain disease diagnosis tasks can be performed. Traditionally, features, such as node degree, local clustering coefficients, or edge weights, are first extracted from the functional brain networks corresponding to different subjects. These features are then selected (if necessary) and input into a vector classifier (such as a support vector machine) to identify subjects with brain diseases from a normal control group. Furthermore, considering that the functional brain network is a graph, graph neural networks can naturally be used for functional brain network classification. Unlike the manual feature extraction methods in traditional vector schemes, graph neural network-based methods combine feature extraction and classification tasks within a single framework. Although both vector-based schemes and graph neural network-based methods have been successfully applied in brain disease diagnosis, they both require pre-estimation of the functional brain network during the learning process. This means that the learning of the functional brain network and downstream tasks are separated into different steps, making it difficult to achieve optimal overall performance.
[0005] To overcome the limitations of traditional step-by-step learning methods, researchers have recently explored joint learning of functional brain networks and downstream tasks. For example, Kazi et al. proposed combining differentiable graph modules (dgm) with graph convolutional networks for the diagnosis of Alzheimer's disease. (Kazi, Anees, et al. "Differentiable graph module (dgm) for graph convolutional networks." IEEE Transactions on Pattern Analysis and Machine Intelligence 45.2(2022):1606-1617). Jia et al. studied a method for adaptive learning of graph structures based on spatiotemporal graph convolutional networks. (Jia, Ziyu, et al. "GraphSleepNet: Adaptive spatial-temporal graph convolutional networks for sleep stage classification." IJCAI. Vol. 2021. 2020). Jang et al. designed a neural network model that uses a data-driven approach to learn graph structures. Jang S, Moon SE, Lee J S. EEG-based emotional video classification via learning connectivity structure[J]. IEEE Transactions on Affective Computing, 2021, 14(2): 1586-1597. However, the architectures involved in these works are mainly designed based on strong skills, without a unified principle to follow, which affects their adaptability and flexibility in new scenarios.
[0006] In contrast, Transformer, as a unified foundational framework, has demonstrated significant effectiveness in multiple fields such as natural language processing and computer vision. More importantly, it provides a natural method to simulate the relationships between brain regions using self-attention mechanisms. Recently, Kan et al. proposed BrainNetTF and DRAT, which utilize Transformer to learn and classify functional brain networks in an end-to-end manner. Kan X, Dai W, Cui H, et al. Brain network transformer[J]. Advances in Neural Information Processing Systems,2022,35:25586-25599. Kan X, Gu AAC, Cui H, et al. Dynamic brain transformer with multi-level attention for functional brain network analysis[C] / / 2023IEEE EMBS International Conference on Biomedical and Health Informatics(BHI).IEEE,2023:1-4. Although these Transformer-based methods have great potential, they involve a large number of parameters, thus requiring sufficient data for training, which is a huge challenge for medical scenarios. In addition, such methods often lead to poor interpretability. On the one hand, the projection matrix W involved in the self-attention module Q W K and W V This coupling of data from different time points in functional magnetic resonance imaging (fMRI) signals poses a challenge to the interpretation of model parameters. Furthermore, traditional Transformer-based methods struggle to determine which brain regions or connections contribute to the final results because the self-attention matrix involved in these methods serves only as an intermediate measure for learning new representations, rather than being directly used as a functional brain network for brain disease classification tasks. Summary of the Invention
[0007] This invention proposes a minimally simplified Transformer method for brain network learning and classification. This method not only reduces the number of parameters that need to be learned, making training based on limited data more efficient, but also enhances the interpretability of model parameters and the final results. Furthermore, two variants based on the Miniformer are designed, applying sparsity and temporal smoothness priors to the functional magnetic resonance imaging (fMRI) signals respectively, flexibly integrating prior information.
[0008] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0009] A simplified Transformer method for brain network learning and classification, characterized by the following steps:
[0010] (1) For the resting-state functional magnetic resonance imaging signal data acquired by the functional magnetic resonance imaging equipment, the following preprocessing was performed using the DPARSF toolbox: 1) Remove the first p unstable time points for each subject; 2) Perform head movement and time-layer correction; 3) Regress the influence of ventricles, white matter, and global signals; 4) Register to standard space using the template from the Montreal Institute of Neuroscience; 5) Perform 0.01-0.1 Hz bandpass filtering to reduce the influence of heartbeat and respiration.
[0011] (2) After preprocessing the resting-state functional magnetic resonance imaging (fMRI) signal data, the brain was divided into several brain regions based on an automated anatomical marker template, and the time series of each brain region was extracted, X = [x1, x2, ..., x...]. i ,…,x N ]∈R T×N , where x i ∈R T Let T represent the time series of the i-th node, where T represents the number of times in the time series and N represents the number of nodes.
[0012] (3) Based on the extracted time series of each brain region, input into the Miniformer model, first go through the learning process of the brain functional network, and then enter the classification process of the brain functional network.
[0013] During the learning process of the described brain functional network, the time series data is input into the MiniEncoder module, which is stacked in multiple layers to progressively extract and fuse the features of the time series. The MiniEncoder then uses a Transformer-based projection matrix. Simplified to a diagonal matrix W l W l diagonal elements in This corresponds precisely to the weights of time points in the functional magnetic resonance imaging signal; for the projection matrix After simplification, we obtain the diagonal matrix W. l The embedded representation Q was obtained. l K l and And through Q l and K l The attention matrix A is calculated using the dot product operation. l The resulting matrix is scaled using the Softmax function and then compared with V. lMultiplying these together yields the output of the self-attention mechanism, calculated as follows:
[0014]
[0015] SA l (Q l ,K l V l ) = SA l (Q l Q l Q l = softmax(A) l )Q l
[0016] Further, residual connections and layer normalization modules are used to address the gradient vanishing or exploding problem in the output of the self-attention mechanism; a feedforward network module is used to transmit and process the input data of each layer of the neural network, and then it is passed through the residual connections and layer normalization modules again; finally, the data output by the MiniEncoder will become the input data of the subsequent MiniEncoder, and the whole process is repeated.
[0017] The aforementioned re-entry classification process of the brain functional network involves learning the attention-based functional brain network. Following this, the model directly imports the obtained functional brain network A. L+1 As input to the classifier; a classic multilayer perceptron (MLP) is used as the classifier, and the upper triangular matrix of the functional brain network is extracted to reduce feature redundancy and computational complexity. This matrix is then flattened and classified through a two-layer fully connected network; the backpropagation process uses cross-entropy loss, the formula of which is as follows:
[0018]
[0019] The final loss of a Miniformer is defined as By setting the number of training updates (epochs) and defining common metrics for measuring model performance, the classification results for patients and healthy individuals can be output, while simultaneously updating the diagonal projection matrix to be learned.
[0020] To bridge the gap between existing models and their application scenarios, this invention presents a minimally simplified Transformer method for brain network learning and classification, known as the Miniformer. This method simplifies the three projection matrices in the Transformer into a single diagonal matrix and directly uses the self-attention matrix as input to the classification module. This improvement meets the needs of functional brain network analysis tasks. First, it significantly reduces the number of model parameters, thereby mitigating the risk of overfitting due to insufficient training data in many medical scenarios. Second, it improves the interpretability of model parameters and the final results. In particular, each parameter in the model's diagonal projection matrix effectively indicates the importance of time points in functional magnetic resonance imaging (fMRI) signal data. By directly using the self-attention matrix (i.e., the functional brain network) as input to the classification module, brain regions or connections that significantly contribute to the final classification results can be identified. Third, due to the interpretability of the model parameters, it makes the incorporation of priors or hypotheses easier and more natural.
[0021] As a further improvement to this technical solution:
[0022] The simplified Transformer method described above for brain network learning and classification, in the MiniEncoder, projects the matrix... The simplified diagonal matrix W l By integrating priors or hypotheses, and considering the contribution of adjacent time points in functional magnetic resonance imaging signals to the learning of functional brain networks—that is, smoothness priors or hypotheses—a new variant, Miniformer (SM), is designed, including the following steps:
[0023] The diagonal matrix W is constrained by the following regularization term. l diagonal elements:
[0024]
[0025] Among them, w t The weights at time point t are represented by the diagonal matrix W. l The t-th element on the diagonal, where T is the number of time points; the final loss of the Miniformer (SM) is defined as... Where λ is a hyperparameter; then, backpropagation is used to set the number of training updates (epochs), common metrics for measuring model performance are defined, and the classification results of patients and normal people are output based on the metric of the optimal number of updates.
[0026] The simplified Transformer method described above for brain network learning and classification, in the MiniEncoder, projects the matrix... The simplified diagonal matrix W lBy integrating priors or hypotheses and introducing a regularization term that measures sparsity into the loss function described in claim 1 to remove "messy" time points that may not be beneficial to the learning of functional brain networks, a new variant, Miniformer (SP), is designed, including the following steps:
[0027] Sparsity is encoded using the following regularization terms:
[0028]
[0029] The final loss of Miniformer (SP) is defined as Where λ is a hyperparameter; then, backpropagation is used to set the number of training updates (epochs), common metrics for measuring model performance are defined, and the classification results of patients and normal people are output based on the metric of the optimal number of updates.
[0030] This invention considers temporal smoothness (SM) and sparsity (SP) "prior information" to improve the proposed Miniformer model.
[0031] After adopting the above technical solution, the beneficial technical effects of the present invention are as follows:
[0032] 1. An innovative end-to-end simplified Transformer method, Miniformer, is proposed for learning and classification of functional brain networks. It not only reduces the number of parameters that need to be learned, making training based on limited data more effective, but also serves as a simpler end-to-end method to enhance the interpretability of model parameters and final results.
[0033] 2. The interpretability of model parameters simplifies the incorporation of prior information or hypotheses. Two variants of the Miniformer are designed, introducing regularization constraints for sparsity and temporal smoothness, respectively, to verify that the proposed architecture can flexibly integrate prior information.
[0034] 3. Directly using the attention matrix (functional brain network) as input to the classification module helps to identify brain regions or connections that make significant contributions to the final classification results, thereby improving the interpretability of the model.
[0035] 4. Comparative experiments were conducted on public datasets to evaluate the proposed minimally simplified Transformer method, Miniformer, for brain disease diagnosis tasks. It performed well across all performance metrics, with overall results exceeding those of the comparative methods and demonstrating greater reliability. Attached Figure Description
[0036] Figure 1 This is a flowchart illustrating the implementation of the Miniformer model of this invention. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and specific implementation examples.
[0038] like Figure 1 As shown, a simplified Transformer method for brain network learning and classification, namely Miniformer, includes the following steps in its implementation example:
[0039] (1) In this example, the publicly available Autism Brain Imaging Data Exchange (ABIDE) dataset and Depression Dataset (REST-MDD) dataset are used. Data from the largest sites of ABIDE and REST-MDD are selected, namely New York University (NYU) and Site 20. The NYU dataset contains 184 subjects, including 79 autistic patients and 105 healthy controls; the REST-MDD dataset contains 533 subjects, including 282 patients with depression and 252 healthy controls. The resting-state functional magnetic resonance imaging (fMRI) signal data acquired by the MRI machine are read and converted in format. The first 10 unstable time points for each subject are excluded; head movement and time-layer correction are performed; the influence of ventricles, white matter, and global signals is regressed; the data are registered to the standard space using the Montreal Neurological Institute template; and a 0.01-0.1 Hz bandpass filter is used to reduce the influence of heart rate and respiration.
[0040] (2) For the resting-state functional magnetic resonance imaging signal data acquired by the functional magnetic resonance imaging equipment, the following preprocessing was performed using the DPARSF toolbox: 1) Remove the first p unstable time points for each subject; 2) Perform head movement and time-layer correction; 3) Regress the influence of ventricles, white matter, and global signals; 4) Register to standard space using the template from the Montreal Institute of Neuroscience; 5) Perform 0.01-0.1 Hz bandpass filtering to reduce the influence of heartbeat and respiration.
[0041] (3) After preprocessing the resting-state functional magnetic resonance imaging signal data, the brain was divided into several brain regions based on an automated anatomical marker template, and the average time series of each brain region was extracted, X=[x1,x2,…,x i ,…,x N ]∈R T×N , where x i ∈R T Let T represent the time series of the i-th node, where T represents the number of times in the time series and N represents the number of nodes.
[0042] (4) Based on the extracted time series of each brain region, input into the Miniformer model, first go through the learning process of the brain functional network, and then enter the classification process of the brain functional network.
[0043] (5) During the learning process of the brain functional network, the time series is input into the MiniEncoder module, which is stacked in multiple layers to progressively extract and fuse the features of the time series; the MiniEncoder will use the Transformer-based projection matrix Simplified to a diagonal matrix W l ,Right now Where l = 1, 2, ..., L are the layer indices; D Q D k and D V W represents the dimensions of the query, key, and value, respectively; l diagonal elements in The weights (importance) correspond precisely to the time points of the functional magnetic resonance imaging signal. For the projection matrix... After simplification, we obtain the diagonal matrix W. l This leads to the corresponding embedding representation Q. l K l and V l And through Q l and K l The attention matrix A is calculated using the dot product operation. l The resulting matrix is scaled using the Softmax function and then compared with V. l Multiplying these together yields the output of the self-attention mechanism, calculated as follows:
[0044]
[0045] SA l (Q l ,K l V l ) = SA l (Q l Q l Q l = softmax(A) l )Q l
[0046] Further, residual connections and layer normalization modules are used to solve the problem of vanishing or exploding gradients; a feedforward network module is used to transmit and process the input data of each layer of the neural network, and then it is passed through the residual connections and layer normalization modules again; finally, the data output by the MiniEncoder will become the input data of the subsequent MiniEncoder, and the whole process is repeated.
[0047] To keep the model simple, this embodiment only considers single-head self-attention; the operation for multi-head self-attention is the same. It is worth noting that, in this case, the attention matrix A obtained based on brain region pairs... l Corresponding to functional brain networks. More importantly, A l It also encodes temporal information, with each row (column) representing the correlation between brain regions. Stacked MiniEncoders progressively extract and integrate multi-layer features, effectively constructing the final functional brain network from the underlying functional brain network. In experiments, the attention matrix A obtained after passing through L complete layers of MiniEncoders... L+1 The final functional brain network used for classifying brain diseases.
[0048] (6) The re-entry classification process of the brain functional network described herein differs from the traditional Transformer model that inputs encoder output into the classifier. After learning the functional brain network based on attention, the model in this embodiment directly inputs the obtained functional brain network (A L+1 This information serves as input to the classifier, helping to identify brain regions or connections that significantly impact the final results and enhancing interpretability. The model employs a classic multilayer perceptron (MLP) classifier. Given that the constructed functional brain network is symmetric, the model chooses to reduce feature redundancy and computational complexity by extracting the upper triangular matrix of the functional brain network. This matrix is then flattened and classified using a two-layer fully connected network. The backpropagation process uses cross-entropy loss, formulated as follows:
[0049]
[0050] The final loss of a Miniformer is defined as By setting the number of training updates (epochs) and defining common metrics for measuring model performance, the Miniformer model can output the classification results of patients and normal individuals, while simultaneously updating the diagonal projection matrix to be learned.
[0051] This embodiment presents a simplified Transformer method for brain network learning and classification, known as the Miniformer. This method simplifies the three projection matrices in the Transformer into a single diagonal matrix and directly uses the self-attention matrix as input to the classification module. This improvement meets the needs of functional brain network analysis tasks. First, it significantly reduces the number of model parameters, thereby mitigating the risk of overfitting due to insufficient training data in many medical scenarios. Second, it improves the interpretability of model parameters and the final results. In particular, each parameter in the model's diagonal projection matrix effectively indicates the importance of time points in functional magnetic resonance imaging (fMRI) signal data. By directly using the self-attention matrix (i.e., the functional brain network) as input to the classification module, brain regions or connections that significantly contribute to the final classification results can be identified. Third, due to the interpretability of the model parameters, it makes the incorporation of priors or hypotheses easier and more natural.
[0052] (7) As a further improvement to this technical solution, two variants, Miniformer (SM) and Miniformer (SP), are proposed:
[0053] The simplified Transformer method described above for brain network learning and classification, in the MiniEncoder, projects the matrix... The simplified diagonal matrix W l By integrating priors or hypotheses, and considering the contribution of adjacent time points in functional magnetic resonance imaging signals to the learning of functional brain networks—that is, smoothness priors or hypotheses—a new variant, Miniformer (SM), is designed, including the following steps:
[0054] The diagonal matrix W is constrained by the following regularization term. l diagonal elements:
[0055]
[0056] Among them, w t The weights at time point t (i.e., the projection matrix W) l The element at time t (the t-th element on the diagonal), where T is the number of time points. The closer the weights of adjacent time points, the better. The smaller the value, the better. The final loss of Miniformer (SM) is defined as... Where λ is a hyperparameter; then, backpropagation is used to set the number of training updates (epochs), common metrics for measuring model performance are defined, and the classification results of patients and normal people are output based on the metric of the optimal number of updates.
[0057] The simplified Transformer method described above for brain network learning and classification, in the MiniEncoder, projects the matrix... The simplified diagonal matrix W l By integrating priors or hypotheses and introducing a regularization term that measures sparsity into the loss function described in claim 1 to remove "messy" time points that may not be beneficial to the learning of functional brain networks, a new variant, Miniformer (SP), is designed, including the following steps:
[0058] Sparsity is encoded using the following regularization terms:
[0059]
[0060] The final loss of Miniformer (SP) is defined as... Where λ is a hyperparameter; then, backpropagation is used to set the number of training updates (epochs), common metrics for measuring model performance are defined, and the classification results of patients and normal people are output based on the metric of the optimal number of updates.
[0061] Because Miniformer is flexible enough to encode many other hypotheses or priors through a simplified projection matrix, it can more effectively encode more domain information or knowledge, thereby improving model performance. This embodiment improves upon Miniformer, resulting in two variants: Miniformer (SM) and Miniformer (SP). These two variants respectively consider temporal smoothness (SM) and sparsity (SP) "prior information" to improve the proposed Miniformer model.
[0062] To verify the effectiveness of the model in this embodiment, the training method of the model is to minimize the common total loss function. In the experiments, a single-layer MiniEncoder, a two-layer fully connected network, and a Softmax layer were used for prediction. During the training of the MiniEncoder, the batch size was set to 8, and the hyperparameter λ was 0.5.
[0063] In the experiment, two classification tasks were performed: 1) autistic individuals vs. normal individuals on the ABIDE dataset; 2) depression individuals vs. normal individuals on the REST-MDD dataset. Miniformer models and their variants were trained end-to-end and evaluated using 10-fold cross-validation. Specifically, all subjects were randomly assigned to 10 groups, with 9 groups used for training and the remaining group for testing. This process was repeated 10 times, and the average was used to measure model performance. Furthermore, the specific performance metrics used in this study included accuracy (ACC), sensitivity (SEN), specificity (SPE), balanced accuracy (BAC), positive predictive value (PPV), negative predictive value (NPV), F1 score, and area under the curve (AUC). Higher values for these metrics indicated better model performance. The calculation methods for these indicators are as follows: ACC = (TP + TN) / (TP + FN + FP + TN), SEN = TP / (TP + FN), SPE = TN / (TN + FP), BAC = (SEN + SPE) / 2, PPV = TP / (TP + FP), NPV = TN / (TN + FN), F1score = 2 × PRE × REC / PRE + REC, where TP, TN, FP and FN represent true positive, true negative, false positive and false positive, respectively;
[0064] As shown in Table 1 and Table 2, the performance comparison of the Miniformer-based simplified Transformer method and other comparative methods on the ABIDE and REST-MDD datasets is shown respectively.
[0065] Table 1. Performance comparison of different methods on the ABIDE dataset.
[0066] ABIDE AUC ACC LATE SPE BAC PPV NPV F1score PC+SVM 0.6852 0.6088 0.5825 0.6294 0.6060 0.5707 0.6554 0.5483 SR+SVM 0.6309 0.6199 0.4366 0.7824 0.6095 0.5896 0.6701 0.4632 SRiLT+SVM 0.6582 0.6197 0.5063 0.7029 0.6046 0.5830 0.6494 0.5352 GCN 0.6593 0.6196 0.4937 0.7143 0.6040 0.5652 0.6522 0.5270 GATE 0.7219 0.6685 0.6582 0.6762 0.6672 0.6047 0.7245 0.6303 Transformers 0.7379 0.6798 0.6369 0.7174 0.6771 0.6364 0.7176 0.6266 Miniforms 0.7576 0.6953 0.5644 0.7848 0.6746 0.6736 0.7009 0.6005 Miniforms(SP) 0.7612 0.7114 0.5536 0.8079 0.6807 0.7263 0.7088 0.5959 Miniforms(SM) 0.7801 0.7330 0.6102 0.8001 0.7051 0.7280 0.7269 0.6522
[0067] Table 2. Performance comparison of different methods on the REST-MDD dataset.
[0068] REST-MDD AUC ACC LATE SPE BAC PPV NPV F1score PC+SVM 0.6087 0.5685 0.5889 0.5411 0.5650 0.5923 0.5380 0.5883 SR+SVM 0.5544 0.5423 0.6077 0.4655 0.5366 0.5581 0.5188 0.5796 SRiLT+SVM 0.5599 0.5463 0.6131 0.4776 0.5454 0.5682 0.5257 0.5848 GCN 0.5258 0.5253 0.5745 0.4701 0.5223 0.5492 0.4958 0.5615 GATE 0.5326 0.5403 0.5603 0.5179 0.5391 0.5663 0.5118 0.5633 Transformers 0.5620 0.5516 0.6024 0.4857 0.5441 0.5693 0.5238 0.5831 Miniforms 0.6101 0.6005 0.6469 0.5525 0.5997 0.6230 0.5829 0.6283 Miniforms(SP) 0.6378 0.6024 0.6282 0.5927 0.6105 0.6365 0.5811 0.6224 Miniforms(SM) 0.6304 0.6079 0.6753 0.5350 0.6052 0.6185 0.6013 0.6419
[0069] As shown in Tables 1 and 2, this embodiment achieves optimal performance across all listed metrics, particularly with Miniformer (SM) achieving an AUC of 78.01% and an ACC of 73.30% on the ABIDE dataset, and Miniformer (SP) achieving an AUC of 63.78% and an ACC of 60.79% on the REST-MDD dataset. These superior performance results compared to other methods are achieved using the simplified Transformer method proposed in this invention.
[0070] This embodiment verifies the effectiveness of the proposed Miniformer and its variants for brain disease diagnosis tasks through experiments on the aforementioned publicly available dataset.
[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Any modifications, equivalent substitutions, and partial additions made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A minimally simplified Transformer method for brain network learning and classification, characterized in that... Includes the following steps: (1) For the resting-state functional magnetic resonance imaging signal data acquired by the functional magnetic resonance imaging equipment, the following preprocessing was performed using the DPARSF toolbox: 1) Remove the first p unstable time points for each subject; 2) Perform head movement and time-layer correction; 3) Regress the influence of ventricles, white matter, and global signals; 4) Register to standard space using the template from the Montreal Institute of Neuroscience; 5) Perform 0.01-0.1 Hz bandpass filtering to reduce the influence of heartbeat and respiration. (2) After preprocessing the resting-state functional magnetic resonance imaging (fMRI) signal data, the brain was divided into several brain regions based on an automated anatomical marker template, and the time series of each brain region was extracted, X = [x1, x2, ..., x...]. i ,…,x N ]∈R T×N , where x i ∈R T Let T represent the time series of the i-th node, where T represents the number of times in the time series, and N represents the number of nodes. (3) Based on the extracted time series of each brain region, input into the Miniformer model, first go through the learning process of the brain functional network, and then enter the classification process of the brain functional network. During the learning process of the brain functional network, the time series is input into the MiniEncoder module, which is stacked in multiple layers to gradually extract and fuse the features of the time series. MiniEncoder will use the Transformer-based projection matrix Simplified to a diagonal matrix W l W l diagonal elements in t = 1, 2, ..., T corresponds exactly to the weights of time points in the functional magnetic resonance imaging signal; for the projection matrix After simplification, we obtain the diagonal matrix W. l The embedded representation Q was obtained. l K l and And through Q l and K l The attention matrix A is calculated using the dot product operation. l The resulting matrix is scaled using the Softmax function and then compared with V. l Multiplying these together yields the output of the self-attention mechanism, calculated as follows: IN l (Q l ,K l ,V l )=IN l (Q l ,Q l ,Q l )=softmax(A l )Q l Further, residual connections and layer normalization modules are used to address the gradient vanishing or exploding problem in the output of the self-attention mechanism; a feedforward network module is used to transmit and process the input data of each layer of the neural network, and then it is passed through the residual connections and layer normalization modules again; finally, the data output by the MiniEncoder will become the input data of the subsequent MiniEncoder, and the whole process is repeated. The aforementioned re-entry classification process of the brain functional network involves learning the attention-based functional brain network. Following this, the model directly imports the obtained functional brain network A. L+1 As input to the classifier; a classic multilayer perceptron (MLP) is used as the classifier, and the upper triangular matrix of the functional brain network is extracted to reduce feature redundancy and computational complexity. This matrix is then flattened and classified through a two-layer fully connected network; the backpropagation process uses cross-entropy loss, the formula of which is as follows: The final loss of a Miniformer is defined as By setting the number of training updates (epochs) and defining common metrics for measuring model performance, the classification results for patients and healthy individuals can be output, while simultaneously updating the diagonal projection matrix to be learned.
2. The simplified Transformer method for brain network learning and classification according to claim 1, in the MiniEncoder, the projection matrix is... The simplified diagonal matrix W l By integrating priors or hypotheses, and considering the contribution of adjacent time points in functional magnetic resonance imaging signals to the learning of functional brain networks—that is, smoothness priors or hypotheses—a new variant, Miniformer (SM), is designed, including the following steps: The diagonal matrix W is constrained by the following regularization term. l diagonal elements: Among them, w t The weights at time point t are represented by the diagonal matrix W. l The t-th element on the diagonal, where T is the number of time points; The final loss of Miniformer (SM) is defined as Where λ is a hyperparameter; then, backpropagation is used to set the number of training updates (epochs), common metrics for measuring model performance are defined, and the classification results of patients and normal people are output based on the metric of the optimal number of updates.
3. The simplified Transformer method for brain network learning and classification according to claim 1, in the MiniEncoder, the projection matrix... The simplified diagonal matrix W l By integrating priors or hypotheses and introducing a regularization term that measures sparsity into the loss function described in claim 1 to remove "messy" time points that may not be beneficial to the learning of functional brain networks, a new variant, Miniformer (SP), is designed, including the following steps: Sparsity is encoded using the following regularization terms: The final loss of Miniformer (SP) is defined as Where λ is a hyperparameter; then, backpropagation is used to set the number of training updates (epochs), common metrics for measuring model performance are defined, and the classification results of patients and normal people are output based on the metric of the optimal number of updates.
