# Classification of Alzheimer’s Disease Using the Convolutional Neural Network
(CNN) with Transfer Learning and Weighted Loss

Muhammad Wildan Oktavian Novanto Yudistira Achmad Ridok

###### Abstract

Alzheimer’s disease is a progressive neurodegenerative disorder that gradually
deprives the patient of cognitive function and can end in death. With the
advancement of technology today, it is possible to detect Alzheimer’s disease
through Magnetic Resonance Imaging (MRI) scans. So that MRI is the technique
most often used for the diagnosis and analysis of the progress of Alzheimer’s
disease. With this technology, image recognition in the early diagnosis of
Alzheimer’s disease can be achieved automatically using machine learning.
Although machine learning has many advantages, currently the use of deep
learning is more widely applied because it has stronger learning capabilities
and is more suitable for solving image recognition problems. However, there
are still several challenges that must be faced to implement deep learning,
such as the need for large datasets, requiring large computing resources, and
requiring careful parameter setting to prevent overfitting or underfitting. In
responding to the challenge of classifying Alzheimer’s disease using deep
learning, this study propose the Convolutional Neural Network (CNN) method
with the Residual Network 18 Layer (ResNet-18) architecture. To overcome the
need for a large and balanced dataset, transfer learning from ImageNet is used
and weighting the loss function values so that each class has the same weight.
And also in this study conducted an experiment by changing the network
activation function to a mish activation function to increase accuracy. From
the results of the tests that have been carried out, the accuracy of the model
is 88.3% using transfer learning, weighted loss and the mish activation
function. This accuracy value increases from the baseline model which only
gets an accuracy of 69.1%.

##  ntroduction

As people age, human health will inevitably decline, making them susceptible
to disease. One part of the body that is the main target of the effects of
aging is the brain. The brain will experience changes in intellectual
function, such as difficulty remembering and being slow to take a decision or
action [1]. One of the diseases caused by this brain disorder is Alzheimer.
Alzheimer’s disease is a progressive neurodegenerative disorder that gradually
robs the patient’s cognitive function and can end in death [2]. This disease
is generally a cause of dementia in the elderly. The majority of people with
Alzheimer will experience several disorders such as memory disorders, changes
in character or personality, moods, and difficulty interacting with other
people [3]. Someone diagnosed with Alzheimer will gradually experience several
disorders over three to nine years [4].

With the advancement of technology today, it is possible to detect Alzheimer’s
disease through Magnetic Resonance Imaging (MRI) scans [5]. Typically, MRI is
the technique most often used for the diagnosis and analysis of the progress
of Alzheimer’s disease [6]. With this technology, early diagnosis of
Alzheimer’s disease can be achieved automatically using machine learning. In
some cases, machine learning can predict Alzheimer’s disease better than
medical personnel, making this field important for computer-based diagnostic
research [7]. Although machine learning has many advantages, it is unsuitable
for image recognition. Currently, the field of image recognition uses deep
learning, which has stronger learning abilities and is more suitable for
solving image recognition problems [8]. Many deep learning methods outperform
machine learning methods in image recognition, such as Convolutional Neural
Network (CNN) and sparse autoencoder [9]. Even though deep learning has robust
performance, there are still some challenges. Firstly, it requires a large
amount of training data which can be a problem because medical data is
expensive and protected from cross-institutional use for ethical reasons.
Training deep learning networks with large amounts of image data requires
large computing resources. Deep learning networks require careful parameter
settings because non-optimal parameter settings can result in overfitting or
underfitting, which leads to poor network performance [10].

In detecting the results of MRI images using deep learning, many approaches
have been taken. As in the previous study on the classification of Alzheimer’s
disease by Aly Valliani and Ameet Soni in 2017 [11] entitled ”Deep Residual
Nets for Improved Alzheimer’s Diagnosis” which found that the use of transfer
learning and augmentation can improve classification accuracy on the CNN Deep
Residual Nets architecture. Research on a similar topic was also conducted by
Aderghal et al. [12] under the title ”Classification of Alzheimer’s Disease on
Imaging Modalities with Deep CNNs using Cross-Modal Transfer Learning” using
transfer learning. It reduces overfitting, improves model performance, and
increases prediction accuracy. Then there is also a study on class imbalance,
such as Songqing Yue in 2017 [13] entitled ”Imbalanced Malware Images
Classification: a CNN based Approach” which uses a weighted loss on the CNN
architecture. It reduces the effect of class imbalance on the dataset used to
increase accuracy. From the problem exposure and previous research, the we
proposed Convolutional Neural Network (CNN) method using Residual Neural
Network (ResNet) architecture with Weighted Loss and Transfer Learning to
classify Alzheimer’s disease from MRI data into three classes.

## I elated Work

Lucas R. Trambaiolli, Ana C. Lorena, Francisco J. Fraga, Paulo A.M. Kanda,
Renato Anghinah, and Ricardo Nitrini 2011 [14] researched the classification
of Alzheimer’s Disease entitled ”Improving Alzheimer’s Disease Diagnosis with
Machine Learning Techniques”. Researchers used the Support Vector Machine
(SVM) machine learning method to differentiate between Alzheimer’s patients
and Controlled patients. From the results of the analysis that has been done,
the accuracy is 79.9% and the sensitivity is 83.2%. This study suggests using
more data and reconsidering the parameters of the SVM classifier to improve
the resulting performance.

Aly Valliani and Ameet Soni 2017 [11] researched the classification of
Alzheimer’s disease entitled ”Deep Residual Nets for Improved Alzheimer’s
Diagnosis.” The researcher focuses on overcoming the problem of the amount of
data to train the CNN model. Therefore, the researcher uses the Deep Residual
Nets (ResNet) architecture, which was previously trained with the ImageNet
dataset, which has large-scale image data. The results of this study indicate
that the use of transfer learning from ImageNet and augmentation can improve
classification accuracy. The model gets a test accuracy of 81.3% for binary
classification and 56.8% for multiclass or 3-way classification. This result
is better than the model that does not use transfer learning and augmentation,
with an accuracy of 78.8% for binary classification and 56.1% for 3-way
classification.

Aderghal et. al in 2018 [12] researched the classification of Alzheimer’s
disease entitled ”Classification of Alzheimer’s Disease on Imaging Modalities
with Deep CNNs using Cross-Modal Transfer Learning”. Researchers stated that
public data on Alzheimer’s disease is not much, so it will result in the
phenomenon of overfitting when trained. Therefore, researchers propose using
transfer learning from larger datasets to improve classification accuracy. The
results of this study indicate that the use of transfer learning on the CNN
model can improve the model’s performance, reduce overfitting, and increase
classification accuracy. Furthermore, the classification can be leveraged to
perform multi instance learning on Alzheimer’s disease dataset to localize
benign and malignant part of the brain (Kavitha et. al 2019 [26]).

Songqing Yue 2017 [13] conducted a study entitled ”Imbalanced Malware Images
Classification: a CNN-based Approach”. According to this study, CNN
classification performance will decrease when the dataset has an unbalanced
number of classes or Class Balance. To overcome this problem, the loss value
weighting in the last CNN layer is used. With this weighting, the
misclassification of the minority class will be strengthened, and the majority
class will be reduced so there can be a balance. Yudistira et. al 2020 [27]
conducted research on organelles localization prediction using U-Net under
imbalanced dataset. It employs weighting term on loss function to detect
minority organelles.

Krit Sriporn, Cheng-Fa Tsai, Chia-En Tsai, and Paohsi Wang 2020 [15] conducted
a study entitled ”Analyzing Lung Disease Using Highly Effective Deep Learning
Techniques”. This study used the mish activation function to replace the ReLU
activation function in several well-known architectures such as MobileNet,
Densenet-121, and Resnet-50. This mish activation function is the current
state-of-the-art activation function. From the analysis results, it was found
that the mish activation function can increase the classification accuracy to
98.88% from the model that does not use mish activation or the baseline model
with an accuracy of 97.25%.

## II esearch Method and Materials

###  III-A Deep Residual Network

According to Kaiming He [16], in general, the deeper the structure of the
neural network, the more difficult it will be to learn. However, Residual
Neural Network (ResNet) provides a residual learning framework to simplify the
training process even though it uses a deep network structure. ResNet
explicitly reformulates the network layer into residual learning functions
that lead to the input layer rather than learning unreferenced functions. As
the deeper layers of the network begin to converge, degradation problems
arise, where as the network depth increases, the accuracy saturates and then
decreases rapidly. The degradation is not caused by vanishing gradients,
overfitting and adding more layers to the model leads to a higher training
error. The architectural type of ResNet is distinguished by the number of
layers on the network. Among the architectures used in testing for the ILSVRC
competition are ResNet-18, ResNet-34, ResNet-50, ResNet-101, and ResNet-152.

###  III-B Weighted Cross Entropy Loss

Cross Entropy is a measure of the field of information theory, which builds on
entropy and usually calculates the difference between two probability
distributions. Cross Entropy is also associated with and is often
misunderstood as logistic loss, which is commonly referred to as log loss.
Although the two measures come from different sources, when used as a loss
function for a classification model, they both calculate the same quantity and
can be used interchangeably [17]. the formula used to calculate the cross
entropy loss can be seen in Equation 1 below.

$-\sum_{c=1}^{M}y_{o,c}\log(P_{o,c})$ (1)

where $M$ is the number of existing classes, $y_{o,c}$ is a binary indicator
(0 or 1) if the class c label is the correct classification for the sample o,
and $p_{(}o,c)$ is the predicted probability sample o from class c. According
to Naceur et. al.[18], to overcome the class imbalance in the dataset, the
formula for the loss function will be added with a weight based on the number
of samples from each class. The formula used to calculate the weighted cross
entropy loss can be seen in Equation 2 and Equation 3 below.

$-\sum_{c=1}^{M}W_{o,c}y_{o,c}\log(P_{o,c})$ (2)

$W_{o,c}=1-\frac{x_{c}}{N}$ (3)

where $W_{(}o,c)$ is the specific weight for each class c, $x_{c}$ is the
number of samples in class c, and $N$ is the total of all samples from all
classes

###  III-C Proposed Method

Figure 1: An Overview of our approach

As shown in Figure 1 above, we use the main part of the ResNet architecture
for the training process with modifications. We modified the activation
function used in the last residual block before the pooling process. We use
the Mish Activation Function to replace the ReLU activation function which is
the default activation function of the ResNet architecture. Mish is a non-
monotonic activation function that is smooth, continuous, and self
regularized. Inspired by the Swish Activation Function, Mish uses the Self-
Gating property where the non-modulated input is multiplied by the output of
the non-linear function of the input[19]. The formula for the Mish Activation
function can be seen in Equation 4 below::

$f(x)=xtanh(softplus(x))=xtanh(ln(1+e^{x}))$ (4)

Then we calculate the loss value using the weighted cross entropy loss. The
formula for calculating this loss value can be seen in Equation 2. This
weighted cross entropy is used because the dataset we use has an imbalance in
the number of samples. This sample consists of AD, MCI, and CN classes. Class
AD has the least number of these three classes. Then the number of samples
from these three classes will be used to calculate the weights in Equation 3.

###  III-D Data Acquisition and Preprocessing

Data used in the preparation of this article were obtained from the
Alzheimer’s Disease Neuroimaging Initiative (ADNI) database
(adni.loni.usc.edu) [20]. The ADNI was launched in 2003 as a public-private
partnership, led by Principal Investigator Michael W. Weiner, MD. The primary
goal of ADNI has been to test whether serial magnetic resonance imaging (MRI),
positron emission tomography (PET), other biological markers, and clinical and
neuropsychological assessment can be combined to measure the progression of
mild cognitive impairment (MCI) and early Alzheimer’s disease (AD). These
imaging data are acquired from 306 ADNI participants including 133 mild
cognitive impairment (MCI), 58 Alzheimer Disease (AD), and 115 Normal Control
(CN). for each image has a size of 256 x 256 x 256 which will be split into
256 slices.

(a)

(b)

Figure 2: Comparison between unpreprocessed and preprocessed data sample: (a)
Unpreprocessed Data, (b) Preprocessed Data

(a)

(b)

(c)

Figure 3: Preprocessed dataset samples : (a) AD Sample, (b) CN Sample, (c) MCI
Sample

The dataset file obtained is a dataset in the form of 3-dimensional images in
nifti format. Before it can be used for training, it needs to be preprocessed.
Image data will be segmented first to remove the skull and other parts of the
head that are not brain. This segmentation aims so that the model only focuses
on the brain. This segmentation is done using the DeepBrain library [21].Then
after segmentation, slicing or cutting of 3-dimensional images into 2
dimensions will be carried out using the med2image library [22] to be used in
network training. The difference in the image data before and after
preprocessing can be seen in figure 2 and the results of preprocessing for
each class can be seen in figure 3. From Figures 2 and 3 it is also seen that
the preprocessed image data has brighter and sharper colors. Then the
preprocessed dataset will then be divided into 3 parts, namely training data,
validation data and test data. The process of dividing this dataset using
K-Fold with K totaling 5. First, the dataset will be divided into 2 parts with
a composition of 20% test data and 80% training data. Then the 80% training
data will be further divided into 80% training data and 20% validation data.

## V esult and Discussion

###  IV-A ResNet Architecture Comparison

The capacity of the neural network to learn is determined by the architecture
used. By using the appropriate architecture, the network model can learn data
patterns better. The scenario for testing the model architecture can be seen
in the Table 1 below.

TABLE I: ResNet Architecture Comparison K-Fold | Accuracy
---|---
ResNet-18 | ResNet-34 | ResNet-50 | ResNet-101 | ResNet-152
Validation | Test | Validation | Test | Validation | Test | Validation | Test | Validation | Test
1 | 0,523 | 0,531 | 0,461 | 0,879 | 0,491 | 0,823 | 0,448 | 0,487 | 0,675 | 0,473
2 | 0,549 | 0,897 | 0,497 | 0,88 | 0,472 | 0,504 | 0,494 | 0,849 | 0,582 | 0,381
3 | 0,578 | 0,655 | 0,601 | 0,513 | 0,6 | 0,472 | 0,433 | 0,8 | 0,525 | 0,597
4 | 0,523 | 0,835 | 0,575 | 0,669 | 0,61 | 0,459 | 0,49 | 0,836 | 0,404 | 0,7
5 | 0,589 | 0,534 | 0,561 | 0,489 | 0,542 | 0,881 | 0,553 | 0,414 | 0,53 | 0,503
Mean | 0,553 | 0,691 | 0,539 | 0,686 | 0,543 | 0,628 | 0,484 | 0,677 | 0,543 | 0,531

From the results of the architectural tests carried out on the accuracy of the
validation data, data testing, and the duration of the training, it shows that
the deeper the network layer of the architecture used the accuracy tends to
decrease, although not significantly. This is due to overfitting because the
architecture used is increasingly complex so that the accuracy decreases and
the training time becomes longer. The results of this test indicate that in
this study the ResNet-18 architecture has better performance with the shortest
training time.

###  IV-B Optimizer Comparison

The optimization algorithm or optimizer was tested 3 times, namely using
Stochastic Gradient Descents (SGD), Root Mean Square Propogation (RMSprop),
and Adam Optimizer. In the SGD optimization, the Learning Rate parameter of
0.001 and the momentum of 0.9 , in the RMSprop optimization the Learning Rate
parameter of 0.01, the alpha of 0.99, the epsilon of 1e-08 weight decay of 0,
and the momentum of 0, and the Adam optimization the Learning parameter is
used Rate is 0.001, beta from 0.9 to 0.999, epsilon is 1e-08, weight decay is
0.

TABLE II: Optimizer Comparison K-Fold | Accuracy
---|---
SGD | RMSprop | Adam
Validation | Test | Validation | Test | Validation | Test
1 | 0,523 | 0,531 | 0,519 | 0,769 | 0,604 | 0,444
2 | 0,549 | 0,897 | 0,645 | 0,438 | 0,646 | 0,437
3 | 0,578 | 0,655 | 0,596 | 0,446 | 0,600 | 0,463
4 | 0,523 | 0,835 | 0,485 | 0,879 | 0,530 | 0,503
5 | 0,589 | 0,534 | 0,644 | 0,445 | 0,651 | 0,456
Mean | 0,553 | 0,691 | 0,578 | 0,595 | 0,606 | 0,460

From the tests that have been carried out in the Table 2 above, it shows that
the SGD optimization algorithm gives the best results compared to other
optimization algorithms on the test data. As for the validation data, the
highest accuracy is obtained by the adam optimization algorithm. Because what
is used as a reference in this research is test data, so SGD will be used as
an optimization algorithm in the next test.

###  IV-C Weighted Loss Function

In datasets that have an unbalanced number of classes, it will affect the
results of the classification carried out. For this reason, it is necessary to
do class weighting on the network loss function so that the class that has
fewer numbers will have a greater weight than the number of classes that have
more. This test was carried out using the ResNet-18 architecture from the
results of the previous architecture test. The scenario for testing this class
weighting can be seen in the Table 3 below.

TABLE III: Weighted Loss Function Condition | Accuracy | Precision | Recall | F1-Score
---|---|---|---|---
Validation | Test | AD | CN | MCI | AD | CN | MCI | AD | CN | MCI
Baseline | 0,553 | 0,691 | 0,550 | 0,490 | 0,916 | 0,761 | 0,857 | 0,654 | 0,598 | 0,589 | 0,707
Weighted Loss | 0,574 | 0,799 | 0,645 | 0,771 | 0,893 | 0,899 | 0,853 | 0,775 | 0,672 | 0,795 | 0,823

From the results of the tests carried out in the Table 3 above, it shows that
applying class weighting has better results. The model can recognize AD and CN
classes better which is indicated by the increasing precision value obtained.
From the F1 Score obtained, it also shows that each class gets an increase in
value. This shows that class weighting can improve the performance of the
model in classifying.

###  IV-D Transfer Learning

Network models that have been trained previously using larger datasets
(pretrained) can help other network models in helping to get better accuracy.
The weights from the results of the pretrained model will be used to train
other models with the new dataset. In this test, the ResNet-18 architecture is
used from the results of the previous architecture test and the transfer
learning weights obtained from ImageNet. The transfer learning test scenario
can be seen in the Table 4 below.

TABLE IV: Transfer Learning Condition | Accuracy | Precision | Recall | F1-Score
---|---|---|---|---
Validation | Test | AD | CN | MCI | AD | CN | MCI | AD | CN | MCI
Baseline | 0,553 | 0,691 | 0,550 | 0,490 | 0,916 | 0,761 | 0,857 | 0,654 | 0,598 | 0,589 | 0,707
Transfer Learning | 0,552 | 0,895 | 0,909 | 0,944 | 0,849 | 0,845 | 0,884 | 0,933 | 0,874 | 0,912 | 0,889

From the results of the tests carried out in the Table 4 above, it shows that
the use of transfer learning significantly increases the accuracy, precision,
recall and f1 score obtained.

###  IV-E Mish Activation

In this section, testing is carried out in the form of changing the activation
function which previously used the ReLu function to be converted into the Mish
function. The network layer whose activation function is changed is divided
into several conditions, namely the first is the last convolution layer before
entering the fully connected layer, and the second changes all activation
functions on the network into Mish functions. These two conditions will be
compared with the initial architecture that uses the ReLu activation function
as the standard condition. The scenario for testing the effect of using the
Mish activation function can be seen in the Tables 5 below.

TABLE V: Mish Activation Condition | Accuracy | Precision | Recall | F1-Score
---|---|---|---|---
Validation | Test | AD | CN | MCI | AD | CN | MCI | AD | CN | MCI
Baseline | 0,567 | 0,885 | 0,871 | 0,918 | 0,855 | 0,830 | 0,904 | 0,911 | 0,849 | 0,909 | 0,879
Mish (Last Layer) | 0,531 | 0,883 | 0,901 | 0,930 | 0,846 | 0,801 | 0,890 | 0,920 | 0,844 | 0,909 | 0,882
Mish (All Layer) | 0,547 | 0,879 | 0,882 | 0,919 | 0,845 | 0,831 | 0,875 | 0,919 | 0,856 | 0,893 | 0,878

From the results of the tests carried out in the Table 5 above, it shows that
the model that uses a combination of weighted loss and transfer learning with
the mish activation function is not better than the baseline model. The use of
mish function and weighted loss does not increase the accuracy of the model
that already uses transfer learning. Although the model with the mish
activation function in the last layer of the network has slightly lower
accuracy, this model can increase the precision for the AD class by 3% and
1.2% for the CN class.

(a)

(b)

(c)

Figure 4: Model visualization with Grad-CAM : (a) AD Sample, (b) CN Sample,
(c) MCI Sample

As a visual explanation in Figure 4 above, Grad-CAM is used to check the
classification results by the model. Gradient-weighted Class Activation
Mapping (Grad-CAM), uses the gradients of any target concept, flowing into the
final convolutional layer to produce a coarse localization map highlighting
the important regions in the image for predicting the concept [23]. In the
figure above, the model is able to focus on three brain areas in classifying
Alzheimer’s disease. Generally, Grad-CAM is used to distinguish several
different objects, but in this case study the focus area of classification in
brain images shows the same location in each class because the characteristics
of each class can be in the same part of the brain. Of the many cases of
Alzheimer’s, the three areas in the figure above are the locations of the most
common symptoms of Alzheimer’s disease which is hippocampus, ventricles, and
cortex [24], so it can be ensured that the model can recognize and classify
Alzheimer’s disease.

###  IV-F Comparison with previous study

TABLE VI: Comparison with previous study Author | Architecture | Accuracy
---|---|---
Trambaiolli et. al., 2011 | Support Vector Machine (SVM) | 79.9% (multiclass)
Valliani, 2017 | ResNet-18 + Pretrain + augmentation | 56.8% (multiclass) and 81.3% (biner)
|  | 85.07% (VGG-16),
Acharya et. al, 2021 | VGG-16, ResNet-50, Modified AlexNet | 75.25% (ResNet-50),
|  | 95.70% (Alexnet)
|  | (multiclass)
Proposed method | ResNet-18 + Weighted Loss + Transfer Learning + Mish Activation | 88,3% (multiclass)

As shown in Table 6 above, research conducted by Trambaiolli et. al.[14] used
as a basis for comparing experiments using traditional machine learning and
deep learning. The proposed research has succeeded in providing a higher test
accuracy, however, the data used is not the same. Then the research by Acharya
et. al.[25], the proposed research can outperform 2 out of 3 architectures,
namely VGG-16 and ResNet-50. The AlexNet architecture gets higher accuracy by
making modifications such as using only 2 of the five convolution layers and
the Adam optimizer. This study also uses a different dataset, namely, using
the dataset contained in the Kaggle repository. Then in Valliani’s research
[11], the dataset and model settings used are the same as the proposed
research, so the use of weighted loss and mish activation is proven to improve
model performance.

##  onclusion

In this study, we successfully classified the AD, CN and MCI data with 88.3%
Accuracy and precision of AD and CN 90.1% and 93% respectively. We have found
that in this case, the deeper the number of layers of the ResNet network that
is used does not increase the model’s performance and even slightly lowers the
accuracy obtained. This is because the amount of data used is not too much,
namely a number of 10,794 images that have been extracted from 306 subjects.
The use of each of the weighted loss, transfer learning and mish activation
functions in the network model can improve the model’s performance better,
such as increasing the precision of AD and CN classes. However, when the
transfer learning model is added with weighted loss and mish activation
function, it does not show a significant increase in the accuracy obtained.

## cknowledgement

Data collection and sharing for this project was funded by the Alzheimer’s
Disease Neuroimaging Initiative (ADNI) (National Institutes of Health Grant
U01 AG024904) and DOD ADNI (Department of Defense award number
W81XWH-12-2-0012). ADNI is funded by the National Institute on Aging, the
National Institute of Biomedical Imaging and Bioengineering, and through
generous contributions from the following: AbbVie, Alzheimer’s Association;
Alzheimer’s Drug Discovery Foundation; Araclon Biotech; BioClinica, Inc.;
Biogen; Bristol-Myers Squibb Company; CereSpir, Inc.; Cogstate; Eisai Inc.;
Elan Pharmaceuticals, Inc.; Eli Lilly and Company; EuroImmun; F. Hoffmann-La
Roche Ltd and its affiliated company Genentech, Inc.; Fujirebio; GE
Healthcare; IXICO Ltd.; Janssen Alzheimer Immunotherapy Research &
Development, LLC.; Johnson & Johnson Pharmaceutical Research & Development
LLC.; Lumosity; Lundbeck; Merck & Co., Inc.; Meso Scale Diagnostics, LLC.;
NeuroRx Research; Neurotrack Technologies; Novartis Pharmaceuticals
Corporation; Pfizer Inc.; Piramal Imaging; Servier; Takeda Pharmaceutical
Company; and Transition Therapeutics. The Canadian Institutes of Health
Research is providing funds to support ADNI clinical sites in Canada. Private
sector contributions are facilitated by the Foundation for the National
Institutes of Health (www.fnih.org). The grantee organization is the Northern
California Institute for Research and Education, and the study is coordinated
by the Alzheimer’s Therapeutic Research Institute at the University of
Southern California. ADNI data are disseminated by the Laboratory for Neuro
Imaging at the University of Southern California.

## References

  * [1] Sidiarto, L., 1999. Tatalaksana dan sistem asuhan pada penyakit alzheimer / demensia. Berkala Neuro Sains 1999, I(1).
  * [2] Cummings, J., 2002. Alzheimer Disease. JAMA, 287(18), p.2335.
  * [3] Al-Naami, B., Gharaibeh, N. and Kheshman, A.A., 2013. Automated detection of Alzheimer disease using region growing technique and artificial neural network. World Acad. Sci. Eng. Technol. Int. J. Biomed. Biol. Eng, 7(5).
  * [4] Long, X., Chen, L., Jiang, C., Zhang, L. and Alzheimer’s Disease Neuroimaging Initiative, 2017. Prediction and classification of Alzheimer disease based on quantification of MRI deformation. PloS one, 12(3), p.e0173372.
  * [5] Korolev, S., Safiullin, A., Belyaev, M.,& Dodonova, Y. (2017). Residual and plain convolutional neural networks for 3D brain MRI classification. 2017 IEEE 14Th International Symposium On Biomedical Imaging (ISBI 2017). doi: 10.1109/isbi.2017.7950647
  * [6] Frisoni, G. B., Fox, N. C., Jack, C. R., Scheltens, P., & Thompson, P. M. (2010). The clinical use of structural MRI in Alzheimer disease. Nature Reviews Neurology, 6(2), 67-77.
  * [7] Kloppel, S., Stonnington, C., Barnes, J., Chen, F., Chu, C., Good, C., Mader, I., Mitchell, L., Patel, A., Roberts, C., Fox, N., Jack, C., Ashburner, J. and Frackowiak, R., 2008. Accuracy of dementia diagnosis–a direct comparison between radiologists and a computerized method. Brain, 131(11), pp.2969-2974.
  * [8] Lai, Y., 2019. A Comparison of Traditional Machine Learning and Deep Learning in Image Recognition. Journal of Physics: Conference Series, 1314, p.012148.
  * [9] Hon, M., & Khan, N. (2017). Towards Alzheimer’s disease classification through transfer learning. 2017 IEEE International Conference On Bioinformatics And Biomedicine (BIBM). doi: 10.1109/bibm.2017.8217822
  * [10] Erhan, D., Manzagol, P. A., Bengio, Y., Bengio, S., & Vincent, P., 2009. The difficulty of training deep architectures and the effect of unsupervised pre-training. In Artificial Intelligence and Statistics (pp. 153-160). PMLR.
  * [11] Valliani, A. and Soni, A., 2017. Deep Residual Nets for Improved Alzheimer’s Diagnosis. Proceedings of the 8th ACM International Conference on Bioinformatics, Computational Biology,and Health Informatics,.
  * [12] Aderghal, K., Khvostikov, A., Krylov, A., Benois-Pineau, J., Afdel, K. and Catheline, G., 2018. Classification of Alzheimer Disease on Imaging Modalities with Deep CNNs Using Cross-Modal Transfer Learning. 2018 IEEE 31st International Symposium on Computer-Based Medical Systems (CBMS),.
  * [13] Yue, S., 2017. Imbalanced Malware Images Classification: a CNN based Approach. arXiv.org, [online] Available at: ¡https://arxiv.org/abs/1708.08042¿ [Accessed 7 July 2021].
  * [14] Trambaiolli, L., Lorena, A., Fraga, F., Kanda, P., Anghinah, R. and Nitrini, R., 2011. Improving Alzheimer’s Disease Diagnosis with Machine Learning Techniques. Clinical EEG and Neuroscience, 42(3), pp.160-165.
  * [15] Sriporn, K., Tsai, C., Tsai, C., & Wang, P. (2020). Analyzing Lung Disease Using Highly Effective Deep Learning Techniques. Healthcare, 8(2), 107. doi: 10.3390/healthcare8020107
  * [16] He, K., Zhang, X., Ren, S. and Sun, J., 2016. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770-778).
  * [17] Brownlee, J., 2020. A Gentle Introduction To Cross-Entropy For Machine Learning. [online] Machine Learning Mastery. Available at: ¡https://machinelearningmastery.com/cross-entropy-for-machine-learning/¿ [Accessed 2 February 2021].
  * [18] Ben naceur, M., Akil, M., Saouli, R. and Kachouri, R., 2020. Fully automatic brain tumor segmentation with deep learning-based selective attention using overlapping patches and multi-class weighted cross-entropy. Medical Image Analysis, 63, p.101692.
  * [19] Misra, D. (2019). Mish: A self regularized non-monotonic activation function. arXiv preprint arXiv:1908.08681.
  * [20] Adni.loni.usc.edu. 2003. ADNI — Alzheimer’s Disease Neuroimaging Initiative. [online] Available at: ¡http://adni.loni.usc.edu/¿ [Accessed 11 February 2021].
  * [21] GitHub - iitzco/deepbrain: Deep Learning tools for brain medical images. Retrieved 5 june 2021, from https://github.com/iitzco/deepbrain
  * [22] GitHub - FNNDSC/med2image: Converts medical images to more displayable formats, e.g. NIfTI to jpg. Retrieved 6 June 2021, from https://github.com/FNNDSC/med2image
  * [23] Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., & Batra, D. (2017). Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision (pp. 618-626).
  * [24] Alzheimer’s Brain — Keep Memory Alive. (2021). Retrieved 7 October 2021, from https://www.keepmemoryalive.org/cc-nevada/alzheimers-brain
  * [25] Acharya, H., Mehta, R., & Kumar Singh, D. (2021). Alzheimer Disease Classification Using Transfer Learning. 2021 5Th International Conference On Computing Methodologies And Communication (ICCMC). doi: 10.1109/iccmc51019.2021.9418294
  * [26] Kavitha, M., Yudistira, N. and Kurita, T., (2019). Multi instance learning via deep CNN for multi-class recognition of Alzheimer’s disease. In 2019 IEEE 11th International Workshop on Computational Intelligence and Applications (IWCIA) (pp. 89-94). IEEE.
  * [27] Yudistira, N., Kavitha, M., Itabashi, T., Iwane, A.H. and Kurita, T., (2020). Prediction of sequential organelles localization under imbalance using a balanced deep u-net. Scientific reports, 10(1), pp.1-11.


11institutetext: Mälardalen University, Sweden 22institutetext: Volvo
Construction Equipment AB, Sweden
22email<EMAIL_ADDRESS>{esc17001<EMAIL_ADDRESS><EMAIL_ADDRESS>

# A System Modeling Approach to Enhance Functional and Software Development

Saurabh Tiwari 11 Emina Smajlovic 11 Amina Krekic 11 Jagadish Suryadevara 22

###### Abstract

This paper presents a SysML-based approach to enhance functional and software
development process within an industrial context. The recent changes in
technology such as electromobility and increased automation in heavy
construction machinery lead to increased complexity for embedded software.
Hence there emerges a need for new development methodologies to address
flexible functional development, enhance communication among development
teams, and maintain traceability from design concepts to software artifacts.
The discussed approach has experimented in the context of developing a new
transmission system (partially electrified) and its functionality. While the
modeling approach is a work-in-progress, some initial success, as well as
existing gaps pointing to future works are highlighted.

###### Keywords:

Modeling SysML Systems Engineering

##  1 Introduction

In recent times, there has been a significant paradigm shift within
construction equipment industry in terms of introducing new technologies such
as electromobility and increased automation. For instance, electrification
(i.e. battery-powered parts) is being introduced into products, hydraulic
motors are being replaced with electric versions, new versions of drive-line
system (DLS) where electrified hub motors (instead of torque power from the
engine) are introduced into wheels.

The advanced technological changes in large complex products causes enormous
challenges for existing software development teams. While the functionality
remains largely unchanged in comparison with legacy systems and software, the
new design concepts lead to major changes in hardware and software. Hence the
traditional function development techniques largely based on small incremental
changes to existing software is no longer valid and may lead to quality issues
as well as maintainability and traceability problems. Model-based
methodologies such as Model-based Systems Engineering (MBSE) and Model-based
Design (MBD) are industry-wide considered as effective solutions in
addressing, above described development challenges [1][2]. While traditionally
MBD methodologies are associated with only Simulink-based development
techniques, currently these techniques are being extended using SysML/UML-
based modeling approaches. In this paper, we present the SysML-based modeling
approach considered within the project for development of a new transmission
system (partially electrified) and its software.

In this paper, we describe a modeling approach developed within VCE (Volvo
CE111Volvo Construction Equipment AB, Sweden). The approach is presented using
the ‘Brake’ functionality to capture the transmission system behavior, in
response to brake requests from the operator/machine. The modeling approach
captures the functional behavior from both problem (as seen externally) and
solution domain (albeit implementation independent) perspectives. Later, the
SysML-based solution models can be further refined into hardware and software
views explicitly reflecting the overall design concept(s), paving the way for
traceable software architecture(s) which in turn implemented using traditional
Simulink-based techniques.

##  2 Background

Software Engineering Framework at VCE referred to as SE-Tool, is a
customization of the commercial tool Systemweaver. It is influenced by EAST-
ADL222We refer the reader to the standard for further details:
http://www.east-adl.info/ framework, to support complete software development
processes at VCE. It is primarily used to develop the complete Electrical and
Electronic (E2E) System in software as well as hardware i.e., ECUs, Sensors,
and Actuators.

MathWorks Simulink333https://se.mathworks.com/products/simulink.html is a
graphical development tool used to run simulations, generate code, and test
and verify embedded systems. All functionalities in the Simulink represented
by the blocks. The Simulink connects different blocks and signals to
simulation models that can be executed. Also, the block in a Simulink work
similarly to functions in a C/C++ program. Blocks are divided into pre-defined
MATLAB libraries444https://se.mathworks.com/help/simulink/block-libraries.html
based on their functionality. These libraries include Logic and Bit Operations
(e.g., blocks like Relational Operator and Logical Operator) and Math
Operations (e.g., blocks like Product, Divide, Add, Subtract are included).

While both SE-Tool and Simulink-based frameworks satisfactorily cover the
development processes within Software domain, currently there are huge gaps
related to systems engineering domain like maintainability, traceability,
incorporating new design concepts etc. Hence, there is a need for the “Model-
based System” approach compared to traditional function development approach.

##  3 Braking Functionality: An Example

The drive-line system consists of a clutch, a transmission, a drive shaft, and
an axle connecting the engine and the drive wheels. To describe the system
modeling approach, we model the ‘Brake’ functionality, based on the logical
distribution of the system behavior in terms of the system components
described above. Please note, to simplify the presentation of this paper both
scope and all the figures and illustrations are limited to the behavior of the
‘Brake’ functionality.

Corresponding to required “Brake behavior”, the DLS system “implements”
corresponding “Braking” behavior within its scope, e.g., to create a tractive
force on the machine and gives the machine the capability to move. Additional
sub-systems and components (besides described below) may be required to
increase the quality of the movement, but they are skipped in this paper, to
keep the presentation simple. In order to perform braking, mainly following
subsystems and external entities are involved:

  * •

Operator represents a person who operates a machine by sending a “braking
request” through appropriate interface.

  * •

Powertrain is a subsystem that includes following subsystems: Engine,
Drivetrain and Wheels(#4)

  * •

Requester represents the braking pedal of the physical machine.

##  4 SysML-based Modeling Approach

The overall modeling methodology, as shown in Fig. 1, is primarily based on a
reverse-engineering approach, i.e., capturing functionality from legacy
concepts and corresponding implementations in the hardware and software (e.g.,
simulink- based environment). The modeling has been done using IBM Rhapsody
tool555https://www.ibm.com/se-en/marketplace/rational-rhapsody. However, in
this paper, for illustration purpose, the models have been re-drawn using
other tool.

Figure 1: Overview of the SysML-based modeling approach

The overall system modeling approach is divided into three stages.

Figure 2: BDD for Powertrain subsystem: description of the Brake function

###  4.1 Functional Modeling (Structure)

The first phase of the modeling activity (refer to Fig. 1), is based on the
product breakdown structure. Thus the modeling focuses on “structural aspects”
using SysML BDD (Block Definition Diagram) and IBD (Internal Block Definition)
Diagrams (as illustrated in Fig. 2 and Fig. 3 respectively). Besides modeling
the physical architecture of the system-of-interest, the function behavior in
logical terms (i.e. implementation independent manner) is captured too. The
“braking behavior” is described below.

The Operator sends the signals to Requester, the ‘braking request’ is created.
Requester represents the braking pedal. It creates a “propulsion torque
event”, with return value of braking torque. The ‘braking request’ is then
forwarded to Powertrain which communicates with Wheels, Engine and Drivetrain.
Powertrain forwards the ‘braking request’ to the Drivetrain, where braking
happens in actual. It is consisted of three subsystems: Generator, Dclink and
four Hub Units. The Drivetrain transform, transmit and modulate mechanical
input torque to actualize requested mechanical torques at wheel interfaces.
After receiving the ‘braking request’, engine requests how much power needs to
be generated and sends that to Generator through the Drivetrain. Generator
transfers mechanical energy to electrical and forwards it to DcLink, and then
DcLink transmits that energy and forwards it to four hub units which modulate
it and send to Wheels.

Figure 3: BrakeDrivetrain IBD representing Operations and Signals

The operations and signals identified to realize (logically) the “braking
behavior” is represented in a block diagram as shown in Fig. 3 (the color
scheme to be explained later). It can be noted that the model elements
(structure) illustrated are named with prefix “Brake” to indicate the modeling
is focused only on “analyzing” and capturing the “Braking” behavior in
isolation. The structure indicates the logical decomposition or “allocation”
of the function w.r.to the overall product breakdown structure. This is an
important phase for both requirement and system engineers, and enhance
communications within development teams. The results of this phase are also
reviewed with the stakeholders.

###  4.2 System Modeling (Behavior)

It is the next level of modeling activity using SysML Statemachine diagrams to
capture the functional behavior of the structural “parts” (w.r.to the system-
of- interest). While in this paper, we restrict the behavior specification to
that of “Braking”, this specification is “incrementally” developed by
considering each of the machine functions separately and eventually “combined”
(manually). For instance, in Fig. 4, the behavior of the HubUnit part of
BrakeDrivetrain is presented. It can be noted the granularity of the
(behavior) modeling effort is not arbitrary, but carefully chosen to cover the
“new” parts, in this case the HubUnit (electrically steering the wheels).

As result of the modeling activity described in previous subsection, it can be
noted, there will be multiple state machines for the HubUnit (in other words,
multiple HubUnits each pre-fixed with the individual function names). These
state machines are “combined” to create a single state machine, at suitable
granularity, that serves as the System Specification (for the DLS). Thus, this
modeling phase also contributes to the overall system design decisions. For
ex- ample, as shown in Fig. 4, the color scheme indicates the design decision
to implement the corresponding operation in Software or Hardware (further
explained in subsection below).

###  4.3 Modeling System Design (S/W & H/W Views)

This is the final phase of the SysML-modeling activity and concerns the
detailed design modeling. As described in the previous subsection, the
“software” and “hardware” parts are identified during behavior modeling phase,
as part of the system specification. This phase further requires extensive
domain expertise (both system and software level), for the technical trade-
offs to be made regarding whether a certain SysML Operation is to be
implemented in software or hardware (e.g. sensor). For instance, as shown in
Fig. 4, the blue color represents the design decision that the corresponding
operation has been allocated to the software modules and red color operations
allocated to the hardware components for realization of the overall system.
Based on these, allocation views are modeled in SysML (skipped in this paper
due to lack of space).

Figure 4: State Machine of BrakeHubUnit subsystem

##  5 Conclusions

The SysML-based modeling approach presented in this paper is primarily a
reverse-engineering effort in capturing functionality from legacy
implementations in the hardware and software. However, the approach is generic
enough to be extended into a useful modeling approach complimentary to
existing software development approaches.

## Acknowledgments

This work is partially funded from the Electronic Component Systems for Euro-
pean Leadership Joint Undertaking under grant agreement No. 737494 and The
Swedish Innovation Agency, Vinnova (MegaM@Rt2).

## References

  * [1] Friedenthal, S., Griego, R., Sampson, M.: INCOSE model based systems engineering (MBSE) initiative. In: INCOSE 2007 Symposium (2007)
  * [2] Friedenthal, S., Moore, A., Steiner, R.: A practical guide to SysML: the systems modeling language. Morgan Kaufmann (2014)