You are on page 1of 4

Brain Tumor Classification Using Pretrained

Convolutional Neural Networks


Mihalaș Constantin Daniel Lascu Mihaela Ruxandra
Measurements and Optical Electronics Department Measurements and Optical Electronics Department
Politechnica University Timisoara Politechnica University Timisoara
2021 16th International Conference on Engineering of Modern Electric Systems (EMES) | 978-1-6654-4995-3/21/$31.00 ©2021 IEEE | DOI: 10.1109/EMES52337.2021.9484102

Timișoara, Romania Timișoara, Romania


constantin.mihalas@student.upt.ro mihaela.lascu@ upt.ro

Abstract— Nowadays, deep learning methods have fulfilled They obtained 90.9% accuracy in glioma detection and 94.2%
great image classification tasks. Convolutional neural networks in grades calculation. A CNN deep learning model was
for classifying brain images into four classes: no tumor, glioma, introduced by Sultan et al. in [7] to classify different BT types.
meningioma, and pituitary are introduced in this paper. The They used open access datasets to classify BTs in (no tumor,
used dataset is public and has 3064 MRI brain images from 233 glioma, meningioma, and pituitary). The proposed
patients, also we have added 980 images with no tumor. A architecture obtained 96.13% accuracy. Different pretrained
comparison between pretrained AlexNet, GoogleNet, networks investigations were presented in [8] by Mehrotra et
DenseNet201, and ResNet101 has been done using our dataset. al. for enhancing BT classification in MRIs. The research
Our results show an accuracy of 98.76% obtained with fine-
group used a PT - CNN for BT classification in two classes
tuned ResNet101.
benign and malign. They achieved an accuracy of 99.04%
Keywords— brain tumor, deep learning, convolutional using a finetuned AlexNet.
neural network, pretrained network, classification, accuracy.
III. CONVOLUTIONAL NEURONAL NETWORKS
I. INTRODUCTION CNNs are a class of deep neural networks and consist of
Brain is a complex organ within the physical body, it neurons that have weights and biases. Each neuron obtains the
weighs around 1.4 kilograms, and it is working with 100 information from some inputs, then calculates a scalar product
billion neurons or nerve cells. Each brain neuron is connected, and freely pursues it with a nonlinearity. CNN architectures
through synapses, with thousands or maybe tens of thousands have images as inputs. This network design solves the image
of others neurons. A brain can form up to a million new classification task best.
connections for every second of our lives. An uncontrolled In recent years CNN is a frequently adopted architecture
division of cells generates a brain tumor (BT). In the vicinity that can execute complicated operations using convolutional
or inside the brain an abnormal cells group is created. This filters [2], [9], [10]. A CNN architecture implements a
cells group can affect the correct brain activity and destroy sequence of feedforward layers with convolutional filters and
healthy cells [1]. pooling layers. This network architecture utilizes several fully
Today, almost every clinic uses the World Health connected layers, after the last pooling layer, that convert
Organization (WHO) classification to detect BT. According to bidimensional feature maps from the previous layers into an
WHO, there are more than 120 BT types. Cell origin and unidimensional vector for classification [11]. Not requiring
behaviour help classify BTs, from the least aggressive feature extraction is a CNN architecture advantage. A CNN
(benign) to the most aggressive (malignant). development from scratch is time consuming and
complicated. It is necessary to apply a large labelled dataset
In recent years neural networks have grown very fast. The for training before the model is ready for classification. CNNs
implementation of accurate methods in training neural are using relatively little preprocessing compared to other
networks has become extremely important in diverse health algorithms for image classification tasks. The network uses
informatics areas such as medical image analysis, filters that in classic algorithms were built manually. A great
bioinformatics, and medical informatics [2]. advantage is that CNNs are independent of previous
knowledge and human effort in designing the features.
II. PREVIOUS REFFERENCES
Convolutional neural networks (CNNs) gained popularity IV. PERFORMANCE PARAMETERS
only in 2012, although they were initially introduced to the The proposed BT detection and classification framework
public in 1998 by LeCun [3]. In 2012 Krizhevsky [4] designed calculates four significant metric equations, that check the
a winning CNN for the ImageNet competition that performed classifier effectiveness [7].
considerably better than previous state of the art models. After Accuracy measures the total number of predictions a
the ImageNet contest from 2012, the CNN’s importance model gets right.
raised in image classification, and the computer vision Precision evaluates how good the model is in predicting
community adopted these network architectures. positive labels.
In [5] Paul et al. used oblique BT images for CNN training, Recall calculates the percentage of actual positives a
and they introduced new methods for detection and model identifies correctly.
classification implementing CNNs. They obtained 91.43% F1 Score is the weighted average considering precision
accuracy. In [6] Anaraki et al. suggest a network to emphasize and recall.
BTs in MRIs considering Genetic Algorithms (GA) and CNN.

978-1-6654-4995-3/21/$31.00 ©2021 European Union

Authorized licensed use limited to: Institute of Technology (Nirma University). Downloaded on October 17,2021 at 16:55:40 UTC from IEEE Xplore. Restrictions apply.
Accuracy = (TP + TN) / (TP + TN + FP + FN) (1) C. GoogleNet
GoogleNet [12] is between the first architectures that
Precision = TP / (TP + FP) (2) recommended the inception block that significantly reduced
the number of trainable parameters in the network. The
Recall = TP / (TP + FN) (3) inception module operates with a parallel combination like
a 1 × 1 convolutional filter added before the 3 × 3, and 5 ×
F1 = 2 * (Precision * Recall) / (Precision + Recall) (4) 5 convolutional blocks. Also, an alongside pooling layer is
True positive (TP) predicts a positive class that is positive. implemented for dimension reduction, as shown in Fig.3 [15].
True negative (TN) predicts a negative class that is negative. D. ResNet101
False Negatives (FN), also named Type II error, predicts a
negative class that is positive. False Positives (FP), also named ResNet architecture [14] introduced by Microsoft is
Type I error, predicts a positive class that is negative. showed in Fig.4.
The fundamental concept is to increase the number of
V. PRETRAINED NETS layers introducing a residual connection (with an identity
A. AlexNet layer). This layer is connected directly with the next layer
improving the learning process.
The AlexNet architecture is presented in Fig.1. AlexNet is
a CNN designed by Alex Krizhevsky [4], which contains eight VI. METHODOLOGY
layers after the input layer, firstly five layers are convolutional
layers and then the next three layers, last in the architecture, Our proposed methodology is based on the pretrained
are fully connected layers with 4096 neurons each. CNN’s architectures AlexNet, GoogleNet, DenseNet201, and
Resnet101 for classification. A specified classifier is detecting
B. DenseNet201 the BT in brain MRIs. This methodology is implemented in
The DenseNet architecture is shown in Fig.2 and contains MATLAB and follows the below steps:
four Dense Blocks (Dx). First an input layer, then transition Step 1: MRI brain dataset acquisition.
layers (Tx), and finally the global average pooling (GAP) Step 2: Extract the images.
layer. The transition layers have a batch normalization layer, Step 3: Resize the images to fit the CNN input layer.
a 1×1 convolutional layer, and a 2×2 average pooling layer Step 4: Import pretrained networks.
with a two stride. GAP is comparable to the classic pooling Step 5: Final layers replacement to get better precision and
approach, but GAP has a more severe feature map reduction. accuracy for classification.
In conclusion, GAP layer is minimizing the whole image into Step 6: Conduct experiments, compare, observe and
a single-digit [13]. decide which network has the best results.

Fig. 1. AlexNet architecture [4].

Fig. 2. DenseNet 201 architecture [13].

Authorized licensed use limited to: Institute of Technology (Nirma University). Downloaded on October 17,2021 at 16:55:40 UTC from IEEE Xplore. Restrictions apply.
Fig. 3. GoogleNet architecture [15].

Fig. 4. ResNet101 architecture [14].

A. Data Acquisition networks in MATLAB. Conclusively, we need to replace the


The dataset used in this paper is downloaded from final fully connected layer (FCL) of the network to fit in our
FigShare. This dataset is in .mat format which contains not image classification task. We can observe the changes in
just the MRIs but also some interesting details such as: label Table I.
(meningioma-1, glioma-2, pituitary tumor-3), patient D. Experiments
identification (PID), tumor border, and tumor mask. This
dataset contains 3064 images from 233 patients with three We used the Experiment Manager application provided by
types of BT: meningioma (708 images), glioma (1426 MATLAB to compare these four finetuned pretrained
images), and pituitary (930 images). Because our application networks. We created a function with multiple variable
has images as input, not .mat files, it is necessary to extract parameters like net, initialLearnRate, epochs, miniBatchSize,
from the datasets only the brain MRIs. To accomplish this, we and solver. We changed these parameters according to
created a MATLAB program to extract from the. mat datasets Table II to achieve the highest accuracy. To calculate the
only the images in the .PNG format having 1072 x 1072 pixels evaluation metrics for our pretrained networks, we
size. Finally, we obtained an adequate dataset with labelled implemented the previously presented formulas for accuracy,
MRIs. precision, recall, and F1-score.
VII. RESULTS
In addition to the previously obtained dataset, we added a
part of other datasets found in Kaggle, which contains two In this paper an optimal skeleton for best pretrainig and
folders (Yes-with tumors and No-without tumors) having 253 transfer learning is presented. The main purpose is to classify
brain MRIs. We selected only the part of the dataset without BT in no tumor, glioma, meningioma, and pituitary. The
tumors that have 98 Brain MRIs. Because 98 images from the feature self-extractions executed by the network are
Kaggle dataset are few compared to 3064 images from depending on their architecture. To perform our image
FigShare, these no tumor images are not enough to train the classification task in Fig.5, we have to finetune the last few
neural network. We used data augmentation, flipping or layers that belong to our pretrained networks. We used
shifting the image left/right or up/down, to create another nine MATLAB R2020b in our paper.
images for each image in the dataset. After data augmentation,
TABLE I THE NETWORKS LAST THREE LAYERS MODIFICATIONS
the dataset consists of 980 brain MRIs without tumors having
630 x 630 pixels size in JPG format. In total, our final image Network Layer Original Replaced
dataset contains 4044 images split into four categories. This Dense Last-2 Pretrained architecture FCL 1000 FCL four with bias one
end dataset is proper for our study, considering that our Net201 Last 1000 classes layer 4 classes layer
computer has an Intel Core I3-5010U CPU @2.1 GHz and Alex Last-2 Pretrained architecture FCL 1000 FCL four with bias two
Net
8GB RAM Memory. Last 1000 classes layer 4 classes layer
Res Last-2 Pretrained architecture FCL 1000 FCL four with bias one
B. Image Dataset Preparation for CNN Net101 Last 1000 classes layer 4 classes layer

Because each pretrained network expects an adequate Google Last-2 Pretrained architecture FCL 1000 FCL four with bias two
Net Last 1000 classes layer 4 classes layer
image input size, we need to resize all these images to fit the
input layer of the pretrained network. TABLE II FINE TUNING OF PARAMETERS
C. Final Layers Preparation for Pretrained Nets Parameter Values
It is mandatory to download the necessary add-on called net [“Googlenet","Alexnet","Densenet201",” Resnet101"]
initialLearnRate [1e-4,1e-3]
Deep Learning Toolbox Model for AlexNet, GoogleNet, epochs [6,7,8]
DenseNet201, and ResNet101 and to import the pretrained miniBatchSize [8,10]
solver ["sgdm" "adam" "rmsprop"]

Authorized licensed use limited to: Institute of Technology (Nirma University). Downloaded on October 17,2021 at 16:55:40 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Training and validation results for AlexNet, GoogleNet, DenseNet201, and ResNet101.

Fig. 6 shows the ResNet101 confusion matrix, true class REFERENCES


versus predicted class, that validates the performance for the [1] H. Mohsen, E.S.A. El-Dahshan, E.S. M. El-Horbaty, and A.B. M.
classification of BT in MRIs. Salem, "Classification using deep learning neural networks for brain
tumors", Future Computing and Informatics Journal, vol. 3, no. 1,
VIII. CONCLUSION pp. 68–71, Jun. 2018, doi: 10.1016/j.fcij.2017.12.001.
[2] L. Singh, G. Chetty, and D. Sharma, "A Novel Machine Learning
This paper examines diverse pretrained networks for Approach for Detecting the Brain Abnormalities from MRI
bettering BT classification in MRI images using transfer Structural Images", Pattern Recognition in Bioinformatics, vol.
learning. 7632, Eds. Springer Berlin Heidelberg, 2012, pp. 94–105. doi:
10.1007/978-3-642-34123-6_9.
Table III summarizes important pretrained CNN networks [3] Y. LeCun, L. Bottou, Y. Bengio, and P. Ha, "Gradient-Based
state of the art. Transfer learning using ResNet101 generates Learning Applied to Document Recognition”, p. 46, 1998.
the best accuracy 98.76% applying the RMSProp optimizer [4] A. Krizhevsky, I. Sutskever, and G. E. Hinton, "ImageNet
among the presented PT-CNN. classification with deep convolutional neural networks", Commun.
ACM, vol. 60, no. 6, pp. 84–90, May 2017, doi: 10.1145/3065386.
The performances for diverse pretrained networks are [5] J. S. Paul, A. J. Plassard, B. A. Landman, and D. Fabbri, "Deep
strongly dependent on the optimizer type. It influences learning for brain tumor classification", Orlando, Florida, United
States, Mar. 2017, doi: 10.1117/12.2254195.
accuracy and network training time. Our conclusion was that [6] A. Kabir Anaraki, M. Ayati, and F. Kazemi, "Magnetic resonance
DenseNet in comparison with other pretrained networks imaging-based brain tumor grades classification and grading via
needed maximum training time, 21hr 47min 40sec, using the convolutional neural networks and genetic algorithms",
RMSProp optimizer. Biocybernetics and Biomedical Engineering, vol. 39, no. 1, 2019.
[7] H. Sultan, N. M. Salem, W. Al-Atabany, "Multi-Classification of
The proposed system accomplished 98.76% accuracy Brain Tumor Images Using Deep Neural Network", IEEE Access,
using our preprocessed dataset. In future work, we will use vol. 7, pp. 215–225, 2019, doi: 10.1109.
larger datasets to improve the accuracy. Also, we will reduce [8] R. Mehrotra, M. A. Ansari, R. Agrawal, and R. S. Anand, "A
Transfer Learning approach for AI-based classification of brain
the network training time by using advanced computing tumors", Machine Learning with Applications, vol. 2, 2020, doi:
processors, graphical processors, and cloud computing. 10.1016/j.mlwa.2020.100003.
[9] G. Litjens et al., "A survey on deep learning in medical image
analysis", Medical Image Analysis, vol. 42, pp. 60–88, 2017, doi:
10.1016/j.media.2017.07.005.
[10] Y. Pan et al., "Brain tumor grading based on Neural Networks and
Convolutional Neural Networks", 37th Annual International
Conference IEEE Engineering in Medicine and Biology Society
(EMBC), pp. 699–702, Milan, Aug. 2015.
[11] D. Ravi et al., "Deep Learning for Health Informatics", IEEE J.
Biomed. Health Inform., vol. 21, no. 1, pp. 4–21, 2017, doi:
10.1109/JBHI.2016.2636665.
[12] C. Szegedy et al., "Going deeper with convolutions", IEEE
Conference on Computer Vision and Pattern Recognition (CVPR),
Boston, MA, USA, pp. 1–9, Jun. 2015.
[13] S.H. Wang and Y.D. Zhang, "DenseNet-201-Based Deep Neural
Network with Composite Learning Factor and Precomputation for
Fig. 6. ResNet101 Confusion Matrix.
Multiple Sclerosis Classification", ACM Trans. Multimedia Comput.
TABLE III PRETRAINED CNNS - STATE OF THE ART Commun. Appl., vol. 16, no. 2s, Jul. 2020, doi: 10.1145/3341095.
Dataset
[14] K. He, X. Zhang, S. Ren, and J. Sun, "Deep Residual Learning for
Accuracy Image Recognition", arXiv:1512.03385 [cs], Dec. 2015,
Authors Method Classes no (0-no tumor, 1-meningioma, 2-
(%)
glioma, 3-pituitary tumor) http://arxiv.org/abs/1512.03385
Paul et al. [15] H.C. Shin et al., "Deep Convolutional Neural Networks for
CNN 3 208-1, 492-2, 289-3 91,43
(2017) [5] Computer-Aided Detection: CNN Architectures, Dataset
Anaraki et al. GA Characteristics and Transfer Learning", IEEE Trans. Med. Imaging,
3 708-1, 1426-2, 930-3 94,20
(2019) [6] CNN
vol. 35, no. 5, May 2016, doi: 10.1109/TMI.2016.2528162.
Sultan et al.
CNN 3 708-1, 1426-2, 930-3 96,13 [16] N. Abiwinanda, M. Hanif, S. T. Hesaputra, A. Handayani, T.R.
(2019) [7]
Mengko, "Brain Tumor Classification using Convolutional Neural
Abiwinanda
et al. (2018) CNN 3 708-1, 1426-2, 930-3 84,19 Network", World Congress on Medical Physics and Biomedical
[16] Engineering, vol. 68, no. 5, ISBN 978-981-10-9034-9, Publisher
PT Springer Singapore.
Proposed 4 708-1, 1426-2,930-3, 980-0 98,76
CNN

Authorized licensed use limited to: Institute of Technology (Nirma University). Downloaded on October 17,2021 at 16:55:40 UTC from IEEE Xplore. Restrictions apply.

You might also like