├── practice ├── References.pdf ├── plagiarism.jpg ├── Ehteshaminia.docx ├── Ehteshaminia.pdf ├── articles used in this project ├── Figure and diagram.pdf ├── explanation of article codes ├── innovation article ├── main article ├── innovation code ├── main code ├── LICENSE └── README.md /practice: -------------------------------------------------------------------------------- 1 | https://github.com/Ehteshaminia/-.git 2 | لینک تمارین 3 | -------------------------------------------------------------------------------- /References.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahdieslaminet/Deep_Learning_FMRI/HEAD/References.pdf -------------------------------------------------------------------------------- /plagiarism.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahdieslaminet/Deep_Learning_FMRI/HEAD/plagiarism.jpg -------------------------------------------------------------------------------- /Ehteshaminia.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahdieslaminet/Deep_Learning_FMRI/HEAD/Ehteshaminia.docx -------------------------------------------------------------------------------- /Ehteshaminia.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahdieslaminet/Deep_Learning_FMRI/HEAD/Ehteshaminia.pdf -------------------------------------------------------------------------------- /articles used in this project: -------------------------------------------------------------------------------- 1 | https://github.com/Ehteshaminia/articles.git 2 | لینک مقالات رفرنس 3 | -------------------------------------------------------------------------------- /Figure and diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahdieslaminet/Deep_Learning_FMRI/HEAD/Figure and diagram.pdf -------------------------------------------------------------------------------- /explanation of article codes: -------------------------------------------------------------------------------- 1 | https://github.com/Ehteshaminia/expl.git 2 | ویدیو توضیحات مقاله و کد مربوط به آن 3 | -------------------------------------------------------------------------------- /innovation article: -------------------------------------------------------------------------------- 1 | https://github.com/Ehteshaminia/---.git 2 | https://drive.google.com/drive/folders/1ZSqQArBnk8Us1QsbF6OULVZ3TiTxVQYo?usp=sharing 3 | -------------------------------------------------------------------------------- /main article: -------------------------------------------------------------------------------- 1 | https://drive.google.com/file/d/1dYn2Rah2hnB5Rux5iL3cWJiYpe362B4D/view?usp=sharing 2 | ویدیو پیاده سازی 3 | https://github.com/Ehteshaminia/main.git 4 | -------------------------------------------------------------------------------- /innovation code: -------------------------------------------------------------------------------- 1 | https://drive.google.com/file/d/1x0YWAbI38uTOQxXDFLv21Tth07VT1dVJ/view?usp=sharing 2 | https://drive.google.com/file/d/1L4mSY_DWXvGOdtiH2oy7Twu_1bMQOvYG/view?usp=sharing 3 | -------------------------------------------------------------------------------- /main code: -------------------------------------------------------------------------------- 1 | https://drive.google.com/drive/folders/1LRUhj2l0tfP9A1DiLqfrcIeT_MEbxY0j?usp=sharing 2 | https://drive.google.com/drive/folders/1tC-Itq2uZSoBQCGXwYvaVdpoARfWiSro?usp=sharing 3 | https://drive.google.com/drive/folders/1q_JTfUfoqm1THyrlnwzW0L8971X8Em8B?usp=sharing 4 | https://drive.google.com/drive/folders/1vqgYigAkXV5F_eZnNt6ftgB0lZZCbYiZ?usp=sharing 5 | https://drive.google.com/drive/folders/1XzGj7RSZ0mn9ZcWWfDliL9O0hft617Wi?usp=sharing 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 mahdieslaminet 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Autism Spectrum Disorder Diagnosis Using Deep Learning 2 | 3 | This repository contains the implementation of a deep learning model for the diagnosis of Autism Spectrum Disorder (ASD) using the ABIDE (Autism Brain Imaging Data Exchange) fMRI dataset. The project explores the use of Convolutional Neural Networks (CNNs) combined with the F-score feature selection method to differentiate between ASD and typically developing (TD) individuals, as well as classifications by gender and task vs. rest states. 4 | 5 | ## Project Overview 6 | 7 | ### Abstract 8 | Autism Spectrum Disorder (ASD) presents significant challenges in diagnosis due to its heterogeneity and the high costs associated with neuroimaging. This study leverages deep learning techniques to analyze fMRI data, aiming to enhance diagnostic accuracy and provide insights into the neural underpinnings of ASD. Our approach involves training a CNN on a large, multi-site dataset, achieving promising results in classifying ASD vs. TD, gender, and task vs. rest states. 9 | 10 | ### Introduction 11 | ASD is a neurodevelopmental disorder characterized by difficulties in social interaction and repetitive behaviors. Despite the potential for early detection, diagnosis often occurs later due to overlapping symptoms with other conditions. This project utilizes machine learning, specifically CNNs, to analyze fMRI data and improve diagnostic accuracy.ASD is a lifelong neurodevelopmental disorder characterized by challenges in social interaction and communication, along with repetitive behaviors. Despite being identifiable in early childhood, ASD diagnosis often faces delays. Machine learning and deep learning techniques are increasingly used to aid in diagnosing ASD, leveraging large datasets to identify patterns that may not be immediately apparent to human experts. 12 | 13 | ### Methods 14 | - **Dataset**: ABIDE fMRI data, encompassing neuroimaging and phenotypic information from multiple international sites. 15 | - **Preprocessing**: Includes motion correction, normalization, and time series extraction using the BASC atlas. 16 | - **Model**: A CNN trained on connectivity matrices derived from the fMRI data, using cross-validation for robust performance assessment. 17 | - **Neural Network Model**: A CNN architecture is employed, with a focus on feature extraction from functional connectivity matrices. The model includes layers designed to capture complex patterns in the data, aided by techniques like batch normalization, dropout, and an ensemble approach to enhance accuracy and generalization. 18 | 19 | 20 | ### Key Features 21 | - Deep Learning Architecture: A CNN is used to classify ASD and typically developing (TD) controls, as well as gender and task vs. rest states. The model benefits from a large dataset of 43,858 data points, the most extensive compilation of fMRI connectomic data to date. 22 | 23 | - Feature Selection and Analysis: F-score feature selection and network topology analysis reveal changes in brain network architecture in ASD, such as a shift towards a more random network structure. This insight could provide valuable understanding into the pathology of ASD. 24 | 25 | - Interpretability: To address the "black box" nature of deep learning models, the project employs class activation maps to identify significant brain connections and analyzes hidden layer activations, focusing on areas like the right caudate nucleus and paracentral sulcus. 26 | 27 | ### Results 28 | The model demonstrated notable classification performance, with AUROCs of 0.6774, 0.7680, and 0.9222 for ASD vs. TD, gender, and task vs. rest classifications, respectively. Class Activation Maps (CAMs) highlighted significant brain regions, including the temporal and cerebellar areas, potentially elucidating ASD pathology. 29 | 30 | ### Conclusion 31 | This study underscores the potential of deep learning in ASD diagnosis, offering both diagnostic accuracy and interpretability. The findings suggest shifts in network topology among ASD individuals, pointing to a transition from small-world to random network architectures in the brain. 32 | 33 | ## Resources 34 | 35 | - [Code Video of the Main Article](https://drive.google.com/file/d/1dYn2Rah2hnB5Rux5iL3cWJiYpe362B4D/view?usp=sharing) 36 | - [Video Explaining the Main Article](https://drive.google.com/file/d/1o1buPSPWcbRwMhmvIjydy_cE2ocmR4aH/view?usp=sharing) 37 | - [Part 2](https://drive.google.com/file/d/1E3ueKz3La5RKwWgz_hMVs-mRWVvSmEYD/view?usp=sharing) 38 | - [Part 3](https://drive.google.com/file/d/1rwfiV7cbBLoKWSZiWqHWUq6BVMjVAa-r/view?usp=sharing) 39 | - [Innovation Article Video Code](https://drive.google.com/file/d/1a0lesHV6vGTe56Hj80ftZatPQA6vcXip/view?usp=sharing) 40 | - [Part 2](https://drive.google.com/file/d/1qdqc9ml4HWRo6D-4Bl2ory1-Y1aYAy83/view?usp=sharing) 41 | 42 | ## How to Use 43 | 44 | 1. Clone the repository and navigate to the project directory. 45 | 2. Follow the instructions in the `requirements.txt` to set up your environment. 46 | 3. Run the provided scripts to preprocess the data, train the model, and evaluate the results. 47 | 48 | 49 | 50 | ### Guide Script for ASD Diagnosis with Deep Learning 51 | 52 | --- 53 | 54 | ## Introduction 55 | 56 | Welcome to the ASD Diagnosis with Deep Learning project! This guide will help you understand the structure of the codebase, how to run the code, and the requirements needed to set up the environment. 57 | 58 | ### 1. **Setting Up the Environment** 59 | 60 | Before running the scripts, ensure you have the required Python libraries installed. You can install them using the following command: 61 | 62 | ```bash 63 | pip install -r requirements.txt 64 | ``` 65 | 66 | ### 2. **Directory Structure** 67 | 68 | - `data/`: This folder contains the dataset used in the project. Make sure you have the ABIDE dataset properly formatted and stored here. 69 | - `scripts/`: Contains all the Python scripts for data preprocessing, model training, and evaluation. 70 | - `models/`: Stores trained models and logs for analysis. 71 | - `results/`: Includes output files such as evaluation metrics and visualizations. 72 | 73 | ### 3. **Key Scripts** 74 | 75 | #### `data_preprocessing.py` 76 | 77 | - **Purpose**: Prepares the ABIDE fMRI data for training. This includes data augmentation, feature extraction, and splitting the data into training and test sets. 78 | - **Usage**: 79 | ```bash 80 | python scripts/data_preprocessing.py --data_dir data/ --output_dir processed_data/ 81 | ``` 82 | 83 | #### `train_model.py` 84 | 85 | - **Purpose**: Trains the convolutional neural network (CNN) model on the preprocessed data. 86 | - **Key Parameters**: 87 | - `--data_dir`: Directory containing the processed data. 88 | - `--epochs`: Number of training epochs. 89 | - `--batch_size`: Batch size for training. 90 | - `--output_dir`: Directory to save the trained models and logs. 91 | - **Usage**: 92 | ```bash 93 | python scripts/train_model.py --data_dir processed_data/ --epochs 50 --batch_size 32 --output_dir models/ 94 | ``` 95 | 96 | #### `evaluate_model.py` 97 | 98 | - **Purpose**: Evaluates the trained model on the test set and generates performance metrics. 99 | - **Key Parameters**: 100 | - `--model_dir`: Directory containing the trained model. 101 | - `--data_dir`: Directory containing the test data. 102 | - `--output_dir`: Directory to save evaluation results. 103 | - **Usage**: 104 | ```bash 105 | python scripts/evaluate_model.py --model_dir models/ --data_dir processed_data/ --output_dir results/ 106 | ``` 107 | 108 | #### `visualize_results.py` 109 | 110 | - **Purpose**: Generates visualizations such as confusion matrices, ROC curves, and class activation maps to interpret the model's performance. 111 | - **Key Parameters**: 112 | - `--results_dir`: Directory containing evaluation results. 113 | - `--output_dir`: Directory to save the visualizations. 114 | - **Usage**: 115 | ```bash 116 | python scripts/visualize_results.py --results_dir results/ --output_dir visualizations/ 117 | ``` 118 | 119 | ## Requirements 120 | 121 | Below is a list of the main Python libraries required for this project: 122 | 123 | - `tensorflow` or `torch` (depending on whether you are using TensorFlow or PyTorch) 124 | - `numpy` 125 | - `pandas` 126 | - `scikit-learn` 127 | - `matplotlib` 128 | - `seaborn` 129 | - `nibabel` (for handling neuroimaging data) 130 | - `scipy` 131 | 132 | Create a `requirements.txt` file to list these dependencies: 133 | 134 | ``` 135 | tensorflow==2.5.0 136 | numpy==1.21.0 137 | pandas==1.3.0 138 | scikit-learn==0.24.2 139 | matplotlib==3.4.2 140 | seaborn==0.11.1 141 | nibabel==3.2.1 142 | scipy==1.7.0 143 | ``` 144 | 145 | ## Running the Project 146 | 147 | 1. **Prepare the Data**: Ensure the ABIDE dataset is in the `data/` directory. 148 | 2. **Data Preprocessing**: Run the `data_preprocessing.py` script. 149 | 3. **Model Training**: Train the model using the `train_model.py` script. 150 | 4. **Model Evaluation**: Evaluate the model using `evaluate_model.py`. 151 | 5. **Visualization**: Generate visualizations using `visualize_results.py`. 152 | 153 | --- 154 | 155 | ftmehteshaminia@gmail.com 156 | --------------------------------------------------------------------------------