A brain disease prediction method based on double encoders and diffusion model

By using a triple contrastive learning framework based on dual encoders and diffusion models, diverse samples are generated and multi-dimensional features are extracted. This solves the overfitting problem of resting-state functional magnetic resonance imaging in small sample scenarios, improves the model's generalization ability and cross-site adaptability, and provides a stable tool for detecting brain diseases.

CN120766980BActive Publication Date: 2026-01-06SHANDONG JIANZHU UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511277273.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2026-01-06
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

Existing brain disease detection methods based on resting-state functional magnetic resonance imaging suffer from overfitting in small sample scenarios, lack sophisticated data augmentation strategies, lack cross-dimensional feature interaction, and have insufficient model generalization ability, especially when there are large differences in data distribution across different sites, resulting in insufficient transferability and adaptability.

Method used

A triple contrastive learning framework based on dual encoders and a diffusion model is adopted. The diffusion model generates diverse samples, and the spatial features of brain functional networks and the temporal features of BOLD signals are extracted by combining dual encoders. A triple contrastive learning mechanism is designed to optimize feature representation and improve the generalization ability and classification performance of the model.

Benefits of technology

It effectively alleviates the problem of small sample size, improves the adaptability and accuracy of the model in cross-site brain disease classification tasks, provides stable prediction results, reduces the risk of misdiagnosis, supports cross-institutional data collaborative analysis, and enhances the credibility and accuracy of diagnostic decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120766980B_ABST
    Figure CN120766980B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of medical artificial intelligence, and discloses a brain disease prediction method based on a double-encoder and a diffusion model, which comprises the following steps: pre-processing a functional magnetic resonance image and constructing a brain function network; through a diffusion model, semantic-preserving data enhancement is realized, wherein a double random matrix and a cosine scheduling strategy are adopted in a noise adding process, and a GraphTransformer neural network containing global topological features is utilized in a noise removing process; a double encoder is adopted to extract spatial features of the brain network and time dynamic features of BOLD signals; a triple contrast learning mechanism is designed to optimize cross-dimension feature interaction; and finally, the method is migrated to a downstream classification task to realize disease prediction. Through diffusion enhancement, small sample overfitting is alleviated, and diagnosis reliability is improved; time-space features are fused to assist multi-dimensional pathological analysis; the model cross-site adaptability is enhanced, and multi-center heterogeneous data collaborative analysis is supported. The application is suitable for the auxiliary diagnosis of brain diseases such as autism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical artificial intelligence technology, specifically to a brain disease prediction method based on dual encoders and a diffusion model. Background Technology

[0002] Brain disease detection is a crucial research area in neuroscience and clinical medicine. Constructing brain functional networks (BFNs) based on blood oxygen level-dependent (BOLD) signals from resting-state functional magnetic resonance imaging (fMRI) and extracting features from the original time series of BOLD signals has become a key method for diagnosing brain diseases. Using the Pearson correlation coefficient to calculate the functional connectivity strength between brain regions allows for the construction of brain networks and the analysis of brain diseases. However, due to the high cost and difficulty in data acquisition and annotation for brain diseases, existing methods are prone to overfitting in small sample scenarios, resulting in insufficient model generalization ability. Furthermore, traditional feature extraction methods typically focus only on single information in the spatial or temporal dimensions, making it difficult to comprehensively capture the complex features of brain diseases.

[0003] In recent years, contrastive learning, as a self-supervised learning method, has shown significant advantages in alleviating the lack of labeled data and improving feature representation capabilities. However, the application of existing contrastive learning methods in brain disease detection still faces many challenges. First, the design of data augmentation strategies is often not refined enough, making it difficult to generate semantically preserved and diverse samples, which affects the robustness and generalization performance of the model. Second, current methods mostly focus on single-dimensional feature extraction, lacking in-depth exploration of cross-dimensional feature interactions between the topological structure of brain functional networks and dynamic time series. Finally, solutions for small sample problems are still imperfect, especially when there are large differences in data distribution across different sites, and the transferability and adaptability of the model still need to be improved.

[0004] To address the aforementioned issues, a novel method is urgently needed to extract brain disease features from multiple dimensions and enhance the model's generalization ability. This invention proposes a triple contrastive learning framework based on dual encoders and a diffusion model. By introducing a diffusion model, semantically preserved data augmentation is achieved, and dual encoders are used to extract spatial features of brain functional networks and temporal features of BOLD signals, thereby comprehensively capturing multidimensional information about brain diseases. Simultaneously, by designing a triple contrastive learning mechanism, the feature representation learning process is optimized, further improving the model's performance in downstream tasks. This method not only effectively alleviates the small sample size problem but also significantly improves the model's adaptability and accuracy in cross-site brain disease classification tasks. Summary of the Invention

[0005] This invention addresses the shortcomings of existing brain disease detection methods based on resting-state functional magnetic resonance imaging (fMRI), such as limited data augmentation strategies, overfitting with small samples, and insufficient feature extraction capabilities. It proposes a brain disease detection method based on triple contrastive learning using a dual encoder and a diffusion model. This method generates diverse samples by introducing a diffusion model, extracts multimodal features in both temporal and spatial dimensions using a dual encoder, and optimizes these features through a triple contrastive learning mechanism, thereby improving the model's generalization ability and classification performance.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a brain disease prediction method based on dual encoders and a diffusion model, comprising the following steps:

[0007] S1. The brain functional images acquired by functional magnetic resonance imaging (fMRI) were preprocessed using the DPARSF toolbox in MATLAB as follows: [The following text appears to be a separate, unrelated section:] Remove the anterior [unclear text] from the MRI images. At specific time points; head motion and temporal correction are applied to the images; effects caused by ventricular and white matter signals and higher-order head motion effects are removed; the corrected images are registered to standard space; the images are then processed using... Time bandpass filtering is used to reduce the effects of heartbeat and respiration.

[0008] S2. Based on an automated anatomical landmark map, the brain is divided into several brain regions, and the BOLD signal of the given subject is in matrix form. ,in Indicates the first BOLD signal for each ROI Indicates the number of time points. This indicates the number of ROIs.

[0009] S3. Calculate the resting-state functional connectivity strength among all ROIs using the Pearson correlation coefficient:

[0010]

[0011] in, Indicates the first brain regions and The Pearson correlation coefficients between brain regions were calculated. Thus, the functional connectivity matrix between brain regions was obtained. For a given node, its Pearson correlation coefficient with other nodes is considered a feature, so the node feature matrix of the graph can be represented as: ,in The first of the matrix The line represents the first brain regions The feature vectors. To maintain strong functional connectivity and remove weak connections in brain networks, the matrix... Elements with a value greater than 0.3 are set to 1, and the remaining elements are set to 0. This yields the edge feature matrix of the brain network. Thus, the brain network was constructed. .

[0012] S4. Diffusion Data Augmentation Module: First, let's look at the noise addition process. This process progressively adds Gaussian noise to the input data through a series of Markov chain steps, ultimately... It is then gradually transformed into a stationary random noise distribution. Diffusion operations are performed independently on node features and edge features, given the original brain network. , A node matrix representing a brain network. This represents the edge matrix of the brain network. Specifically, for each node, the node noise matrix is ​​defined as follows: For each edge, the edge noise matrix is ​​defined as follows: .in, Here This is the total number of diffusion steps. To directly extract data from the raw data... Add noise to the final noise state Therefore, the noise-adding process can be defined as:

[0013]

[0014]

[0015] Here ,in The noise matrix is ​​not arbitrary; it must satisfy the following conditions: First, the sum of all rows in the noise matrix should be 1. Second, the sum of each column in the noise matrix should be equal to 1. This means the matrix... It is also a Markov transition matrix (row sum of 1) and has a uniform steady-state distribution (column sum of 1). A common practice is to use a double random matrix to define the noise matrix. :

[0016]

[0017] in, It is the identity matrix. The last dimension representing the feature of a node or edge. It is a column vector where all elements are equal to 1. Following cosine tuning:

[0018]

[0019] here It is a very small value. , The following formula can be used for calculation:

[0020]

[0021]

[0022]

[0023] The next step is the denoising process, which is necessary to denoise the noisy graph structure. To perform denoising, a denoising neural network based on GraphTransformer was trained. The network predicts and compares the actual clean map Denoising is achieved using similar graphs. The network consists of an input MLP, a GraphTransformer block, and an output MLP. The GraphTransformer block comprises a self-attention module, two fully connected layers, a layer normalization layer, and a ReLU activation function. Since simple node and edge features can only represent the local structure of the graph, global features that can represent the overall graph topology are introduced to enhance the model's expressive power. This feature is composed of the spectral features of the graph Laplacian matrix, specifically including the number of connected components of the graph and the first five non-zero eigenvalues. Based on this design, the module can simultaneously process the features of noisy nodes. Noise edge features and global features First, the original features are mapped to MLP input as follows: , and These higher-order features are then input into the GraphTransformer module. The GraphTransformer module uses a self-attention mechanism to dynamically update node features, and simultaneously uses a FiLM layer to fuse node features, edge features, and global features. By aggregating node and edge features, the global features are updated, ultimately generating new features. , , These features can be input into the next GraphTransformer module for deeper feature abstraction, ultimately generating an MLP through the output. .

[0024] Based on the prediction graph and real graphs with nodes and edges The loss function is defined to optimize the diffusion loss by using the mean squared error between the two values. of:

[0025]

[0026] in, This represents the node features of the real graph. This represents the predicted node features. This represents the edge features of the real graph. This represents the predicted edge features.

[0027] Once the network is trained, it can be used to sample and generate new brain networks. Specifically, the process begins by sampling a completely random graph, then using a trained denoising neural network to predict a clean graph. The predicted graph is then processed using a posterior distribution, serving as input to the denoising network at the next time step, iteratively generating the final graph. To achieve this, a denoising neural network-based approach is required. Estimating back diffusion iterations This distribution can be represented as the product of the node and edge distributions:

[0028]

[0029] Taking nodes as an example, the formula for predicting each node using a denoising neural network is as follows:

[0030] ;

[0031] ;

[0032] The sampling process for edges is similar, as is the distribution of edges. These distributions are used for sampling discrete data. This will be the input to the denoising network at the next time step. After... The next iteration will eventually generate a new graph. .

[0033] S5. Dual encoder section: Two different encoders are used to extract features from different dimensions of resting-state functional magnetic resonance imaging (fMRI) data. To extract temporal features, the Mamba encoder is used to extract the subject's BOLD signal biometrics. , and Three matrices are used to iteratively calculate the hidden state using a recursive formula:

[0034]

[0035]

[0036] Output of all time steps By splicing along the time dimension, a complete output sequence is formed. Then, the linear projection of the initial input is fused through a skip connection:

[0037]

[0038] After passing through a linear layer, the extracted feature vector can be obtained. .

[0039] The GIN encoder was used to extract spatial features from resting-state functional magnetic resonance imaging data, respectively, based on the original brain network. and the brain network generated after diffusion model enhancement As input. For the primitive brain network. Among the nodes Indicates the first Each brain region, side This represents the set of edges. Similarly, the enhanced brain network works in a similar way. To enhance the model's expressive power, a Graph Isomorphic Network (GIN) is used as the basic feature encoder, and the node feature updates in each layer are completed by aggregating information from its neighbors:

[0040]

[0041] in, This indicates an MLP operation. It is a parameter. Indicates the first Layer nodes eigenvectors, Represents a node The neighbor set. In the model, the number of GIN layers is set to 2. Taking a single branch as an example, the original graph... The input is fed into the GIN for feature learning, so the node feature matrix is ​​updated after two stacked GIN layers. It can be represented as:

[0042]

[0043] in, yes Activation function and These represent the weight matrices of the first and second GIN layers learned by the MLP, respectively. Finally, based on the obtained feature matrices... Perform average pooling to obtain graph-level feature vectors. Similar to enhancing the view. The feature vector is also fed into the parameter-sharing GIN encoder. .

[0044] S6. Next is the triple contrast learning module. In contrast learning, the proper construction of positive and negative sample pairs is crucial. A triple contrast learning mechanism was designed to extract features from different dimensions of the subject's fMRI data (original spatial features and temporal dynamic features, enhanced spatial features and temporal dynamic features) as well as from same-dimensional enhanced contrast (original spatial features and enhanced spatial features).

[0045] Taking raw spatial features and temporal dynamic features as an example: different dimensional feature vectors of the same subject are considered positive sample pairs, and different dimensional feature vectors of different subjects are considered negative sample pairs. Specifically, the formula is as follows:

[0046]

[0047]

[0048]

[0049] Here and The feature vectors representing the original brain network and BOLD signal, as well as the enhanced spatial features and temporal dynamic features, and the original spatial features and enhanced spatial features, are represented by the same formulas as above:

[0050]

[0051]

[0052] Therefore, the overall loss function of the pre-trained model is:

[0053]

[0054] Here , , , It's a hyperparameter.

[0055] S7. After the pre-training phase, the trained spatial feature encoder (GIN) and temporal feature encoder (Mamba) are transferred to the downstream brain disease classification task. Only the original brain network is used. The BOLD signal and the BOLD signal are respectively input into the GIN and Mamba encoders to obtain feature vectors. and Then, concatenate the two feature vectors obtained earlier and denote them as... Then, brain diseases are classified using an MLP and a Softmax layer, and the model is updated using a cross-entropy loss function.

[0056] This invention provides a method for predicting brain diseases based on a dual encoder and a diffusion model. It has the following beneficial effects:

[0057] 1. This invention addresses the challenges of difficult data annotation and limited sample size in brain disease studies by generating semantically preserved, diverse, and enhanced samples using a diffusion model. Therefore, even with limited case data, it can still provide doctors with stable and reliable prediction results, reducing the risk of misdiagnosis due to insufficient samples and providing objective evidence for initial screening.

[0058] 2. This invention extracts the spatial topological features of brain functional networks and the temporal dynamic features of BOLD signals using dual encoders, and achieves cross-dimensional feature interaction through triple contrastive learning. It simultaneously presents doctors with quantitative information on abnormal brain region connectivity and temporal changes in neural activity, assisting them in comprehensively assessing the condition from multiple perspectives and avoiding missed diagnoses from a single viewpoint.

[0059] 3. This invention preserves the semantic information of the original data through the enhanced samples generated by the diffusion model; the brain functional network directly reflects the connectivity strength of brain regions. Doctors can combine the visualization results of the generated enhanced samples with the brain network connectivity map to intuitively understand the pathological basis predicted by the model, and combine the algorithm results with clinical experience to improve the credibility of diagnostic decisions.

[0060] 4. This invention significantly improves the model's generalization ability to data from different medical sites by optimizing feature representation through diffusion enhancement and contrastive learning. It supports the integration of heterogeneous brain imaging data from multiple hospitals and devices, facilitating unified case analysis by doctors during cross-institutional consultations and avoiding model failure due to equipment differences.

[0061] 5. This invention improves the discriminative power and robustness of features through a triple contrastive learning mechanism, significantly outperforming traditional methods in metrics such as ACC and AUC on the ABIDE dataset. It provides objective quantitative classification results, reducing subjective judgment bias caused by doctors' experience differences, and is particularly suitable for borderline cases with atypical symptoms.

[0062] In summary, this method provides physicians with: a more reliable early screening tool; a multi-dimensional pathological analysis view; cross-institutional data collaboration capabilities; and traceable quantitative diagnostic evidence by generating high-quality samples, fusing spatiotemporal features, improving model generalization, and enhancing result interpretability. Ultimately, it assists physicians in making more comprehensive and accurate diagnostic decisions in scenarios with limited data, complex symptoms, or requiring multi-center collaboration. Attached Figure Description

[0063] Figure 1 This is a flowchart illustrating the overall process framework of a brain disease prediction method based on dual encoders and diffusion models disclosed in this application.

[0064] Figure 2This is a schematic diagram illustrating the data augmentation process of the diffusion model in the embodiment of the present invention.

[0065] Figure 3 This is a schematic diagram of the structure of the triple contrastive learning mechanism in the embodiment of the present invention;

[0066] Figure 4 This is a schematic diagram of the overall structure of the denoising neural network in an embodiment of the present invention;

[0067] Figure 5 This is a schematic diagram of the internal structure of the GraphTransformer module in the denoising neural network in this embodiment of the invention;

[0068] Figure 6 This is a schematic diagram of the global feature update mechanism in the denoising neural network in an embodiment of the present invention;

[0069] Figure 7 This is a schematic diagram of the temporal dynamic feature extraction process of the Mamba encoder in an embodiment of the present invention;

[0070] Figure 8 This is a schematic diagram of the overall process of an embodiment of the present invention. Detailed Implementation

[0071] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0072] Please see the appendix Figure 1 -Appendix Figure 8 This invention provides a brain disease prediction method based on a dual encoder and a diffusion model, specifically including:

[0073] Dataset selection: In this example, a publicly available resting-state functional magnetic resonance imaging (ABIDE) dataset for autism is used. Data from the two largest sites are selected: NYU and UM116. The NYU dataset contains 184 participants, including 79 autistic patients and 105 healthy participants. The UM116 dataset contains 145 participants, including 68 autistic patients and 77 healthy participants.

[0074] The brain functional images acquired by functional magnetic resonance imaging (fMRI) were preprocessed using the DPARSF toolbox in MATLAB as follows: the first few time points of the MRI images were removed; head motion and time-layer corrections were performed on the images; the effects of ventricular and white matter signals and higher-order head motion effects were removed; the corrected images were registered to standard space; and temporal bandpass filtering was applied to the images to reduce the influence of heartbeat and respiration.

[0075] The brain is divided into several brain regions: Based on the standard brain network spectrum, the brain is divided into N regions of interest (ROIs), with each ROI corresponding to a node in the graph. The node content is a matrix of Pearson correlation coefficients between that node and every other node. Then, functional connectivity calculations are performed: given the subject's BOLD signal in matrix form... ,in Indicates the first BOLD signal for each ROI Indicates the number of time points. This indicates the number of ROIs.

[0076] The resting-state functional connectivity strength among all ROIs was calculated using the Pearson correlation coefficient.

[0077] in Let represent the Pearson correlation coefficient between brain region i and brain region j. Thus, the functional connectivity matrix between brain regions is obtained. For a given node, its Pearson correlation coefficient with other nodes is considered a feature, so the node feature matrix of the graph can be represented as: ,in The first of the matrix The line represents the first brain regions The feature vectors. To maintain strong functional connectivity and remove weak connections in brain networks, the matrix... Elements with a value greater than 0.3 are set to 1, and the remaining elements are set to 0. This yields the edge feature matrix of the brain network. Thus, the brain network was constructed. .

[0078] Next is the diffusion data augmentation module. First, let's look at the noise addition process. This process progressively adds Gaussian noise to the input data through a series of Markov chain steps, ultimately... It is then gradually transformed into a stationary random noise distribution. Diffusion operations are performed independently on node features and edge features, given the original brain network. , A node matrix representing a brain network. This represents the edge matrix of the brain network. Specifically, for each node, the node noise matrix is ​​defined as follows: For each edge, the edge noise matrix is ​​defined as follows: .in, Here This is the total number of diffusion steps. To directly extract data from the raw data... Add noise to the final noise state Therefore, the noise-adding process can be defined as: ,

[0079] Here ,in The noise matrix is ​​not arbitrary; it must satisfy the following conditions: First, the sum of all rows in the noise matrix should be 1. Second, the sum of each column in the noise matrix should be 1. This means the matrix... It is also a Markov transition matrix (row sum of 1) and has a uniform steady-state distribution (column sum of 1). A common practice is to use a double random matrix to define the noise matrix. : in, It is the identity matrix. The last dimension representing the feature of a node or edge. It is a column vector where all elements are equal to 1. Following cosine tuning: ,here It is a very small value. , The following formula can be used for calculation: , , .

[0080] The next step is the denoising process, which is necessary to denoise the noisy graph structure. To perform denoising, a denoising neural network based on GraphTransformer was trained. The network predicts and compares the actual clean map Denoising can be achieved using similar images. For example... Figures 4-6 As shown, the network consists of an input MLP, a GraphTransformer block, and an output MLP. The GraphTransformer block comprises a self-attention module, two fully connected layers, a layer normalization operation layer, and a ReLU activation function. Since simple node and edge features can only represent the local structural information of the graph, global features that can represent the overall graph topological properties are introduced to enhance the model's expressive power. This feature is composed of the spectral features of the graph Laplacian matrix, specifically including the number of connected components of the graph and the first five non-zero eigenvalues. Based on this design, the module can simultaneously process the features of noisy nodes. Noise edge features and global features First, the original features are mapped to MLP input as follows: , and These higher-order features are then input into the GraphTransformer module. For example... Figure 5 As shown, this module uses a self-attention mechanism to dynamically update node features, and simultaneously uses a FiLM layer to fuse node features, edge features, and global features. Figure 6 As shown, global features are updated by aggregating node features and edge features, ultimately generating new features. , , These features can be input into the next GraphTransformer module for deeper feature abstraction, ultimately generating an MLP through the output. .

[0081] Based on the prediction graph and real graphs with nodes and edges The loss function is defined to optimize the diffusion loss by using the mean squared error between the two values. of ,in This represents the node features of the real graph. This represents the predicted node features. This represents the edge features of the real graph. This represents the predicted edge features.

[0082] Once the network is trained, new brain networks can be generated using sampling. Specifically, the process begins by sampling a completely random graph, then using a trained denoising neural network to predict a clean graph. The predicted graph is then processed using a posterior distribution, serving as input to the denoising network at the next time step, iteratively generating the final graph. To achieve this, a denoising neural network-based approach is required. Estimating back diffusion iterations This distribution can be represented as the product of the node and edge distributions: Taking nodes as an example, a denoising neural network is used to predict each node. , The edge sampling process is similar, yielding the edge distribution. These distributions are used for sampling discrete data. This will be the input to the denoising network at the next time step. After... The next iteration will eventually generate a new graph. .

[0083] The next part involves a dual encoder, employing two different encoders to extract features from different dimensions of the resting-state functional magnetic resonance imaging (fMRI) data. To extract temporal features, a Mamba encoder is used to extract the subject's BOLD signal biometrics, such as... Figure 7 As shown, a creation was made , and Three matrices are used to iteratively calculate the hidden state using a recursive formula: , Output of all time steps By splicing along the time dimension, a complete output sequence is formed. Then, the linear projection of the initial input is fused through a skip connection: After passing through a linear layer, the extracted feature vector can be obtained. .

[0084] A GIN encoder is used to extract spatial features from resting-state functional magnetic resonance imaging (fMRI) data, such as... Figures 1-3 As shown, the primitive brain network is used respectively. and the brain network generated after diffusion model enhancement As input. For the primitive brain network. Among the nodes Indicates the first Each brain region, side This represents the set of edges. Similarly, the enhanced brain network works in a similar way. To enhance the model's expressive power, a Graph Isomorphic Network (GIN) is used as the basic feature encoder, and the node feature updates in each layer are completed by aggregating information from its neighbors: ,in This indicates an MLP operation. It is a parameter. Indicates the first Layer nodes eigenvectors, Represents a node The neighbor set. In the model, the number of GIN layers is set to 2. Taking a single branch as an example, the original graph... The input is fed into the GIN for feature learning, so the node feature matrix is ​​updated after two stacked GIN layers. It can be represented as: ,in yes Activation function and These represent the weight matrices of the first and second GIN layers learned by the MLP, respectively. Finally, based on the obtained feature matrices... Perform average pooling to obtain graph-level feature vectors. Similarly, this will enhance the view. The feature vector is also fed into the parameter-sharing GIN encoder. .

[0085] Next is the triple contrastive learning module, where the proper construction of positive and negative sample pairs is crucial. For example... Figure 1 As shown, a triple contrastive learning mechanism was designed to extract features from different dimensions of the subject's fMRI data (original spatial features and temporal dynamic features, enhanced spatial features and temporal dynamic features) as well as the same-dimensional enhanced contrast (original spatial features and enhanced spatial features).

[0086] Taking raw spatial features and temporal dynamic features as an example: different dimensional feature vectors of the same subject are considered positive sample pairs, and different dimensional feature vectors of different subjects are considered negative sample pairs. Specifically, the formula is as follows: , , , here and The feature vectors representing the original brain network and BOLD signal, as well as the enhanced spatial features and temporal dynamic features, and the original spatial features and enhanced spatial features, are represented by the same formulas as above: , Therefore, the overall loss function of the pre-trained model is: , here , , , It's a hyperparameter.

[0087] After comparative learning, the trained Mamba encoder and GIN encoder are transferred together to downstream tasks, while the trained spatial feature encoder (GIN) and temporal feature encoder (Mamba) are transferred to downstream brain disease classification tasks. For example... Figure 3 As shown, only the primitive brain network is shown. The BOLD signal and the BOLD signal are respectively input into the GIN and Mamba encoders to obtain feature vectors. and Then, concatenate the two feature vectors obtained earlier and denote them as... Then, brain diseases are classified using an MLP and a Softmax layer, and the model is updated using a cross-entropy loss function.

[0088] Specifically, all experiments in this application were implemented using the PyTorch 2.5.1 deep learning framework. The experimental platform's hardware configuration included an NVIDIA GeForce RTX 4060 Ti (32GB VRAM) and a 13th Gen Intel® Core™ i5-13500. Some key parameters were set as follows: the number of diffusion steps for the pre-trained model... The value is set to 1000. The number of GraphTransformerBlocks in the denoising neural network is set to 2. In the feature extractor, the GIN hyperparameters are configured as follows: input dimension 116, consistent with the number of functional regions of interest (ROIs) in the brain; hidden layer dimension 64; and 2 GIN layers. The principal dimension of the Mamba module is 116, and the state space dimension is 14. The parameter set used in the final loss function is... The pre-trained model was trained. A five-fold cross-validation strategy was used to evaluate the performance of the task-specific model. The dataset was randomly divided into five mutually exclusive subsets. In each round, one subset was selected as the validation set, and the remaining four subsets were used as the training set. This process was repeated five times to ensure that each sample participated in validation once. The final performance metric was the average of the five experiments. A stochastic gradient descent (SGD) optimizer was used to train the task-specific model with an initial learning rate of 0.004, weight decay of 0.0001, and momentum of 0.9. The training batch size was 16, and the training epochs were 40. In this work, cross-site brain disease classification was performed. CL-MambaGIN was first pre-trained on one fMRI dataset site and then fine-tuned on other sites. ASD and HC classification were performed on the ABIDE dataset. CL-MambaGIN was pre-trained on the NYU site and fine-tuned and tested on the UM116 and LEUVEN sites, respectively. To measure the performance of each method, four metrics were used: ACC, AUC, SEN, and SPE. The experimental results and control methods are shown in Tables 1 and 2:

[0089] Table 1. Results of the control experiment on NYU → UM116 on the ABIDE dataset.

[0090] Model ACC AUC SEN SPE Window_sliceWindow_warp 0.560.57 0.590.56 0.530.56 0.660.65 Node DroppingGCA 0.590.58 0.600.61 0.650.53 0.590.70 AD-GCLAuto-GCL 0.600.61 0.640.63 0.560.51 0.630.66 No Pretrain 0.56 0.56 0.54 0.61 CL-MambaGIN 0.67 0.69 0.63 0.64

[0091] Table 2. Results of the control experiment on the ABIDE dataset for NYU → LEUVEN

[0092] Model ACC AUC SEN SPE Window_sliceWindow_warp 0.590.57 0.600.59 0.510.53 0.660.54 Node DroppingGCA 0.610.61 0.650.63 0.520.58 0.650.62 AD-GCLAuto-GCL 0.630.64 0.600.63 0.560.64 0.580.54 No Pretrain 0.59 0.61 0.51 0.65 CL-MambaGIN 0.69 0.73 0.65 0.63

[0093] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A brain disease prediction method based on a double-encoder and diffusion model, characterized in that, The method comprises the following steps: S1. Preprocessing the brain function image collected by the functional magnetic resonance device, including removing the first several time points, head motion correction, time layer correction, signal interference removal, spatial registration and band pass filtering; S2. Dividing the brain region based on the anatomical atlas, and constructing the BOLD signal matrix of the subject; S3. Calculating the resting state functional connection strength between brain regions, generating the node feature matrix and edge feature matrix of the brain function network, and constructing the original brain network; S4. Data augmentation of the original brain network through a diffusion model: Performing a noise adding process: independently adding Gaussian noise on the node features and edge features, and converting it into a random noise distribution through a Markov chain step; Performing a noise removing process: using a neural network based on GraphTransformer to denoise the noisy graph structure, and generating an augmented brain network; S5. Extracting features using a double encoder: Using a Mamba encoder to extract time dynamic features from the BOLD signal; Using a graph isomorphism network (GIN) encoder to extract spatial topological features from the original brain network and the augmented brain network; S6. Designing a triple contrast learning mechanism: First level: cross-dimension contrast between original spatial features and time dynamic features; Second level: cross-dimension contrast between augmented spatial features and time dynamic features; Third level: same-dimension contrast between original spatial features and augmented spatial features; S7. Migrating the trained double encoder to a downstream classification task: concatenating the spatial features and the time dynamic features, and realizing brain disease prediction through a classification layer; The noise adding process of step S4 satisfies: The noise matrix is a double random matrix, and the row sum and the column sum are both 1; The noise schedule uses a cosine decay strategy to control the noise intensity; The noise removing process of step S4: The neural network includes an input MLP, a GraphTransformer module and an output MLP; Global features are introduced, including the number of graph connected components and the first five non-zero eigenvalues, which are input into the Graph Transformer module together with the node features and the edge features; The Graph Transformer module: Updates the node features through a self-attention mechanism; Fuses the node features, the edge features and the global features based on a FiLM layer; Updates the global features through a pooling operation; In the triple contrast learning mechanism of step S6: The positive samples correspond to different dimension feature vectors of the same subject; The negative samples are feature vectors of different subjects; The overall loss function is the weighted sum of the triple contrast losses.

2. The brain disease prediction method based on double-encoder and diffusion model according to claim 1, characterized in that, In step S3: The functional connection strength is calculated by the Pearson correlation coefficient; The functional connection matrix is binarized: connections with a strength greater than 0.3 are kept as 1, and the rest are set to 0.

3. The brain disease prediction method based on dual-encoder and diffusion model according to claim 1, characterized in that, In step S5: The GIN encoder uses a two-layer graph isomorphism network to update the features by aggregating neighbor node information; The GIN encoder parameters are shared for the original brain network and the augmented brain network.

4. The brain disease prediction method based on double-encoder and diffusion model according to claim 1, characterized in that, In step S7, the downstream classification task: Only the original brain network and the BOLD signal are used to input the trained double encoder; The output spatial feature vector and the time feature vector are spliced, and classified through an MLP and a Softmax layer.

5. The brain disease prediction method based on double-encoder and diffusion model according to claim 1, characterized in that, The brain disease is autism spectrum disorder, and the used data set is a resting-state functional magnetic resonance imaging data set.

6. The brain disease prediction method based on dual-encoder and diffusion model according to claim 1, characterized in that, Supports brain image data classification across medical sites, including unified analysis of heterogeneous data collected by different devices.