{'fraction_non_alphanumeric': 0.037529764986023395, 'fraction_numerical': 0.010974220933844083, 'mean_word_length': 5.009020217729393, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Spatio-Temporal Attention in Multi-Granular Brain Chronnectomes for Detection of Autism Spectrum Disorder

The traditional methods for detecting autism spectrum disorder (ASD) are expensive, subjective, and time-consuming, often taking years for a diagnosis, with many children growing well into adolescence and even adulthood before finally confirming the disorder. Recently, graph-based learning techniques have demonstrated impressive results on resting-state functional magnetic resonance imaging (rs-fMRI) data from the Autism Brain Imaging Data Exchange (ABIDE). We introduce IMAGIN, a multI-granular, Multi-Atlas spatio-temporal attention Graph Isomorphism Network, which we use to learn graph representations of dynamic functional brain connectivity (chronnectome), as opposed to static connectivity (connectome). The experimental results demonstrate that IMAGIN achieves a 5-fold cross-validation accuracy of 79.25%, which surpasses the current state-of-the-art by 1.5%. In addition, analysis of the spatial and temporal attention scores provides further validation for the neural basis of autism.


INTRODUCTION
Autism spectrum disorder (ASD) is considered to be a neurodevelopmental disorder resulting from abnormal development of brain connectivity. This atypical connectivity in autism has loosely been characterized by underconnectivity between distant brain regions and hyperconnectivity between neighboring ones [1,2]. ASD manifests as a wide variety of deficits in social communication and language acquisition, as well as restricted interests and repetitive behaviors [3]. Early detection is often cited as the most important factor in the successful treatment of autism. However, there are a number of significant barriers in the way of an accurate diagnosis. No quantitative metric or medical test currently exists that can quickly screen for autism, but instead patients must be subjected to intense observation of developmental behavior with medical specialists including neurologists, behavioral pediatricians, and psychiatrists. We investigate a new paradigm in autism detection through the analysis of rs-fMRI data, which measures the hemodynamic response of the brain while the subject is at rest. By using blood flow as an indirect metric for brain activity, an intrinsic map of functional connectivity (FC) can be established for each subject.
The first work performed on this multi-site autism classification problem involved training generalized linear models and a leaveone-out classifier on FC matrices and phenotypic features from 7266 brain regions of interest (ROIs), achieving accuracy of 60.0% [4]. This remained as the state-of-the-art for years until a support vector classifier trained on a subset of ABIDE I (871 subjects who passed manual quality control inspections from three independent human reviewers) improved to 66.8% accuracy on an atlas with only 84 ROIs [5]. As deep-learning methods gained popularity, new techniques such as MLPs, CNNs, autoencoders, and graph-based models brought a resurgent interest in the classification of ASD [6,7].
Among graph-based models, the ASD detection problem can be formulated as both a node classification task and a graph classification task. In node classification, one graph is constructed for the entire population, with each node and its associated features corresponding to a single subject and their flattened FC matrices. Nodes are connected through weighted similarity metrics of phenotypic features, such as age, sex, handedness, and location of the scanning site. In graph classification, a graph is constructed for each individual in the ABIDE I dataset, with nodes representing ROIs and edges representing functional time series correlations between ROIs [8]. Previously, the state-of-the-art in graph-based models was a populationbased 16-layer Deep-GCN trained on FC matrices extracted from the 111-region Harvard-Oxford brain atlas. Using the same ABIDE I subset of 871 subjects as described in [5], they achieved a 10-fold cross-validation accuracy of 73.7% [9]. This was recently surpassed, however, by an ensemble graph-based learning method that classified each individual with 75.9% accuracy according to a majority vote from six different brain atlases, ranging from 110 to 200 ROIs [10]. Both of these graph-based models only used static FC information, where pairwise correlations between regions are calculated using the entire duration of the fMRI scan. This neglects the fact that our brains are dynamic systems, with functional connectivity fluctuating over short periods of time, even when at rest. This has led to the distinction between the "connectome" and the "chronnectome"with the analysis of time-varying connectivity networks being established as the next frontier in fMRI data discovery [11,12]. The current SOTA in dynamic graph-based models only achieves 70.7% 10fold cross-validation accuracy, with a notable limitation being that it measures temporal functional connectivity with a single frame at a time, rather than with a sliding-window approach [13].
Our key contributions to this autism detection problem are as follows: (i) A novel multi-granular modeling technique to capture finegrained local connectivity (voxels) as well as coarse-grained connectivity (atlas regions) across the dynamic connectome, (ii) A multiatlas individual-level graph-based ensemble learning technique that incorporates dynamic functional connectivity (dFC) data with phenotypic features, and (iii) We integrate spatial and temporal attention into a Graph Isomorphism Network (GIN) to provide a measure of explainability for our methods -not only to indicate the most discriminative brain regions for this detection problem, but to also show how variations in connectivity can be quantified over time. In evaluating the patterns of FC between subjects with ASD and healthy controls (HC), we achieve state-of-the-art ASD classification performance (79.25% accuracy) over all previous methods, successfully combining a graph-based multi-atlas model architecture with dynamic functional connectivity and phenotypic features. The ABIDE (Autism Brain Imaging Data Exchange) dataset provides resting-state fMRI data of subjects with autism and healthy controls collected from across 17 international sites. Previous research has shown that when classifying scans from a single site, accuracy is quite high, but drops drastically when scans across multiple sites are considered, perhaps due to scanning parameter differences between sites [4]. In the tradition of previous ABIDE research referenced in this paper, we only use data from the ABIDE I Preprocessed Connectomes Project [14] preprocessed through the Configurable Pipeline for the Analysis of Connectomes (CPAC), with band-pass filtering and no global signal regression. Following [5], we take the 871 subjects that passed manual quality control checks from three expert human reviewers and further prune the data with less than 150 time steps to a final total of 809 samples. The resulting class distribution is 383 subjects with ASD to 426 healthy controls.

Dynamic Graph Construction
Traditionally, rs-fMRI analysis was done under the outdated assumption that the activity of the brain remains stagnant throughout the duration of the scan and the functional connectivity between brain regions is static. Research has shown, however, that even throughout the relatively short duration of an MRI scan, the brain is a dynamic entity, displaying measurable changes in functional connectivity over time periods of milliseconds, seconds, and minutes [15].
To construct a sequence of dFC graphs, we utilize the popular sliding window approach [16]. For a given window length Γ, voxel timeseries are extracted, averaged, and standardized from each brain atlas ROI to form an aggregate ROI timeseries ri(t) ∈ R Γ . Pairwise correlation coefficients between ROI timeseries are calculated to construct FC matrices and the top α-percentile correlations are thresholded to produce a sparse, weighted adjacency matrix A(t).
The window is then continually shifted by stride S until the end of the fMRI scan to construct T = T max − Γ/S total windows, resulting in a sequence of sparse dFC matrices A dyn = (A(1), ..., A(T )).
The node features xn(t) corresponding to each ROI n in window t are a concatenation of three sets of features: (i) one-hot encoded ROI vectors, (ii) encoded timestamps from a Gated Recurrent Unit (GRU) that receives as input the ROI timeseries from the beginning of the fMRI scan until the end of the sliding window following [17], and (iii) average clustering coefficient and density of intra-regional voxel connectivity, which is further detailed in section 3.1. Thus, for each sliding window t, the dynamic input graphs G(t) = (V (t), E(t)) are defined by the temporal node features X(t) and adjacency matrices A(t), forming the vertex set V (t) and edge set E(t), respectively.

Multi-Granular Graph-Structural Information
ASD manifests as an abnormal pattern of connectivity both throughout the brain at-large and within localized regions of interest [18]. However, no previous methods have been able to effectively capture network dynamics at the level of individual voxels.
We propose a novel method to extract local intra-region connectivity information at the scale of individual voxels, in addition to the standard technique of computing pairwise correlations between brain parcellations across greater spatial distances.
1. Extract standardized timeseries of individual voxels within each region n of the specified brain atlas.
2. Generate a k-nearest neighbors graph, where k is set to √ # of voxels in n, that reduces the number of connections to the top-k signed correlation coefficients for each ROI n. This can be achieved with the following distance function derived from the standard Euclidean distance: where δ(x t , y t ) = |x t − y t | 2 .
3. Set the edge weights between voxels to their pairwise Pearson correlation coefficients: where cov denotes the covariance.
4. Calculate the graph-structural features of density and average clustering coefficient for the weighted k-nearest neighbors graph. The density for undirected graphs is defined by d = 2m n(n−1) , where n is the number of nodes and m is the number of edges in the k-NN graph G. The average clustering coefficient for signed weighted graphs [19] is defined as C = 1 n u∈G cu, where n is the number of nodes in G. The clustering cu is defined as the geometric average of the subgraph edge weights, where ku is the degree of u and the edge weightsŵuv are normalized by the maximum weight ∆(G) of the network: wuv = wuv/∆(G).

Model Architecture
At the core of our model lies a modified Graph Isomorphism Network (GIN) architecture from [17]  the problem of learning dynamic brain connectome graph representations while also providing temporal explainability. This can be formalized as mapping a sequence of graphs G dyn = (G(1), ..., G(T )) with T timesteps to an embedding hG dyn . This embedding is generated in a two-step process through the combination of a GIN and Transformer encoder with self-attention.
Graph Isomorphism Networks [20] are a variant of traditional GNNs designed specifically for the graph classification task. Omitting timepoint notation (t), we modify the GIN layer to support edge weights eij: where h (k) i is the representation of the node xi at layer k. We refer to this modified architecture as e-STAGIN.
The main contribution to the standard GIN architecture that we use in e-STAGIN is a novel attention-based adaptive READOUT mechanism that pools a spatially-attended global graph-level repre-sentationhG from each of the node embeddings h (k) i . Before applying the attention mechanism, the average of the node embeddings in each layer k defined by h (k) are concatenated into the global graph embedding h G(t) .
According to the procedure in [17], the attention function s(h G(t) ) produces the node coefficient vectors z (k) space ∈ [0, 1] N indicating the relative level of importance of each node in layer k. The spatially-attended global graph representationh  For attention across time, the spatially-attended graph embed-dingshG dyn = (h G(1) , ...,h G(T ) ) are fed as inputs to a singleheaded Transformer encoder, which in turn computes the dynamic graph embeddings h (k) G dyn from each layer as a summation over time.
The self-attention weights Z time ∈ [0, 1] T ×T can now be interpreted as a measure of the temporal importance of each dynamic graph throughout the length of the scan [21]. The final output of the e-STAGIN model is the dynamic graph embedding, a concatenation of each spatially and temporally-attended dynamic graph embedding across all K e-STAGIN layers. We further expand upon the e-STAGIN architecture to create IMAGIN (multI-granular, Multi-Atlas spatio-temporal attention Graph Isomorphism Network), a multimodal ensemble learning architecture that integrates the outputs of three separate multi-granular e-STAGIN modules with phenotypic data to produce a diagnosis.
Each e-STAGIN module output from individual brain atlases -hAAL dyn , hCC200 dyn , and h Sch dyn -is fed as input along with phenotypic features (age, sex, scanning site) to a linear layer and the final ASD diagnosis is predicted with a softmax classifier. The full IMAGIN architecture is illustrated in Figure 1.

RESULTS
We utilize a stratified 5-fold cross-validated training procedure with a data split of 65% training, 15% validation, and 20% testing during hyperparameter tuning. The stratification occurs over both class (ASD and HC) and site (one of 17 scanning locations), in attempt to minimize the effects of the different scanning parameters on our dataset distribution.
Due to the combinatorial explosion of hyperparameter tuning in the multi-atlas learning regime, optimal hyperparameters used for each e-STAGIN module within IMAGIN were found by training a single e-STAGIN module with individual atlases. With the optimal hyperparameters found, we train IMAGIN for 50 epochs on the same data splits used for each e-STAGIN module to compare performance under reproducible conditions. In addition, to evaluate the effectiveness of our multi-granularity feature engineering method, we train IMAGIN without such node features (MAGIN).
Since each e-STAGIN module accepts only a fixed-length sequence of graphs, we stochastically slice each subject's fMRI timeseries into a continuous sequence of 120 timesteps (4 minutes), with the minimum length scan in our subsample of the ABIDE-I dataset being 150 timesteps (5 minutes). We leave the tuning of this dynamic sequence length to future work. The validation and test sets are subsampled equivalently when evaluating model performance. In order to ensure reproducibility, this random subsampling is set with the same seed used to stratify our cross-validation folds.
We train using cross entropy loss with the Adam optimizer. All experiments were performed on a system composed of an Intel Core i9-9900K processor, 64 GB of RAM, and an NVIDIA GeForce RTX 3090 GPU. Our code is publicly available 1 for reproducibility. The 5-fold cross-validation results of our methods are presented in Table 1, with classification performance compared to previous results. We achieve state-of-the-art performance across all model categories, beating the top graph-based models: ST-GCN [22], cGCN [13], Deep-GCN [9], and MAGE [10]; dFC models: SVM+RFE [23] and SVM+MTFS [24]; and multi-atlas models: MISO-DNN [25]. In addition, the introduction of multi-granular graph-structural node features results in a clear increase in accuracy between MAGIN and IMAGIN (+1.13%).

Spatio-Temporal Attention Analysis
The spatial attention z (k) space (t) of each region is averaged across each layer and throughout time to create an aggregated measure of the importance of each node z space ∈ [0, 1] N . The top-5 percentile ROIs for the AAL atlas are shown in Figure 2(a). In particular, the putamen of the striatum complex is selected, as well as cerebellar regions in the left hemisphere, which have previously been established as loci for the neural basis of repetitive behaviors in ASD [26,27]. Furthermore, this analysis was reproduced for the spatial attention results of the Schaefer atlas separated into seven distinct Yeo intrinsic connectivity networks (ICNs) [28]. Both the Salience Network (SN) and the Dorsal Attention Network (DAN), responsible for the collaborative ventral and dorsal streams of attention, are especially attended to. The SN is the basis for the "bottom-up" view of attention, which draws attention to unexpected or anomalous stimuli, while the DAN, or "top-down" view, is the locus of directed, conscious allocation of focus. Attention deficits are hallmark symptoms of autism, with atypical development of the SN and DAN being cited as reasons for the impairment [29]. Finally, a large number of regions from the Default Mode Network (DMN) and from sensory regions of the Somatomotor Network (SMN) are highlighted, which likely correspond to the social and sensory processing deficits associated with ASD, respectively [3,30].
In analyzing the temporal attention results, we use k-means clustering to group the dFC information of all subjects. We effectively partition the set of fMRI timeseries into k "brain activity states." Fol-1 https://github.com/jamiesonor/imagin lowing the methods of [31], we take the set of all attended timepoints T such that each attended timepoint is at least one standard deviation greater than the average temporal attention score ztime ∈ [0, 1] T across each layer, and we set the number of clusters k to 3. Removing the unattended timepoints from each subject's sequence of dFC A(t), we assign each subject to their closest cluster. Using the temporal attention scores from the Schaefer atlas, we examine the temporal states of the Dorsal Attention Network (DAN) and Somatomotor Network (SMN) in particular. We calculate the ratio of ASD subjects to healthy controls (HC) assigned to each cluster. It can be observed in Figure 2(b) that for the clusters in which there is hyperactivity in the DAN compared to the SMN, the ratio of ASD to HC is significantly greater than one (1.34). Conversely, when there is hypoactivity in the DAN compared to the SMN, the ratio of ASD to HC is less than one (0.63). This validates previous findings that discovered significant underconnectivity in sensorimotor regions and heightened connectivity in prefrontal and parietal regions among subjects with ASD [1, 2].

CONCLUSION
Overall, we introduce the multi-granular multi-atlas ensemble learning method IMAGIN, and demonstrate state-of-the-art results on this ASD detection task. For future work, we look to exploit the fact that FC patterns change between children and adults [32] in order to weight correct diagnoses for children more heavily. The age distribution of the ABIDE-I dataset is likely much older than if this method were to be tested in a clinical setting, so new techniques would need to be investigated to solve this domain shift problem. With that said, we hope to integrate this automated diagnostic system as part of a new paradigm in autism detection, and bring about a critical reduction in the time to diagnosis.