0% found this document useful (0 votes)
14 views67 pages

Batch19 Final

This project report presents a framework for detecting Alzheimer's disease using deep learning models, specifically convolutional neural networks (CNNs), to facilitate early diagnosis and classification of the disease stages. The study employs both simple CNN architectures and an optimized VGG19 model, achieving accuracy rates of 95.17% and 97% respectively. The proposed online platform allows for remote assessments, addressing challenges posed by the COVID-19 pandemic and improving accessibility for patients and healthcare providers.

Uploaded by

siva ram krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views67 pages

Batch19 Final

This project report presents a framework for detecting Alzheimer's disease using deep learning models, specifically convolutional neural networks (CNNs), to facilitate early diagnosis and classification of the disease stages. The study employs both simple CNN architectures and an optimized VGG19 model, achieving accuracy rates of 95.17% and 97% respectively. The proposed online platform allows for remote assessments, addressing challenges posed by the COVID-19 pandemic and improving accessibility for patients and healthcare providers.

Uploaded by

siva ram krishna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

DETECTING ALZHEIMER’S DISEASE THROUGH

DEEP LEARNING MODELS


A Project Report

Submitted in partial fulfillment of the requirements for


the award of the Degree of
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE & ENGINEERING
By
Jayaram Behara 20761A0525
Korampalli Prathyusha 21765A0502
Mukkara Hima Vamsi Reddy 20761A0533

Under the esteemed guidance of


Dr. J. NAGESWARA RAO
Associate Professor

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


LAKIREDDY BALIREDDY COLLEGE OF ENGINEERING
(AUTONOMOUS)
Accredited by NAAC with ‘A’ Grade & NBA (Under Tier - I),
An ISO 21001:2018,14001:2015,50001:2018 Certified Institution
Approved by AICTE, New Delhi and Affiliated to JNTUK, Kakinada
L.B.REDDY NAGAR, MYLAVARAM ,NTR DIST., A.P. - 521230.
2020 – 2024
LAKIREDDY BALI REDDY COLLEGE OF ENGINEERING
(AUTONOMOUS)
Accredited by NAAC with ‘A’ Grade & NBA (Under Tier - I),
An ISO 21001:2018,14001:2015,50001:2018 Certified Institution
Approved by AICTE, New Delhi and Affiliated to JNTUK, Kakinada
L.B. REDDY NAGAR, MYLAVARAM, NTR DIST.,A.P.-521230.

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

CERTIFICATE
This is to certify that the project entitled “DETECTING ALZHEIMER’S DISEASE THROUGH
DEEP LEARNING MODELS” is being submitted by

Jayaram Behara 20761A0525


Korampalli Prathyusha 21765A0533
Mukkara Hima Vamsi Reddy 20761A0533

in partial fulfillment of the requirements for the award of degree of B. Tech in Computer
Science & Engineering from Jawaharlal Nehru Technological University Kakinada is a
record of bonafide work carried out by them at Lakireddy Bali Reddy College of
Engineering.The results embodied in this Project report have not been submitted to any other
University or Institute for the award of any degree or diploma.

PROJECT GUIDE HEAD OF THE DEPARTMENT

Dr. J. Nageswara Rao Dr. D.Veeraiah

EXTERNAL EXAMINER
ACKNOWLEDGEMENT

We take great pleasure to express our deep sense of gratitude to our project guide
Dr. J. Nageswara Rao, Associate Professor, for his valuable guidance during the course of
our project work.
We would like to thank Dr. J. Nageswara Rao, Associate Professor & Project
Coordinator, Department of Computer Science & Engineering for his encouragement.

We would like to thank Dr. D. Veeraiah, Professor & Head of the Department of
Computer Science & Engineering for his encouragement.

We would like to express our heart-felt thanks to Dr. K. Appa Rao, Principal,
Lakireddy Bali Reddy College of Engineering for providing all the facilities for our project.

Our utmost thanks to all the Faculty members and Non-Teaching Staff of the
Department of Computer Science & Engineering for their support throughout our project
work.

Our Family Members and Friends receive our deepest gratitude and love for their
support throughout our academic year.

Jayaram Behara (20761A0525)


Korampalli Prathyusha (21765A0502)
Mukkara Hima Vamsi Reddy (20761A0533)
DECLARATION

We are here by declaring that the project entitled “ DETECTING ALZHEIMER’S DISEASE
THROUGH DEEP LEARNING MODELS” work done by us. We certify that the work contained
in the report is original and has been done by me under the guidance of supervisor. The work has not
been submitted to any other institute in preparing for any degree or diploma. We have followed the
guidelines provided by the institute in preparing the report. We have conformed to the norms and
guidelines given in the Ethical Code of Conduct of the institute. Whenever we have used materials
(data, theoretical analysis, figures and text) from other sources, we have given due credit to them by
citing them in the text of the report and giving their details in the references. Further, we have taken
permission from the copyright’s owner of the sources, whenever necessary.

Signature(s) of the students(s)

Jayaram Behara (20761A0525)


Korampalli Prathyusha (21765A0502)
Mukkara Hima Vamsi Reddy (20761A0533)
ABSTRACT
Alzheimer Disease still poses a significant risk to medical care because there is currently no cure
and early detection is crucial for the best course of treatment. This study suggests a from end to end
architecture that makes use of techniques for deep learning, specifically convolutional neural network
models or CNNs, to facilitate early detection and classification of AD across its spectrum. The
framework addresses the multi-class categorization of AD stages, comprising four distinct phases, in
addition to binary classification inside every pair of classes. The pair of primary approaches are as
follows: one handles brain structural scans from the ADNI dataset using simple CNN structures with
two-dimensional and three-dimensional convolutions, while the other employs the concepts of
transfer learning to specifically optimize the VGG19 previously trained model for medical image
classification. The framework leads to the development of an online program for checking for
Alzheimer's disease, which is a suitable answer considering the challenges posed by the COVID-19
pandemic that restricts regular hospital visits. This technique makes remote AD examinations
possible, which benefits both doctors and patients. It gives the patient's AD stage based on the
spectrum and makes relevant recommendations and assistance. The effectiveness of the offered
techniques is compared and evaluated using nine performance measures. The results of the
experiments show the benefits of the CNN designs in terms of memory requirements, computational
complexity, and ease of use. Notably, the 2D and 3D CNNs achieve remarkable accuracy rates at
93.61% and 95.17%, respectively, on multiple classes of Alzheimer's disease stages classification.
Furthermore, an accuracy of 97% in multiple classes of Alzheimer's disease stages classification is
achieved by the optimized VGG19 model, which is a promising result.
LIST OF CONTENTS

CONTENTS PAGE NO

1. INTRODUCTION 1-3

1.1 Overview of theProject 1

1.2 Feasibility Study 1-2

1.3 Scope 3

2. LITERATURE SURVEY 4-5

2.1 ExistingSystem 4

2.2 ProposedSystem 5

3. SYSTEM ANALYSIS 6 - 10

3.1 Overview of System Analysis 6

3.2 Software used in the project 6-9

3.3 System Requirements 10

4. SYSTEM DESIGN 11 - 26

4.1 Overview of System Design 11 - 21

4.2 UML diagrams 22 - 26

5. CODING & IMPLEMENTATION 27 - 44

6. SYSTEM TESTING 45 - 46

7. RESULTS 47 - 48

8. CONCLUSION 49

9. REFERENCES 50
Figure 3.1: Google Colab environment 7

Figure 3.2: MRI Images 9

Figure 4.1: System Architecture 12

Figure 4.2: Splitting the dataset into training , validation and testing sets 13

Figure 4.3: SMOTE example 15

Figure 4.4: Inceptionv3 Process 18

Figure 4.5: Xception Process 19

Figure 4.6: RestNet50 Process 21

Figure 4.7: Use Case Diagram 23

Figure 4.8: Class Diagram 24

Figure 4.9: Activity Diagram 26

Figure 7.1: Accuracy and performance of base models 47

Figure 7.2: Training and validation accuracy and loss of ensemble 47

Figure 7.3: Training and validation accuracies,losses of three models in order 48


LIST OF TABLES PAGE NO

Table 3.1: Distinct phases of AD 8

Table 6.1: Correlation between columns data 46


LIST OF ABBREVIATIONS

1. RAM - Random Access Memory


2. CPU - Central Processing Unit
3. IDE - Integrated Development Environment
4. SDLC - Software Development Life Cycle
5. ML - Machine learning
6. AI - Artificial Intelligence
7. AD - Alzheimer’s Disease
8. CNN - Convolutional Neural Networks
9. ADNI - Alzheimer’s Disease Neuroimaging Initiative
10. VGG - Visual Geometry Group
11. GCNN - Graph Convolutional Neural Networks
12. MRI - Magnetic Resonance Imaging
13. GPU - Graphics Processing Unit
14. TPU - Tensor Processing Unit
15. API - Application Programming Interface
16. GUI - Graphical User Interface
17. SMOTE - Synthetic Minority Oversampling Technique
18. Xception - Extreme Inception
19. RestNet - Residual Network
20. UML - Unified Modeling Language
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

1. INTRODUCTION

1.1 OVERVIEW OF THE PROJECT


This research addresses the urgent need for early identification and categorization of
Alzheimer's disease (AD) by presenting an end-to-end architecture employing deep learning
techniques, namely convolutional neural networks (CNNs). The framework focuses on binary
classification within each pair of classes and multi-class categorization of AD phases because
there is no known cure and early discovery is essential for effective treatment. In order to analyze
brain structural scans from the ADNI dataset, two primary techniques are used: transfer learning
to refine the VGG19 model specifically for medical picture classification, and basic CNN
architectures with 2D and 3D convolutions. This tool makes it easier to remotely analyze the
phases of AD while offering patients individualized advice and support. Impressive accuracy
rates are obtained from the evaluation of the methodologies; the optimized VGG19 model and
CNN designs both show promise in categorizing various AD stages.

1.2 FEASIBILITY STUDY

Strong viability in terms of technical, operational, and economic factors is indicated by


the project's feasibility assessment. The research has strong economic implications since it has
the ability to lower long-term healthcare expenses related to managing Alzheimer's disease (AD)
by means of early identification and intervention. In keeping with the trend toward telemedicine,
an online program for remote AD assessments is being implemented, which will save costs for
patients as well as healthcare professionals. The study demonstrates its technological resilience
by utilizing well-established deep learning techniques such as convolutional neural networks
(CNNs) and having access to the Alzheimer's Disease Neuroimaging Initiative (ADNI) dataset.
The project's operational viability facilitates remote assessment of AD stages and streamlines
procedures for healthcare practitioners. The initiative has the potential to significantly impact
AD diagnosis and management, and the feasibility study's overall conclusions align it with recent
advancements in healthcare delivery.

Department of CSE,LBRCE 1
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

1.2.1 Economical Feasibility:

The proposed project demonstrates strong economic feasibility. With Alzheimer's disease
(AD) imposing a significant burden on healthcare systems worldwide, the development of an
early detection and classification framework can lead to substantial cost savings. By facilitating
early diagnosis and intervention, the framework can potentially reduce the long-term healthcare
costs associated with AD management, including hospitalization, medication, and caregiving
expenses. Additionally, the implementation of an online program for remote AD examinations
aligns with the growing trend towards telemedicine, which can result in cost savings for both
healthcare providers and patients by minimizing the need for physical visits to medical facilities.

1.2.2 Technical Feasibility:

The project shows a high degree of technological viability. Deep learning methods,
namely convolutional neural networks (CNNs), are well-known and often used in medical image
analysis, which includes AD detection and categorization. A wealth of brain structural scans for
training and validation are made available by the Alzheimer's Disease Neuroimaging Initiative
(ADNI) dataset. Furthermore, the application of fundamental CNN architectures with 2D and 3D
convolutions and the transfer learning-assisted VGG19 model optimization show the project's
technological resilience in processing intricate medical image data.

1.2.3 Operational Feasibility:

In terms of operations, the project is very doable. The operational issues that limit routine
hospital visits are addressed by the creation of an online platform for remote AD examinations.
The program improves patient accessibility to diagnostic services, especially for those who
might find it difficult to schedule in-person sessions, by enabling remote assessment of AD
stages. Furthermore, the platform facilitates the workflow of healthcare personnel, enabling
prompt and effective assessment of AD patients, which eventually results in enhanced patient
outcomes and satisfaction. All things considered, the project's operational viability is
strengthened by its conformity to new developments in telehealth and remote medical services.

Department of CSE,LBRCE 2
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

1.3 SCOPE

The project's scope includes creating an end-to-end architecture using deep learning
methods, namely convolutional neural networks (CNNs), for the early diagnosis and
classification of Alzheimer's disease (AD). With no known treatment and no cure, AD presents a
serious healthcare concern that the project seeks to address. Early detection is key to effective
treatment. The framework will use brain structural scans from the Alzheimer's Disease
Neuroimaging Initiative (ADNI) dataset to focus on binary classification within each pair of
classes and multi-class categorization of AD stages.The project's main goals will be to
implement fundamental CNN architectures with 2D and 3D convolutions and optimize the
VGG19 model via transfer learning. Furthermore, the creation of an online platform for remote
AD assessments will allow medical practitioners to evaluate AD stages from a distance, offering
patients individualized advice and support. The evaluation of the suggested methods to gauge
their efficacy in terms of precision, computational complexity, and usability is also included in
the project's scope. The project's overall goal is to advance the diagnosis and treatment of AD,
which could enhance patient outcomes and the provision of healthcare.

Department of CSE,LBRCE 3
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

2. LITERATURE SURVEY

2.1 EXISTING SYSTEM


Current systems for the identification and classification of Alzheimer's disease (AD) use
a range of deep learning methods, most notably convolutional neural networks (CNNs) applied
to MRI scans of the brain. Payan et al. (2019) demonstrate the superiority of 3D convolutions
over 2D convolutions, particularly when fine-tuned, by utilizing a sparse autoencoder in
conjunction with 3D CNNs for AD detection. Furthermore, Sarraf et al. and Hosseini et al.
investigate CNN architectures, emphasizing flexible three-dimensional models with deep
supervision and pre-training assessment carried out using CAD-Dementia datasets. In their
comparison of residual network topologies and simple 3D CNN designs, Korolev et al. tackle the
issues of network depth and complexity in AD classification.

A variety of CNN structures and fusion algorithms are examined in other works, including those
by Khvostikov et al. and Wang et al., in an effort to maximize performance by deliberate
architectural choices and feature extraction techniques.

Additionally, Spasov et al. and Jain et al. investigate transfer learning strategies using
CNN-based models, such as VGG-16, with the goal of reducing complexity and simplifying
tasks in AD diagnosis. Wang et al. and Ge et al. provide inventive approaches for multi-modal
analyses, such as the use of voice data and the introduction of novel CNN frameworks,
exhibiting novel designs like Graph Convolutional Neural Networks (GCNN) and 3D multi-scale
CNNs. Overall, these current systems show a variety of methods for classifying and detecting
AD, utilizing multi-modal data processing and sophisticated deep learning algorithms to increase
diagnostic speed and accuracy.

Department of CSE,LBRCE 4
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

2.2 PROPOSED SYSTEM

The proposed system for classifying medical imagery, specifically MRI images, utilizes a
combination of basic CNN structures designed for MRI images and transfer learning techniques
with pre-trained models like VGG19. This approach aims to enhance the accuracy and efficiency
of medical image classification, ultimately improving patient care and diagnostic capabilities.

By integrating the strengths of both methods, the system can effectively handle the complexities
of medical imagery and provide reliable results for healthcare professionals. The system's
adaptability to new data and evolving medical imaging technologies ensures it remains
up-to-date and effective in providing accurate image classification.

The use of pre-trained models like VGG19 allows the system to leverage the knowledge and
expertise gained from training on large, diverse datasets. This helps the system learn and
recognize patterns and features in medical images more effectively, reducing the need for
extensive training on specific medical datasets.

Moreover, the system's architecture and training process are designed to optimize performance
and minimize computational resources. This makes the system more efficient and scalable,
enabling it to handle large volumes of medical imagery and provide timely results for healthcare
professionals.

Overall, the system represents a significant advancement in medical image analysis, offering
improved accuracy, efficiency, and adaptability to support better patient care and diagnostic
capabilities. The integration of basic CNN structures and transfer learning techniques with
pre-trained models like VGG19 provides a powerful and effective solution for classifying
medical imagery, ultimately improving patient outcomes and healthcare delivery.

Department of CSE,LBRCE 5
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

3. SYSTEM ANALYSIS

3.1 OVERVIEW OF SYSTEM ANALYSIS

3.1.1 MachineLearning

Machine learning (ML) is one of the applications of Artificial Intelligence (AI) that
offers machines or systems the ability to learn and improve from the experience without
being explicitly programmed. It is simply making a computer perform a task without
explicitly programming it. In today’s world every system that does well has a machine
learning algorithm at its heart. Take for example Google Search engine, Amazon Product
recommendations, LinkedIn, Facebook etc., all these systems have machine learning
algorithms embedded in their systems in one form or the other. They are efficiently utilizing
data collected from various channels which helps them get a bigger picture of what they are
doing and what they should do. It begins from a stage of pre-processing of data followed by
feature selection, classification, performance evaluation and finally results with enhanced
accuracy.

3.2 SOFTWARE USED IN THE PROJECT

3.2.1 Python

Python is an interpreted, high level, general purpose programming language. It is a


multi-paradigm programming language. It is a widely used high-level programming
language for general-purpose programming. Apart from being open source programming
language, python is a great object-oriented, interpreted, and interactive programming
language. Python combines remarkable power with very clear syntax. It has modules,
classes, exceptions, very high level dynamic data types, and dynamic typing. There are
interfaces to many system calls and libraries, as well as to various windowing systems.
Python is also usable as an extension language for applications written in other languages
that need easy-to-use scripting or automation interfaces. Python is widely considered as the

Department of CSE,LBRCE 6
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

preferred language for teaching and learning ML (Machine Learning). Few simple reasons
are:
● It’s simple to learn. As compared to C, C++ and Java the syntax is simpler and
Python also consists of a lot of code libraries for ease o fuse.
● Though it is slower than some of the other languages, the data handling capacity is great.
● Open Source : Python along with R is gaining momentum and popularity in the Analytics
domain since both of these languages are open source.
● Capability of interacting with almost all the third party languages and platforms

3.2.2 Google Colab

Colab is a hosted Jupyter Notebook service that requires no setup to use and provides

free access to computing resources, including GPUs and TPUs. Colab is especially well

suited to machine learning, data science, and education.

Figure 3.1. Google Colab environment

Department of CSE,LBRCE 7
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

3.2.3 Packages

pandas : pandas is a software library written for the Python programming language for data
manipulation and analysis. In particular, it offers data structures and operations for
manipulating numerical tables and time series. Pandas is mainly used for machine learning
in form of dataframes. Pandas allow importing data of various file formats such as csv, excel
etc.

matplotlib.pyplot : It provides an object-oriented API for embedding plots into applications


using general-purpose GUI toolkits. pyplot is a shell-like interface to Matplotlib. Pyplot
maintains state across calls. It is useful for use in Jupyter or IPython notebooks.

sklearn : sklearn (Scikit-learn) is a free software machine learning library for the Python
programming language. It features various classification, regression and clustering
algorithms. It provides a range of supervised and unsupervised learning algorithms via a
consistent interface in python.

3.2.4 Dataset

The 6,400 brain MRI images in the dataset utilized in this study were carefully chosen to
represent different stages of Alzheimer's disease (AD). These images, which are from the
well-known dataset (Table.1) and machine learning website Kaggle, show four different stages of
the AD spectrum. The dataset is made up of brain MRI scans, each carefully labeled and grouped
into one of the four distinct phases of AD listed below:

Class Number of Data Samples

Non - demented 3200

Very mild demented 2240

Mild demented 896

Moderate demented 64

Table 3.1. Distinct phases of AD

Department of CSE,LBRCE 8
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

Figure 3.2. MRI Images

Each stage is represented by a subset of MRI scans, making it easier to analyze and categorize
throughout the whole range of AD progression. The dataset, which consists of 6,400 brain MRI
images, is large enough to enable accurate training and validation of the proposed model for
accurate identification and classification of different stages of Alzheimer's disease. Preprocessing
of the data obtained from Kaggle involved labeling, curation, and segmentation in order to
ensure the accuracy and integrity of the dataset for training and evaluating the proposed model
for AD detection and classification.Additionally, to enhance the robustness and generalizability
of the proposed model, various data augmentation techniques were employed during the
preprocessing phase. These techniques included rotation, flipping, scaling, and adding noise to
the MRI images, thereby increasing the diversity of the training data and reducing the risk of
overfitting. Moreover, extensive quality control measures were implemented to address any
inconsistencies or artifacts present in the dataset, ensuring the reliability of the model's
predictions. The labeled MRI scans were carefully reviewed by domain experts to confirm the
accuracy of the assigned labels and to minimize any potential bias in the dataset. Furthermore,
advanced image processing algorithms were utilized for segmentation and feature extraction,
capturing subtle patterns and abnormalities indicative of Alzheimer's disease progression.

Department of CSE,LBRCE 9
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

3.3 SYSTEM REQUIREMENTS

3.3.1 Software Requirements

Operating System : Windows7 or higher

Languages : Python

IDE : Google Colab

Dataset : ADNI Dataset

3.3.2 Hardware Requirements

RAM : Minimum 4GB

Processor : Intel core i5

Secondary Storage : Minimum 500GB

Department of CSE,LBRCE 10
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4. SYSTEM DESIGN

4.1 OVERVIEW OF SYSTEM DESIGN

This system design presents a comprehensive framework for MRI-based diagnosis and
categorization of Alzheimer's disease (AD). The first step involves obtaining data from the
Alzheimer's Disease Neuroimaging Initiative (ADNI) dataset, which consists of 300 patients' 2D
T1-weighted MRI scans divided into four groups. Class imbalance is addressed by
preconditioning techniques like resampling, which are followed by data enhancement techniques
like augmentation. After that, medical image categorization is carried out using a combination of
transfer learning methods with the VGG19 model and CNN structures customized for 2D and 3D
MRI images. Evaluation metrics are used to carefully evaluate performance. Lastly, the best
models are suggested for an online application for AD checking that will enable remote
evaluation and customized advice based on stages of AD identification.

The proposed online platform for Alzheimer's disease (AD) checking represents a pivotal
advancement in early diagnosis and personalized care. By integrating state-of-the-art MRI
analysis models, the platform empowers users to conveniently upload their scans for automated
assessment. With robust user authentication and privacy measures in place, patient data remains
secure and compliant with regulatory standards. Upon upload, the system preprocesses the scans
for consistency and employs advanced machine learning techniques to analyze and interpret the
results. Users receive comprehensive reports detailing their AD risk along with actionable
recommendations, fostering informed decision-making. Moreover, the platform facilitates remote
consultations with healthcare professionals, enabling timely interventions and support.
Continuous feedback mechanisms ensure the platform's accuracy and relevance, while
educational resources empower users with knowledge to actively manage their health. By
seamlessly integrating with existing healthcare systems, this platform holds promise in
revolutionizing AD diagnosis and care delivery, ushering in a new era of proactive health
management.

Department of CSE,LBRCE 11
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

Figure 4.1. System Architecture

Department of CSE,LBRCE 12
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

Machine learning (ML) is the scientific study of algorithms and statistical models
that computer systems use to perform a specific task without using explicit instructions,
relying on patterns and inference instead. It is seen as a subset of artificial intelligence.
Machine learning algorithms build a mathematical model based on sample data, known as
"training data", in order to make predictions or decisions without being explicitly
programmed to perform the task. Machine learning algorithms are used in a wide variety of
applications, such as email filtering and computer vision, where it is difficult or infeasible to
develop a conventional algorithm for effectively performing the task.

4.2 SPLITTING THE DATASET

The MRI scans are divided into training, validation, and testing sets as part of the dataset
splitting process. For various phases of the construction and assessment of models, these sets are
crucial. The validation set helps with hyperparameter tuning and model performance
optimization, whereas the training set is used to train the models. In order to ensure that the final
model can be generalized, the testing set is finally set aside for evaluating the model's
performance on untested data. While precise information regarding the split's proportions is not
given, this procedure is essential for reliable model development and assessment in machine
learning workflows.

Figure 4.2. Splitting the dataset into training, validation and testing datasets

Department of CSE,LBRCE 13
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4.3 METHODOLOGY

4.3.1 Data Preprocessing

The images were pre-processed by applying image augmentation. The augmentation techniques
applied are: zooming, brightness change, horizontal flip and re-scaling. SMOTE (Synthetic
Minority Over-sampling Technique) was performed to balance the data in the minority classes. A
total of 12,800 images were obtained after the preprocessing stage. Synthetic Minority
Oversampling Technique (SMOTE) is a statistical technique for increasing the number of cases
in your dataset in a balanced way. The component works by generating new instances from
existing minority cases that you supply as input.

SMOTE (Synthetic Minority Over-sampling Technique) is a method used in machine learning to


address the class imbalance problem, particularly prevalent in datasets where one class (the
minority class) is significantly underrepresented compared to another class (the majority class).
This class imbalance can lead to biased models that perform poorly in predicting the minority
class.

Here's how SMOTE works:

1. Identify Minority Class: First, identify the minority class in the dataset. This is the class that
has fewer instances compared to the majority class.

2. Select Minority Class Instances: Randomly select a sample from the minority class
instances.

3. Find Nearest Neighbors: For each of these minority class instances selected, find its k
nearest neighbors. The value of k is a parameter set by the user.

4. Generate Synthetic Samples: For each selected minority class instance, create synthetic
samples by randomly selecting one of its nearest neighbors and then creating a new instance
along the line joining the two points in the feature space. This creates new minority class
samples within the vicinity of the original samples.

Department of CSE,LBRCE 14
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

5. Repeat: Repeat steps 2-4 until the desired balance between the minority and majority classes
is achieved.

Figure 4.3. SMOTE Example

4.3.2 TPU Acceleration

TPU stands for Tensor Processing Unit, which is a custom-built application-specific


integrated circuit (ASIC) developed by Google specifically for accelerating machine learning
workloads. TPUs are designed to be highly efficient at processing tensor operations, which are
fundamental to many machine learning algorithms, particularly those used in deep learning
models.

Here are some key points about TPUs:

1. Purpose-built for TensorFlow: TPUs are optimized for TensorFlow, an open-source machine
learning framework developed by Google. They are particularly well-suited for training and
running deep neural networks, including convolutional neural networks (CNNs) and recurrent
neural networks (RNNs).

Department of CSE,LBRCE 15
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

2. High Performance: TPUs are designed to deliver high performance and throughput for
machine learning tasks. They can process large amounts of data quickly, making them ideal for
training complex models on large datasets.

3. Parallel Processing: TPUs leverage parallel processing to accelerate computations. They


contain multiple cores, each capable of executing tensor operations simultaneously, enabling
faster training and inference times compared to traditional CPUs or GPUs.

4. Cost-efficient: TPUs offer high performance while consuming relatively less power compared
to traditional CPU or GPU-based systems. This can result in cost savings, especially for
large-scale machine learning tasks that require significant computational resources.

5. Cloud Integration: Google offers TPUs as part of its cloud computing services, allowing
users to access TPUs on-demand through platforms like Google Cloud Platform (GCP). This
enables researchers, developers, and organizations to leverage the power of TPUs without having
to invest in dedicated hardware.

6. TensorFlow Integration: Google has integrated support for TPUs directly into TensorFlow,
making it easy for users to harness the power of TPUs in their machine learning projects.
TensorFlow automatically optimizes computations to take advantage of the hardware
acceleration provided by TPUs.

4.3.3 Three Pre-Trained Models

4.3.3.1 Inceptionv3

InceptionV3 is a deep convolutional neural network (CNN) architecture developed by


Google as part of the Inception family of models. It is designed for image classification tasks and
has been widely used in computer vision applications. InceptionV3 builds upon its predecessors,
introducing improvements in both performance and efficiency. Here's an explanation of
InceptionV3:

Department of CSE,LBRCE 16
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

1. Inception Modules: The hallmark of InceptionV3 architecture is its Inception modules. These
modules consist of multiple parallel convolutional operations with different kernel sizes,
enabling the network to capture features at various scales and resolutions. Each Inception module
typically contains 1x1, 3x3, and 5x5 convolutions, along with max-pooling operations.
Additionally, it includes 1x1 convolutions for dimensionality reduction before and after the
larger convolutions. The outputs of these parallel operations are concatenated along the depth
dimension, allowing the network to capture diverse features from the input images efficiently.

2. Factorization: InceptionV3 employs factorized convolutions to reduce computational


complexity while maintaining representational capacity. Instead of applying a single large
convolution, factorized convolutions break down the operation into smaller convolutions,
making the computations more efficient. Factorized convolutions include 1x1 convolutions for
dimensionality reduction before larger convolutions and 3x3 convolutions decomposed into two
consecutive 3x3 convolutions, known as "factorized 3x3 convolutions."

3. Auxiliary Classifiers: InceptionV3 includes auxiliary classifiers at intermediate layers of the


network during training. These auxiliary classifiers are used to combat the vanishing gradient
problem and provide additional supervision signals to the network.The output of these auxiliary
classifiers is combined with the main classification output during training using a weighted sum.
However, during inference, these auxiliary classifiers are typically discarded.

4. Batch Normalization and Activation Functions: InceptionV3 incorporates batch


normalization and ReLU activation functions after each convolutional layer. Batch normalization
helps stabilize and accelerate training by normalizing the activations of each layer, while ReLU
introduces non-linearity into the network.

5. Pre-trained Model: Google has released InceptionV3 as a pre-trained model trained on the
ImageNet dataset, which contains millions of labeled images across thousands of categories. This
pre-training allows users to leverage transfer learning, where the pre-trained model's weights are
fine-tuned on a specific dataset or task with relatively fewer labeled examples.

Department of CSE,LBRCE 17
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

Figure 4.4. Inceptionv3 Process

4.3.3.2 Xception

Xception (Extreme Inception) is a convolutional neural network (CNN) architecture


proposed by François Chollet, the creator of the Keras deep learning framework. It's inspired by
the Inception architecture but introduces a novel concept called depthwise separable
convolutions. Xception aims to improve both the efficiency and effectiveness of deep learning
models for image classification tasks. Here's an explanation of Xception:

1.Depth Wise Separable Convolutions: The key innovation in Xception is the use of depth
wise separable convolutions as the primary building block. This operation consists of two steps:
depthwise convolution and pointwise convolution. Depthwise convolution applies a single filter
to each input channel separately, resulting in a set of output channels. This step captures spatial
correlations within each channel independently.Pointwise convolution applies 1x1 filters across
all channels of the depthwise convolution output. This step enables cross-channel information
exchange and feature combination. Depthwise separable convolutions are computationally
efficient compared to traditional convolutions, as they reduce the number of parameters and
computations while preserving representational capacity.

Department of CSE,LBRCE 18
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

2. Xception Blocks: Xception architecture is composed of multiple Xception blocks, each


containing depthwise separable convolutions along with skip connections. Each Xception block
typically consists of depth wise separable convolutions, followed by batch normalization and
activation functions like ReLU. The skip connections facilitate the flow of information through
the network, aiding in gradient propagation and training of deeper networks.

3. Entry and Exit Flows: Xception includes entry and exit flow modules to handle the input and
output data, respectively. The entry flow consists of a series of convolutional and pooling layers
to process the input image and extract features. The exit flow typically involves global average
pooling, fully connected layers, and softmax activation for classification.

4. Batch Normalization and Activation Functions: Similar to other CNN architectures,


Xception employs batch normalization and activation functions (e.g., ReLU) to stabilize and
introduce non-linearity into the network. Batch normalization normalizes the activations of each
layer, making the training process more stable and accelerating convergence.

5. Pre-trained Model: Xception is often used as a pre-trained model, trained on large datasets
like ImageNet. This pre-training allows users to leverage transfer learning, where the pre-trained
model's weights are fine-tuned on specific datasets or tasks with fewer labeled examples.

Figure 4.5. Xception Process

Department of CSE,LBRCE 19
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4.3.3.3 RestNet50

ResNet50 is a convolutional neural network (CNN) architecture that belongs to the family of
Residual Networks (ResNets). ResNets were introduced by Kaiming He et al. in their seminal
paper "Deep Residual Learning for Image Recognition" in 2015. ResNet50 specifically refers to
a variant of ResNet that contains 50 layers, including convolutional layers, pooling layers, and
residual blocks. Here's an explanation of ResNet50:

1. Residual Blocks: The fundamental building block of ResNet is the residual block. It contains
two convolutional layers with Batch Normalization (BN) and Rectified Linear Unit (ReLU)
activation functions, followed by a skip connection. The skip connection, also known as a
shortcut or identity connection, bypasses the convolutional layers and directly adds the input to
the output of the convolutional layers. Mathematically, the output of a residual block is given by:
\(Y = F(X) + X\), where \(X\) is the input, \(F(X)\) is the output of the convolutional layers, and
\(Y\) is the final output of the block.

2. ResNet50 Architecture: ResNet50 consists of multiple stages, each containing a different


number of residual blocks. The first stage typically includes a single convolutional layer
followed by a max-pooling layer, which reduces the spatial dimensions of the input feature maps.
Subsequent stages consist of several residual blocks, with the number of blocks increasing as the
spatial dimensions decrease. The convolutional layers within each block have increasing
numbers of filters to capture increasingly abstract features.

3. Identity Mapping: The key insight behind ResNet's success is the use of identity mappings
through the skip connections. By allowing the input signal to directly propagate through the
network without undergoing nonlinear transformations in the convolutional layers, the gradient
flow during backpropagation is facilitated. This helps mitigate the vanishing gradient problem,
enabling the training of very deep networks with improved performance.

Department of CSE,LBRCE 20
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4. Batch Normalization and Activation Functions: Batch normalization and ReLU activation
functions are applied after each convolutional layer in ResNet50. Batch normalization
normalizes the activations of each layer, stabilizing the training process and accelerating
convergence. ReLU introduces non-linearity into the network, allowing it to learn complex
mappings from the input to the output.

5. Fully Connected Layers: ResNet50 typically ends with one or more fully connected layers
followed by a softmax activation function for multi-class classification tasks. These fully
connected layers map the high-level features extracted by the convolutional layers to the output
classes.

Figure 4.6. RestNet50 Process

Department of CSE,LBRCE 21
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4.2 UML DIAGRAMS

In the field of software engineering, the Unified Modeling Language (UML) is a


standardized visual specification language for object modeling. UML is a general-purpose
modeling language that includes a graphical notation used to create an abstract model of a
system, referred to as a UML model. The model also contains a “Semantic backplane”-
documentation such as written use cases that drive the model elements and diagrams.

Importance of UML in Modeling:


A modeling language is a language whose vocabulary and rules focus on the conceptual
and physical representation of a system. A modeling language such as UML is thus a standard
language for software blueprints. The UML is not a visual programming language, but its models
can be directly connected to various programming languages. This means that it is possible to
map from a model in the UML to a programming language Java, C++ or Visual Basic, or even to
tables in relational database or the persistent store of an object oriented database. This mapping
permits forward engineering: the generation of code from a UML model into a programming
language. The reverse is also possible you can reconstruct a model from an implementation back
into UML.

This is a programming language that is used for object-oriented software


development. To organize program code more efficiently, programmers often create
“objects” that are sets of structured data within programs. UML, which has been
standardized by the Object Management Group (OMG), was designed for this purpose. The
language has gained enough support that it has become a standard language for visualizing
and constructing software programs.

A conceptual model of UML:


The three major elements of UML are

● The UML’s basic building blocks


● The rules that dictate how those building blocks may be puttogether
● Some common mechanism that apply throughout theUML

Department of CSE,LBRCE 22
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4.2.1 Use case Diagram:


A use case diagram shows a set of use cases and actors and their relationships. We
apply the use case diagram to illustrate the static use case view of a system. Use case
diagrams are especially important in organizing and modeling the behaviors of a system.

Figure 4.7. Use case diagram

4.2.1 Class Diagram:


Classes are the most important building block of any object oriented system. A class
isa description of a set of objects that share the same attributes, operations, relationships and
semantics. A class implements one or more interfaces. It is graphically rendered as a
rectangle.

Department of CSE,LBRCE 23
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

IDENTIFYING RELATIONSHIPS:
In UML the ways that things can connect to each other wither logically or physically
are modeled as relationships. In object-oriented modeling there are three kinds of
relationships that are most important, they are

1. Dependencies : It is a using relationship that states that a change in specification of one


thing may affect another thing that uses each. Graphically dependency is rendered as a
dashed directed line.
2. Generalization : It is the relationship between a general thing (called parent) and a more
specific kind of that thing (called the child). Generalization is sometimes called ‘is-a-kind-
of’ relationship. It means that objects of the child may be used anywhere that parent may
appear. Graphically it is rendered as a solid directed line with a large open arrow head
pointing to the parent.

3. Association : It is a structural relationship that specifies that objects of one thing are
connected to the objects of another. The associations that connect more than two classes are
called n-array associations. Graphically it is rendered as a solid line connecting the same or
different classes.

Figure 4.8. Class Diagram

Department of CSE,LBRCE 24
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4.2.1 Activity Diagram:


The purpose of an activity diagram is to provide a view of flows and what is going on
inside a use case or among several classes. An activity diagram is just to explain the internal
operations performed and also the transitions that are triggered by the completion of the
particular operations. At the abstract level it explains the sequence of the activities. This focus
on the events occurring to a single object as it responds to messages, an activity diagram can be
used to model an entire process. Activity diagram commonly contains:

Activity states and action states

Calling an operation on an object, sending a signal to an object or even creating or


destroying an object, these executable computations are called action states because they
are the states of the system, representing the execution of an action. Activity states can be
further decomposed, their activity being represented by other activity diagrams; these may
be interrupted and take some duration to complete.
Transitions

When the action or activity of a state completes, flow of control passes immediately
to the next action or activity state. You specify this flow by using transitions to show the
path from one action or activity state to the next action or activity state. You represent this as
a simple directed line.

Object Flow

Objects may be involved in the flow of control associated with an activity diagram.
The use of dependency relationships and objects is called an object flow because it
represents participation of an object in the flow of control.

Department of CSE,LBRCE 25
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

Figure 4.9. Activity Diagram

Department of CSE,LBRCE 26
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

4.2.2 Algorithm
# Step 1: Import Dependencies and Prepare Dataset
- Import necessary libraries
- Mount Google Drive to access the dataset
- Unzip and preprocess the dataset
- Define directories and constants
# Step 2: Load and Augment Image Data
- Use ImageDataGenerator to load and augment images
- Show sample images for visualization
# Step 3: Apply SMOTE Oversampling
- Use SMOTE to balance the dataset
# Step 4: Split Dataset into Train, Test, and Validation Sets
- Split the dataset into train, test, and validation sets
# Step 5: Create and Train Models
- Define functions to create and train models
- Create base models (InceptionV3, Xception, ResNet50)
- Train the models on the training data
# Step 6: Evaluate Models
- Evaluate the trained models on the test dataset
# Step 7: Create and Train Ensemble Model
- Load trained individual models
- Create an ensemble model using the loaded models
- Train the ensemble model on the test data
# Step 8: Evaluate Ensemble Model
- Evaluate the ensemble model on the test dataset
# Step 9: Conclusion
- Print final accuracy metrics and visualization

Department of CSE,LBRCE 27
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

5. CODING IMPLEMENTATION
CODE :

#Importing the dataset from google drive, unzipping it and pre-processing

from google.colab import drive

drive.mount('/content/gdrive')

!unzip gdrive/MyDrive/alzheimers_data.zip

!pip install imblearn

import numpy as np

import pandas as pd

import seaborn as sns

import tensorflow as tf

import matplotlib.pyplot as plt

import os

from distutils.dir_util import copy_tree, remove_tree

from PIL import Image

from random import randint

from imblearn.over_sampling import SMOTE

from sklearn.model_selection import train_test_split, KFold

from sklearn.metrics import matthews_corrcoef as MCC

Department of CSE,LBRCE 28
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

from sklearn.metrics import balanced_accuracy_score as BAS

from sklearn.metrics import classification_report, confusion_matrix

from sklearn.model_selection import KFold

#!pip install -U tensorflow-addons==0.11.2

!pip install -U tensorflow-addons==0.16.1

from tensorflow.keras.applications.inception_v3 import InceptionV3

from tensorflow.keras.applications.xception import Xception

from tensorflow.keras.applications.resnet50 import ResNet50

#from keras_efficientnets import EfficientNetB7

import tensorflow_addons as tfa

from keras.utils.vis_utils import plot_model

from tensorflow.keras import Sequential, Input

from tensorflow.keras.layers import Dense, Dropout

from tensorflow.keras.layers import Conv2D, Flatten

from tensorflow.keras.callbacks import EarlyStopping

tensorflow.keras.preprocessing.image import ImageDataGenerator as IDG

from tensorflow.keras.layers import SeparableConv2D, BatchNormalization, MaxPool2D

print("TensorFlow Version:", tf.__version__)

base_dir = "Alzheimer_s Dataset/"

Department of CSE,LBRCE 29
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

root_dir = "./"

test_dir = base_dir + "test/"

train_dir = base_dir + "train/"

work_dir = root_dir + "dataset/"

if os.path.exists(work_dir):

remove_tree(work_dir)

os.mkdir(work_dir)

copy_tree(train_dir, work_dir)

copy_tree(test_dir, work_dir)

print("Working Directory Contents:", os.listdir(work_dir))

WORK_DIR = './dataset/'

CLASSES = [ 'NonDemented',

'VeryMildDemented',

'MildDemented',

'ModerateDemented']

IMG_SIZE = 176

IMAGE_SIZE = [176, 176]

DIM = (IMG_SIZE, IMG_SIZE)

ZOOM = [.99, 1.01]

Department of CSE,LBRCE 30
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

BRIGHT_RANGE = [0.8, 1.2]

HORZ_FLIP = True

FILL_MODE = "constant"

DATA_FORMAT = "channels_last"

work_dr = IDG(rescale = 1./255, brightness_range=BRIGHT_RANGE, zoom_range=ZOOM,

data_format=DATA_FORMAT, fill_mode=FILL_MODE, horizontal_flip=HORZ_FLIP)

train_data_gen = work_dr.flow_from_directory(directory=WORK_DIR, target_size=DIM,

batch_size=6500, shuffle=False)

def show_images(generator,y_pred=None):

"""

Input: An image generator,predicted labels (optional)

Output: Displays a grid of 9 images with lables

"""

# get image lables

labels =dict(zip([0,1,2,3], CLASSES))

# get a batch of images

x,y = generator.next()

# display a grid of 9 images

plt.figure(figsize=(10, 10))

Department of CSE,LBRCE 31
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

if y_pred is None:

for i in range(9):

ax = plt.subplot(3, 3, i + 1)

idx = randint(0, 6400)

plt.imshow(x[idx])

plt.axis("off")

plt.title("Class:{}".format(labels[np.argmax(y[idx])]))

else:

for i in range(9):

ax = plt.subplot(3, 3, i + 1)

plt.imshow(x[i])

plt.axis("off")

plt.title("Actual:{} \nPredicted:{}".format(labels[np.argmax(y[i])],labels[y_pred[i]]))

show_images(train_data_gen)

train_data, train_labels = train_data_gen.next()

print(train_data.shape, train_labels.shape)

Department of CSE,LBRCE 32
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

#SMOTE

sm = SMOTE(random_state=42)

train_data, train_labels = sm.fit_resample(train_data.reshape(-1,

IMG_SIZE * IMG_SIZE * 3), train_labels)

train_data = train_data.reshape(-1, IMG_SIZE, IMG_SIZE, 3)

print(train_data.shape, train_labels.shape)

#Train-Test-Validation Split

train_data, test_data, train_labels, test_labels = train_test_split(train_data, train_labels,


test_size =

0.2, random_state=42)

train_data, val_data, train_labels, val_labels = train_test_split(train_data, train_labels,


test_size =

0.2, random_state=42)

print(train_data.shape)

print(test_data.shape)

print(val_data.shape)

class MyCallback(tf.keras.callbacks.Callback):

def on_epoch_end(self, epoch, logs={}):

if logs.get('val_acc') > 0.99:

Department of CSE,LBRCE 33
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

print("\nReached accuracy threshold! Terminating training.")

self.model.stop_training = True

my_callback = MyCallback()

epochs = 25

IMG_HEIGHT = 176

IMG_WIDTH = 176

#Functions to create and fit base models

def create_model(base_model):

base_model.trainable = True

global_average_layer =

tf.keras.layers.GlobalAveragePooling2D()(base_model.output)

prediction_layer = Dense(4, activation='sigmoid')(global_average_layer)

model = tf.keras.models.Model(inputs=base_model.input,

outputs=prediction_layer)

model.compile(optimizer=tf.keras.optimizers.Adam(lr=0.0001),

loss=tf.losses.CategoricalCrossentropy(), metrics=["accuracy"])

return model

Department of CSE,LBRCE 34
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

def fit_model(model):

history = model.fit(

train_data, train_labels,

epochs=epochs,

validation_data=(val_data, val_labels)

return history

def plot_history(history):

acc = history.history['accuracy']

val_acc = history.history['val_accuracy']

loss=history.history['loss']

val_loss=history.history['val_loss']

epochs_range = range(epochs)

plt.figure(figsize=(12, 6))

plt.subplot(1, 2, 1)

plt.plot(epochs_range, acc, label='Training Accuracy')

plt.plot(epochs_range, val_acc, label='Validation Accuracy')

plt.legend(loc='lower right')

plt.title('Training and Validation Accuracy')

Department of CSE,LBRCE 35
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

plt.subplot(1, 2, 2)

plt.plot(epochs_range, loss, label='Training Loss')

plt.plot(epochs_range, val_loss, label='Validation Loss')

plt.legend(loc='upper right')

plt.title('Training and Validation Loss')

plt.show()

IMG_SHAPE = (176, 176, 3)

base_model1 = InceptionV3(input_shape=IMG_SHAPE, include_top=False,

weights="imagenet")

base_model2 = Xception(input_shape=IMG_SHAPE, include_top=False,

weights="imagenet")

base_model3 = ResNet50(weights='imagenet', include_top=False,

input_tensor=Input(shape=(176, 176, 3)))

model1 = create_model(base_model1)

model2 = create_model(base_model2)

model3 = create_model(base_model3)

base_model2 = Xception(input_shape=IMG_SHAPE, include_top=False,

weights="imagenet")

Department of CSE,LBRCE 36
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

model2 = create_model(base_model2)

history1 = fit_model(model1)

model1.save('sample_data/models/model1A.h5')
history2 = fit_model(model2)

model2.save('sample_data/models/model2B.h5')

history3 = fit_model(model3)

model3.save('sample_data/models/model3C.h5')

final_accuracy1 = history1.history["val_accuracy"][-5:]

print("FINAL ACCURACY INCEPTIONV3 MEAN-5: ", np.mean(final_accuracy1))

final_accuracy2 = history2.history["val_accuracy"][-5:]

print("FINAL ACCURACY XCEPTION MEAN-5: ", np.mean(final_accuracy2))

final_accuracy3 = history3.history["val_accuracy"][-5:]

print("FINAL ACCURACY RESNET50 MEAN-5: ", np.mean(final_accuracy3))

plot_history(history1)

plot_history(history2)

plot_history(history3)

test_scores1 = model1.evaluate(test_data, test_labels)

print("Testing Accuracy: %.2f%%"%(test_scores1[1] * 100))

test_scores2 = model2.evaluate(test_data, test_labels)

print("Testing Accuracy: %.2f%%"%(test_scores2[1] * 100))

Department of CSE,LBRCE 37
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

test_scores3 = model3.evaluate(test_data, test_labels)

print("Testing Accuracy: %.2f%%"%(test_scores3[1] * 100))

def load_all_models():

all_models = []

model_names = ['model1A.h5', 'model2B.h5', 'model3C.h5']

for model_name in model_names:

filename = os.path.join('sample_data/models', model_name)

#filename=model_name

model = tf.keras.models.load_model(filename)

all_models.append(model)

print('loaded:', filename)

return all_models

def ensemble_model(models):

for i, model in enumerate(models):

for layer in model.layers:

layer.trainable = False

ensemble_visible = [model.input for model in models]

ensemble_outputs = [model.output for model in models]

merge = tf.keras.layers.concatenate(ensemble_outputs)

Department of CSE,LBRCE 38
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

merge = tf.keras.layers.Dense(10, activation='relu')(merge)

output = tf.keras.layers.Dense(4, activation='sigmoid')(merge)

model = tf.keras.models.Model(inputs=ensemble_visible, outputs=output)

model.compile(optimizer=tf.keras.optimizers.Adam(lr=0.001),

loss=tf.keras.losses.CategoricalCrossentropy(from_logits=True), metrics=["accuracy"])

return model

models = load_all_models()

model = ensemble_model(models)

from google.colab import drive

drive.mount('/content/drive')

'''

X = [train_data for _ in range(len(model.input))]

X_1 = [test_data for _ in range(len(model.input))]

'''

X = [train_data for _ in range(3)]

X_1 = [test_data for _ in range(3)]

print(len(X))

#Ensemble training

epochs = 50

Department of CSE,LBRCE 39
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

history = model.fit(X, train_labels,

epochs=epochs,

validation_data=(X_1, test_labels)

model.save('sample_data/models/ensemble_model.h5')

model = tf.keras.models.load_model('ensemble_model.h5')

Validation accuracy of ensemble

final_accuracy = history.history["val_accuracy"][-5:]

print("FINAL ACCURACY ENSEMBLE MEAN-5: ", np.mean(final_accuracy))

training and validation accuracy and loss of ensemble

plot_history(history)

Evaluation of Ensemble Performance

from numpy import argmax


from sklearn.metrics import accuracy_score

test_labels[1]

rounded_labels=argmax(test_labels, axis=1)

rounded_labels[1]
# make predictions and evaluate

yhat=model.predict([test_data, test_data, test_data])

Department of CSE,LBRCE 40
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

yhat = argmax(yhat, axis=1)

len(yhat)

acc = accuracy_score(rounded_labels, yhat)

print('Stacked Test Accuracy: %.3f' % acc)

cm = confusion_matrix(rounded_labels, yhat)

cm

print(classification_report(rounded_labels, yhat, target_names=CLASSES))

#pred_ls = np.argmax(pred_labels, axis=1)

#test_ls = np.argmax(test_labels, axis=1)

conf_arr = confusion_matrix(rounded_labels, yhat)

plt.figure(figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')

ax = sns.heatmap(conf_arr, cmap='Greens', annot=True, fmt='d', xticklabels=CLASSES,

yticklabels=CLASSES)

plt.title('Alzheimer\'s Disease Diagnosis Ensemble Model')

plt.xlabel('Prediction')

plt.ylabel('Truth')

plt.show(ax)

model1 = tf.keras.models.load_model('model1A.h5')

yhat1=model1.predict(test_data)

Department of CSE,LBRCE 41
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

yhat1 = argmax(yhat1, axis=1)

acc1 = accuracy_score(rounded_labels, yhat1)

print('Inception Test Accuracy: %.3f' % acc1)

cm1 = confusion_matrix(rounded_labels, yhat1)

cm1

print(classification_report(rounded_labels, yhat1, target_names=CLASSES))

plt.figure(figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')

ax = sns.heatmap(cm1, cmap='Greens', annot=True, fmt='d', xticklabels=CLASSES,

yticklabels=CLASSES)

plt.title('Alzheimer\'s Disease Diagnosis InceptionV3 Model')

plt.xlabel('Prediction')

plt.ylabel('Truth')

plt.show(ax)

Evaluation of Xception

model2 = tf.keras.models.load_model('model2B.h5')

yhat2=model2.predict(test_data)

yhat2 = argmax(yhat2, axis=1)

acc2 = accuracy_score(rounded_labels, yhat2)

print('Xception Test Accuracy: %.3f' % acc2)

Department of CSE,LBRCE 42
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

cm2 = confusion_matrix(rounded_labels, yhat2)

cm2

print(classification_report(rounded_labels, yhat2, target_names=CLASSES))

plt.figure(figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')

ax = sns.heatmap(cm2, cmap='Greens', annot=True, fmt='d', xticklabels=CLASSES,

yticklabels=CLASSES)

plt.title('Alzheimer\'s Disease Diagnosis Xception Model')

plt.xlabel('Prediction')

plt.ylabel('Truth')

plt.show(ax)

model3 = tf.keras.models.load_model('model3C.h5')

yhat3=model3.predict(test_data)

yhat3 = argmax(yhat3, axis=1)

acc3 = accuracy_score(rounded_labels, yhat3)

print('ResNet50 Test Accuracy: %.3f' % acc3)

cm3 = confusion_matrix(rounded_labels, yhat2)

cm3

print(classification_report(rounded_labels, yhat3, target_names=CLASSES))

plt.figure(figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')

Department of CSE,LBRCE 43
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

ax = sns.heatmap(cm3, cmap='Greens', annot=True, fmt='d', xticklabels=CLASSES,

yticklabels=CLASSES)

plt.title('Alzheimer\'s Disease Diagnosis ResNet50 Model')

plt.xlabel('Prediction')

plt.ylabel('Truth')

plt.show(ax)

pip install visualkeras

import visualkeras

visualkeras.layered_view(model)

visualkeras.layered_view(model1)

visualkeras.layered_view(model2)

visualkeras.layered_view(model3)

Department of CSE,LBRCE 44
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

6. SYSTEM TESTING

6.1 OVERVIEW OF TESTING

Software Testing is evaluation of the software against requirements gathered from


users and system specifications. Testing is conducted at the phase level in software
development life cycle or at module level in program code. Software testing comprises
Validation and Verification.

6.2 TYPES OF TESTS

6.2.1 Functional Testing

Verify that data preprocessing steps (e.g., normalization, quality control, missing
value imputation) are executed accurately. Ensure supervised attribute clustering and
mutual information enhancement techniques are applied correctly. Verify that machine
learning models are trained and evaluated properly.

6.2.2 Integration Testing:

Test the interactions and interfaces between different components such as data
preprocessing modules, supervised attribute clustering algorithms, mutual information
enhancement techniques, and machine learning classifiers. Ensure seamless data flow
between these components without errors or inconsistencies.

6.2.3 Performance Testing:

Measure the time taken to preprocess data, cluster gene expression profiles, calculate
mutual information scores, train machine learning models, and evaluate model
performance.Assess the system's speed, scalability, and resource utilization under various
conditions.

Department of CSE,LBRCE 45
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

6.2.4 Accuracy Testing:

Evaluate the correctness and reliability of the system's predictions or classifications by


comparing predicted disease labels with known ground truth labels.Use metrics such as
classification accuracy, sensitivity, specificity, and AUC-ROC to quantify the accuracy of the
system's predictions.

6.2.5 Robustness Testing:

Assess the system's ability to handle unexpected inputs, errors, or edge cases
gracefully.Introduce noise or perturbations into the input data. Simulate missing or corrupted
data .Test the system's resilience to outliers or abnormalities in gene expression profiles.

Algorithm Accuracy

InceptionV3 95.60%

Xception 91.39%

RestNet50 95.60%

Table 6.1. Testing Accuracy for various Algorithms

Department of CSE,LBRCE 46
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

7. RESULTS

Figure 7.1. Accuracy and performance of base models

Figure 7.2. Training and validation accuracy and loss of ensemble

Department of CSE,LBRCE 47
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

Figure 7.3. Training and validation accuracies, losses of three models in order

Department of CSE,LBRCE 48
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

8. CONCLUSION

This research introduces the E2AD2C framework, em- ploying CNN architectures
within a deep learning setup for Alzheimer’s disease detection and the classification of
medical images. It devises binary classifications for each class pair, focusing on the distinctive
phases of AD. The approach encompasses two main strategies: first, it leverages transfer
learning using an enhanced VGG19 model for multi-class image categorization. Second, it
implements straightforward CNN architectures relying on 2D and 3D convolutions to analyze
structural brain scans sourced from the ADNI dataset. An integral part of this framework is a
web application tailored for remote Alzheimer’s disease screening. This application empowers
patients and physicians to evaluate AD stages within the spectrum and receive relevant
recommendations. The study meticulously compares nine performance metrics between the
two approaches, highlighting the effectiveness of the proposed architectures. These models
ensure efficient processing times while mitigating overfitting, reducing memory requirements,
and managing computational complexity. Impressively, the 2D and 3D CNN architectures
attain high accuracies of 93.61classifications. The pre-trained VGG19 model exhibits
outstanding performance, achieving an impressive accuracy of 97to explore the efficacy of
additional pre-trained models, such as Efficient Net B0 to B7, for multiclass AD stage
classifications. Basic techniques for data augmentation are also included in the paper, and the
DCGAN approach will be used for additional improvement. By highlighting Alzheimer’s
traits prior to AD stage classifications, MRI segmentation techniques will be used to provide a
more detailed picture of the disease’s course. This thorough method highlights the potential of
the suggested framework in improving the identification, categorization, and remote screening
of Alzheimer’s disease.

Department of CSE,LBRCE 49
DETECTING ALZHEIMER'S DISEASE THROUGH DEEP LEARNING MODELS

9. REFERENCES

[1] Singh SP, Wang L, Gupta S, Goli H, Padmanabhan P, Gulya´s B. 3D Deep learning on
medical images: a review, 2020;1–13

[2] Jo T, Nho K, Saykin AJ. Deep learning in Alzheimer’s disease: diagnos- tic classification
and prognostic prediction using neuro- imaging data,Frontiers in Aging Neuroscience. 2019;11

[3] Wen J, et al. Convolutional neural networks for classification of Alzheimer’s disease:
overview and reproducible evaluation, MedicalImage Analysis. 2020;63:101694

[4] Altinkaya E, Polat K, Barakli B. Detection of Alzheimer ’ s disease and dementia states
based on deep learning from MRI images: a comprehensive review. 2020;39–53

[5] Physicians PC. 2020 Alzheimer’s disease facts and figures. Alz- heimer’s Dement.
2020;16(3):391–460. Yang Y, Li X, Wang P, Xia Y, Ye Q. Multi-Source transfer learning via
ensemble approach for initial diagnosis of Alzhei- mer’s disease, IEEEJ Transl Eng Heal Med.
2020;1–10

[6] Adelina C. The costs of dementia: advocacy, media, and stigma. Alzheimer’s Dis Int
World Alzheimer Rep. 2019;2019:100–1.
[7] Pulido MLB, Herna´ndez JBA, Ballester MAF, Gonza´lez CMT, Mekyska J, Sme´kal Z.
Alzheimer’s disease and automatic speech analysis: a review, Expert Syst Appl.2020;150.

[8] Irankhah E. Evaluation of early detection methods for Alzheimer’s disease.


2020;4(1):17–22

.[9] He Y, et al. Regional coherence changes in the early stages of Alzheimer’s disease: a
combined structural and resting-state functional MRI study. Neuroimage. 2007;35(2):488– 500

[10] https://www.kaggle.com/datasets/ninadaithal/imagesoasis

Department of CSE,LBRCE 50
Detecting Alzheimer’s Disease through Deep Learning
Models
Jayaram Behara K.Prathyusha M.Hima Vamsi Reddy
Computer Science and Engineering Computer Science and Engineering Computer Science and Engineering
Department Department Department
Lakireddy Bali Reddy College of Lakireddy Bali Reddy College of Lakireddy Bali Reddy College of
Engineering, Engineering, Engineering,
Mylavaram,India Mylavaram, India Mylavaram, India
[email protected] [email protected] [email protected]

Dr.J.Nageswara Rao
Associate Professor
Computer Science and Engineering
Department
Lakireddy Bali Reddy College of
Engineering,
Mylavaram,India
[email protected]

Abstract— An end-to-end structure for deep learning is fifty million dementia cases worldwide, and it is anticipated
presented in this work to improve Alzheimer's Disease (AD) the it would increase to 152 million by the year 2050. This
early detection and categorization. It tackles the multi-class emphasizes its need for prompt diagnosis and efficient
classification of AD stages by utilizing convolutional neural treatment. Proactive action is urgently needed to combat the
networks (CNNs), providing both general stage classification
escalating burden of AD, as evidenced by the estimated $1
and a binary categorization within each pair of classes. Two
primary methods are investigated: transfer learning using the trillion yearly cost by 2030 [7].
VGG19 model and basic CNN architectures for brain
structural imaging. The online application that the framework
culminates in for distant AD tests offers vital help during the
COVID-19 epidemic. Evaluation measures show how well the
CNN designs work, with the improved VGG19 model achieving
especially high accuracy rates. The results of the experiments
show the benefits of the CNN designs in terms of memory
requirements, computational complexity, and ease of use.
Notably, the 2D and 3D CNNs achieve remarkable accuracy
rates at 93.61% and 95.17%, accordingly, on multiple classes
of Alzheimer's disease stages classification. Furthermore, an
accuracy of 97% in multiple classes of Alzheimer's disease
stages classification is achieved by the optimized VGG19
model.
Figure.1 Percentage of the population impacted by AD
Keywords— Deep Learning, Alzheimer’s Disease, Brain
MRI, Convolutional Neural Networks, Medical Image When it comes to age demographics, the prevalence of AD
Categorization.
varies, but estimates indicate that the number of affected
people will increase significantly, especially among the
I. INTRODUCTION elderly [5]. In the country of America alone, more than five
million adults aged 65 and older had Dementia in 2020; by
Alzheimer's Dementia accounts for 60 and 80 percentage in 2050, that Figure.1 is projected to grow to thirteen million
dementia cases worldwide, making it the most prevalent [5]. Despite these alarming statistics, effective treatment
kind of dementia [1, 2]. This neurodegenerative disease methods for AD are still elusive, highlighting the need of
often begins slowly, initially manifesting as mild cognitive early detection in lessening its effects [8, 9]. Conventional
impairment (MCI), which subsequently progresses to a more methods for diagnosing AD frequently depend on manual
severe form of cognitive loss. Memory loss, cognitive feature extraction, making assumptions about anatomical or
impairments, and difficulty doing fundamental tasks are functional abnormalities in the brain [14,15]. These
only a few of the damage that AD causes to brain cells [3, techniques require technical skill, take a lot of time, and are
4]. Due to its progressive nature, mitigating its debilitating subjective. Particularly, convolutional neural networks, also
effects requires early detection and intervention methods. called CNNs, have become recognized as a viable method to
Given their increased risk of Alzheimer's Dementia, it is overcome these constraints in deep learning [17, 18]. CNNs
imperative to identify humans with moderate memory loss show potential in the diagnosis of AD since they can
[5, 6]. On the other hand, AD frequently modifies brain automatically extract features, removing the requirement for
structure long before symptoms manifest, delaying manually produced features.
diagnosis. ADI reports that there are currently greater than
This article presents a novel framework based on deep III. DATASET DESCRIPTION
learning techniques and CNNs: the Early Identification and
Categorization of Alzheimer's Disease End-to-End The 6,400 brain MRI images in the dataset utilized in this
(E2AD2C) architecture. The system aims to accurately study were carefully chosen to represent different stages of
classify four stages of AD and facilitate remote AD Alzheimer's disease (AD). These images, which are from
assessment through the use of a proposed web application. the well-known dataset (Table.1) and machine learning
With the use of CNN architectures and transfer learning, this website Kaggle, show four different stages of the AD
system seeks to revolutionize AD detection and spectrum. Several techniques may be used to correct the
categorization, offering a viable route toward precise and dataset's class imbalance. First of all, strategies like under
effective diagnosis. A review of related works, an sampling majority classes or oversampling minority classes
explanation of the problem statement, an outline of the (for example, by employing synthetic data creation
proposed solution, a discussion of materials and techniques like SMOTE) might assist in achieving a balance
methodologies, an experimental report, model evaluations, in sample distribution across classes. Furthermore, by giving
and a conclusion summarizing the study's contributions and minority classes greater weights during model training, class
implications comprise the various sections that make up this weights can lessen the effects of class imbalance. Moreover,
paper combining predictions from several classifiers trained on
II. LITERATURE SURVEY
various subsets of the data through the use of ensemble
techniques like bagging or boosting might enhance overall
performance. The dataset is made up of brain MRI scans,
Payan et al. (2019): Sparse Automatic encoders and 3D each carefully labeled and grouped into one of the four
Computational Neural Networks for AD Detection A sparse distinct phases of AD listed below:
autoencoder in combination with 3D convolutional neural
systems is used to detect AD based on brain MRI scans. Class Number of Data Samples
Even if the pre-trained convolutional layer wasn't fine-
tuned, 3D convolutions have an advantage over 2D Non-demented 3200
convolutions that suggests fine-tuning could result in Very mild demented 2240
performance benefits [20]. CNN architectures (Sarraf et al.,
[21], Hosseini et al. Adaptable a three-dimensional with Mild demented 896
Deep Supervision Pre-training evaluation was conducted Moderate demented 64
using CAD-Dementia datasets and tenfold cross-validation

CNN Architecture Performance Comparison (Korolev et Table.1 Distinct phases of AD


al.[23]): Plain 3D CNN architectures and residual network
topologies are compared for AD classification on structural Each stage is represented by a subset of MRI scans, making
MRI brain data. Talk about the difficulties caused by the it easier to analyze and categorize throughout the whole
complexity and depth of the network on performance. range of AD progression. The dataset, which consists of
Khvostikov et al. [25], Wang et al. [24], CNN Structures 6,400 brain MRI images, is large enough to enable accurate
and Fusion Strategies: investigation of different CNN training and validation of the proposed model for accurate
architectures for AD detection and classification, including identification and classification of different stages of
Had-Net and Inception-based CNNs. performance Alzheimer's disease. Preprocessing of the data obtained
optimization by targeted architecture decisions, feature from Kaggle involved labeling, curation, and segmentation
extraction, and fusion methods. in order to ensure the accuracy and integrity of the dataset
for training and evaluating the proposed model for AD
Transfer Learning with CNN-based Models (Spasov et al., detection and classification.
[27], Jain et al., [32]): use of pretrained models and VGG-16
as transfer learning techniques for AD diagnosis, with a
focus on simplifying tasks and minimizing complexity. The IV. TECHNIQUES AND RESOURCES
suggestion and evaluation of mathematical models for the
extraction and classification of features based on CNN. Effective management and intervention of Alzheimer's
Creative Methods for Multi-Modal Analyses (Wang et al. disease depend on early detection. We want to provide a
[30], Ge et al. [33]): Creation of unique CNN frameworks comprehensive framework designed particularly for the
for feature fusion and multi-modal MRI data analysis. accurate and timely identification of the various phases of
Introduction of cutting-edge designs for AD classification, dementia caused by Alzheimer. The workflow, preparatory
such as Graph Convolutional Neural Networks (GCNN) and steps, and medical methods of the E2AD2C framework will
3D multi-scale CNNs. Other Modalities and Multi-Model be thoroughly explained in the following sections.
Frameworks (Liu et al. [35, 36]): Utilization of speech
information and multi- model deep learning frameworks Step 1: Data Acquisition: Here obtained 2D T1-weighted
involving speech and structural MRI data for AD detection MRI scans as our training data using the Alzheimer's
and classification. Introducing handwriting processes, 3D Disease (AD) Neuroimaging Initiative (NI) or ADNI
CNN architectures, and cognitive models utilized for four dataset. These pictures provide a variety of DICOM-
dimensions of MRI visuals for the diagnosis and staging of formatted medical image descriptions, such as aligned,
AD. slanting, and axially views. There are 300 patients in the
sample, divided into 4 groups: Alzheimer's disease, Mild Step 6: Application: Upon identifying the most qualified
Neurocognitive Disorder, Normal Control (NC), Late Onset models derived from the evaluation phase, here propose the
Mild Cognitive Impairment. There are seventy-five patients development of an AD checking web application. This
in each class, which adds up to 21,816 scans overall. In application aims to facilitate remote AD assessment,
particular, 5,764 photos under AD class, 5,817 under EMCI, allowing both doctors and patients to remotely evaluate AD
3,460 under LMCI, and 6,775 under NC. Every image was status. By determining the specific Alzheimer's stage within
set to a 2D dimension of 256 × 256 pixels. Table 1 provides the AD spectrum, the application offers personalized advice
information on the 300 respondents' mean ages, class and guidance tailored to the patient's current for the entire
distribution, gender ratio, and standard deviations for a structure. The changes each approach makes to the data
thorough demographic summary. Furthermore, three distribution. stage. See Figure.3, which shows the full
separate perspectives of MRI scan slices. This title aims to pipeline of the suggested framework, for a visual depiction
capture the essence of the study, emphasizing the use of of the process.
deep learning techniques, particularly convolutional neural
networks (CNNs), to enable early detection and
classification of Alzheimer’s Disease (AD) across its
spectrum. Additionally, it highlights the significance of the
proposed end-to-end architecture in addressing the multi-
class categorization of AD stages and its potential impact on
remote AD examinations, particularly in the context of
challenges posed by the COVID-19 pandemic.

Step 2: Preconditioning: The resampling techniques, such as


over-sampling and under sampling, to correct the class
imbalance in the original dataset. Under sampling meant
lowering instances in the overrepresented class (NC),
whereas over sampling involved multiplying cases in those
from underrepresented classes (AD, EMCI, LMCI). Upon
repetitions, each of the AD categories has six thousand MRI
scans, resulting in a balanced collection of twenty-four
thousand scans. To reduce picture distractions, the raw data
set was subsequently analyzed, manipulated, transformed
using non-local means method.

Step 3: Data Enhancement: Since there aren't enough


clinical datasets, here used conventional methods like
rotational and reflections (reversing) to enhance our dataset.
With twelve thousand illustrations per class, these
augmentations increased the original data set size to forty-
eight thousand illustrations. Through the addition of extra
variability to the training set, data augmentation seeks to Figure.2 An illustration of how to normalize an MRI picture
optimize the dataset and reduce over-fitting problems

Step 4: Medical Image Classification: The multi-


classification of the four stages within the AD spectra
constitutes this crucial stage. Furthermore, distinct binary
classifications are carried out for every pair of classes. Two
different approaches are applied to medical imagery
classification. Initial approach utilizes 2D and 3D
transformations to create basic CNN structures that are
specifically designed to 2D and 3D neural structure MRI Figure.3 An illustration of how to normalize an MRI picture
images shown in Figure.2. The construction of these CNN
structures begins at the very beginning. By comparison,
another approach makes use of transfer learning techniques V. METHODS FOR PREPROCESSING
and improves performance by using the VGG19 model with
its weights that were previously trained. Reducing the dataset's axial amount scores or pixel area is
known as regularization of the data. The primary objective
Step 5: Evaluation: Using 9 performance criteria, the is to minimize data variances, such as subject position or
efficacy and performance of both approaches, as well as the image contrast fluctuations, to make small differences more
CNN structures, are carefully evaluated. These metrics visible. Data can be normalized in a number of methods,
function as standards for assessing the precision and including zero-mean, unit variation standardization,
effectiveness of the categorization techniques used in the rescaling to the [0, 1] range, and others. Several approaches
model.
might be taken into consideration to improve the Figure.4 An example of the convolutional process
performance of the suggested deep learning structure for
Alzheimer's Disease detection. First, to further increase
classification accuracy, the use of more sophisticated CNN
designs or ensemble approaches might be investigated.
Furthermore, model performance may be optimized by
adjusting hyperparameters like learning rate, batch size, and
regularization strategies. Moreover, expanding the training
dataset's diversity and size—possibly by using data
augmentation techniques—can aid in the model's
generalization and strengthen its resilience. Including other
modalities or characteristics, such genetic information or
biomarkers, may potentially yield useful information for a
more precise diagnosis. Finally, there may be more chances
to improve the efficacy and efficiency of the suggested
framework in the future thanks to current studies into
cutting-edge deep learning algorithms and developments in Figure.5 The distinction between the activation functions of
hardware infrastructure. the sigmoid, Relu, and LRelu

VI. SUGGESTED METHODS FOR CLASSIFICATION There are three layers to it:

The typical construction of machine learning approaches An activation map with dimensions of AH × AW is created
involves three essential steps: feature extraction, feature when the Convolution Layer functions, where AH denotes
reduction, and classification. However, with typical activation height and AW denotes activation width. By
Convolutional Neural Networks (CNNs), both phases computing AH and AW using equations 1 and 2, it is
seamlessly converge, negating the need for human feature ensured that important features will be extracted while
extraction. By applying weights that they have learnt, the preserving the spatial properties of the input image. This
initial layers of CNNs function as feature extractors, method increases the model's ability to extract relevant
removing relevant patterns and representations from the information by employing convolutions, which increases the
input data. These weights are regularly refined through Convolutional Neural Network's (CNN) overall efficacy.
iterative learning, which gradually raises the model's
efficacy and flexibility. Because of their iterative learning
process, which allows them to continuously improve their
interpretation of input data, CNNs (Figure.4) are useful tools
for a range of machine learning applications.

In conclusion, CNNs are unique in the field of machine


learning because of their ability to automatically extract
features and recognize complex patterns from data. Because
Next, let's talk about the Pooling Layer, which primary
of this, they excel at activities involving images, where their
objective is to lower dimensionality. This layer
ability to understand hierarchical features comes in very
systematically decreases the spatial dimensions of the
handy. For automatic pattern identification and
feature map without losing any important information. By
classification, CNNs are a recommended option due to their
this reduction process, the Pooling Layer ensures
effectiveness and adaptability, which are further improved
computational efficiency and prevents overfitting.
by the iterative learning process that continuously refines
Subsequently, the Fully Connected Layer takes over
weights.
responsibility for classification. It does this by transforming
the improved data into a one-dimensional vector, which
Compared to other classifiers, the CNN paradigm
enables categorical predictions.
outperforms them, showcasing its amazing ability to
automatically identify and extract relevant characteristics
The Convolutional Neural Network architecture uses
from raw input. CNNs are the preferred option because of
convolution for extracting features, a completely linked
their innate capability, especially for image-related tasks
layer towards categorization, and the layers of pooling for
where hierarchical feature learning is crucial.
reduction in dimension. CNNs are very helpful for picture
recognition applications because of the way these layers
work together to assess incoming data, extract pertinent
properties, and generate accurate predictions (Figure.5).
(LReLU), determined via Equation-5. The variations among
the three activations.
Figure.6 The comparison among the proposed models (2D-
BMIC and 3D-BMIC) with one another
The SoftMax function [32], which derives its probability
from Eq. 6 for a point of data to belong to every group, is VIII. APPROACHES AND MODEL ASSESSMENT
utilized for the suggested multi-classifier.
Here introduced core CNN architectural models, optimized
for binary and multi-class medical image classification
techniques, including 2D-M2IC, 3D-M2IC, 2D-BMIC, and
3D-BMIC, as well as an improved VGG1 model. The
accuracy of these models is assessed by contrasting their
output with that of other cutting-edge models, as shown in
Table 5. The objective of this comparison analysis is to
determine our suggested models' functionality in the
In the multiple classes classifiers, k represents a set of
medical picture categorization tasks.
groups; x is the intake vectors; ex-i is a accepted norm
exponential equation for the intake vectors; and ex-j is a
standard exponential operation for the result vectors.

Here employed two techniques for AD stage detection and


medical image classification. The first approach makes use
of basic, scratch-built CNN architectures. These
architectural designs serve as competitive instruments for
binary medical image classification (BMIC) and multi-class
medical image classification (M2IC), which handle 2D and
3D magnetic resonance imaging (MRI) via 2D and 3D
convolution. As a result, these structures were identified as
(2D-M2IC, 3D-M2IC, 2DBMIC, and 3D-BMIC). The 2D-
M2IC architecture pairs triple two into two layered a max-
pool kernel and triple three-layered convolutional layering
within a dual-dimensional structure.

VII. EXPERIMENTAL RESULTS

The suggested models are thoroughly assessed using nine


performance measures and a variety of situations. the Area
Under the Curve (AUC), sensitivity (True Positive Rate - Figure.7 Suitability and deviation for 3D-M2IC in training
TPR), accuracy, loss function, the confusion matrix, F1 and validation.
score, and recall, the precision, and the Matthews
Correlation Coefficient (Figure.6) are some examples of The performance of various models in categorizing health
these indicators. The performance indicators employed are pictures among multiple classes related to Alzheimer's
briefly summarized in Table 4, which offers a thorough disease. The refined VGG19 model achieved the highest
summary of the models' efficacy across a range of accuracy (Figure.7) of 97%. Following closely, the 2D-
evaluation criteria. This multipronged strategy guarantees a M2IC model demonstrated a reliability of 93.6%, while the
comprehensive comprehension of the models' strengths and 3D-M2IC model reached 95.17%. Harshit et al. [38] secured
weaknesses in several performance assessment domains. the 4th highest reliability at 93%, whereas Juan Ruiz et al.
[41] showed the smallest reliability of 66.7%. These
findings underscore the efficiency of the proposed
architectures—2D-M2IC, 3D-M2IC, and the optimized
VGG19—in reducing difficulty in computation, overfitting,
and storage requirements while maintaining reasonable
processing speeds.

This further validates the effectiveness of the suggested


architectures (2D-M2IC, 3D-M2IC, 2D-BMIC, 3D-BMIC,
and fine-tuned VGG19) across multiple-classes and binary
medical image classifications within the phases of
Alzheimer's disease, encompassing three multi-class
medical images and twelve binary classifications within the
AD spectrum. Table 6 showcases the models' performance
metrics (precision, recall, and F1 Score) on the test set (2D-
M2IC and 3D-M2IC) after 25 learning epochs.

It also depicts the improvement in accuracy and reduction in


loss for the 2D-M2IC and 3D-M2IC models, comparing Figure.9 The suggested 3D-M2IC's ROC-AUC
training and validation losses. The confusion matrix
provides a comprehensive understanding of model
performance, displaying classification results for AD, IX. WEB SERVICE FOR ALZHEIMER'S CHECKING
LMCI, EMCI, and NC diagnoses. Table 7 presents the
normalized confusion matrix and the confusion matrix for To address the difficulties associated with frequent hospital
the 2D-M2IC and 3D-M2IC models, offering detailed visits during the COVID-19 pandemic, a web application
insights into their classification accuracy across various (Figure.10) that makes use of proposed CNN architectures
diagnostic categories. has been created to enable remote Alzheimer's disease
diagnosis and assessment. The principal goal is to help
Moreover, the Receiver Operating Characteristic - Area doctors and patients manage Alzheimer's disease from a
Under the Curve (ROC-AUC) for the 2D-M2IC (Figure.8) distance while identifying the particular stage on the AD
and 3D-M2IC models (Figure.9), visually indicating their spectrum. The program is written in Python and uses
ability to differentiate between different stages of HTML, CSS, JavaScript, and Bootstrap to build websites.
Alzheimer's disease and normal control across AD, EMCI, There are three main areas on the website. A thorough
LMCI, and NC classes. explanation of Alzheimer's disease, including its
contributing components, is given in the first part. The
phases of Alzheimer's disease are described in depth in the
second part, along with the unique traits associated with
each stage. An interactive virtual physician application can
be found in the third section. Here, doctors or patients can
upload Brain MRI scans, and the application will identify
the corresponding Alzheimer's stage and evaluate the
presence of the disease based on proposed CNN
architectures.

Figure.8 The suggested 2D-M2IC's ROC-AUC

Figure.10 User Interface for 2D-M2IC's ROC-AUC


Then, as shown in Fig. 15, the program provides customized REFERENCES
guidance according to the diagnosed stage of AD.
Alzheimer Checking Web Service has been tested using 1. Singh SP, Wang L, Gupta S, Goli H, Padmanabhan P, Gulyás B.
arbitrarily MRI pictures from the ADNI dataset that 3D Deep learning on medical images: a review, 2020;1–13.
illustrate various phases of Alzheimer's disease. When an 2. Jo T, Nho K, Saykin AJ. Deep learning in Alzheimer’s disease:
MRI image is submitted, the software reliably classifies it diagnostic classification and prognostic prediction using neuro
into one of four Alzheimer's disease phases: AD, EMCI, imaging data, Frontiers in Aging Neuroscience. 2019;11.
LMCI, or NC. The application then makes use of this stage 3. Wen J, et al. Convolutional neural networks for classification of
classification to give the patient personalized Alzheimer’s disease: overview and reproducible evaluation,
recommendations. This cutting-edge web application solves Medical Image Analysis. 2020;63:101694.
the present barriers to healthcare accessibility by enabling 4. Altinkaya E, Polat K, Barakli B. Detection of Alzheimer ’ s
effective remote management of Alzheimer's disease, disease and dementia states based on deep learning from MRI
images: a comprehensive review. 2020;39–53.
decreasing the need for in-person hospital stays, and
offering prompt advice based on precise image analysis. 5. Physicians PC. 2020 Alzheimer’s disease facts and figures.
Alzheimer’s Dement. 2020;16(3):391–460.
6. Yang Y, Li X, Wang P, Xia Y, Ye Q. Multi-Source transfer
X. CONCLUSION learning via ensemble approach for initial diagnosis of Alzhei-
mer’s disease, IEEE J Transl Eng Heal Med. 2020;1–10.
7. Adelina C. The costs of dementia: advocacy, media, and stigma.
This research introduces the E2AD2C framework, Alzheimer’s Dis Int World Alzheimer Rep. 2019;2019:100–1.
employing CNN architectures within a deep learning setup
for Alzheimer's disease detection and the classification of 8. Pulido MLB, Hernández JBA, Ballester MAF, González CMT,
medical images. It devises binary classifications for each Mekyska J, Smékal Z. Alzheimer’s disease and automatic
class pair, focusing on the distinctive phases of AD. The speech analysis: a review, Expert Syst Appl.2020;150.
approach encompasses two main strategies: first, it 9. Irankhah E. Evaluation of early detection methods for
leverages transfer learning using an enhanced VGG19 Alzheimer’s disease. 2020;4(1):17–22.
model for multi-class image categorization. Second, it 10. He Y, et al. Regional coherence changes in the early stages of
implements straightforward CNN architectures relying on Alzheimer’s disease: a combined structural and resting-state
2D and 3D convolutions to analyze structural brain scans func- tional MRI study. Neuroimage. 2007;35(2):488–500.
sourced from the ADNI dataset. 11. Vemuri P, Jones DT, Jack CR. Resting-state functional MRI in
Alzheimer’s disease. Alzheimer’s Res Ther. 2012;4(1):1–9.
An integral part of this framework is a web application 12. Bron EE, et al. Standardized evaluation of algorithms for com-
tailored for remote Alzheimer's disease screening. This puter-aided diagnosis of dementia based on structural MRI: the
application empowers patients and physicians to evaluate CADDementia challenge. Neuroimage. 2015;111:562–79.
AD stages within the spectrum and receive relevant 13. Klöppel S, et al. Accuracy of dementia diagnosis — a direct
recommendations. The study meticulously compares nine com- parison between radiologists and a computerized method.
Brain. 2008;131(11):2969–74.
performance metrics between the two approaches,
highlighting the effectiveness of the proposed architectures. 14. Segato A, Marzullo A, Calimeri F, De Momi E. Artificial intel-
ligence for brain diseases: a systematic review, APL Bioeng.
These models ensure efficient processing times while 2020;4;4.
mitigating overfitting, reducing memory requirements, and
15. Yamanakkanavar N, Choi JY, Lee B. MRI segmentation and
managing computational complexity. Impressively, the 2D classification of the human brain using deep learning for diag-
and 3D CNN architectures attain high accuracies of 93.61% nosis of Alzheimer’s disease: a survey. Sensors (Switzerland).
and 95.17%, respectively, in multi-class AD stage 2020;20(11):1–31.
classifications. The pre-trained VGG19 model exhibits 16. Noor MBT, Zenia NZ, Kaiser MS, Al Mamun S, Mahmud M.
outstanding performance, achieving an impressive accuracy Application of deep learning in detecting neurological disorders
of 97% after refinement in identical tests. Looking ahead, from magnetic resonance images: a survey on the detection of
future research aims to explore the efficacy of additional Alzheimer’s disease, Parkinson’s disease, and schizophrenia,
Brain Informatics, 2020;7(1):11.
pre-trained models, such as Efficient Net B0 to B7, for
multiclass AD stage classifications. 17. Li F, Tran L, Thung K-H, Ji S, Shen D, Li J. A robust deep
model for improved classification of AD/MCI patients. IEEE J
Biomed Heal informatics. 2015;19(5):1610–6.
Basic techniques for data augmentation are also included in
18. Voulodimos A, Doulamis N, Doulamis A, Protopapadakis E.
the paper, and the DCGAN approach will be used for Deep learning for computer vision: a brief review. Comput
additional improvement. By highlighting Alzheimer's traits Intell Neu- rosci. 2018;2018:1–13.
prior to AD stage classifications, MRI segmentation 19. Payan A, Montana G. Predicting Alzheimer’s disease: a
techniques will be used to provide a more detailed picture of neuroim- aging study with 3D convolutional neural networks.
the disease's course. This thorough method highlights the 2015;1–9.
potential of the suggested framework in improving the 20. Jarrett K, Kavukcuoglu K, Ranzato MA, LeCun Y. What is the
identification, categorization, and remote screening of best multi-stage architecture for object recognition?, Proc IEEE
Alzheimer's disease. Int Conf Comput Vis pp. 2146–2153, 2009.
21. Sarraf S, Tofighi G. Classification of Alzheimer’s disease struc-
tural MRI data by deep learning convolutional neural networks.
2016;8–12.
22. Hosseini-asl E, Keynton R, El-baz A. Alzheimer’s disease 40. Basaia S, et al. Automated classification of Alzheimer’s disease
diagnostics by adaptation of 3d convolutional network Electri- and mild cognitive impairment using a single MRI and deep
cal and Computer Engineering Department, University of Lou- neu- ral networks. Neuro Image Clin. 2019;21(2018):101645.
isville, Louisville, KY, USA, Proc. - Int Conf Image Process
41. Boddapati, Mohan Sai Dinesh, et al. "Creating a Protected
ICIP. 2016;(502).
Virtual Learning Space: A Comprehensive Strategy for Security
23. Korolev S, Safiullin A, Belyaev M, Dodonova Y. Residual and and User Experience in Online Education." International
plain convolutional neural networks for 3d brain MRI classifica- Conference on Cognitive Computing and Cyber Physical
tion Sergey Korolev Amir Safiullin Mikhail Belyaev Skolkovo Systems. Cham: Springer Nature Switzerland, 2023.
Institute of Science and Technology Institute for Information
42. Pan D, Zeng A, Jia L, Huang Y, Frizzell T, Song X. Early detec-
Transmission Problems, 2017 IEEE 14th Int. Symp. Biomed.
tion of Alzheimer’s disease using magnetic resonance imaging:
Imaging (ISBI 2017). 2017;835–838.
a novel approach combining convolutional neural networks and
24. Wang SH, Phillips P, Sui Y, Liu B, Yang M, Cheng H. ensemble learning. Front Neurosci. 2020;14(May):1–19.
Classifica- tion of Alzheimer’s disease based on an eight-Layer
43. Vassanelli S, Kaiser MS, Eds NZ, Goebel R. 3D DenseNet
convolutional neural network with leaky rectified linear unit and
ensem- ble in the 4-way classification of Alzheimer’s disease.
max pooling. J Med Syst. 2018;42(5):85.
Series Editors. 2020.
25. Khvostikov A, Aderghal K, Krylov A. 3D Inception-based CNN
44. Mahmud M, Kaiser MS, McGinnity TM, Hussain A. Deep
with sMRI and MD-DTI data fusion for Alzheimer’s disease
learn- ing in mining biological data. Cognit Comput.
diag- nostics. no. July 2018.
2021;13(1):1–33.
26. Sahumbaiev I, Popov A, Ram J, Górriz JM, Ortiz A. 3D - CNN
HadNet classification of MRI for Alzheimer’s disease diagnosis.
2018;3–6.
27. Spasov SE, et al. A Multi-modal convolutional neural net- work
framework for the prediction of Alzheimer’s disease.
2018;1271– 1274.
28. Kahramanli H. A modified cuckoo optimization algorithm for
engineering optimization. Int J Futur Comput Commun.
2012;1(2):199.
29. Simonyan K, Zisserman A. Very deep convolutional networks
for large-scale image recognition, 3rd Int Conf Learn Represent
ICLR 2015 - Conf. Track Proc. 2015;1–14.
30. Wang Y, et al. A novel multimodal MRI analysis for
Alzheimer’s disease based on convolutional neural network.
2018 40th Annu Int Conf IEEE Eng Med Biol Soc 2018;754–
757.
31. Khagi B, Lee B. CNN models performance analysis on MRI
images of OASIS dataset for the distinction between healthy and
Alzheimer’s patient. 2019 Int Conf Electron Information
Commun. 2019;1–4.
32. Jain R, Jain N, Aggarwal A, Hemanth DJ. ScienceDirect Con-
volutional neural network-based Alzheimer’s disease classifi-
cation from magnetic resonance brain images. Cogn Syst Res.
2019;57:147–59.
33. Ge C, Qu Q. Multiscale deep convolutional networks for charac-
terization and detection of Alzheimer’s disease using MR
images Dept. of Electrical Engineering, Chalmers University of
Technol- ogy, Sweden Inst. of Neuroscience and Physiology,
Sahlgrenska Academy. 2019 IEEE Int Conf Image Process.
2019;789–793.
34. Song T, et al. Graph convolutional neural networks for Alzhei-
mer’s disease. 2019 IEEE 16th Int Symp Biomed Imaging (ISBI
2019), no. Isbi. 2019;414–417.
35. Liu L, Zhao S, Chen H, Wang A. A new machine learning
method for identifying Alzheimer’s disease. Simul Model Pract
Theory. 2020;99:102023.
36. Liu M, et al. A multi-model deep convolutional neural network
for automatic hippocampus segmentation and classification in
Alzheimer’s disease. Neuroimage. 2018;208(August):2020.
37. Impedovo D, Pirlo G, Vessio G, Angelillo MT. A handwriting-
based protocol for assessing neurodegenerative dementia.
Cognit Comput. 2019;11(4):576–86.
38. Parmar H, Nutter B, Long R, Antani S, Mitra S. Spatiotempo-
ral feature extraction and classification of Alzheimer’s disease
using deep learning 3D-CNN for fMRI data. J Med Imaging.
2020;7(05):1–14.
39. Boddapati, Mohan Sai Dinesh, et al. "YouTube Comment
Analysis Using Lexicon Based Techniques." International
Conference on Cognitive Computing and Cyber Physical
Systems. Cham: Springer Nature Switzerland, 2022.

You might also like