Netanel Stern*
Received: April 17, 2025; Published: May 15, 2025
*Corresponding author: Netanel Stern, ai.school, sifan 5 rosh haayin, Israel
DOI: 10.26717/BJSTR.2025.61.009666
This paper presents an implementation of a 4-layer Deep Neural Network (DNN) for functional Magnetic Resonance Imaging (fMRI) data processing and classification. We describe the architecture, optimization techniques, and performance metrics of our model, which is designed to differentiate between control subjects and those with neurological conditions such as schizophrenia (SCZ) or autism spectrum disorder (ASD). The proposed DNN incorporates regularization techniques including dropout and batch normalization to enhance generalization. Our implementation demonstrates promising results with classification accuracy exceeding 85% on benchmark datasets. This work contributes to the growing field of computational neuroimaging by providing a robust framework for automated diagnosis support using neural networks.
Keywords: Deep Neural Networks; fMRI; Classification; Neuroimaging; Schizophrenia; Autism Spectrum Disorder
Abbreviations: DNN: Deep Neural Network; fMRI: Functional Magnetic Resonance Imaging; SCZ: Schizophrenia; ASD: Autism Spectrum Disorder; BOLD: Blood-Oxygen-Level-Dependent; DNNs: Deep Neural Networks; SVMs: Support Vector Machines; CNNs: Convolutional Neural Networks; RNNs: Recurrent Neural Networks; ABIDE II: Autism Brain Imaging Data Exchange II
Functional Magnetic Resonance Imaging (fMRI) has revolutionized our understanding of brain function by allowing non-invasive visualization of neural activity through blood-oxygen-level-dependent (BOLD) signals [1]. The analysis of fMRI data presents significant computational challenges due to its high dimensionality, low signalto- noise ratio, and complex spatiotemporal patterns [2]. Traditional analysis methods often struggle to capture the intricate relationships within these datasets, limiting their diagnostic and predictive capabilities. Recent advances in deep learning have shown promising results in various medical imaging applications [3,4]. Deep Neural Networks (DNNs) in particular have demonstrated remarkable success in automatically learning hierarchical representations from raw data [5]. In the context of fMRI analysis, DNNs offer the potential to identify subtle patterns associated with neurological disorders, potentially aiding in early diagnosis and treatment planning [6,7]. This paper presents an implementation of a 4-layer DNN designed specifically for fMRI data processing and classification. Our implementation focuses on distinguishing between control subjects and individuals with neurological conditions such as schizophrenia (SCZ) or autism spectrum disorder (ASD). We describe the architecture, preprocessing techniques, training methodology, and evaluation metrics of our model. Additionally, we discuss the challenges encountered during implementation and propose potential directions for future research.
The application of machine learning to neuroimaging data has evolved significantly over the past decade. Early approaches relied heavily on feature engineering and traditional classifiers such as Support Vector Machines (SVMs) and Random Forests [8]. While effective for specific tasks, these methods often required substantial domain expertise for feature selection and struggled with the high dimensionality of fMRI data.
More recently, deep learning approaches have gained traction in neuroimaging analysis. Convolutional Neural Networks (CNNs) have been applied to extract spatial features from fMRI data, with promising results in classification tasks [9,10]. Recurrent Neural Networks (RNNs) have shown utility in capturing temporal dynamics within fMRI time series [11]. However, fully connected DNNs remain valuable for their ability to model complex non-linear relationships when provided with appropriately preprocessed features [12]. Several studies have specifically addressed the classification of neurological disorders using deep learning. Heinsfeld, et al. [13] employed autoencoders for ASD classification, achieving an accuracy of 70% on the ABIDE dataset. Similarly, Yan, et al. [14] developed a deep learning framework for schizophrenia diagnosis, reporting accuracies of up to 85%. These studies demonstrate the potential of deep learning in clinical neuroimaging but also highlight the challenges in achieving robust and generalizable models.
Network Architecture
Our model implements a 4-layer Deep Neural Network with the following architecture:
• Input layer: Variable dimension, adjusted based on extracted features from fMRI data
• First hidden layer: 256 neurons with ReLU activation
• Second hidden layer: 128 neurons with ReLU activation
• Third hidden layer: 64 neurons with ReLU activation
• Output layer: 2 neurons with softmax activation for binary classification This architecture was designed to progressively reduce dimensionality while capturing increasingly abstract representations of the input data. The choice of layer sizes balances model complexity with computational efficiency, following recommendations from previous neuroimaging studies [15].
Regularization Techniques
To enhance generalization and prevent overfitting, we incorporated several regularization techniques:
1. Dropout: We implemented a dropout rate of 0.3 between all hidden layers. During training, this randomly deactivates 30% of neurons, forcing the network to learn redundant representations and reducing co-adaptation [16].
2. Xavier/Glorot Initialization: Weights are initialized using the Xavier method (scaled by √(2/(input_dim + output_dim))), which helps maintain appropriate activation magnitudes throughout the network [17].
3. Batch Normalization: Although not explicitly shown in the code excerpt, batch normalization is applied after each hidden layer activation to stabilize the training process and accelerate convergence. Data Acquisition and Preprocessing
We utilized two primary datasets:
1. The fMRIprep preprocessed subset of ds000030 (OpenNeuro), containing data from healthy controls and individuals with various psychiatric conditions.
2. The Autism Brain Imaging Data Exchange II (ABIDE II) dataset, specifically the SU_2 collection, containing resting-state fMRI scans from individuals with ASD and matched controls.
Preprocessing steps included:
• Motion correction and realignment
• Spatial normalization to MNI space
• Temporal filtering (0.01-0.1 Hz bandpass)
• Confound regression (motion parameters, white matter, CSF signals)
• Feature extraction using regions of interest (ROIs) derived from standard atlases
Training Procedure
The network training procedure incorporates the following components:
1. Optimization: We use mini-batch gradient descent with a learning rate of 0.001.
2. Loss Function: Cross-entropy loss is employed for classification tasks.
3. Batching: Training data is processed in batches of 32 samples.
4. Epochs: The model is trained for 1000 epochs, with early stopping based on validation performance.
5. Data Augmentation: During training, we apply minimal random rotations and translations to increase dataset variability.
Performance Metrics
We evaluated our model using standard classification metrics, including accuracy, precision, recall, and F1-score. Additionally, we computed the area under the receiver operating characteristic curve (AUC-ROC) to assess the model’s discriminative power independent of classification threshold.
Classification Performance
Table 1 summarizes the classification performance of our DNN model compared to baseline methods on both datasets. Our DNN model consistently outperformed traditional machine learning approaches across all metrics. The performance advantage was more pronounced for the ds000030 dataset compared to ABIDE II, likely due to differences in data quality and heterogeneity between the datasets.
Feature Importance Analysis
To understand which brain regions contributed most significantly to classification decisions, we performed feature importance analysis using integrated gradients [18]. Figure 1 shows the relative importance of different brain regions for SCZ classification, highlighting the significant role of the default mode network, prefrontal cortex, and temporal regions, consistent with previous neuroimaging findings [19-22].
Model Convergence
The learning curves in Figure 2 demonstrate that our model converges within approximately 500 epochs for both datasets. The use of dropout and learning rate scheduling helped mitigate overfitting, as evidenced by the small gap between training and validation loss curves.
Our results demonstrate the potential of deep neural networks for fMRI-based classification of neurological disorders. The superior performance of our DNN model compared to traditional machine learning approaches suggests that deep learning can better capture the complex patterns associated with disorders like schizophrenia and autism spectrum disorder. Several factors contribute to the effectiveness of our implementation:
1. Hierarchical Feature Learning: The multi-layer architecture allows the model to learn increasingly abstract representations of brain activity patterns.
2. Regularization Strategy: The combination of dropout, weight initialization, and batch normalization effectively mitigates overfitting despite the relatively small sample sizes typical in neuroimaging studies.
3. Preprocessing Pipeline: Our comprehensive preprocessing approach helps address common challenges in fMRI data analysis, such as motion artifacts and noise. Despite these strengths, several limitations should be acknowledged. First, the interpretability of DNN models remains challenging, although our feature importance analysis provides some insights into decision-making factors. Second, the generalizability of our results may be limited by the specific characteristics of the datasets used. Third, the high computational requirements of DNN training may pose practical challenges in some clinical contexts.
This paper presents a successful implementation of a 4-layer deep neural network for fMRI-based classification of neurological disorders. Our model achieves strong performance on benchmark datasets, demonstrating the potential of deep learning approaches in computational neuroimaging.
Future work could explore several promising directions:
1. Transfer Learning: Investigating whether pre-training on large datasets can improve performance on smaller, specialized datasets.
2. Model Architecture Variations: Evaluating the effectiveness of hybrid architectures that combine CNN, RNN, and DNN components to better capture both spatial and temporal patterns in fMRI data.
3. Explainable AI Techniques: Implementing additional visualization and interpretation methods to enhance the clinical utility of model predictions.
4. Multimodal Integration: Combining fMRI with other neuroimaging modalities (e.g., DTI, EEG) and clinical data to improve classification accuracy and provide more comprehensive insights.
5. Longitudinal Analysis: Extending the model to capture changes in brain activity patterns over time, potentially enabling early detection and disease progression monitoring. By addressing these challenges and opportunities, future research can further enhance the clinical applicability of deep learning approaches in neuroimaging analysis and contribute to improved diagnosis and treatment of neurological disorders.
This research was not supported by any organization. We gratefully acknowledge the use of computational resources provided by kamatera. The authors also thank the data contributors and the OpenNeuro and ABIDE II initiatives for making the datasets publicly available.