Brain Tumor Classification using Machine and Transfer Learning
Iliass Zine-dine
a
, Jamal Riffi
b
, Khalid El Fazazy
c
, Mohamed Adnane Mahraz
d
, Hamid Tairi
e
LISAC Laboratory, Faculty of Sciences Dhar El Mehraz (F.S.D.M),Sidi Mohamed Ben Abdellah University (U.S.M.B.A),
Fès , Morocco
Keywords: The Brain Tumor, Transfer Learning, VGG-16, Deep Features Extraction.
Abstract: Brain tumor classification is a controversial problem in computer-aided diagnosis (CAD). Conventionally,
cancer diagnosis depends mainly on its early prediction. Accordingly, the improvement of technology and the
rise of machines and deep learning facilitate the tasks of tumors’ detection and diagnosis while limiting human
intervention. Transfer learning has been widely adopted in several applications due to its performance. In the
present paper, we have combined VGG-16 and several classifiers for brain tumor classification. Indeed, after
the fine-tuning step of VGG-16, we have fed the extracted features to the classifiers. The proposed approach
has achieved efficient results and has outperformed several state-of-the-art studies in the topic of brain tumors
in terms of precision (98.7%), recall 98.7, F1-score 98.7%.
1 INTRODUCTION
We cannot deny the fact that cancer orders as a
principal cause of death, and an essential factor
determining life expectancy in every nation all over
the earth (Bray F), as in 2020, a brain tumor forms
1.6% of all tumors that can affect the human body,
and 2.5% of fatal tumors (Sung), its constantly
increasing incidence all across the world makes it a
priority to the World Health Organization (WHO) in
terms of screening, diagnosis, and treatment
(Idlahcen Ferdaous, 2020). To be more precise, a
brain tumor is an abnormal growth of tissue in the
brain. Unlike other tumors, brain tumors grow by
regional extension and infrequently metastasize
outside the brain (DeAngelis, 2001). Consequently,
the classification of brain tumors represents a
challenge because of their spread in different
positions. Our goal is to classify the cancer in MRI
images.
Several approaches have been proposed to
automatically predict the existence of a tumor in a
medical images such as those based on machine
learning. These approaches could be divided into two
a
https://orcid.org/0000-0001-7134-4888
b
https://orcid.org/0000-0003-0818-7706
c
https://orcid.org/0000-0000-0000-0000
d
https://orcid.org/0000-0002-0966-9654
e
https://orcid.org/0000-0002-5445-0037
main steps: the features extraction and the
classification model. Sharma et al. (Sharma, 2014)
found that human life takes a crucial position in
society and more precisely in the domain of medicine,
it is for that the intervention, the detection, and the
classification of the brain diseases appears very
necessary, the resolution of this problem
classification is frequently based on extracting and
classifying features using a machine learning
algorithm. In this regard, Javeria Amin et al. (Amin J.
S., 2018) proposed a new method to detect and
classify brain diseases (ischemic strokes, gliomas) at
an early step, using machine learning and features
extraction algorithms.
Despite the positive outcomes of these
approaches, they remain limited, especially when
dealing with vast databases. Another sort of approach
based on Deep Learning is proving to be very
effective while handling extensive data. Heba
Mohsen et al. (Mohsen, 2018) presented a new
approach using a DNN learning method to classify
brain tumor images by using fuzzy C-means to
segment the images, and also the discrete wavelet
transforms (DWT) to extract the features, and
principle component analysis (PCA) technique for
566
Zine-dine, I., Riffi, J., El Fazazi, K., Mahraz, M. and Tairi, H.
Brain Tumor Classification using Machine and Transfer Learning.
DOI: 10.5220/0010762800003101
In Proceedings of the 2nd International Conference on Big Data, Modelling and Machine Learning (BML 2021), pages 566-571
ISBN: 978-989-758-559-3
Copyright
c
2022 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved
reducing the dimensions, and Deep Neural Network
(DNN) for classification. Milica M. Badža et al.
(Badža, 2020) presented a new CNN method to detect
and classify brain tumors, depending on their kind
(Meningioma, Glioma, Pituitary).
To improve the studies made on the topic of brain
tumors, we used a deep learning interface (API
FastAI), which allows us to resize the images and
speed up the training of the applied models.
Transfer learning is defined as an approach that
allows using the information of a model that has
already been trained to learn another target data set.
Arshia Rehman et al. (Rehman, 2020) employed and
explored CNN approaches (AlexNet, GoogleNet, and
VGG-16) to detect and classify brain tumors, using
MRI images.
In this paper, we propose an architecture based on
transfer Learning using the VGG-16 model to our
data set in order to get the feature extractions for the
machine learning models for the purpose of having a
higher prediction score.
The remainder of the paper is organized as
follows: in the second section, we present the related
work, followed by the material and the methods, then
the experimental results, ending with a conclusion.
2 RELATED WORK
The main aim of this part is to describe previous
studies related to the detection and classification of
brain tumors using machine learning and deep
learning models. Many researchers who used
Machine Learning classifier. George, D. N. et al.
(George, 2015) proposed architecture to segment
brain tumors and detect regions of MRI images. In
this regard, Ali and Hanbay (Ari Ali, 2018) proposed
a method that included three main steps: image
preprocessing, image classification with ELM-LRF,
along tumor extraction using image processing
techniques. Amin et al. (Amin, Sharif, Raza, &
Yasmin, 2018) proposed a methodology to segment
and classify the brain tumor using Deep Neural
Networks (DNN) and magnetic resonance images
(MRI).
Deep Learning is another powerful approach to
classifying problems. H. Sultan et al. (HOSSAM H.
SULTAN, 2019) suggested a deep learning approach
that uses a convolutional neural network (CNNs) for
the detection and classification (Meningioma,
Glioma, Pituitary) kinds of brain tumors. Amin Kabir
Anaraki et al. (Kabir Anaraki, 2019) presented a new
approach using CNNs, and a genetic algorithm (GA)
to classify brain tumors based on magnetic resonance
imaging. Correspondingly, Hüseyin and Engin
(Hüseyin Kultu, 2019) proposed a new approach to
categorising liver and brain tumors based on the CNN
efficiency in feature extraction, the capability of the
discrete wavelet transform in signal processing, and
the ability of memory long-term in signal
classification. Parnian Afshar et al. (Afshar,
Plataniotis, & Mohammadi, 2019) proposed a method
to classify brain tumors into three categories:
Meningioma, Pituitary, and Glioma, based on CNN
usage via CapsuleNet architecture and MRI images,
these are frequently used approaches for early
prediction of brain disease.
Although these approaches give perfect results,
another technique based on data pre-training is very
effective when processing extensive data. Several
methods are involved in this challenge; S. Deepak et
al. (Deepak, 2019) applied a pre-trained deep
network, based on GoogLeNet to classify problems
(MR images brain tumors) via transfer learning, in
this regard, Swati et al. (wati, et al., 2019) proposed a
new method that uses the deep neural network, and
trained CNN on the short data set, using a pre-trained
deep CNN model, and proposed a block-based fine-
tuning approach based on transfer learning.
3 MATERIAL AND METHODS
This research study has adopted three main steps
method. First, image preprocessing; second, image
representation; last but not least, image classification.
The structure of the proposed method is illustrated
in the figure below. The acquisition of images are the
first step of this method, the second step is the
preprocessing of images (cropping, resize, and
splitting increase) via the FastAI interface,
afterwards, the classification step by transfer learning
VGG-16, then, we transform the output images into
arrays, in the last step in this study, various Machine
Learning classification algorithms have been used to
compare their performance including Random Forest,
Support Vector Machine, Decision Tree, Gaussian
Naive Bayes, and K-Nearest Neighbor.
Brain Tumor Classification using Machine and Transfer Learning
567
Figure 1: Diagram of Brain Tumor Classification Method.
We used a deep learning interface (API FastAI) to
get a reasonable learning rate, Tensorflow, Pytorch,
Keras, Pandas, Numpy, and Sklearn as libraries to
build our models. During training, in order to make
the model converge to the maximum state, the
number of epochs was 80, and the batch size was 32
for all models. We apply RMSprop as an optimizer,
binary_crossentropy as loss, and accuracy as metrics
for the VGG-16 parameters model. Our experiments
were run on the Kaggle notebook, which gave us 16G
RAM and a GPU kernel.
Figure 2: Sample image preprocessing (function cropped).
The last step of our method consists of classifying
and detecting the tumor in the images. The output of
the VGG-16 (features extraction) is fed to several
machine learning models such as Random Forest,
Support Vector Machine, Decision Tree Classifier,
Gaussian Naive Bayes, and K-Nearest Neighbor.
Figure 3: Sample MRI, no brain tumor.
Figure 4: Sample MRI, yes brain tumor.
4 EXPERIMENTAL RESULTS
4.1 Dataset
We obtained the data on which we carried out this
study (Brain MRI Images for Brain Tumor Detection)
from a Kaggle competition (Rakotomamonjy, 2008).
After augmenting and preprocessing the image, we
split the resulting data set into three categories: data
training which includes 1444 (70%) of images, data
validation that contains 310 (15%) of images, and
data testing that includes 309 (15%) of images, as
shown in the following table(1), and then we build
our VGG-16 model on our dataset. The outputs
(features extraction) that we get will be the inputs of
each machine learning model.
Table 1: Representation examples.
Step Number of examples
Train 1444 (70%) of ima
g
es
Validation 310 (15%) of images
Test 309 (15%) of images
As we have already stressed, Transfer learning (S.
Deepak, 2019) is an approach that allows using the
information of a model that has already been trained
to learn another target task. Thus, in order to improve
the studies made in this field of brain tumors, we have
applied FastAI (Francis, 2021), which is a library that
allows the processing of images, the construction of
deep learning models in a simpler and faster way.
The implementation of the VGG-16 model is
based primarily on the input layer of data, the
different types of the layers (Conv, Pooling), and the
dense layer on output. After the application on our
dataset, we haven’t only have gained a test accuracy
of 98.7% but also, outputs which transformed into
matrices to exploit them as inputs in the different
models of machine learning.
BML 2021 - INTERNATIONAL CONFERENCE ON BIG DATA, MODELLING AND MACHINE LEARNING (BML’21)
568
Figure 5: Loss and Accuracy of VGG-16 model.
The loss is the sum of the errors made for each
example in the training or validation sets. So we
assume that "the lower the loss, the better the model".
Precision is a measure of the performance of a
classification model (R. Prashanth, 2016).
Informally, precision indicates the percentage of
accurate predictions made by the model. Following
the same path, accuracy is defined as:
𝐜𝐨𝐫𝐫𝐞𝐜𝐭 𝐩𝐫𝐞𝐝𝐢𝐜𝐭𝐢𝐨𝐧 𝐧𝐮𝐦𝐛𝐞𝐫
𝐭𝐨𝐭𝐚𝐥 𝐩𝐫𝐞𝐝𝐢𝐜𝐭𝐢𝐨𝐧 𝐧𝐮𝐦𝐛𝐞𝐫
1
For binary classification, trueness can also be
calculated in terms of positives and negatives as
follows:
𝐕𝐏  𝐕𝐍
𝐕𝐏𝐕𝐍𝐅𝐏𝐅𝐍
2
4.2 Applied Machine Learning Models
In this paragraph, we will cite the Machine Learning
algorithms used to classify brain tumors in this work.
Support vector machines (SVM) (Joachims) are
supervised machine learning methods; they are linear
classifiers, interested in solving discrimination and
regression problems.
The Random Forest Algorithm (Breiman, 2001)
is a machine learning method that applies to several
decision trees formed on subsets of data.
The decision tree (Quinlan, 1993) is a method that
is built in the graph of a tree and gives a group of
choices, the ends or the leaves of the tree represent
the different possible decisions, several fields such as
medicine, commerce, security use this approach
A k-nearest-neighbor (K-NN) algorithm
(Peterson, 2009) is a data classification method that
predicts the probability that a data point is a part of
one set or the other.
The naive Bayesian classification (Liu Ximeng,
2016) is a probabilistic classifier using Bayes'
theorem.
4.3 Performances Metrics
ROC curve (Receiver Operating Characteristic curve)
(Hand, 2009) is a sensitivity/specificity function; it is
a performance measure that allows the characteristics
of a binary classifier to be evaluated.
ROC curve VGG-16
ROC curve SVM
ROC curve Random Forest ROC curve Decision Tree
ROC curve Gaussian Naive
Bayes
ROC curve K-Nearest
Neighbor
Figure 6: ROC curve Machine Learning models
A confusion matrix (S Visa, 2011) is a tool used
to assess the performance of a classification problem.
A confusion matrix is an array of a two-dimensional
Brain Tumor Classification using Machine and Transfer Learning
569
Table 2: Comparison between machine learning models prediction.
Model Accuracy Precision Recall F1_score
VGG-16 0.987 0.987 0.987 0.987
SVM 0.825 0.827 0.805 0.830
Random Forest 0.887 0.887 0.887 0.887
Decision Tree 0.686 0.686 0.686 0.686
Naive Bayes 0.595 0.622 0.595 0.585
K-NN 0.796 0.824 0.796 0.6794
array: rows contain predicted values, and columns
have actual values.
VGG-16
SVM
Random Forest
Decision Tree
K-Nearest Neighbor
Gaussian Naive Bayes
Figure 7: Confusion Matrix
In this study, we built five different machine learning
models, starting with the implementation and
augmentation of the dataset to have more images for
the training, the evaluation, and the test of the model
built. We applied the VGG-16 model, followed by
getting the features extraction of this model and
consider them as inputs for all the machine learning
models built. In the end, we get the results of each
model.
After applying the VGG-16 model on our dataset,
along with considering its outputs (features
extraction) as inputs of the following models, the
prediction results based on our machine learning
models achieved 98.7% in terms of accuracy (test).
They ranked as follows (SVM: 82.5%, Random
Forest: 88.7%, Decision Tree: 68.6%, Naive Bayes:
59.5%, and 55.6% K-Nearest Neighbor).
5 CONCLUSION AND FUTURE
WORK
In the manuscript, we have built several machine-
learning models to classify brain tumors. Firstly, we
have implemented and augmented the data set in
order to have more images for the training. Secondly,
we have split the data set into training, validation, and
testing steps. After applying the VGG-16 model, we
extracted the outputs of this model (features
extraction) and considered them as inputs for all the
machine-learning models built. Finally, we get the
results of each model, and we compared them. Our
experimental findings are remarkable bearing in mind
the fact that they demonstrate the capability of deep
learning pre-trained models toward a promising
computer-aided diagnosis in digital pathology.
Eventually, this study is an initiation to other
researches, in light of the fact that some cancer
patterns can not be gleaned by human examination.
REFERENCES
Afshar, P., Plataniotis, K., & Mohammadi, A. (2019).
Capsule Networks for Brain Tumor Classification
based on MRI Images and Course Tumor Boundaries.
Amin, J. S. (2018). Detection of Brain Tumor based on
Features Fusion and Machine Learning.
BML 2021 - INTERNATIONAL CONFERENCE ON BIG DATA, MODELLING AND MACHINE LEARNING (BML’21)
570
Amin, J., Sharif, M., Raza, M., & Yasmin, M. (2018).
Detection of Brain Tumor based on Features Fusion
and Machine Learning.
Ari Ali, H. D. (2018). Deep learning-based brain tumor
classification and detection system.
Badža, M. M. (2020). Classification of brain tumors from
MRI images using a convolutional neural network.
Bray F, L. M. (s.d.). The everincreasing importance of
cancer as a leading cause of premature death
worldwide. Cancer. In press.
Breiman, L. (2001). Random Forests, Machine Learning.
DeAngelis, L. M. (2001). Brain Tumors.
Deepak, S. A. (2019). Brain tumor classification using deep
CNN features via transfer learning.
Francis, C. R. (2021). Alzheimer’s Disease Prediction
Using Fastai.
George, D. N. (2015). Brain tumor detection using shape
features and machine learning algorithms.
Hand, D. J. (2009). Measuring classifier performance: a
coherent alternative to the area under the ROC curve.
HOSSAM H. SULTAN, N. M.-A. (2019). Multi-
Classification of Brain Tumor Images Using Deep
Neural Network.
Hüseyin Kultu, E. A. (2019). A Novel Method for
Classifying Liver and Brain Tumors Using
Convolutional Neural Networks, Discrete Wavelet
Transform and Long Short-Term Memory Networks.
Idlahcen Ferdaous, M. A. (2020). Cnn-based approach for
cervical cancer classification in whole-slide
histopathology images.
Joachims, T. M. (s.d.). large-scale SVM learning practical.
Kabir Anaraki, A. A. (2019). Magnetic resonance imaging-
based brain tumor grades classification and grading
via convolutional neural networks and genetic
algorithms.
Liu Ximeng, L. R. (2016). Privacy-Preserving Patient-
Centric Clinical Decision Support System on Naïve
Bayesian Classification.
Mohsen, H. E.-D.-S.-H.-S.-B. (2018). Classification using
deep learning neural networks.
Peterson, L. (2009). K-nearest neighbor.
Quinlan, R. (1993). Programs for Machine Learning.
Morgan Kaufmann Publishers .
R. Prashanth, D. R. (2016). High-Accuracy Detection of
Early Parkinson's Disease through Multimodal
Features and Machine Learning.
Rakotomamonjy, A. G. (2008). BCI competition III:
Dataset II.
Rehman, A. N. (2020). A Deep Learning-Based Framework
for Automatic Brain Tumors Classification Using
Transfer Learning.
S Visa, B. R. (2011). Confusion Matrix-based Feature
Selection.
S. Deepak, P. A. (2019). Brain tumor classification using
deep CNN features via transfer learning.
Sharma, K. K. (2014). Brain Tumor Detection based on
Machine.
Sung, H. F. (s.d.). Global cancer statistics 2020:
GLOBOCAN estimates of incidence and mortality
worldwide for 36 cancers in 185 countries.
wati, Z., Zhao, Q., Kabir, M., Ali, F., Ali, Z., Ahmed, S., &
Lu, J. (2019). Brain tumor classification for MR images
using transfer learning and fine_tuning.
Brain Tumor Classification using Machine and Transfer Learning
571