You are on page 1of 4

An ML model for the detection of brain-related

diseases
S.Ravikanth
Senior Assistant Professor
Department of ECE
CVR College of Engineering
Email;s.ravikanth@cvr.ac.in

Abstract—The brain, as the most complex part of the body,


operates as the central control system, rendering it susceptible
II. DATA COLLECTION
to a broad spectrum of diseases. This continuous unveiling of A. Alzheimer’s disease
new challenges in diagnosis and detection establishes an
evolving landscape for brain-related disorders, posing an The MRI data employed in this study is retrieved from the
ongoing research frontier. Early identification of these diseases Open Access Series of Imaging Studies (OASIS) portal,
holds pivotal importance for effective treatment, and the accessible at https://www.oasis-brains.org. The meticulously
incorporation of artificial intelligence (AI) has markedly curated dataset comprises a diverse collection of images
revolutionized the field of neurology. This review extensively representing various levels of dementia. Specifically, the
explores recent advancements in machine learning and deep dataset encompasses 5,002 images corresponding to the mild
learning techniques dedicated to detecting Alzheimer's disease dementia category, 488 images representing the moderate
(AD), epilepsy, and Parkinson's disease. The overarching goal dementia category, 67,222 images associated with the non-
of the review is to pinpoint the most accurate techniques for the demented category, and an additional 13,725 images
detection of various brain diseases, providing valuable belonging to the very mild dementia category. In aggregate,
perspectives for future improvements in diagnostics. this dataset encompasses a substantial collection of 86,437
MRI images, providing a comprehensive and varied resource
Keywords—Alzheimer’s disease, deep learning, epilepsy
seizures, Parkinson’s disease, machine learning. for the study of dementia across different severity levels.
B. Parkinson’s disease
I. INTRODUCTION The numerical data in this study is retrieved from the
The increasing prevalence of brain-related diseases, coupled repository of the Donald Bren School of Information and
with the aging global population, has underscored the need Computer Sciences (ICS) portal accessible at
for robust and efficient diagnostic tools. Alzheimer's Disease, https://archive.ics.uci.edu...This dataset comprises
characterized by progressive cognitive decline, Parkinson's biomedical voice measurements obtained from 42 individuals
Disease, associated with motor impairments, and epileptic in the early stages of Parkinson's disease participating in a
seizures, causing unpredictable neurological events, six-month trial for remote symptom monitoring through a
collectively represent a significant burden on healthcare telemonitoring device. The voice recordings, totaling 5,875,
systems worldwide. Traditional diagnostic methods for these were automatically collected in the participants' homes. The
disorders often rely on clinical assessments, which may be table includes columns for subject number, age, gender, time
subjective and prone to variability. The integration of interval from baseline recruitment, motor UPDRS, total
medical imaging, particularly Magnetic Resonance Imaging UPDRS, and 16 biomedical voice measures. Each row
(MRI) and Electroencephalography (EEG, provides valuable represents a distinct voice recording from the study
insights into the structural and functional aspects of the brain. participants.
However, the sheer volume and complexity of data generated
necessitate using advanced computational techniques. C. Epilepsy seizures
Machine learning algorithms have demonstrated the ability to The numerical data in this study is retrieved from the
analyze intricate patterns within medical imaging data, repository of the Donald Bren School of Information and
enabling the development of accurate and reliable diagnostic Computer Sciences (ICS) portal accessible at
models. In this paper, we propose a comprehensive ML https://archive.ics.uci.edu...The initial dataset, as described
model designed to detect and differentiate between
in the reference, is organized into five folders, each
Alzheimer's Disease, Parkinson's Disease, and epileptic
containing 100 files representing individual subjects. Each
seizures based on multi-modal neuroimaging data. In
subsequent sections, we delve into the methodology, file corresponds to a 23.6-second recording of brain activity,
experimental setup, and results, presenting a thorough sampled into 4097 data points. In total, there are 500
evaluation of the proposed ML model's performance. The individuals, and each person has 4097 data points capturing
ultimate goal of this research is to provide clinicians with a brain activity over 23.5 seconds. The 4097 data points were
reliable and efficient tool for the early detection and rearranged and randomized into 23 chunks to enhance the
monitoring of Alzheimer's Disease, Parkinson's Disease, and dataset. Each chunk now comprises 178 data points,
epileptic seizures, thereby advancing the frontier of representing a 1-second interval, with each data point
personalized and precision medicine in neurology. reflecting the EEG recording at a specific moment.
Consequently, the dataset has been transformed into 11,500
pieces of information, combining the 23 chunks for each of
the 500 individuals.
Since transformers don't have any inherent
understanding of spatial relationships, positional
III.METHODS information needs to be injected into the input data. This
is usually done by adding positional encodings to the
A. Vision Transformer input vectors. The positional encoding PE is defined as:
A CNN model named Vision Transformer is used for PE
building the model. Departing from conventional
( )
pos
(pos ,2 i)=sin 2i
Convolutional Neural Networks (CNNs), the Vision 10000 d
Transformer employs a transformer architecture with
self-attention mechanisms to capture global dependencies PE
( )
pos
(pos ,2 i+1 )=cos
within images. Rather than processing data in fixed-size 10000 d
2i

grids, the ViT divides images into manageable patches,


embedding them linearly and enabling the model to Where pos is the position and i is the dimension index,
comprehend relationships across the entire input space. and d is the dimensionality of the input vectors.
This departure from traditional CNN structures eliminates
3. Concatenate positional encoding:
the reliance on convolutional layers and proves highly
scalable, particularly with larger image resolutions. The concatenate the positional encoding to the input vectors:
Vision Transformer has exhibited exceptional
performance in various computer vision tasks, surpassing ^x i=[ x 'i , PE i ] ,
conventional architectures and establishing its potential to
d +d pos
redefine visual recognition and understanding. here ^x i ∈ R is the extended input vector and d pos is
the dimensionality of the positional encoding.
B. Support vector Regression
For Parkinson’s disease and epilepsy seizures, we used 4. Linear Projection for Token embedding:
the Support Vector Regression method. Support Vector Linearly project the extended input vectors into the token
Regression (SVR) is a powerful machine learning space:
algorithm designed for regression tasks, offering robust
capabilities in modelling complex relationships between z i=W z ^xi +b z ,
variables. Based on the principles of Support Vector
Machines (SVM), SVR excels in predicting continuous Where W z is the learnable weight and b z is a learnable
outcomes by identifying a hyperplane that best captures bias.
the trend of the data. Unlike traditional regression 5. Transformer encoder blocks:
models, SVR is effective in handling non-linear patterns
through the use of kernel functions that transform the Apply a series of transformer encoder blocks to the token
input space. The algorithm aims to minimize the error embeddings z i . Each block consists of a multi-head self-
between predicted and actual values while allowing for a attention mechanism and a feedforward neural network.
controlled margin of tolerance. SVR's strength lies in its Let h be the number of attention heads, d model be the
ability to adapt to diverse data distributions and its
resistance to overfitting, making it particularly suitable model dimension, and d ff be the dimension of the
for datasets with intricate structures. feedforward layer.
MultiHead (Q, K, V) = Concat (head 1 ,..... , head h)
Wo,
IV.WORKING
head i = Attention (QW Qi , KW Ki, VW Vi ),
A. Vision Transformer

(√ )
A Vision Transformer (ViT) is a type of neural network Q KT
architecture that applies the transformer model, originally
designed for natural language processing, to image data. d model
The ViT model can be represented mathematically as Attention (Q, K, V) = SoftMax V,
h
follows:
1. Input representation: FFN ( x ¿ = ReLU ( x W ff ,1 +b ff ,1 ) W ff ,2+b ff ,2 ,

Let X be the input image, which is divided into non- Where W Qi , W Ki, W Vi , W o, W ff ,1, W ff ,2, b ff ,1 and
overlapping patches x i. Each patch is then linearly b ff ,2 are learnable parameters.
' d
embedded into a vector x i ∈ R using a learnable linear 6. Output Projection:
projection.
Linearly project the transformer output into the final
X ={x 1 , x 2 , … , x N } output space:
'
x i=W 0 x i+ b0 , Y = W y z N +b y,

W 0 is a learnable weight matrix and Where W y is a learnable weight matrix and b y is a


Where
learnable bias.
b 0 is learnable bias .
2. Positional encoding:
The model takes an input image, processes it through 1
linear projections, adds positional encodings, applies b=
transformer encoder blocks, and outputs the final result. ¿ S∨¿ ∑ ( y i−⟨ w , x i ⟩ ) ¿ ,
i ∈S
B. Support Vector Regression Where S is the set of support vectors.
Support Vector Regression (SVR) is a machine learning
algorithm used for regression tasks. The key idea behind This formulation captures the essence of linear Support
SVR is to find a hyperplane that best represents the data Vector Regression. In practice, kernels can be employed to
while minimizing the error within a specified margin. handle non-linear relationships by mapping the input features
into a higher-dimensional space.
1. Data Representation:
Assume we have a dataset with N samples:
V. RESULTS
{(x ¿ ¿ 1 , y 1 ),( x ¿ ¿ 2 , y 2) , … ,(x ¿ ¿ N , y N )}¿ ¿ ¿ A. Alzheimer’s disease
Here, the MRI images are uploaded in 128 X 128 images
Where x iis the input feature vector and y iis the into the machine learning model. The model processes the
corresponding target value. image and gives the output results. The machine learning
model gives you the classification of dementia depending
2. Linear SVR model: upon the input MRI data.
The linear SVR model can be represented as:
f ( x )= ⟨ w , x ⟩ + b ,
Where w is the weight vector, x is the input feature
vector, ⟨ . ,. ⟩ denotes the dot product and b is the bias
term.
3. Objective Function (Cost Function):
The goal of SVR is to find a hyperplane that
minimizes the error within a specified margin (ε). The
objective function for linear SVR is given by:
N
1
min w ,b ‖w‖ +C ∑ (max ⁡(0 ,|f ( x i )− y i|−ε )),
2

2 i=1

Where ‖w‖ is the L2 norm of the weight vector, C


is the regularization parameter and ε is the margin.
Figure 1
4. Support Vectors:
In figure 1, the first image is that of mild dementia, the
Support vectors are the data points that lie on the margin second image is that of moderate dementia, the third image is
or violate the margin (have non-zero errors). They play a of no dementia and the final image is of very mild dementia.
crucial role in defining the hyperplane. The decision Alzheimer’s disease is categorized towards the second case
function is influenced only by the support vectors. i.e. moderate dementia.
5. Dual Problem and Lagrange Multipliers:
B. Parkinson’s disease
The optimization problem is often converted into its dual Here, using the data available from the dataset, we plotted
form. Introducing Lagrange multipliers (α i) for the a graph which is between the actual readings of UPDRS
inequality constraints, the dual problem is: versus the predicted ratings of the UPDRS. Here UPDRS
N N
stands for ‘Universal Parkinsons Disease Rating System’.
1 This method is used to quantify the values related to the
max α ∑ α i− ∑ α α y y ⟨x ,x ⟩ diagnosis of the Parkinson’s disease.
i=1 2 i , j=1 i j i j i j ,
N

Subject to 0
≤ αi ≤ C
and ∑ αi y j=0.
i=1

6. Dual Problem and Lagrange Multipliers:


The weight vector w can be expressed as a linear
combination of the support vectors:
N
w=∑ α i y i x i.
i=1

The bias term b is determined using the support vectors


and the margin:
Accuracy = (TP + TN) / (TP + TN + FP + FN). Which is
equal to 81%. We also find out the values of Specificity and
Sensitivity which are obtained by calculating the ratios of
true positives and true negatives to the total number of
instances in each class.
Specificity (For the first class) = TP / (TP + TN) = 89.2%
Sensitivity (For the second class) = FP / (FP + FN) =40.9%
The F1 score which is used for evaluation of the performance
of the model is approximately 80%.

CONCLUSION
In this study, we presented a comprehensive
exploration into the development and evaluation of a
machine learning model designed for the detection of
Figure 2 brain-related diseases. Leveraging advanced
Here in figure 2, we have actual UPDRS in the x-axis and techniques in feature extraction, model training, and
predicted UPDRS in the y-axis. There is a positive validation, our proposed model has demonstrated
correlation between the predicted and actual total UPDRS promising results in accurately classifying and
values. This means that as the predicted values increase, the diagnosing such diseases. However there is a scope of
actual values also tend to increase. improvement as these models have a large scope of
scalability and need for extensive research and
C. Epilepsy Seizures: development.
Here, we got a confusion matrix from the above given
data from the obtained graph. REFERENCES
[1] C. S. Eke, E. Jammeh, X. Li, C. Carroll, S. Pearson and E. Ifeachor,
"Early Detection of Alzheimer's Disease with Blood Plasma Proteins
Using Support Vector Machines," in IEEE Journal of Biomedical and
Health Informatics, vol. 25, no. 1, pp. 218-226, Jan. 2021, doi:
10.1109/JBHI.2020.2984355.
[2] P. Khan et al., "Machine Learning and Deep Learning Approaches for
Brain Disease Diagnosis: Principles and Recent Advances," in IEEE
Access, vol. 9, pp. 37622-37655, 2021, doi:
10.1109/ACCESS.2021.3062484.
[3] A. AlMohimeed et al., "Explainable Artificial Intelligence of Multi-
Level Stacking Ensemble for Detection of Alzheimer’s Disease Based
on Particle Swarm Optimization and the Sub-Scores of Cognitive
Biomarkers," in IEEE Access, vol. 11, pp. 123173-123193, 2023, doi:
10.1109/ACCESS.2023.3328331.
[4] A. Mitoubsi et al., "Evaluating the Fitness-to-Drive Using Evoked
Visual Responses in Alzheimer’s Disease," 2021 43rd Annual
International Conference of the IEEE Engineering in Medicine &
Biology Society (EMBC), Mexico, 2021, pp. 2382-2385, doi:
Figure 3 10.1109/EMBC46164.2021.9630321.
Figure 3 is a graph with the count on the y-axis and the [5] G. G.S and N. S, "A Comprehensive Review on Early Diagnosis of
Alzheimer’s Disease Detection," 2023 International Conference on
predicted label on the x-axis. Research Methodologies in Knowledge Management, Artificial
Here, there are parameters calculated such as True Intelligence and Telecommunication Engineering (RMKMATE),
Chennai, India, 2023, pp. 1-6, doi:
Positives (TP) to find correctly predicted seizures, True 10.1109/RMKMATE59243.2023.10369111.
Negatives (TN) to find correctly non-seizures, False [6] M. Shetty, Deekshitha, M. Bhat and M. Devadiga, "Detection of
Positives (FP) to find Non seizures incorrectly predicted as Alzheimer's Disease Using Machine Learning," 2022 International
seizures, and False Negatives (FN) to find seizures Conference on Artificial Intelligence and Data Engineering (AIDE),
incorrectly predicted as non-seizures respectively. Karkala, India, 2022, pp. 117-120, doi:
10.1109/AIDE57180.2022.10060433.
Here we get a matrix of 5 rows and 180 columns from the [7] A. R. Zouaoui, H. Bentahar, M. Djeriuoi, Z. Mokadem and H. E.
extensive dataset which is reduced using the SVR method, Bentahar, "Machine Learning and Deep Learning Techniques for
and we get the confusion matrix as follows: Alzheimer's Disease Prediction Using CSF and Plasma Biomarkers,"
2023 International Conference on Networking and Advanced Systems

[ 8313 109 ]
(ICNAS), Algiers, Algeria, 2023, pp. 1-6, doi:
confusion ¿ 10.1109/ICNAS59892.2023.10330506.
[8] V. Srilakshmi, A. Anumolu, M. A. Safali and V. S. Parvathi, "A
Hybrid-Layered Framework for Detection and Diagnosis of
Here, we got True Positives as 83, True Negatives as 10, Alzheimer’s Disease (AD) from Fundus Images," 2023 Third
False Positives as 13, and False Negatives as 9. International Conference on Artificial Intelligence and Smart Energy
(ICAIS), Coimbatore, India, 2023, pp. 1639-1643, doi:
After substituting all the values, we get the accuracy of the 10.1109/ICAIS56108.2023.10073930.
system using the formula:

You might also like