An autism classification method based on dynamic community perception graph transformer
Patent Information
- Application Number
- CN202611183376.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-05
- Publication Date
- 2026-10-30
AI Technical Summary
针对脑网络社区结构利用不充分及空间先验融合不足的问题,本发明通过引入动态社区分配机制,对脑网络进行自适应社区划分,并在此基础上分别提取社区级局部特征与全脑级全局拓扑特征,结合先验知识引导的图Transformer模块增强结构信息表达能力,从而实现了对脑网络层级组织特性的有效建模
[0067]本发明与其他现有技术相比,其显著优点是:该模型通过动态社区分配机制优化脑区与功能社区的隶属关系,以模拟大脑的功能模块化结构;分别捕捉社区内部与社区之间的信息交互,构建融合微观连接细节与宏观网络架构的综合空间表征;借鉴生物大脑信息传递机制,将空间距离与社区结构约束引入多头自注意力机制,在提升模型预测精度的同时,增强其生物可解释性。经实验评估,验证了本发明的有效性。
Smart Images

Figure CN123017438A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image processing and analysis, specifically a method for autism classification based on the dynamic community-aware graph Transformer. Background Technology
[0002] Autistic Spectrum Disorder (ASD) is a genetically based neurodevelopmental disorder characterized by impaired social communication, repetitive and stereotyped behaviors, and limited interests. Because the specific causes of ASD are unclear and there is no cure, patients typically require long-term intervention and support, which significantly impacts the quality of life for both patients and their families. Early diagnosis of ASD requires multidisciplinary evaluation, but current behavioral interventions and pharmacological treatments can only improve social functioning and emotional problems to a certain extent, and cannot completely cure the condition. Therefore, in-depth research into the physiological mechanisms of brain connectivity and potential pathogenesis of ASD is crucial for developing more precise diagnostic and intervention methods.
[0003] Graph Transformer is a graph structure modeling method developed based on the Transformer architecture. Its core idea is to use a self-attention mechanism to replace the fixed neighborhood aggregation method based on the adjacency matrix in traditional graph neural networks, thereby achieving adaptive modeling of the dependencies between nodes. However, existing methods still have many shortcomings and are difficult to meet the needs of accurate early clinical diagnosis: First, most methods adopt a static community partitioning strategy, which fixes brain regions to specific functional communities. This cannot adaptively capture the dynamic evolution characteristics of brain functional networks. However, brain functional communities are inherently dynamic and reorganize. Static partitioning will lose the dynamic functional information of the brain network, resulting in a decrease in the accuracy of feature extraction. Second, the feature extraction modules of most methods only focus on single-scale feature information, either emphasizing local node features or global network features. It is difficult to achieve effective fusion of multi-scale features, resulting in insufficient modeling ability for complex brain network structures and classification performance that needs further improvement. Finally, when processing brain network data, most methods use random location encoding or simple spatial coordinate encoding, without fully integrating prior knowledge such as the physical spatial distance of brain regions and community structure. This leads to unreasonable attention weight allocation and an inability to efficiently capture local interaction features within communities and global association features across communities. Therefore, there is an urgent need to develop a novel graph Transformer method to adaptively capture dynamic community features of brain functional networks, achieve multi-scale feature fusion, and optimize feature modeling by combining prior knowledge, ultimately providing a more accurate and reliable computer-aided diagnosis for autism spectrum disorders. Summary of the Invention
[0004] This invention proposes an autism classification method based on a dynamic community-aware graph Transformer. Addressing the issues of insufficient utilization of brain network community structure and inadequate spatial prior fusion, this invention introduces a dynamic community allocation mechanism to adaptively divide the brain network into communities. Based on this, it extracts community-level local features and whole-brain-level global topological features, respectively. Combined with a graph Transformer module guided by prior knowledge, it enhances the structural information representation capability, thereby achieving effective modeling of the hierarchical organizational characteristics of the brain network.
[0005] To achieve the above objectives, the present invention provides the following technical solution: an autism classification method based on a dynamic community-aware graph Transformer, comprising the following steps:
[0006] Step S1: Preprocess the functional magnetic resonance imaging (fMRI) data using the CPAC neuroimaging data processing toolkit.
[0007] The main processing steps include: (1) slice time correction; (2) skull dissection; (3) motion correction; (4) global intensity normalization; (5) noise signal regression; (6) bandpass filtering (0.01-0.1 Hz), etc. Then, the preprocessed fMRI images are registered to the MNI152 template space.
[0008] Step S2: Construct an adaptive community-aware graph Transformer model.
[0009] In step S2, the proposed model first constructs the graph structure based on the dynamic community allocation module; then, based on the dual-scale spatial feature extraction module, it captures the information interaction within and between communities, and constructs a comprehensive spatial representation that integrates micro-connection details and macro-network architecture; then, with the help of the graph Transformer module guided by prior knowledge, it improves the model's prediction accuracy and enhances biological interpretability; finally, it uses an orthogonal clustering readout function to aggregate the learned node embeddings, and outputs the final classification result through a multilayer perceptron.
[0010] In step S2, the graph structure is constructed based on the dynamic community allocation module. The specific implementation steps are as follows:
[0011] Step a1: Construct the functional connectivity matrix. First, the fMRI data of each subject is represented as an N×T matrix, where T is the number of time points and N is the number of Regions of Interest (ROIs) into which the whole brain is divided according to the standardized atlas. Then, based on this matrix, the time-series correlation between any two ROIs is calculated to construct the functional connectivity matrix. .
[0012] Step a2, community initialization with prior knowledge constraints. The whole brain's N=200 ROIs are pre-divided into C=8 functional networks, and then index vectors are used... A priori community boundary is defined, where adjacent index values define the range of ROIs contained in a functional network. For example, index [0, 23) corresponds to 23 brain regions of the visual network, index [23, 59) corresponds to 36 brain regions of the somatic motor network, and so on. Based on the above prior knowledge, a priori constraint matrix is constructed. Its elements are defined as:
[0013]
[0014] Step a3, Dynamic Community Allocation Mechanism. The dynamic community allocation matrix Z is generated in the following way:
[0015]
[0016] in, is a learnable linear transformation matrix; b is a bias vector; The node feature matrix; The a priori constraint strength coefficient; Temperature is a parameter that controls the smoothness of the probability distribution. To prevent logarithmic overflow, a smoothing term is included. Using the above formula, prior knowledge is injected into the dynamic community assignment matrix in the form of a logarithmic bias, causing each brain region to be predisposed to be assigned to its prior functional network during initialization. As the model trains, the learnable parameters dynamically adjust community assignments based on data features, achieving adaptive correction of prior knowledge and learning the community assignments of the patient's abnormal brain networks. The column index corresponding to the maximum value in each row of matrix Z represents the dominant community assignment of that brain region.
[0017]
[0018] Step a4: Construct the community subgraph. Based on the above community partitioning results, modify the initial functional connectivity matrix. Perform a simultaneous rearrangement of rows and columns to obtain the rearranged functional connectivity matrix. And record the starting row index of each community in the matrix. Then, a Top-k sparsity strategy was applied to matrix X to retain the K strongest functional connections corresponding to each ROI, thus constructing a mind map. Where the node set V corresponds to the whole brain ROI, the edge set E corresponds to the functional connections between ROIs, and its adjacency matrix is denoted as . The node feature matrix is denoted as For the subgraph corresponding to the c-th community Its adjacency matrix With node feature matrix It is obtained by partitioning the node subsets and edge subsets corresponding to the communities in the parent graph G, and is defined as follows:
[0019]
[0020]
[0021] in, Let c be the number of nodes in the c-th community, satisfying the constraint on the total number of nodes in the whole brain:
[0022]
[0023] In step S2, the information interaction within and between communities is captured based on the dual-scale spatial feature extraction module, constructing a comprehensive spatial representation that integrates micro-level connection details and macro-level network architecture. The specific implementation steps are as follows:
[0024] Step b1, for the c-th community subgraph The message passing process of its edge-weighted graph convolutional network is defined as follows:
[0025]
[0026] in, It is a non-linear activation function; This represents the feature matrix of the nodes in the l-th layer; The weight matrix is a learnable matrix; for The degree matrix. The adjacency matrix after adding self-loops, where elements This directly represents the functional connection strength between nodes u and v. After processing by an edge-weighted graph convolutional network, the node update features within each community are denoted as follows: d represents the dimension of the intermediate feature. Then, the local features of all communities are concatenated to obtain the local feature matrix of the whole-brain node:
[0027]
[0028] Step b2 involves constructing a global graph between communities based on local features extracted within each community. This begins with the aggregation features of each community. Perform readout operations that combine average pooling and max pooling to extract robust and representative community representations. Concatenate all community representations to construct a community-level feature matrix:
[0029]
[0030] Here, P(⋅) is a composite readout function that combines average pooling and max pooling, which can smooth feature noise while preserving key community features. Subsequently, a community-level connectivity matrix M is constructed based on the whole-brain functional connectivity matrix, whose elements... The total number of functional connections between the i-th community and the j-th community is represented by the following formula:
[0031]
[0032] in, and These are the node sets for the i-th and j-th communities, respectively. Let M be the connection weights between nodes u and v in the whole-brain adjacency matrix. After normalizing matrix M, the adjacency matrix of the community-level graph is obtained. To build a community-level graph The nodes in this graph correspond to functional communities, and the edge weights reflect the tightness of functional connections between communities. (This is part of a community-level graph.) We then introduce an edge-weighted graph convolutional network to aggregate interaction information between communities, resulting in a global community feature matrix:
[0033]
[0034] Step b3 involves designing a feature fusion strategy to integrate feature information at both local and global scales, ultimately generating a brain region representation matrix that incorporates multi-scale features. The feature fusion formula is as follows:
[0035]
[0036] Here, lin(⋅) is a linear transformation layer used to align the dimensions of the concatenated features. expand(⋅) is a feature expansion operation based on community indexes, whose core logic is to map community-level features back to the whole-brain node scale, specifically implemented as follows:
[0037]
[0038] Here, repeat(⋅) is the matrix copy operation; This is the index of the last row of the c-th community in the whole brain node.
[0039] In step S2, the graph Transformer module, guided by prior knowledge, improves the model's prediction accuracy and enhances its biological interpretability. The specific implementation steps are as follows:
[0040] Step c1, Location Encoding. A hybrid location encoding suitable for brain functional networks is designed by combining random walk location encoding with the three-dimensional spatial coordinates of the Montreal Neuroscience Institute. Specifically, random walk location encoding captures the centrality and global structural information of brain region nodes by calculating the probability distribution of random walks. The probability that node i returns to itself after a random walk is calculated as follows:
[0041]
[0042] in, It is a degree matrix. Let be the adjacency matrix of the graph. Based on this probability, the position code after S steps of the random walk is calculated as:
[0043]
[0044] Assume the coordinates of the i-th ROI are The three-dimensional spatial coordinate matrix of the brain, as defined by the Montreal Neuroscience Institute, is as follows:
[0045]
[0046] The final position code can be defined as:
[0047]
[0048] Where norm(·) normalizes the MNI coordinates; This indicates matrix concatenation. Position encoding is added to the model input as follows:
[0049]
[0050] Here, lin(·) maps PE to d-dimensional space. The final input... Local-global features Combined with positional encoding, it allows the model to capture spatial and graphical structural information.
[0051] Step c2, spatial distance weighting. First, the three-dimensional spatial coordinates of any two brain regions are calculated based on the nodes of the Montreal Neuroscience Institute. and Euclidean distance between Subsequently, the distance matrix is transformed into a distance weight matrix using a Gaussian kernel function. :
[0052]
[0053] in, This is a learnable parameter. The exponential decay function can effectively enhance the weight of short-range connections and suppress the influence of physically distant connections on attention scores, thereby constraining the attention mechanism to better conform to the spatial proximity law of information transmission in the brain.
[0054] Step c3, community structure weighting. Based on the dynamic community allocation matrix generated above. Construct a community attention weight matrix. Specifically, for any two brain region nodes... and The strength of their association at the community level can be obtained by calculating the sum of the products of their probability distributions across different functional communities:
[0055]
[0056] Step c4, improve the multi-head self-attention mechanism. Adjust the spatial distance weights mentioned above. With dynamic community weight This is incorporated into the calculation of attention scores, thereby constructing a priori-guided attention weight matrix. The improved attention calculation formula is as follows:
[0057]
[0058]
[0059]
[0060] in, ; This indicates the concatenation operator; H is the number of attention heads; , , These are the query, key, and value matrices for the h-th attention head in the l-th layer, respectively. , , , These are learnable model parameters; and This is a learnable scaling factor used to balance the contributions of feature similarity and prior information to the attention score. Finally, after L layers of Transformer encoding, the model outputs a node feature map that incorporates community spatial structure information. .
[0061] In step S2, the learned node embeddings are aggregated using an orthogonal clustering readout function. The specific implementation steps are as follows:
[0062] The orthogonal clustering readout function first uses an encoder to map node data to a latent space, and then calculates the orthogonally constrained cluster centers. Graph-level embedding employs a soft allocation mechanism to assign nodes to corresponding cluster centers. The calculation formula is as follows:
[0063]
[0064] in, It is a learnable assignment matrix generated by the orthogonal clustering readout function; This is the node feature matrix output by the encoder. This process effectively captures the complex patterns of brain activity.
[0065] Step S3: Input the preprocessed fMRI data into the constructed network model for training to obtain a trained autism classification model.
[0066] Step S4: Use the trained autism classification model to predict the test data and obtain the corresponding autism classification results.
[0067] Compared with other existing technologies, the significant advantages of this invention are: the model optimizes the affiliation between brain regions and functional communities through a dynamic community allocation mechanism to simulate the modular functional structure of the brain; it captures information interactions within and between communities, constructing a comprehensive spatial representation that integrates microscopic connection details and macroscopic network architecture; and it draws on the information transmission mechanism of the biological brain, introducing spatial distance and community structure constraints into a multi-head self-attention mechanism, thereby improving the model's prediction accuracy and enhancing its biological interpretability. Experimental evaluation has verified the effectiveness of this invention. Attached Figure Description
[0068] Figure 1 This is a flowchart illustrating the implementation of the present invention.
[0069] Figure 2 This is a structural diagram of the autism classification model of the present invention. Detailed Implementation
[0070] The present invention will be described in detail below with reference to the accompanying drawings for implementation purposes. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0071] Example: An autism classification method based on the dynamic community-aware graph Transformer.
[0072] refer to Figure 1The steps of implementing the invention include: (1) using CPAC to preprocess fMRI data; (2) constructing an adaptive community-aware graph Transformer model; (3) inputting the preprocessed fMRI data into the constructed network model for training to obtain a trained autism classification model; (4) using the trained autism classification model to predict test data and obtain the corresponding autism classification results.
[0073] refer to Figure 2 An adaptive community-aware graph Transformer model is constructed. This model first builds the graph structure based on a dynamic community assignment module; then, based on a dual-scale spatial feature extraction module, it captures information interactions within and between communities, constructing a comprehensive spatial representation that integrates micro-level connection details and macro-level network architecture; next, it leverages a graph Transformer module guided by prior knowledge to improve prediction accuracy and enhance biological interpretability; finally, it uses an orthogonal clustering readout function to aggregate the learned node embeddings and outputs the final classification result through a multilayer perceptron. Detailed explanation follows:
[0074] A graph structure is constructed based on a dynamic community allocation module. The specific implementation steps are as follows:
[0075] Step a1: Construct the functional connectivity matrix. First, the fMRI data of each subject is represented as an N×T matrix, where T is the number of time points and N is the number of Regions of Interest (ROIs) into which the whole brain is divided according to the standardized atlas. Then, based on this matrix, the time-series correlation between any two ROIs is calculated to construct the functional connectivity matrix. This matrix fully characterizes the functional connectivity network of the whole brain's Regions of Interest (ROIs), with each row vector corresponding to a whole-brain connectivity feature of an ROI.
[0076] Step a2, community initialization with prior knowledge constraints. The whole brain's N=200 ROIs are pre-divided into C=8 functional networks, and then index vectors are used... A priori community boundary is defined, where adjacent index values define the range of ROIs contained in a functional network. For example, index [0, 23) corresponds to 23 brain regions of the visual network, index [23, 59) corresponds to 36 brain regions of the somatic motor network, and so on. Based on the above prior knowledge, a priori constraint matrix is constructed. Its elements are defined as:
[0077]
[0078] Step a3, Dynamic Community Allocation Mechanism. The dynamic community allocation matrix Z is generated in the following way:
[0079]
[0080] in, is a learnable linear transformation matrix; b is a bias vector; The node feature matrix; The a priori constraint strength coefficient; Temperature is a parameter that controls the smoothness of the probability distribution. To prevent logarithmic overflow, a smoothing term is included. Using the above formula, prior knowledge is injected into the dynamic community assignment matrix in the form of a logarithmic bias, causing each brain region to be predisposed to be assigned to its prior functional network during initialization. As the model trains, the learnable parameters dynamically adjust community assignments based on data features, achieving adaptive correction of prior knowledge and learning the community assignments of the patient's abnormal brain networks. The column index corresponding to the maximum value in each row of matrix Z represents the dominant community assignment of that brain region.
[0081]
[0082] Step a4: Construct the community subgraph. Based on the above community partitioning results, modify the initial functional connectivity matrix. Perform a simultaneous rearrangement of rows and columns to obtain the rearranged functional connectivity matrix. And record the starting row index of each community in the matrix. Then, a Top-k sparsity strategy is applied to matrix X, retaining the K strongest functional connections for each ROI. It's important to note that the rearrangement operation only changes the order of ROIs in the functional connectivity matrix; it does not alter the original connectivity information of any ROI. Finally, a mind map is constructed. Where the node set V corresponds to the whole brain ROI, the edge set E corresponds to the functional connections between ROIs, and its adjacency matrix is denoted as . The node feature matrix is denoted as For the subgraph corresponding to the c-th community Its adjacency matrix With node feature matrix It is obtained by partitioning the node subsets and edge subsets corresponding to the communities in the parent graph G, and is defined as follows:
[0083]
[0084]
[0085] in, Let c be the number of nodes in the c-th community, satisfying the constraint on the total number of nodes in the whole brain:
[0086]
[0087] Dividing the whole brain map into multiple community sub-maps lays the foundation for extracting interaction features within and across communities.
[0088] Based on a dual-scale spatial feature extraction module, information interactions within and between communities are captured, constructing a comprehensive spatial representation that integrates micro-level connection details and macro-level network architecture. The specific implementation steps are as follows:
[0089] Step b1, for the c-th community subgraph The message passing process of its edge-weighted graph convolutional network is defined as follows:
[0090]
[0091] in, It is a non-linear activation function; This represents the feature matrix of the nodes in the l-th layer; The weight matrix is a learnable matrix; for The degree matrix. The adjacency matrix after adding self-loops, where elements This directly represents the functional connection strength between nodes u and v. After processing by an edge-weighted graph convolutional network, the node update features within each community are denoted as follows: d represents the dimension of the intermediate feature. Then, the local features of all communities are concatenated to obtain the local feature matrix of the whole-brain node:
[0092]
[0093] Step b2 involves constructing a global graph between communities based on local features extracted within each community. This begins with the aggregation features of each community. Perform readout operations that combine average pooling and max pooling to extract robust and representative community representations. Concatenate all community representations to construct a community-level feature matrix:
[0094]
[0095] Here, P(⋅) is a composite readout function that combines average pooling and max pooling, which can smooth feature noise while preserving key community features. Subsequently, a community-level connectivity matrix M is constructed based on the whole-brain functional connectivity matrix, whose elements... The total number of functional connections between the i-th community and the j-th community is represented by the following formula:
[0096]
[0097] in, and These are the node sets for the i-th and j-th communities, respectively. Let M be the connection weights between nodes u and v in the whole-brain adjacency matrix. After normalizing matrix M, the adjacency matrix of the community-level graph is obtained. To build a community-level graph The nodes in this graph correspond to functional communities, and the edge weights reflect the tightness of functional connections between communities. (This is part of a community-level graph.) We then introduce an edge-weighted graph convolutional network to aggregate interaction information between communities, resulting in a global community feature matrix:
[0098]
[0099] Step b3 involves designing a feature fusion strategy to integrate feature information at both local and global scales, ultimately generating a brain region representation matrix that incorporates multi-scale features. The feature fusion formula is as follows:
[0100]
[0101] Here, lin(⋅) is a linear transformation layer used to align the dimensions of the concatenated features. expand(⋅) is a feature expansion operation based on community indexes, whose core logic is to map community-level features back to the whole-brain node scale, specifically implemented as follows:
[0102]
[0103] Here, repeat(⋅) is the matrix copy operation; This is the index of the last row of the c-th community in the whole brain node.
[0104] By leveraging a graph Transformer module guided by prior knowledge, the model's prediction accuracy is improved and its biological interpretability is enhanced. The specific implementation steps are as follows:
[0105] Step c1, Location Encoding. A hybrid location encoding suitable for brain functional networks is designed by combining random walk location encoding with the three-dimensional spatial coordinates of the Montreal Neuroscience Institute. Specifically, random walk location encoding captures the centrality and global structural information of brain region nodes by calculating the probability distribution of random walks. The probability that node i returns to itself after a random walk is calculated as follows:
[0106]
[0107] in, It is a degree matrix. Let be the adjacency matrix of the graph. Based on this probability, the position code after S steps of the random walk is calculated as:
[0108]
[0109] Assume the coordinates of the i-th ROI are The three-dimensional spatial coordinate matrix of the brain, as defined by the Montreal Neuroscience Institute, is as follows:
[0110]
[0111] The final position code can be defined as:
[0112]
[0113] Where norm(·) normalizes the MNI coordinates; This indicates matrix concatenation. Position encoding is added to the model input as follows:
[0114]
[0115] Here, lin(·) maps PE to d-dimensional space. The final input... Local-global features Combined with positional encoding, it allows the model to capture spatial and graphical structural information.
[0116] Step c2, spatial distance weighting. First, the three-dimensional spatial coordinates of any two brain regions are calculated based on the nodes of the Montreal Neuroscience Institute. and Euclidean distance between Subsequently, the distance matrix is transformed into a distance weight matrix using a Gaussian kernel function. :
[0117]
[0118] in, This is a learnable parameter. The exponential decay function can effectively enhance the weight of short-range connections and suppress the influence of physically distant connections on attention scores, thereby constraining the attention mechanism to better conform to the spatial proximity law of information transmission in the brain.
[0119] Step c3, community structure weighting. Based on the dynamic community allocation matrix generated above. Construct a community attention weight matrix. Specifically, for any two brain region nodes... and The strength of their association at the community level can be obtained by calculating the sum of the products of their probability distributions across different functional communities:
[0120]
[0121] Step c4, improve the multi-head self-attention mechanism. Adjust the spatial distance weights mentioned above. With dynamic community weight This is incorporated into the calculation of attention scores, thereby constructing a priori-guided attention weight matrix. The improved attention calculation formula is as follows:
[0122]
[0123]
[0124]
[0125] in, ; This indicates the concatenation operator; H is the number of attention heads; , , These are the query, key, and value matrices for the h-th attention head in the l-th layer, respectively. , , , These are learnable model parameters; and This is a learnable scaling factor used to balance the contributions of feature similarity and prior information to the attention score. Finally, after L layers of Transformer encoding, the model outputs a node feature map that incorporates community spatial structure information. .
[0126] The learned node embeddings are aggregated using an orthogonal clustering readout function. The specific implementation steps are as follows:
[0127] The orthogonal clustering readout function first uses an encoder to map node data to a latent space, and then calculates the orthogonally constrained cluster centers. Graph-level embedding employs a soft allocation mechanism to assign nodes to corresponding cluster centers. The calculation formula is as follows:
[0128]
[0129] in, It is a learnable assignment matrix generated by the orthogonal clustering readout function; This is the node feature matrix output by the encoder. This process effectively captures the complex patterns of brain activity.
[0130] The above description, in conjunction with the preferred embodiments, provides a further detailed explanation of the present invention, but it should not be construed as limiting the specific implementation of the invention to these descriptions. Those skilled in the art should understand that various modifications to the details may be made without departing from the scope defined by the appended claims, and all such modifications should be considered to fall within the protection scope of the present invention.
Claims
1. An autism classification method based on a dynamic community-aware graph Transformer, characterized in that: S1. Use the CPAC (Neuroimaging Data Processing Toolkit) to preprocess functional magnetic resonance imaging (fMRI) data; S2. Construct an adaptive community-aware graph Transformer model; S3. Input the preprocessed fMRI data into the constructed network model for training to obtain a trained autism classification model. S4. Use the trained autism classification model to predict the test data and obtain the corresponding autism classification results.
2. The autism classification method based on the Dynamic Community-Aware Graph Transformer according to claim 1, characterized in that: In step S1, the fMRI data is preprocessed using CPAC. The main processing steps include: (1) slice time correction; (2) skull dissection; (3) motion correction; (4) global intensity normalization; (5) noise signal regression; and (6) bandpass filtering (0.01-0.1 Hz). Then, the preprocessed fMRI images are registered to the MNI152 template space.
3. The autism classification method based on the Dynamic Community Awareness Graph Transformer according to claim 1, characterized in that: In step S2, the proposed model first constructs the graph structure based on the dynamic community allocation module; then, based on the dual-scale spatial feature extraction module, it captures the information interaction within and between communities, and constructs a comprehensive spatial representation that integrates micro-connection details and macro-network architecture; then, with the help of the graph Transformer module guided by prior knowledge, it improves the model's prediction accuracy and enhances its biological interpretability; finally, it uses an orthogonal clustering readout function to aggregate the learned node embeddings, and outputs the final classification result through a multilayer perceptron.
4. The autism classification method based on the dynamic community-aware graph Transformer according to claim 3, characterized in that: A graph structure is constructed based on a dynamic community allocation module. The specific implementation steps are as follows: Step a1: Construct the functional connectivity matrix. First, the fMRI data of each subject is represented as an N×T matrix, where T is the number of time points and N is the number of Regions of Interest (ROIs) into which the whole brain is divided according to the standardized atlas. Then, based on this matrix, the time-series correlation between any two ROIs is calculated to construct the functional connectivity matrix. . Step a2, community initialization with prior knowledge constraints. The whole brain's N=200 ROIs are pre-divided into C=8 functional networks, and then index vectors are used... A priori community boundary is defined, where adjacent index values define the range of ROIs contained in a functional network. For example, index [0, 23) corresponds to 23 brain regions of the visual network, index [23, 59) corresponds to 36 brain regions of the somatic motor network, and so on. Based on the above prior knowledge, a priori constraint matrix is constructed. Its elements are defined as: Step a3, Dynamic Community Allocation Mechanism. The dynamic community allocation matrix Z is generated in the following way: in, is a learnable linear transformation matrix; b is a bias vector; The node feature matrix; The a priori constraint strength coefficient; Temperature is a parameter that controls the smoothness of the probability distribution. To prevent logarithmic overflow, a smoothing term is included. Using the above formula, prior knowledge is injected into the dynamic community assignment matrix in the form of a logarithmic bias, causing each brain region to be predisposed to be assigned to its prior functional network during initialization. As the model trains, the learnable parameters dynamically adjust community assignments based on data features, achieving adaptive correction of prior knowledge and learning the community assignments of the patient's abnormal brain networks. The column index corresponding to the maximum value in each row of matrix Z represents the dominant community assignment of that brain region. Step a4: Construct the community subgraph. Based on the above community partitioning results, modify the initial functional connectivity matrix. Perform a simultaneous rearrangement of rows and columns to obtain the rearranged functional connectivity matrix. And record the starting row index of each community in the matrix. Then, a Top-k sparsity strategy was applied to matrix X to retain the K strongest functional connections corresponding to each ROI, thus constructing a mind map. Where the node set V corresponds to the whole brain ROI, the edge set E corresponds to the functional connections between ROIs, and its adjacency matrix is denoted as . The node feature matrix is denoted as For the subgraph corresponding to the c-th community Its adjacency matrix With node feature matrix It is obtained by partitioning the node subsets and edge subsets corresponding to the communities in the parent graph G, and is defined as follows: in, Let c be the number of nodes in the c-th community, satisfying the constraint on the total number of nodes in the whole brain:
5. The autism classification method based on the Dynamic Community Awareness Graph Transformer according to claim 3, characterized in that: Based on a dual-scale spatial feature extraction module, information interactions within and between communities are captured, constructing a comprehensive spatial representation that integrates micro-level connection details and macro-level network architecture. The specific implementation steps are as follows: Step b1, for the c-th community subgraph The message passing process of its edge-weighted graph convolutional network is defined as follows: in, It is a non-linear activation function; This represents the feature matrix of the nodes in the l-th layer; The weight matrix is a learnable matrix; for The degree matrix. The adjacency matrix after adding self-loops, where elements This directly represents the functional connection strength between nodes u and v. After processing by an edge-weighted graph convolutional network, the node update features within each community are denoted as follows: d represents the dimension of the intermediate feature. Then, the local features of all communities are concatenated to obtain the local feature matrix of the whole-brain node: Step b2 involves constructing a global graph between communities based on local features extracted within each community. This begins with the aggregation features of each community. Perform readout operations that combine average pooling and max pooling to extract robust and representative community representations. Concatenate all community representations to construct a community-level feature matrix: Here, P(⋅) is a composite readout function that combines average pooling and max pooling, which can smooth feature noise while preserving key community features. Subsequently, a community-level connectivity matrix M is constructed based on the whole-brain functional connectivity matrix, whose elements... The total number of functional connections between the i-th community and the j-th community is represented by the following formula: in, and These are the node sets for the i-th and j-th communities, respectively. Let M be the connection weights between nodes u and v in the whole-brain adjacency matrix. After normalizing matrix M, the adjacency matrix of the community-level graph is obtained. To build a community-level graph The nodes in this graph correspond to functional communities, and the edge weights reflect the tightness of functional connections between communities. (This is part of a community-level graph.) We then introduce an edge-weighted graph convolutional network to aggregate interaction information between communities, resulting in a global community feature matrix: Step b3 involves designing a feature fusion strategy to integrate feature information at both local and global scales, ultimately generating a brain region representation matrix that incorporates multi-scale features. The feature fusion formula is as follows: Here, lin(⋅) is a linear transformation layer used to align the dimensions of the concatenated features. expand(⋅) is a feature expansion operation based on community indexes, whose core logic is to map community-level features back to the whole-brain node scale, specifically implemented as follows: Where repeat(⋅) is the matrix copy operation; This is the index of the last row of the c-th community in the whole brain node.
6. The autism classification method based on the dynamic community-aware graph Transformer according to claim 3, characterized in that: By leveraging a graph Transformer module guided by prior knowledge, the model's prediction accuracy is improved and its biological interpretability is enhanced. The specific implementation steps are as follows: Step c1, Location Encoding. A hybrid location encoding suitable for brain functional networks is designed by combining random walk location encoding with the three-dimensional spatial coordinates of the Montreal Neuroscience Institute. Specifically, random walk location encoding captures the centrality and global structural information of brain region nodes by calculating the probability distribution of random walks. The probability that node i returns to itself after a random walk is calculated as follows: in, It is a degree matrix. Let be the adjacency matrix of the graph. Based on this probability, the position code after S steps of the random walk is calculated as: Assume the coordinates of the i-th ROI are The three-dimensional spatial coordinate matrix of the brain, as defined by the Montreal Neuroscience Institute, is as follows: The final position code can be defined as: Where norm(·) normalizes the MNI coordinates; This indicates matrix concatenation. Positional encoding is added to the model input as follows: Here, lin(·) maps PE to d-dimensional space. The final input... Local-global features Combined with positional encoding, it allows the model to capture spatial and graphical structural information. Step c2, spatial distance weighting. First, the three-dimensional spatial coordinates of any two brain regions are calculated based on the nodes of the Montreal Neuroscience Institute. and Euclidean distance between Subsequently, the distance matrix is transformed into a distance weight matrix using a Gaussian kernel function. : in, This is a learnable parameter. The exponential decay function can effectively enhance the weight of short-range connections and suppress the influence of physically distant connections on attention scores, thereby constraining the attention mechanism to better conform to the spatial proximity law of information transmission in the brain. Step c3, community structure weighting. Based on the dynamic community allocation matrix generated above. Construct a community attention weight matrix. Specifically, for any two brain region nodes... and The strength of their association at the community level can be obtained by calculating the sum of the products of their probability distributions across different functional communities: Step c4, improve the multi-head self-attention mechanism. Adjust the spatial distance weights mentioned above. With dynamic community weight This is incorporated into the calculation of attention scores, thereby constructing a priori-guided attention weight matrix. The improved attention calculation formula is as follows: in, ; This indicates the concatenation operator; H is the number of attention heads; , , These are the query, key, and value matrices for the h-th attention head in the l-th layer, respectively. , , , These are learnable model parameters; and This is a learnable scaling factor used to balance the contributions of feature similarity and prior information to the attention score. Finally, after L layers of Transformer encoding, the model outputs a node feature map that incorporates community spatial structure information. .
7. The autism classification method based on the dynamic community-aware graph Transformer according to claim 3, characterized in that: The learned node embeddings are aggregated using an orthogonal clustering readout function. The specific implementation steps are as follows: The orthogonal clustering readout function first uses an encoder to map node data to a latent space, and then calculates the orthogonally constrained cluster centers. Graph-level embedding employs a soft allocation mechanism to assign nodes to corresponding cluster centers. The calculation formula is as follows: in, It is a learnable assignment matrix generated by the orthogonal clustering readout function; This is the node feature matrix output by the encoder. This process effectively captures the complex patterns of brain activity.
