{'fraction_non_alphanumeric': 0.037189315366455346, 'fraction_numerical': 0.017188784848404467, 'mean_word_length': 5.145069274653626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Surface Vision Transformers: Flexible Attention-Based Modelling of Biomedical Surfaces

Recent state-of-the-art performances of Vision Transformers (ViT) in computer vision tasks demonstrate that a general-purpose architecture, which implements long-range self-attention, could replace the local feature learning operations of convolutional neural networks. In this paper, we extend ViTs to surfaces by reformulating the task of surface learning as a sequence-to-sequence learning problem, by proposing patching mechanisms for general surface meshes. Sequences of patches are then processed by a transformer encoder and used for classification or regression. We validate our method on a range of different biomedical surface domains and tasks: brain age prediction in the developing Human Connectome Project (dHCP), fluid intelligence prediction in the Human Connectome Project (HCP), and coronary artery calcium score classification using surfaces from the Scottish Computed Tomography of the Heart (SCOT-HEART) dataset, and investigate the impact of pretraining and data augmentation on model performance. Results suggest that Surface Vision Transformers (SiT) demonstrate consistent improvement over geometric deep learning methods for brain age and fluid intelligence prediction and achieve comparable performance on calcium score classification to standard metrics used in clinical practice. Furthermore, analysis of transformer attention maps offers clear and individualised predictions of the features driving each task. Code is available on Github: https://github.com/metrics-lab/surface-vision-transformers

Recently, Dosovitskiy et al. proposed the Vision Transformer, which sought to extend the use of self-attention transformer architectures, used in Natural Language Processing (NLP), to imaging data, by treating computer vision tasks as a sequence-to-sequence learning problem. In [23], RGB images were split into a grid of 16 × 16 × 3 non-overlapping patches, forming a sequence that was passed to a vanilla transformer encoder [24] for image classification. Results showed that the ViT was able to offer a scalable solution that outperformed comparable CNNs when pre-trained on very large datasets. Lately, many improvements in the architecture have been proposed [25], leading to vision transformers now being considered as generic vision backbones for a broad range of tasks including image classification [25], [26], detection [27] and segmentation [28].
In this paper we propose a Surface Vision Transformer (SiT), which extends the ViT to general surfaces through proposing mechanisms for surface patching. In particular, we extend from previous work [29], in which the method was validated on neurodevelopmental phenotype prediction using cortical surface data from the Developing Human Connectome Project (dHCP), to also investigate fluid intelligence prediction using multimodal cortical imaging data from the Human Connectome Project (HCP) [6], [7], and prediction of high coronary artery calcium score (a risk biomarker highly predictive of cardiovascular disease) using cardiac meshes from the Scottish Computed Tomography of the Heart (SCOT-HEART) trial [30].
Surface deep learning architectures offer important opportunity for cortical applications since human brain morphology and functional topography varies considerably across individuals, in ways that violate the assumptions of traditional image registration [7], and thereby limit the sensitivity of populationbased comparisons. Since cortical surface representations encode more biologically meaningful geodesic distances between cortical areas [6], [8], [9], [31], they are able to support more precise comparison of features of cortical micro and cyto-architecture [7], [10], shape [22] and function [7], [22]. This is important since changes to cortical organisation are implicated in numerous neurological [16], [17], psychiatric [18], [19] and developmental disorders [20], [21]. Equally, surface-based cardiac models are essential for characterising the biomechanical properties of the atria and ventricles, for instance in patients with suspected coronary artery disease [1].
Recently, [32] benchmarked a number of geometric deep learning (gDL) methods on cortical phenotype regression and segmentation, and found that these methods typically involve trade-offs between computational complexity, feature expressivity, and rotational equivariance of the models. The objective of this paper is to propose the SiT as a competitive alternative to these frameworks. The key contributions of this paper, relative to [29], are as follows: • We demonstrate two general frameworks for sequence-tosequence modelling of biomedical surfaces, which patch surfaces either via projection to a regularly tessellated icosphere, or through use of a finite element model [3]. • Surface Vision Transformers (SiT) are compared against geometric CNNs and traditional machine learning and demonstrate competitive results over a diverse range of cortical and cardiac prediction tasks. • We extend beyond [29] to improve optimisation through data augmentation and show this leads to significant gains for the challenging task of birth age prediction. • Maps of attention extracted from the SiT encoder are displayed on the input space for the fluid intelligence task, to demonstrate that SiTs can generate interpretable visualisations of the key features driving each task.

A. Geometric Deep Learning
Geometric deep learning (gDL) is a field that seeks to translate concepts from Euclidean deep learning, to non-Euclidean manifolds such as graphs, surfaces or point clouds. Studying surfaces is particularly challenging as many gDL frameworks would in principle be suitable for studying mesh topologies, including: graph convolutional networks [33], which learn convolutions in the graph spectral domain, through polynomial approximation of the eigenvectors of the graph Laplacian; spherical spectral CNNs which fit convolutions using spherical harmonics or Wigner-D matrices [34]; spatialtemplating approaches, which approximate Euclidean CNNs by fitting spatially localised filters to the surface [35], [36]; and point cloud networks, which take coordinates as inputs and process data using multiple shared multi-layer perceptron units, followed by a permutation invariant function, to learn global feature vectors that can then be used for classification. Recent work [32] showed that each architecture generates very different solutions to the same biomedical problem, with variable performance across different tasks.

B. Attention
The concept of attention was introduced to the domain of Natural Language Processing (NLP), in the context of neural machine translation, to solve the bottleneck present in Recurrent Neural Networks (RNN) that limits the flow of contextual information in long sentences. Attention was first implemented in the decoder part of RNNs, by learning output tokens that weight the contribution of different words from the input sequence, in such a way to selectively focus on the most meaningful content [37], [38]. Subsequently in [24], Vaswani et al introduced the self-attention (SA) mechanism of transformers, which further improved the modelling of longrange dependencies in sequences by relating all elements in each sequence via a pairwise alignment score (a scaled dotproduct in [24]). Despite the quadratic complexity of such an operation (O(n 2 ) with n the sequence length), transformers have become the de-facto architecture in NLP leading to major breakthroughs in language understanding with the BERT model [39] and GPT models [40], [41], as notable examples.
In contrast, computer vision and medical imaging have mostly been pushed forward by developments in CNNs, where the locality and weight sharing properties of the convolution operation have created sample-efficient architectures that can generalise to a broad range of tasks. However, this inductive bias towards locality also has drawbacks, since it induces a limited receptive field that impairs the modelling of long-range spatial dependencies between distant parts of an image. This prevents CNNs from efficiently modelling processes that are diffuse in space and/or time; something that is known to be true for a wide range of biomedical applications, including multiorgan segmentation [42], cognitive and neurodevelopmental modelling [10], [43] and estimation of the spatio-temporal dynamics of the heart [3], [44].
As a result, many attempts were made to introduce some add-on form of attention mechanisms into CNNs, as a way to incorporate more informative features across images. In one of the first examples, applied to video classification, [45] proposed a non-local block that computed self-attention for CNN feature maps, by estimating the dot-product similarity of activations across all map locations, as a way to aggregate non-local information. Limited by the quadratic cost of such operations at a pixel-level, these attention maps were only computed at low-resolution. Such non-local attention block modules have been inserted into the encoders of U-Net-like medical imaging segmentation architectures for vertebrae [46] and brain segmentation [47]. Similarly, attention-gate mechanisms have been developed, which identify the most salient regions in CNN feature maps, to increase their contributions to the learning process [48]- [50]; and Squeeze and Excitation blocks have been implemented for dynamic channel-wise feature recalibration, used for natural image classification [51], and adapted to improve 2D-slice brain segmentation in [52].
Regardless, any use of attention blocks within CNNs remains inherently limited by the inductive biases that limit the learning of long-range associations. Therefore, in the Vision Transformer [23] Dosovitskiy et al. proposed a paradigm shift, in which they suggested image recognition tasks should be reformulated as a sequence-to-sequence learning problem. By doing so, they showed that general-purpose transformer architectures [24] could be used for natural image classification; thereby demonstrating the benefits of using self-attention on image patches to improve modelling of global-context without relying on strong spatial priors. Since then, the performance of end-to-end Vision Transformers has challenged even highly optimised CNNs for image classification [25], [26], [53], [54], object detection [55], semantic segmentation [28] and video understanding [56].
Similarly in medical imaging, recent years have seen emergence of many vision transformers models replacing CNNs. Such models have demonstrated enhanced global context, leading to both qualitative and quantitative improvements for histopathology [57] and brain tumor segmentation [58], [59], tumor classification [60] and polyp detection [61]. Pure (endto-end) transformers have even shown advantages over CNNs in the low-data regime for brain segmentation [62]. While, development of transformers for 3D data is challenging due to the quadratic cost of self-attention, it may be mitigated by the use of hybrid architectures that combine transformer encoders with CNNs layers [58], [61], [63], or through use of efficient transformer architectures with revised self-attention operations, used for medical imaging tasks such as [59], [63].

A. Architecture
The SiT models translate surface understanding to a sequence-to-sequence learning task by reshaping the high- ). The positional embedding is added to encode spatial information about the sequence of patches. While E pos can be fixed or trainable, here it is implemented in the form of a 1D learnable weights, similar to the approach employed in [23].
The SiT generates patches from any regularly tessellated reference grid that supports down-sampling. For the cortical applications, this is achieved by imposing a low-resolution triangulated grid, on the input mesh, using a regularly tessellated icosphere (Fig 1(b)). For cardiac applications, this is achieved by subdividing a control mesh twice using the Catmull-Clark algorithm (Fig 2). More details are provided in Section III-C.
The architecture of the SiT is illustrated in Figure 1. The SiT network is made of L consecutive transformer encoder blocks of Multi-Head Self-Attention (MHSA) and Feed Forward Network (FFN) layers, with residual layers in-between: Following standard practice in transformers, LayerNorm [64] is used prior to each MSHA and FFN layer (omitted for clarity in Eq 1). In the last output sequence, the regression token X (L) 0 is used as input to the final Multi-Layer Perceptron (MLP) for prediction.
Following [29], the proposed SiT model builds upon two variants of the data efficient image transformer or DeiT [53]: DeiT-Tiny, DeiT-Small, adapted into smaller versions from the vanilla Vision Transformer (ViT) [23]. A number of L = 12 layers or transformer encoder blocks is used for all SiT versions; however, they differ in their number of heads, hidden size or embedding dimension D, and in the number of neurons (MLP size) in the FFN. In Table I, details about the architectures are provided. The number of parameters in Table  I corresponds to the configuration for the dHCP dataset, as the size of the first linear layer depends on the number of vertices and channels of the patches, and therefore the overall number of parameters. As a comparison, with the 115 channels for the HCP cortical surface a SiT-tiny has 8.6M parameters.

Models
Layers Heads Hidden size D MLP size Params.

B. Multi-Head Self Attention and Feed Forward Layers
The mechanism of self-attention is based on the computation of attention weights/scores between tokens in a sequence, to capture the relative importance of patches. For all Multi-Head Self-Attention layers (MHSA) layers, patches in the sequence are linearly projected into a triplet, Query, Key, and Value (Q, K, V ∈ R (N +1)×D ), such that: are estimated from the inner product: ω i,j = q i , k j , between the query (q i ) of patch i, and keys from all patches (k j , ∀j ∈ 0, N ). After scaling, a softmax layer is applied along rows to derive the self-attention weight where an illustration of the MHSA layer is provided in Fig 1. Finally, the output sequence SA (l) (Q, K, V ) ∈ R (N +1)×D is obtained by weighting columns V based on the self-attention weights.
The Multi-Head Self-Attention layers (MHSA) run multiple self-attention operations in parallel on subdivided part of the input embedded sequence in order to capture different interactions between tokens in the sequence. In practice, it means that the input sequence of dimension D is divided into sub-parts of dimension D h = D/h and each head processes its own triplet (Q h , K h , V h ), such that: Outputs of the MHSA heads of dimension (N +1)×D h are concatenated together along the channel dimension and then linearly projected to preserve the sequence dimension D, with a residual connection: Each MHSA layer is then followed by a Feed Forward Network, which consists of a succession of Layer norm, two linear layers with GeLU activation and dropout. The linear Layer expands the dimension of the sequence of patches to 4 × D then reduces it to D.

C. Surface Patching
Surface patching is implemented differently for the cortical and cardiac domains. For the cortex, all imaging data were first projected to a sphere as part of the dHCP [65] and HCP [6] pipelines. Spherical data were then resampled onto a regular sixth-order icosahedron with 40,962 equally spaced vertices using barycentric interpolation, then split into triangular patches, where each patch corresponds to all data points within one face of a second-order icosphere (153 vertices per patch). The sequence is thus made of 320 non-overlapping patches sharing only common edges ( Fig. 1 (a-c)).
By contrast the cardiac mesh is a non-closed surface, including inner (endocardial) and outer (epicardial) surfaces for the left and right ventricles. Illustration of the mesh is provided in Fig. 2. Coronary computed tomography angiography (CCTA) images part of the SCOT-HEART trial [30] were first segmented using a neural network algorithm [4] and then biventricular meshes were fitted to the surface points extracted from the segmentation results by deforming a finite element model [3]. The biventricular subdivision surface model was initiated with a control mesh consisting of 388 vertices and 180 elements. A final mesh was obtained after subdividing the control mesh twice using the Catmull-Clark algorithm, giving 5 × 5 = 25 vertices for each surface patch [2] as shown in Figure 2, redrawn from [2]. This resulted in a template mesh of 354 patches, where patches were subsequently merged in pairs to generate 177 larger patches (with 50 vertices per patch) which were then used for training.

D. Optimisation
To mitigate the lack of inductive biases in the architecture, transformers typically require large training datasets. In this paper, we therefore explore techniques for improving model generalisation: specifically pre-training and augmentation. 1) Pretraining: is performed through self-supervision, implemented as a masked patch prediction (MPP) task, following the approach proposed in BERT [39]. This consists of corrupting some input patches at random, then training the network to learn how to reconstruct the full corrupted patches. In this setting, we corrupt at random 50% of the input patches, either replacing them with a learnable mask token (80%), another patch embedding from the sequence at random (10%) or keeping their original embeddings (10%). To optimise the reconstruction, the mean square error (MSE) loss is computed only for the patches in the sequence that were masked.
2) Data augmentation: In extension to previous work [29] we additionally propose to augment the icosahedral patch selection by implementing ± {5 • , 10 • , 15 • , 20 • , 25 • , 30 • } rotations of the sphere around one of the x,y,z axis. These are implemented for HCP and dHCP experiments. Further optimisation strategies tailored for the specific datasets are presented in the corresponding sections.

E. Visualisation
Attention maps can be visualised on the input space by aggregating the attention weights across all transformer layers. To do so, here, the final attention weight matrix is W K is recursively multiplied to the attention weight matrices of previous layers ( A (l) l=(L−1)...1 ). The identity is added to all attention matrices A (l) to take into account the contributions of the residual connections. The attention maps presented in Fig. 3 were then obtained by extracting and normalising the first row of the resulting matrix, corresponding to the vector of attention scores between the classification/regression token and all other tokens in the sequence. This vector can be resolved at resolution ico2 and upsampled to resolution ico6 to support comparison to the original data. As a different attention weight matrix is available per layer, but also per head A (l) h , we repeat this procedure to extract attention-maps for each head. As each transformer head being run in parallel, the self-attention operation should attend to different parts of the input sequence.

IV. RESULTS
We evaluate the performance of the SiT methodology on three tasks; 1) prediction of postmenstrual age at scan and gestational age at birth using neonatal data from the developing Human Connectome Project (dHCP) [66], 2) prediction of fluid intelligence scores from the Human Connectome Project multimodal parcellation dataset (HCP) [6], [7], and 3) classification of cardiac surfaces between high and low coronary artery calcium score (CACS) from the Scottish Computed Tomography of the Heart (SCOT-HEART) dataset [30]. All experiments were run using an NVIDIA RTX 3090 24GB GPU.
A. dHCP experiments: Scan age and Birth age predictions 1) dHCP Dataset: Data for this experiment corresponds to cortical surface meshes and metrics, derived from the third release of the developing Human Connectome Project (dHCP) [66]. Surfaces were extracted from T2-and T1weighted Magnetic Resonance Imaging (MRI) scans using the dHCP pipeline [65]- [69]. Briefly, T2w and T1w scans were motion and bias corrected, brain-extracted, and segmented, using the the Draw-EM [70] algorithm, which parcellates scans into 9 tissue types: including cortical grey matter and 3 categories of white matter. White matter masks were then fused, a topology correction step was implemented and surfaces were generated through an iterative process of inflation and smoothing. Among the various surface-based features generated by the pipeline, four cortical surfaces metrics were used in this work: sulcal depth, curvature, cortical thickness and T1w/T2w myelination. Data were registered using the Multimodal Surface Matching algortihm [8], [9] to the leftright symmetric 40-week sulcal depth template from the dHCP spatiotemporal cortical atlas [22], [71]. Subsequently, surfaces were then resampled to a sixth-order icosahedral mesh of 40,962 equally spaced vertices. Experiments were run on both template-aligned data and unregistered (native) data, and train/test/validation splits parallel those used in [32].
A total of 588 images were utilised, acquired from term (born ≥ 37 weeks gestational age, GA) and preterm (born < 37 weeks GA) neonatal subjects, scanned between 24 and 45 weeks postmenstrual age (PMA). Some of the preterm neonates were scanned twice: once after birth and again around term-equivalent age. The proposed framework was benchmarked on two phenotype regression tasks: prediction of postmenstrual age (PMA) at scan, and gestational age (GA) at birth, where since the objective was to model PMA and GA as markers of healthy development, all preterms' second scans were excluded from the PMA prediction task, and all first scans were excluded from the GA regression task. This resulted in 530 neonatal subjects for the PMA prediction task (419 term/111 preterm), and 514 neonatal subjects (419 term/95 preterm) for the GA prediction task.
2) Training: The task of GA prediction is arguably more complicated than the PMA task, as it is run on scans acquired around term-equivalent age (37−45 weeks PMA) for both term and preterm neonates, and therefore is highly correlated to PMA at scan. Previous work by [32] have shown the benefit of deconfounding the scan age for the task of birth age prediction, where for all gDL methods an additional 1D convolution was used to incorporate scan age as a confound, before the last fully connected layer used to make the birth age prediction. Here, a deconfounding strategy was employed where the scan age information was incorporated into the patch sequence by adding an extra embedding to all patches in the sequence before the transformer encoder. This was implemented using a fully connected network to project scan age to a vector embedding of dimension D after batch-normalisation [72].
The dHCP dataset is heavily unbalanced with more term babies than preterm babies. In extension to previous work, this class imbalance was addressed by adapting sampling during training. Subjects were split into 3 categories, which reflect the clinical subcategories of preterm birth [73]: over 37 weeks, between 32 and 37 and below 32 weeks. The original ratio of examples in each of these three categories was 1/7/11. In all instances, the proposed transformer networks were compared against the best performing surface CNNs reported in [32]: Spherical U-Net [35], MoNet [36], GConvNet [74], ChebNet [33] and S2CNN [34]. Since the best performance in [32], and presented in Table II, was achieved using data augmentation (with non-linear warped surface meshes augmentation), we extend from [29] to further investigate whether data augmentation would improve generalisation. We also investigated the stability of the model by reporting the standard deviation over 3 runs. Best performances were obtained by using SGD optimiser for all PMA tasks and for the task of GA with augmentation and Adam for the GA task without augmentation. A batch size of 256 was used for SiT-tiny and 128 for SiT-small.
3) dHCP Results: Results for the tasks of PMA at scan and GA at birth are reported in Table II. The results for SiT-tiny and SiT-small are reported under a range of training conditions: 1) following training from scratch or using pretraining; 2) with and without augmentation (in this case adaptive sampling and rotations). All SiT models were trained from scratch for 2,000 iterations and following pre-training for 1,000 iterations.
Overall, SiT-tiny and SiT-small configurations consistently outperformed two of the gDL methods (GConvNet and Cheb-Net), with SiT-small returning the best performances overall for the tasks of PMA-template and GA-native. On average for both tasks, 6/8 SiT training configurations achieved prediction errors less than 1.00 MAE and outperformed all the gDL methods, with the best averaged performance for SiT-small pretrained and augmented with 0.89 MAE compared to the best gDL model, MoNet with 1.05 MAE.
For the task of PMA, the best performing SiT configurations were obtained with SiT-small pretrained, for both template and native configurations: 0.55/0.63. These results are competitive with MoNet: 0.57/0.61 (the best performing gDL network). The use of data augmentation did not improve the performance of SiT models for this task but seems to reduce the variance across runs, especially for the native configuration.
The gain in performance following data augmentation is particularly noteworthy for the task of birth age prediction (GA-deconfounded). For all SiT configurations (except SiTsmall trained from scratch) the use of data augmentation greatly boosted performance, while reducing the variance, returning an average of 0.29 MAE improvements across all four SiT augmented configurations. With data from native space, augmentation consistently improved results (by at least by 0.16 MAE) relative to the best performing gDL model for this sub-task, S2CNN with 1.52. The best performances were obtained for rotations in the range ± {5 • , 10 • }. Bigger rotations appeared to limit the gain in performance but would probably have benefited from training for more iterations.
Finally, across all tasks, performances of SiT models are much more consistent. For example, relative to Spherical U-Net, which is the best performing network on aligned surfaces, SiT performs much better on native data, dropping only from 1.02 (for template PMA) to 1.21 (for native PMA) whereas Spherical U-Net drops from 0.85 to 2.16 MAE. The drop in performance on this task is known to be related to Spherical U-Net's lack of rotational equivariance [32]. Likewise between the tasks of PMA and GA prediction, the SiT shows a much lower drop in performance for the GA task than MoNetwhich although rotationally equivariant (and therefore consistent on native and template domains) learns less expressive convolutional filters, parameterised as a mixture of Gaussians.
B. HCP experiments: Fluid intelligence predictions 1) Dataset: Data from 446 healthy individuals scanned as part of the HCP were used. Acquisition and minimal preprocessing pipelines are described in [6]. Cortical metrics correspond to the 115 features used for the HCP multimodal parcellation (MMP) [7] and include cortical thickness, T1w/T2w myelin, curvature, as well as 20 task fMRI maps and 77 resting state fMRI maps (derived from group ICA followed by weighted dual regression), a mean task-fMRI activation map and 9 visuotopic maps derived from weighted regression of hand-engineered retinotopic spatial maps, and 5 artefact maps. For more details on feature generation and pre-processing see [7].
2) Training: The performance of the SiT was benchmarked for the task of fluid intelligence prediction -evaluated from the number of correct responses to the Penn progressive matrices (PMAT) task. To prevent mixing of data across families, examples were split into five folds, keeping all members of a family within a single fold.
Best performance was achieved through implementing strong regularisation to prevent overfitting. A dropout of 0.5 was used before the first linear embedding and dropout of 0.3 was used in the FFN. For each split, models were trained for 200 iterations, as more iterations lead to overfitting, using a batch size of 128. Best correlation scores were obtained with the use of an SGD optimiser and a learning rate of 5e −4 . Data were augmented with rotations of the cortical surface and adaptive sampling, specifically by oversampling the subjects with low fluid intelligence scores, who were under-represented in the dataset. However, such augmentation did not strongly improve performance for this task.
Since fluid intelligence is most commonly estimated from functional brain connectivity, the method was compared against a spatio-temporal graph convolution neural network MS-G3D [75] which was adapted to the analysis of cortical connectomes in [76]. Functional data for this model comes from the first session (15mn -1200 frames -0.72s/frame) of the Human Connectome Project (HCP) S1200 release where individual-subject node timeseries were derived following group-wise independent component analysis (Group-ICA) and dual-regression [77], [78] to spatial maps (functional nodes, 15 to 300) and associated time courses. The MS-G3D was trained on functional connectivity matrices, derived from the correlation of ICA nodes' timeseries, where the results reported here deviate from what was reported in [76], since this paper uses a only subset of the full HCP dataset (446/1003) corresponding to the datasets for which HCP multimodal parcellations are also available. Models were trained for 2000 iterations, and optimised with Adam and a learning rate of 3e −4 , with a batch size of 128. Best performance was achieved for an ICA dimensionality of 100.

Methods Correlation
MS-G3D-ICA100 [76] 0.26 ± 0.08 SiT-tiny 0.35 ± 0.03 3) Results: The task of fluid intelligence prediction from high resolution cortical metrics is highly challenging as models must relate complex sources of information that are distributed across the whole brain. This need for long-range context should therefore benefit from self-attention.
Results in Table III, demonstrate that the SiT outperformed the spatio-temporal graph network MS-G3D, on the subset of 446 subjects used for this experiment. This score of 0.35 also outperforms the results for MS-G3D in [76] that report mean correlation of 0.325 across 5 folds, when trained on the full HCP dataset (1003), and compare strongly against other results in the literature [79], [80]. The attention maps, shown in Figure 3, visualise the regions most attended to during prediction for two individuals that each had high and low fluid intelligence scores respectively, and were correctly predicted by the model. In both cases, attention focuses on association areas in the frontal and parietal lobes. This aligns with theory since these areas reflect regions most evolved relative to non-human primates. The combined attention to frontal and parietal regions, observed particularly for the subject with high intelligence, reflects previous studies [81] which suggests interactions between these spatially-distant regions are important for working memory. .
C. SCOT-HEART experiments: high calcium classification 1) Dataset: Data for this experiment consisted of biventricular surface meshes, comprising endocardial and epicardial surfaces of the left ventricle (LV) and right ventricle (RV), customised to patients with suspected coronary artery disease, who participated in the Scottish Computed Tomography of the Heart (SCOT-HEART) trial [30]. We used coronary artery calcium score (CACS) as a surrogate biomarker, since it is known to be highly predictive of adverse cardiovascular events and associated with changes in heart geometry (mass and volume) [82], [83]. Relationships between heart geometry and cardiovascular risk factors inform mechanisms of heart disease and suggest treatment plans [3]. A healthy sub-cohort was identified as 248 participants with CASC < 300 AU, bodymass index < 30 kg/m2, no evidence of obstructive coronary artery disease on CCTA, and no documented hypertension, smoking history or diabetes mellitus. A high CACS sub-cohort was identified as CACS > 300 AU with 367 participants. Figure 2 (b) shows an element of the coarse mesh and for each element endocardial and epicardial surfaces there are 25 × 2 = 50 corresponding vertices from the final mesh.
2) Training & Results: The performance of the SiT was benchmarked for the task of cardiac mesh classification between healthy and high CASC against a baseline logistic regression model, using standard LV and RV volumes and LV mass as predictors, with five-fold cross-validation. A mean cardiac shape was constructed using Procrustes alignment and the displacement of the biventricular meshes from the mean shape (dx, dy, dz) and the wall thickness (t) forms the 4 feature channels used for the SiT models. Models were trained using five-fold cross validation and best performance was achieved using Adam optimiser and a learning rate of 3e −4 .

Methods AUC
Logistic regression 0.750 SiT-tiny 0.738 ± 0.04 SiT-small 0.742 ± 0.03 Best performances (reported in Table IV) were obtained using the larger patches of 50 vertices. SiT models with smaller patches overfit dramatically, and would probably benefit from specific data augmentation and adaption of the embedding dimension to account for the small number of vertices in the patch sequence. SiT models obtained good performances using mesh displacement and wall thickness, similar to the ones obtained with logistic regression used as standard clinical metrics.

V. DISCUSSION
In this paper, we build from [29], to show that SiTs can improve over convolutional gDL frameworks, in terms of both performance and interpretability. The potential of the proposed framework was validated across a range of domains and tasks.
Results from experiments on dHCP phenotype regression, show that the SiT performs competitively with the best performing gDL networks, on data that has been pre-aligned, and shows far less drop in performance on unregistered data, relative to the best performing gDL network (Spherical U-Net [35]). This suggests that SiT is able to encode a degree of transformation invariance, which was further enhanced (relative to [29]) by training with augmentations. As a result, SiT-small returned the best performance of all networks on the challenging GA prediction task and lowest error across all tasks. Likewise, for HCP fluid intelligence regression, the SiT trained on cortical imaging data strongly outperformed a graph convolutional network trained only on functional connectomes.
At the same time, when validated on the fluid intelligence task, the SiT returned highly interpretable individualised attention maps, which highlighted regions already known to be highly important for working memory [81]. These results parallel the visualisation of PMA prediction in [29], which demonstrated the model was attending to a diffuse range of brain regions known to be associated with early neonatal cortical maturation.
Beyond cortical surface analysis, this paper extended the icosahedral patching methodology of [29], to propose an alternative framework for patching non-closed surfaces that leverage finite element models. This approach was validated for cardiac mesh models by classifying calcium levels (as a biomarker of cardiovascular risk) from mesh features associated with cardiac shape and wall thickness. Results showed that the relationship with cardiac shape captured by SiT was similar to standard measures of cardiac mass and volume used in standard clinical practice. Nevertheless, future work would look to extend the features utilised by the SiT, for example to include measures of wall curvature, biomechanical measures of wall strain, or explore motion in space and time, to support computation of a risk score with improved prognostic significance.
While performance gains were shown for the SiT through pre-training [23], [53], regularising and incorporating data augmentation, the model still overfitted on the relatively small datasets of the HCP fluid intelligence task and the SCOT-HEART trial. It is possible that the domain gap between natural and medical imaging impacts the potential gains of pretraining strategies. Specific schemes for pre-training medical transformers and adapted losses have been shown to improve performance [42], [84], specifically for 3D medical segmentation, where tailored proxy tasks of self-supervision improved the learning of the underlying pattern of human anatomy, and achieved state-of-the-art results on multi-organ segmentation datasets [42].
Finally, while the presented results clearly emphasise the advantages of modelling long-range dependencies for biomedical surface applications, in some cases, the lack of inductive biases of transformers have been shown to impair their learning [54]. Lately, therefore some studies have been reintroducing forms of inductive biases in end-to-end vision transformer architectures, reusing some concept of locality from convolutions.
With Hierarchical Transformers, Liu et al [25] introduced local forms of attention with sliding windows and improved on the limitations of the vanilla ViT for more complex tasks such as detection or semantic segmentation [25], [26]. Such hierarchical approaches, like the Swin Transformer [25], have also been used to surpass the ViT for 3D brain segmentation tasks [59].