م2021 الربانمح البحثي الصيفي جامعة امللك فهد للبرتول واملعادن Magnetic resonance imaging (MRI) in early diagnosis and classification of AD using convolutional neural network Maryam Faisal Altuwaijri . E-mail: maryamfaisal033@gmail.com 29-july-2021 Abstract Although advancements in diagnostic imaging such as magnetic resonance imaging (MRIs) have led to a greater understanding of the diagnosis and treatment of Alzheimer's Disease (AD), medical professionals are still required to analyze the images which is a time-consuming and errorprone process. With the help of neural network models, diagnoses can be reached more accurately and efficiently. In this study I use well-known CNN approaches to determine the most accurate at diagnosis and performing multiclass classification of brain MRI scans of AD patients [1 I also perform multilevel classification of Alzheimer’s disease ie; Mild Demented, Moderate Demented, Non-Demented and Very Mild Demented using CNN with InceptionV3 using Fastai. This approach results in 94% predictive accuracy which means a significant increase in accuracy. compared to previous studies and clearly demonstrates the effectiveness of the proposed methods. keyword: Machine learning (ML), Alzheimer's disease (AD), convolutional neural network (CNN) , Magnetic resonance imaging (MRI). 1.Introduction Alzheimer’s disease (AD) is a type of dementia disease that is common in older ages. a terminal illness that is characterized by progressive memory loss, disorientation, and pathological markers, including senile plaques and neurofibrillary tangles in the brain. Most often, AD is diagnosed in people over 65 years of age although the less-prevalent early-onset Alzheimer's disease can occur in much younger people. These attacks are sufficiently intense to affect the daily social and professional lives of patients. Today, in the absence of a reliable diagnosis and effective curative treatments, fighting this disease is becoming a real public health issue, prompting research to consider non-drug techniques. It is named after German neurologist Aloïs Alzheimer, who in 1907 first described the symptoms as well as the neuropathological features of the disease, such as amyloid plaques and tangles in the brain. In this research, you will find the answers to the following questions: -What’s the best ML (CNN, RF, SVM…) model for detection AD from MRI? -What are the exist methods used to diagnosis AD using MRI? This research paper contains 5 sections. We review previous knowledge and related works in the next section. Then we elaborate on the research methodology. Experiments and the results generated by them will be described in section 4. Finally, the research concludes in section 5 with a future work plan. 2.Related works As early as 1999, researchers have been employing various machine learning methods to detect AD onset from MRI data alone. Researchers began by establishing biomarkers to be evaluated. A biomarker is a quantifiable indicator of a biological state. Hippocampal volume has been a key biomarker that doctors have used in the past, and it has shown high diagnostic accuracy for AD. However, hippocampal volume alone is considered clinically insufficient as a predictor of progression from mild cognitive impairment (MCI) to AD. Hence there is a need to look at more features, and recent research has shown that important changes in many other cortical regions also occur. Given the spatial features in the MRI scans, machine learning and deep learning methods tend to be good at aggregating such features for classification. Images are one of the data expression methods in photography form. It consists of small elements called pixels that have a specific value and position. The techniques of handling an image using computer algorithms are known as Image Processing. Image processing is an important part of the many images' analysis [2]. Image classification plays an important part in the field of medicine and teaching research. Radiologists and medical experts see tumor detection and extraction as such a tedious and arduous task to perform. The analysis and accuracy depend on their experience alone. However, there is a limit to consistent analysis and accuracy of both experienced and inexperienced medical expert. In fact, the task becomes increasingly burdensome when there are abundant data present to be analyzed. Hence, the use of cutting-edge technology comes in hand to overcome these challenges [3]. Title date of publication data model accuracy Diagnosis of Alzheimer’s Disease Based on Structural MRI Images (2018) ADNI SVM, IVM, and RELM 57.40 ,55.50 ,61.20 Classification of Structural MRI Images in Alzheimer’s Disease from the Perspective of Ill-Posed Problems Automated Classification of Alzheimer’s Disease Based on MRI Image Processing using Convolutional Neural Network (CNN) with AlexNet Architecture Comparing the Architecture and Performance of AlexNet, Faster R-CNN, and YOLOv4 in the Multiclass Classification of Alzheimer Brain MRI Scans (2012) ADNI RLR, LRC, SVM 91,90,88 (2020) Kaggle AlexNet 95 - Kaggle AlexNet. Faster R-CNN, YOLOv4 99,84,99 Table1. Recently published scientific papers One work employed a Deep Neural Network containing autoencoders to combine features from Region of Interest (ROI) in PET and MRI scans. Plant et al. (2010) used feature selection to achieve 92% accuracy in a binary classification of AD . Their paper demonstrates that principal component analysis, independent component analysis, structural equation modeling, and support vector machines have recently shown promise analyzing structural MRI to detect spatial patterns of atrophy associated with AD. ROI-based methods such as this can extract representative features and partly reduce the feature dimensions, but usually the ROIs are too empirical as they are based on qualitative observation. This is not sufficient to capture the more granular features associated with AD. An additional method proposed was to capture successive slices from MRI scans because it was deemed that each slice covers the significant areas for dementia detection. Wang et al. (2018) used DenseNet and ensemble methods to classify the entire 3D MRI scan, leading to a new state of the art three class classification (Alzheimer versus Mild Cognitive Impairment versus Cognitively Normal) accuracy of 97% [4]. 3.Methodology To write this research we follow ML methodology which start by collecting the data then preprocess the data and then we build the CNN that going to classify the 4 classes then training and testing the model . Data Data pre- collection processing Construct the CNN architecture Training & Testing the model . Figure1. Block diagram of the proposed methodology for Magnetic resonance imaging (MRI) in the diagnosis and classification of AD using convolutional neural network. The primary method of diagnosis is analysis of MRI images of the patient's brain. Our proposed model is a convolutional neural network (CNN). The model has several layers performing four basic operations - convolution, batch normalization, rectified linear unit, and pooling. The layers in the model follow a particular connection pattern known as dense connectivity, where each layer is connected to every other layer. For final classification, there is a SoftMax layer with four different output classes: nondemented, very mild, mild and moderate AD. This data augmentation technique increases the number of samples in the training data set. The size of each patch is 176*176 [5]. The following steps were taken in Figure1 to prepare the images for analysis, select a base model, and tune hyperparameters. Several helper functions were built to simplify tasks for reuse throughout the analysis. Data collection The data utilized in the completion of this project was obtained from a publicly available database on Kaggle. 6400 segmented MRI images of the brain from an axial view were labeled and divided into four classifications: NonDemented, VeryMildDemented, MildDemented, and ModerateDemented. These images were then divided into the training and test set in a 4:1 ratio, respectively. It is important to note that the number of images per class were unbalanced, especially in regards to the ModerateDemented, which had only 52 images in the training and 12 images in the testing sets. Classes The number NonDemented 3200 VeryMildDemented 2240 MildDemented 896 ModerateDemented 64 Table1. The number of images in each classification for the training and test set.(total:6400) Figure 2. Four different classifications of Kaggle brain MRI dataset (a) non-Demented (b) Very Mild Demented (c) Mild Demented (d) Moderate Demented. There are a number of libraries required for this analysis, Keras is used to perform grid-search to find optimal hyperparameters and split-folders is used to split folders of images into test, train and validate folders with stratification for classes [7]. Data pre-processing The number of images per class was largely unbalanced, with the ModerateDemented images being vastly underrepresented (total: 64 images) in comparison to the MildDemented (total: 3200). So, we decided to process the image and rearrange it, so that each class contains 2,3200 images, with a total of 12800 images by Image random flipping and image random zooming. Image generators from TensorFlow were used to feed images directly to our model from the image directories. The images were grayscale and needed to be converted to color to use with pre-trained models. Image Transformations • • • scale images convert to RGB set seed for reproducibility Construct the CNN architecture Flatten MaxPooling 176,176,3 MRI image 176,176,16 88,88,16 Sequential 11,11,128 Dropout Sequential Denese 5,5,256 None,4 None,6400 None,64 00 CNN architecture , For more details, click on Here Convolutional neural networks and deep learning generally have been contributing immensely to various innovations such as image classifications and segmentation, as well as object detection and recognition research on computer vision. These techniques have been successfully implemented in automation task and eliminating the tedious work of handcrafted engineering gradually. CNN and deep learning were trying to mimic the human visual cortex system in structure and operation by adopting a hierarchical layer of feature representation. Multilayer CNN model it possible to train different image features automatically, and enabled CNNs to perform better than hand crafted-feature techniques. The earlier convolutional blocks in the model have learned to recognize very low-level features that are common to all-natural images so they will already be optimized. The convolutional layers at the end will learn higher level features that are more specific to the dataset being used so these will likely need more optimization during training. We also had originally used an Adam optimizer, which is an adaptive moment optimizer. This has the benefits of being straightforward to implement, is computationally efficient, and its hyper-parameters have intuitive interpretation, typically requiring little tuning. However, we found through research that an Adam optimizer might not be well suited for my needs as they function best for data which has nonstationary targets or non-convex optimization problems. Our classification problem has stationary targets and a generally convex solution [6]. Training & testing the model . After trying more than one model, and we got the best result using CNN with InceptionV3 which is the best ML model for detection AD from MRI and following the best methods. The training & testing took us about an hour and 54 minutes, CPU: 393%, Disk: 2.7GB (Max 73.1GB), RAM: 12.2GB (Max 16GB). 4. Results and Discussion A total of 6400 images was used out of which 896 Mild demented, 64 Moderate demented, 3200 Non demented, 2240 very mild demented. We measured the performance of our algorithm using 1013 test images out of which 139 Mild demented, 10 Moderate demented, 530 Non demented, 334 very mild demented. We obtained an accuracy of 94.8% on the test data, with a loss of ~0.18 This is an exceptional result that we were very proud of. We used a confusion matrix to see which classes, if any, were being misclassified more. We can see in the matrix that there is almost no misclassification occurring at all, with the few that do occur happening mostly between the “Normal” brains and the “Very Mildly Demented” brains. This result makes sense intuitively as the distinction between normal and mild dementia is the smallest relative to each of the other classes. which is remarkable achievement when compared to existing state of art. InceptionV3 enabled us to give such a good performance for the four way classification of Alzheimer's disease. The confusion metrics was computed as given in the figure3 using which Precision, Support, Recall and F1 score was computed for further analysis of the classification task a given in. [8] Figure3. Confusion Matrix of 4 way classification. NonDemented VerMildDemented MildDemented ModerateDemented Micro avg Macro avg Weighted avg Samples avg Pprecision 0.96 1.00 0.93 0.90 0.95 0.95 0.95 0.95 Recall 1.00 1.00 0.89 0.91 0.95 0.95 0.95 0.95 F1-score 0.98 1.00 0.91 0.90 0.95 0.95 0.95 0.95 Support 639 635 662 624 2560 2560 2560 2560 Table2. Performance measures. For the training process the learning was chosen which helped to attain smooth exponentially decreasing curve for training and validation losses and an exponentially increasing curve for training and testing accuracy as shown in Figure 4. FASTAI helped to finish the training process in number of epochs. Figure 4. Graph of training and testing accuracy with epochs(loss). Our current methodology performs inference over the entire MRI scan rather than only specific regions in the brain. The excellent results produced by this method has supported the hypothesis that features of Alzheimer’s diseases are not discerned in specific brain regions but rather aggregate and hidden features present throughout the brain. We have demonstrated an efficient approach to Alzheimer’s Disease diagnosis using brain MRI data analysis. While the majority of the existing research works focuses on binary classification, our model provides significant improvement for multi-class classification. Our proposed network can be very beneficial for early-stage Alzheimer’s Disease diagnosis. Though the proposed model has been tested only on Alzheimer’s Disease dataset, we believe it can be used successfully for other classification problems of the medical domain. The experiment was evaluated using 4 different metrics in order to ascertain the performance of the models. The following performance metrics were used namely; accuracy, F1- score, precision and recall. 5.Conclusion We can see from the confusion matrix that the model does best at identifying normal and very-mild MRIs and poorest identifying moderate cases. This makes sense given the small number of moderate examples in the dataset. Adding model capacity, searching for optimal hyperparameters and adding data augmentation resulted better performance on the test dataset. In this Work, we used the basic InceptionV3 model with Fastai to classify Alzheimer's from MRI images. The proposed work was able to give an accuracy of 94.8% on test data with very small misclassifications on normal and very mild demented. Future work includes using data from other modalities like PET, fMRI to improve the performance. I also would like to explore feature extraction on select brain regions. More data from more patients are also required in the future to ensure the accuracy of the model stays consistently high. Several methods in literature are used to address the problem of limited training data which I would like to explore more in the future. I acknowledge our gratitude to the use of Alzheimer’s disease (4 class of images) and the data derived from Kaggle [9] database. I also thank the referees for their useful suggestions Dr.Imane boudellioua & Miss.Leina abouhagar. This research was supported by King Fahad university of petroleum and minerals. References: [1] Comparing the Architecture and Performance of AlexNet, Faster RCNN, and YOLOv4 in the Multiclass Classification of Alzheimer Brain MRI Scans [2],[3] Multi-classification of alzheimer disease on magnetic resonance images (MRI) using deep convolutional neural network (DCNN) approaches [4],[6] Early Detection of Alzheimer’s Disease Through Machine Learning in MRI Scans [5] Machine Learning Theory and Applications for Healthcare [7] Alzheimer's Multi-class Classification [8] Deep Learning Based Multilevel Classification of Alzheimer’s Disease using MRI Scans [9] Alzheimer's Dataset ( 4 class of Images)