{'fraction_non_alphanumeric': 0.03326889358449849, 'fraction_numerical': 0.02252394011599155, 'mean_word_length': 4.898700609917793, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, '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}}
Predicting brain-age from raw T 1 -weighted Magnetic Resonance Imaging data using 3D Convolutional Neural Networks

Age prediction based on Magnetic Resonance Imaging (MRI) data of the brain is a biomarker to quantify the progress of brain diseases and aging. Current approaches rely on preparing the data with multiple preprocessing steps, such as registering voxels to a standardized brain atlas, which yields a significant computational overhead, hampers widespread usage and results in the predicted brain-age to be sensitive to preprocessing parameters. Here we describe a 3D Convolutional Neural Network (CNN) based on the ResNet architecture being trained on raw, non-registered T$_ 1$-weighted MRI data of N=10,691 samples from the German National Cohort and additionally applied and validated in N=2,173 samples from three independent studies using transfer learning. For comparison, state-of-the-art models using preprocessed neuroimaging data are trained and validated on the same samples. The 3D CNN using raw neuroimaging data predicts age with a mean average deviation of 2.84 years, outperforming the state-of-the-art brain-age models using preprocessed data. Since our approach is invariant to preprocessing software and parameter choices, it enables faster, more robust and more accurate brain-age modeling.


Introduction
The so-called brain-age paradigm aims to estimate the biological age (Ludwig and Smoke, 1980) of the brain of an individual under the assumption that brain-age may serve as a cumulative marker of disease-risk, functional capacity and residual lifespan (Cole, 2020). Specifically, brain-age models are trained to predict the chronological age of healthy subjects based on structural Magnetic Resonance Imaging (MRI) brain scans. Applying the trained model to brain scans of previously unseen individuals allows the determination of their brain age. A positive brain-age gap -i.e. a higher predicted brain-age compared to chronological age -has been associated with cognitive (Cole et al., 2018) and physiological aging (e.g. grip strength, lung function, walking speed), progression of dementia (Franke and Gaser, 2012;Gaser et al., 2013), mortality (Cole et al., 2018) and a range of neurological diseases and psychiatric disorders (for a review, see (Cole et al., 2019)).
Despite these insights and advances, the wide-spread use of current brain-age models is hampered by the need for extensive preprocessing. This regularly includes image registration, spatial smoothing and normalization to improve the quality and comparability of the data. Preprocessing thus manipulates the original image data e.g. via denoising, bias-correction and affine / non-linear transformations such that the voxels are registered to a standard space and unwanted artifacts are removed. This preprocessing leads to three issues: First, there is a tremendous computational overhead: For example, the preprocessing of the data used in this study took several weeks of CPU time. Second, if models are shared and applied to new datasets these must be preprocessed as well, which hampers widespread usage and clinical application. Third, preprocessing the same data with different software may yield substantially different results. Even seemingly minor updates of the same software tool -often unknown to the user -may affect the results. Likewise, if the preprocessing parameters are altered (e.g. because of different preferences between research institutes), all brain-age models may need to be retrained. Thus, preprocessing is a source for potential distortion of the brain-age predictions and a significant computational expense which reduces the useability of current brain-age models.
In the early years of brain-age research, efficient algorithms such as Support Vector Machines (SVM) and Relevance Vector Machines (RVM) have been used due to limited data and computation.
When large datasets and increased computational performance became available, deep learning approaches such as Convolutional Neural Networks (CNNs) (LeCun et al., 1998) -which already constitute the state-of-the-art in neighboring fields including computer vision -have received increased attention in the brain-age community (Bashyam et al., 2020;Cole et al., 2017;Dinsdale et al., 2021;Hong et al., 2020). Weight sharing which is one main aspect of the CNN architecture enables feature extraction used to be done by the preprocessing to be integrated into the model while being able to fit into memory.
Because of the aforementioned disadvantages of preprocessing and the capabilities of CNNs reducing the preprocessing steps is a recent trend in the brain-age community (Bashyam et al., 2020;Cole et al., 2017;Dinsdale et al., 2021;Hong et al., 2020). In most articles, the preprocessing pipeline has been cut down to skull-stripping followed by voxel-based registration to an atlas. This reduced preprocessing yielded data which could be used by CNNs to model brain-age accurately. However, registration takes up a substantial part of the computation with regard to the preprocessing.
Additionally, as pointed out in (Dinsdale et al., 2021) using nonlinearly registered images to train the CNN can lead to a model that is driven by artifacts of the registration process. One recent study attempted to model brain-age without any preprocessing in N = 220 children between the ages of 0 and 5 years (Hong et al., 2020). In addition to the low age range and low number of training samples, this approach results in the skull not being removed, potentially confounding brain age predictions with bone density and growth unrelated to actual brain aging.
We used an approach that reduced the preprocessing task to the minimum needed, which is skull-stripping. We hypothesize that this approach not only simplifies the use of brain-age models but will improve predictive performance due to less variability introduced by the preprocessing pipeline. The brain-age modeling using the skull-stripped data is done using a 3D CNN based on the ResNet architecture (He et al., 2016). The model is trained on the German National Cohort (GNC) brain MRI dataset (N = 10.691) which includes diverse samples regarding age, gender and scanner sites. To avoid performance overestimation (discussed in (Flint et al., 2019)) cross-validation and transfer learning to three different studies -i.e. BiDirect, FOR2107/MACS and IXI -is applied. The performance and computation times are compared to three state-of-the-art models trained with preprocessed data from the conventional preprocessing pipeline (Hahn et al., 2020). Finally, a bias assessment is done to investigate the influence of gender and ethnicity on the brain-age predictions.

7
BiDirect: The BiDirect Study is a propspective project that comprises three distinct cohorts: patients hospitalized for an acute episode of major depression, patients up to six months after an acute cardiac event and healthy controls randomly drawn from the population register of the city of Münster, Germany. Baseline examination of all participants included a 3 Tesla MRI of the brain, a computer-assisted face-to-face interview on sociodemographic characteristics, medical history, and an extensive psychiatric characterization as well as a collection of blood samples. Inclusion criteria for the present analyses were availability of completed baseline MRI data and sufficient MRI quality. Only data from the healthy control group was used in this study. Further details on the rationale, design and recruitment procedures of the BiDirect study have been described in (Teuber et al., 2017).

Marburg-Münster Affective Disorders Cohort Study (FOR2107/MACS):
Participants -patients and a control group -were recruited through psychiatric hospitals or newspaper advertisements. Inclusion criteria included mild, moderate or partially remitted Major Depressive Disorder episodes in addition to severe depression. Patients could be undergoing inpatient, outpatient or no current treatment.
The FOR2107/MACS was conducted at two scanning sites -University of Münster and University of Marburg. Further details about the structure of the FOR2107/MACS  and MRI quality assurance protocol (Vogelbacher et al., 2018) are provided elsewhere. Inclusion criteria for the present study were availability of completed baseline MRI data with sufficient MRI quality. Only data from the healthy control group was used in this study.

Information eXtraction from Images (IXI):
This dataset comprises images from healthy subjects, along with demographic characteristics, collected as part of the Information eXtraction from Images (IXI) project available for download (https://brain-development.org/ixi-dataset/). The data has been collected at three different hospitals in London (Hammersmith Hospital using a Philips 3T system), Guy's Hospital using a Philips 1.5T system, and Institute of Psychiatry using a GE 1.5T system).
Inclusion criteria for the present study were availability of completed baseline MRI data with sufficient MRI quality.
Beijing Normal University: This dataset includes 180 healthy controls from a community (student) sample at Beijing Normal University in China. Inclusion criteria for the present study were availability of completed baseline MRI data with sufficient MRI quality. Further details can be found online (http://fcon_1000.projects.nitrc.org/indi/retro/BeijingEnhanced.html).

Preprocessing
In order to compare our approach to other models using preprocessing, we require the same data in both conventionally preprocessed and minimally preprocessed formats. For both formats, we additionally consider three different spatial resolutions to investigate its influence on model performances. The highest spatial resolution considered is 134 x 168 x 134 voxels, resulting in a voxel size of 1.36 x 1.30 x 1.36 mm, because this is found to be the average cuboid of voxels which is taken up by the brain in the T1-weighted images in the GNC dataset. For minimal preprocessing, the T1-weighted images only ran through skull stripping, cropping and resampling. The skull stripping is done with the HD-BET brain extraction tool (Isensee et al., 2019) which uses an artificial neural network with an U-Net architecture (Ronneberger et al., 2015) which is specialized for image segmentation tasks. After the skull is removed the brain is cropped and finally this cropped part of the scan is resampled via linear interpolation to the three considered spatial resolutions without registration to a standard space. The minimal preprocessing is done using the implementations of HD-BET (https://github.com/MIC-DKFZ/HD-BET) and fastai_scans (https://github.com/renato145/fastai_scans).
For the processed data, the T1-weighted images are preprocessed with the commonly used

Data Augmentation
Data Augmentation artificially increases the amount of training data which avoids overfitting and yields increased stability of the model. In this paper the data is augmented by cropping the three-dimensional brain-scan (see Figure 1). The size of the cropped image along each dimension ranges from 90% to 100% of the original image and is randomly picked for each dimension individually. After cropping at a random position, oversampling is done via linear interpolation such that the original resolution of the skull stripped T1-scan is restored. Figure 1. Schematic representation of the machine learning pipeline used to predict brain-age from raw, non-registered, skull stripped T1-scans. White rectangles indicate the cropping of the cubic scan before the 3D CNN with the ResNet architecture is applied.

3D CNN (raw data):
The model which predicts brain-age from minimally preprocessed data is a 3D convolutional neural network (CNN) with the ResNet architecture (He et al., 2016) (see Figure 1).
Two blocks, the convolutional and the residual convolutional block, are used repeatedly in this architecture. The convolutional block starts with a convolutional layer which is followed by a rectified linear unit (ReLU) and a 3D batch-normalization layer (Ioffe and Szegedy, 2015). The first convolutional block in the model uses a kernel size of 7 x 7 x 7, a stride of 2 x 2 x 2, a padding of 3 x 3 x 3 and 16 output channels. All the following convolutional blocks which are part of residual convolutional blocks take 16 respectively 32 input channels and use a kernel size of 3 x 3 x 3, a stride of 1 x 1 x 1, a padding of 1 x 1 x 1 and 32 output channels. The first module of the residual convolutional block is the just described convolutional block followed by a convolutional layer and a 3D batch-normalization layer.
The proposed model consists of a convolutional block followed by two residual convolutional blocks. After the convolutional block max pooling is applied with a kernel size of 3 x 3 x 3, a stride of 2 x 2 x 2 and a padding of 1 x 1 x 1. The first residual convolutional block is followed by a convolutional layer, a 3D batch-normalization layer and a ReLU is applied. The second residual convolutional block is activated by a ReLU and followed by the final module which consists of a 1D batch-normalization layer and a dense net with a sigmoid activation function. The 3D CNN using the high resolution of 136 x 168 x 136 voxels consists of 49,820,497 parameters. The corresponding models using medium (68 x 84 x 68 voxels) and low resolution (34 x 42 x 34 voxels) consist of 6,317,905 and 1,015,633 parameters, respectively.

ANN (preprocessed data):
The artificial neural net (ANN) used in this work is fully connected consisting of one hidden layer with 32 nodes. These nodes are activated by a ReLU which is followed by a 1D batch-normalization and a dropout layer (Srivastava et al., 2014).

SVM (preprocessed data):
In this paper the sklearn implementation of the Support Vector Regression (SVR) with default settings and a linear kernel is used (Pedregosa et al., 2011).

Training Procedure
The 3D CNN is trained using the Adam W algorithm to minimize the mean squared error (MSE) using the fastai package (Howard and Gugger, 2020;Kingma and Ba, 2015). Part of this package is the 1-cycle learning rate policy which maximizes convergence by increasing the learning rate to a maximum ηmax during the begin of the training and decreasing it gradually afterwards (Smith, 2018).
Before training, an optimal maximal learning rate ηmax is determined via a mock training during which the learning rate is increased exponentially. As proposed in (Howard and Gugger, 2020), a tenth of the learning rate with the minimal loss is used as the optimal maximal learning rate ηmax. This yields an optimal maximal learning rate of ηmax = .02. The minimum and maximum value of the cyclical momentums used in the 1-cycle method are set to 0.85 and 0.95.

Results
The minimal preprocessing reduces the time needed for data preparation by an order of magnitude. The application of the conventional, CPU-only preprocessing to the GNC dataset takes two weeks on the considered system, a personal computer with a Ryzen 9 5950X Central Processing Unit (CPU) and a RTX 3090 Graphics Processing Unit (GPU). In contrast the GPU supported minimal preprocessing of the same dataset can be done in one day on the same system.
On top of that, the 3D CNN using these minimally preprocessed brain scans with the highest spatial resolution considered (134 x 168 x 134 voxels) achieves the best average mean absolute error (MAE) of 2.84 years in the validation folds during 10-fold cross validation with a standard deviation (std) of 0.05 years (see Table 1). This is a significant improvement (p<.001) compared to the ANN with a MAE of 3.32 years (std=.05) which is the best results of the considered state-of-the-art models using conventionally preprocessed scans. down to ten seconds (low resolution), however yielding high MAEs. To check how well the models can be transferred to other datasets, the models are applied to three independent datasets (N=2,173), namely the BiDirect study, the FOR2107/MACS, and the IXI dataset (IXI) which cover a larger age range than the training data (20 to 86 years vs. 20 to 72 years in the GNC sample) and were acquired on independent scanners and sites. This application shows how additional sources of variability such as different data acquisition protocols, alterations in recruitment or sample characteristics can be learned starting from the model trained on the full GNC dataset. In addition to simply applying the pretrained model to these datasets, transfer learning is done on the respective dataset with the same training routine which is used during the initial training with the GNC dataset. Table 3. Mean Absolute Error for all considered scan resolutions and models which were pretrained on the German National Cohort (GNC) dataset and successively applied to three independent datasets (BiDirect, FOR2107/MACS, and IXI). TL: Models which did undergo transfer learning on respective datasets after pretraining. For both the TL-models, the standard deviation of the MAE during cross-validation is given in parentheses. years, which is better than the RVRs 6.09 years but still worse than the ANNs 4.59 years. The ANN using the preprocessed data shows to predict age most robustly across studies reaching a MAE of as low as 4.03 years for the BiDirect study.

Study
However, when transfer learning is utilized the 3D CNN again yields the lowest MAEs for each study. These low MAEs are always produced by the 3D CNN using the highest resolution scans. The 3D CNNs performance drops faster when compared to the ANN when the resolution of the scans is reduced. In both the BiDirect (N=688) and the FOR2107/MACS (N=924) (Vogelbacher et al., 2018) dataset the 3D CNN still reaches the lowest MAEs of 3.51 (std=.24) and 3.40 years (std=.23) using the medium resolution. But in case of the IXI dataset (N=561) a MAE of 4.15 years (std=.47) is reached which favors the ANN with an MAE of 3.71 years (std=.29). In case of the low resolution the ANN using preprocessed data results in lower MAEs in all the three datasets considered.

Bias Assessment
As machine learning models are not programmed, but trained, they will mimic systematic biases inherent in their training data  . While this potential algorithmic bias must be carefully investigated with regard to performance differences in specific subgroups to determine for which populations it yields robust estimates, it is often neglected in brain-age research (for an indepth discussion, see (Sokol et al., 2019)

Discussion
We showed that using minimally preprocessed brain scans in combination with a 3D CNN improves predictive performance compared to state-of-the-art brain-age models which use preprocessed neuroimaging data. The 3D CNN achieved a MAE of 2.84 years (std=.05) in the GNC dataset including 10,691 men and women aged 20 -72 years. This is a significant improvement compared to the RVR, SVR and ANN model which were trained on preprocessed data and whose best performance is a MAE of 3.22 years (std=.06) achieved by the ANN. The results after transfer learning on three independent datasets confirm the advantage of the 3D CNN in terms of being more adaptive to unseen datasets. However, when the pretrained model is applied to these datasets without transfer learning the models using the preprocessed data show more robust age predictions. This issue could be reduced by incorporating additional data augmentation methods, which aim to match artifacts of different MRI machines such as different noise levels.
Assessment of the model bias showed that the performance of the 3D CNN does not differ substantially between sexes. However, there are biases related to ethnicity and age groups which could be uncovered during the assessment. Transfer learning on the dataset consisting solely of young Chinese citizens showed a much higher standardized MAE. The correlation between BAG and age is a known issue in brain-age research, as the predictions after regression will tend towards the mean of the dataset. To counteract this bias while using these brain-age predictions in further analysis, age should be included as a covariate (for an introduction to age-bias correction approaches in brain-age modeling, see (de Lange and Cole, 2020)).
Regarding the age bias, the model could be improved by using the methods presented in (Smith et al., 2019) that reduced the tendency of the age-prediction towards the mean of the dataset. The ethnicity bias could be mitigated by finetuning the model using datasets with heterogeneous ethnicity. Finally, uncertainty of the brain-age prediction could be estimated using this 3D CNN by pursuing the methods shown in (Hahn et al., 2020).
spending days or weeks on extensive preprocessing of the neuroimaging data. A minimal preprocessing consisting of HD-BET for brain-extraction and cropping to minimize the amount of zero intensity voxels, appears to be sufficient. This minimal preprocessing can be applied to large datasets within one day using a single GPU. Additionally, resampling to lower resolutions can be used to train models on large datasets within minutes while still obtaining reasonable performances and for hyperparameter finetuning of the model. The implementation of the minimal preprocessing, the training routine and the pretrained models is made available at https://github.com/wwummll/fastbrainage. This user-friendly implementation aims to further lowering the barrier for researchers aiming to apply the model to their own dataset.
The analysis was conducted with data from the German National Cohort (GNC) (www.nako.de). The GNC is funded by the Federal Ministry of Education and Research (BMBF) [project funding reference numbers: 01ER1301A/B/C and 01ER1511D], the federal states and the Helmholtz Association with additional financial support by the participating universities and the institutes of the Helmholtz Association and of the Leibniz Association. We thank all participants who took part in the GNC study and the staff in this research program.
The BiDirect Study is supported by grants from the Federal Ministry of Education and Research (BMBF) to the University of Muenster (grant numbers: 01ER0816, 01ER1506 and 01ER1205).