A Framework for Brain Tumor Segmentation and Classification using Deep Learning Algorithm

The brain tumor is a cluster of the abnormal tissues, and it is essential to categorize brain tumors for treatment using Magnetic Resonance Imaging (MRI). The segmentation of tumors from brain MRI is understood to be complicated and also crucial tasks. It can be further use in surgery, medical preparation, and assessments. In addition to this, the brain MRI classification is also essential. The enhancement of machine learning and technology will aid radiologists in diagnosing tumors without taking invasive steps. In this paper, the method to detect a brain tumor and classification has been present. Brain tumor detection processes through pre-processing, skull stripping, and tumor segmentation. It is employing a thresholding method followed by morphological operations. The number of training image influences the feature extracted by the CNN, then CNN models overfit after some epoch. Hence, deep learning CNN with transfer learning techniques has evolved. The tumorous brain MRI is classified using CNN based AlexNet architecture. Further, the malignant brain tumor is classified using GooLeNet transfer learning architecture. The performance of this approach is evaluated by precision, recall, F-measure, and accuracy metrics. Keywords—Brain MRI; segmentation; CNN; deep learning; transfer learning


I. INTRODUCTION
Brain tumor detection and classification is one of the active research areas. The segmentation technique extracts the brain tumor from the brain MRI, and classification algorithms classify the brain tumor into respective categories. It has an essential task in interpreting, extracting features, analyzing, and interpreting images in many applications. It has been widely used in brain imaging to classify tissues, detect tumors, assess tumor size, delineating blood cells, and operation preparation. The brain tumor identification, size, shape, and location are carried using Magnetic Resonance Imaging (MRI). The brain tumor is caused by the irregular uncontrolled spreading out of cells in the brain called trauma. It is classified as primary and secondary tumors. Primary brain tumors are non-cancer or benign tumors developed in the brain tumor itself. The brain tumor that initiates in the rest of the body parts such as the lungs, breast, and then migrates to the brain over the blood flow is the secondary tumor. These secondary tumors are cancer-causing or malignant.  This research aims first to detect the brain tumor from MRI. The tumorous MRIs further classifies using the transfer learning architecture, i.e., AlexNet, into Malignant and benign. The cancerous malignant tumors are also classified into glioma and meningioma using the GoogLeNet architecture of CNN. The classification architectures are selected based on their accuracy by hyper tuning the training parameters. As the database is limited, the transfer learning model helps speed up training and improves the job of the classifier. This paper is structured as Section II offers a brief outline of the recent progress in the brain tumor detection, and classification aided by Machine Learning (ML) and Deep Learning (DL) algorithms into malignant and benign as well as glioma and meningioma. Section III presents the architecture of the proposed methodology. It includes the brain tumor segmentation and classification using transfer learning. Quantitative and qualitative analysis is present in Section IV. Section V gives concluded the approach and suggests the future direction for this research work.

II. LITERATURE SURVEY
Brain tumor classification plays a substantial role in the suggested methodology. In the latest times, the classification process widely uses DL and ML algorithms. This section presents the methods and previous works in brain tumor segmentation and ML-based classification from MRI.
A. Padma et al. [2] introduced segmentation and classification of the brain tumor in the CT image. It used Dominant Gray Level Run Length Matrix (DGLRLM) as a feature extraction technique. The proposed method for finding tumors in brain CT images with the use of a Support Vector Machine (SVM) classification shows an efficient segmentation algorithm. Their work aims to combine the DGLRLM and wavelet-based feature extraction techniques. Ideal shape features are selected using a genetic algorithm. SVM uses DGLRLM and wavelet features as input. The average accuracy rate is over 97%.
A. Hamamci et al. [3] proposed a brain tumor segmentation approach for radiotherapy applications. They provide a quick real-world platform for the classification of tumors with the least user collaboration to aid researchers along with clinicians in surgical preparation and assess response to treatment. Importantly, Cellular Automata (CA) focuses on seeded tumor classification method on MRI, which offered seed selection. First, they build a relationship between CA-based segmentation for graph-theory techniques to establish that the redundant CA structure responds to the shortest path problem. The state conversion performance of the CA followed to estimates the shortest path. Besides, the segmentation problems adjusted the sensitivity factor amplitude for the segmentation problem, and a level set of tumor probability maps generated from CA states. Only adequate clinical data can be collected from the user with clinical practice to reset the algorithm by drawing on the largest diameter of the tumor.
Aneza and Rawat et al. [4] introduced the Fuzzy Clustering Mean (FCM) segmentation approach. The performance of the segmentation is evaluated based on cluster validation functions, processing time, and convergence rate. It achieves an of 0.537% misclassification error using the Intuitionistic Fuzzy C-Means (IFCM) method. Ravindra Sonavane et al. [5] present the approach for the sorting of brain MRI classification into malignant and benign. This system used the AdaBoost algorithm. It consists of preprocessing using Anisotropic Diffusion Filtering, feature extraction by Discrete Wavelet Transform (DWT), and classification by using the Adaboost ML algorithm. Experimental results use 155 MRI images for performance evaluation.
V. Wasule and P. Sonar [6] presented a method for MRI classification of the brain in malignant versus benign. In this paper, feature extraction uses the GLCM algorithm. This system uses SVM and K Nearest Neighbors (KNN) for the classification of malignant vs. benign and low grade vs. highgrade glioma. The clinical dataset is used for malignant and benign classification, while the BRATS 2012 dataset for highgrade and low-grade glioma classification. The system shows that SVM performs better.
Saleck et al. [7] presented a robust and accurate system using the FCM segmentation technique. It extracts the tumorous mass from the MRIs. The presented method aims to avoid problematic estimation by selecting the cluster in the FCM as input data, which can provide us with the data needed to execute mass partitions by fitting only two clusters of pixels. GLCM is used to extract texture properties to obtain the optimal threshold, which divides between the selected group and the pixels of other groups, which significantly affects the precision.
M. Rashid et al. [8] examined the MRI image and a method for an even clearer vision of the position acquired by the tumor. MRI brain image is an input of the system. This method used an Anisotropic filter to remove the noise from the brain MRI, SVM used for segmentation followed by a morphological operation.
T. Ren et al. [9] proposed the method to solve brain tumor segmentation. Initially, the irrelevant information is removed from the image by histogram equalization. Then, by the study and research, three segmentation techniques were proposed by them are FCM, Kernel-based FCM (KFCOM), and Weighted Fuzzy Kernel Clustering (WKFCOM). The assessment displays that WKFCOM does better as compared to KFCOM, a 2.36% lesser false classification rate. P. Kumar et al. [10] presented a four-step sorting method for brain tumor segmentation and classification. The Wiener filter is used to denoising the image in the initial stage, image decomposition in the second stage. Then the combined edge and texture feature is combined with the Principal Component Analysis (PCA) is performed to minimize the dimension of the features. The last step is the classification step, which classifies brain tumors from MRI using SVM classification.
S. Kebir et al. [11] provides a supervised approach to detect abnormalities of the brain, predominantly proposing MRI images in three stages. The first stage is the creation of a DL CNN model, and the next section of tumor segmentation using the K-mean clustering. They are introducing CNN models to classify the abnormality of the MRIs. 375 | P a g e www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 8, 2020 Muhammad Talo et al. [12] suggested the deep transfer learning technique classifies MRI images of the brain as normal and abnormal. The pre-trained CNN model used the ResNet34 algorithm. The database is expands using data augmentation techniques. This method is validated on the Harvard Medical School MR dataset [13] and suggests finding additional abnormalities such as autism, stroke, Parkinson's, and Alzheimer's disease.
S. Deepak et al. [14] presented a brain tumor classification technique using GoogLeNet. Brain tumors are classified according to their nature as glioma, meningioma, and pituitary. Because the classification of brain tumors is comparatively complex, the convenience of classification means that there is a reasonable degree of deviation in size and shape, which affects the classification. This problem is most surprising when it comes to use traditional ML techniques. To defeat this problem, they introduced transfer learning to achieve a higher level of learning accuracy compared to the previous model. The significant enhancement was attained even for smaller datasets. This system suggested GoogLeNet, which is prevalent at the Softmax level, with some modifications for a wide variety of tumor classifications. The CNN focused GoogLeNet method attained a better precision of 92.3% that reached 97.8% by using multiclass SVM.

III. PROPOSED METHODOLOGY
This section presents brain tumor detection and classification techniques shown in Fig. 2. The three stages of the proposed system are: • Brain Tumor Detection.
• Benign and Malignant Brain MRI Classification.
• Glioma and Meningioma Brain MRI Classification.

A. Brain Tumor Detection
The methodology to detect the brain tumor from the brain MRI discusses in this section.

1) Tumor Vs. Non-Tumor Dataset:
The online data is collected from the online source for tumorous and nontumorous classification [15]. This dataset consists of 154 tumorous MRIs and 91 non-tumorous MRIs. Fig. 3(a) and Fig. 3(b). show the sample of tumorous and non-tumorous brain MRI.
2) Pre-processing: In the normalization process, the intensity falls within the range of pixel values converted into [0 1] range. In this process, each pixel intensity is divided by the maximum intensity values within an image. Normalization can create binary thresholding by creating a more extensive source. Such MRI images can help to prevent classifications affected by variations of grayscale value.
3) Skull stripping: Skull stripping is a necessary procedure in the biomedical image examination for the efficient analysis of brain tumors from brain MRI [16]. It eliminates the non-brain parts like skin, fat, and skull from the brain MRI. There are many different ways to segment the skull. Among them, skull stripping is the technique that focuses on automatic segmentation and morphological operation. Fig. 4 shows the process of the skull stripping algorithm. 4) Brain tumor detection and area calculation: The following methods achieve the brain tumor segmentation from the brain MRIs: Initially, the input brain MRIs are preprocessed and converted into a binary image by thresholding technique and morphological operation. The thresholding process chooses 128 as a threshold value. The pixel whose values are more significant than the defined threshold is subject to 1, while rest are subject to 0. It makes two areas built around the tumor region. The conversion of a grayscale image into a binary image is done by (1).
Where I(x, y) is the intensity value of the grayscale pixel and f g(x,y) is the resultant binary pixel.
In the next step, morphological processing is performed by erosion and dilation process on binary image to gain the proper boundary of the tum while dilation operation filling the gaps within the detected object using Erosion operation. The morphological process uses a small mask (3x3 or 5x5) of different sizes, and it is applied over the image known as the structuring element. This element has various shapes, such as lines, disk, diamonds, etc.
The erosion of an image is given by The dilation of an image is given by After the detection of tumors, calculates the area of the tumor for further processing (Eq. (4)).

B. Benign and Malignant brain MRI Classification
Once the tumor is detected, the brain MRI is analyzing for the malignancy of the image. In this section, the CNN based AlexNet transfer learning architecture is utilized for training and classifying the brain MRI for classification.

1) Benign Vs. Malignant Dataset:
The classification of brain tumors into benign and malignant uses clinical dataset collected from the hospital. The database comprises of benign and malignant MRI images [17]. The complete databasedistribution is tabulated in Table I. The database has MRIs that are pre-processed by brain augmentation and segmentation methods after separating testing and training data. Finally, it presents the performance of the training and testing process.
MRIs of the dataset are pre-processed and remove nonbrain parts by skull stripping, as illustrated in Sections III (A(2)) and III (A(3)) of this paper.
2) Data augmentation: DL architecture requires an enormous amount of data that includes variation. In transfer learning, data augmentation forms happen to be a vital component of the pre-processing. If the database is comparatively lesser, then that DL model may begin to remember the features that are too explicit to that particular database, which leads to overfitting. Thus to avoid the overfitting dilemma, the dataset should be huge with significant dissimilarity, but this is an extremely puzzling task in this scenario of clinical images. One remedy could be to augment the existing database synthetically. Such a practice is general when dealing with image-based data [18]. Data augmentation includes various methods like flipping, rotation, adding noise, scaling translation, resizing, perspective transform, etc. The parameters related to data augmentation used in the proposed method are as charted in Table II.
3) Training using AlexNet: In the presented work, the pretrained CNN network, referred to as 'AlexNet,' is employed. AlexNet is among the renowned architecture that comprises of Convolution Layers (CL) (five in number), max-pooling layers (three in number), and Fully Connected Layer (FCL) (three in number). It was training for classifying 1000 different objects [20]. There may be few objects that don't go with the original dataset. So the network can have specific layers kept back to identify those non-belonging objects. Fig. 5. illustrates the architecture of AlexNet.
With the actual size of the dataset, training a DL model from zero is inadequate since there is a tremendous rise in the number of training images. Pre-trained AlexNet architecture employs three different steps to avoid this situation. In the first step, the classification layer of the AlexNet replaces with the softmax layer that includes two categories (benign and malignant). Then in the second step, the weights are modified and backpropagate to retrain the images. The learning rate is set to a lesser value so that the weights of the CL do not alter intensely. At the same time, the weights of the FLC set asystematically. The stochastic gradient descent algorithm is employed to appraise the weight depending on the input database of brain MRI. This procedure helps in achieving the optimum weights of the exact network system. Random Y Translation [- 10 10] 377 | P a g e www.ijacsa.thesai.org

C. Glioma and Meningioma brain MRI Classification
This section presents the GoogLeNet algorithm for the classification of brain MRI into Glioma and Meningioma.

1) Glioma Vs Meningioma Dataset:
This approach uses a clinical dataset of Glioma and Meningioma brain MR images as an input. The dataset is collected from the Cancer Hospital and validated by the radiologist. The database distribution for training and testing is as shown in Table III.
The skull stripping is the initial step used to remove the non-brain part and select the region of interest. The process of skull stripping is shown in Sections 3.1.2 and 3.1.3 of this paper.
2) Data augmentation: Data augmentation includes various methods such as flipping, rotation, adding noise, scaling translation, resizing, perspective transform, etc. The parameters related to data augmentation of the proposed method are as charted in Table IV. 3) Training using GoogLeNet: VGG-16 has CL piled one above the other while GoogLeNet has pooling and CL in a parallel fashion, which helps in the feature extraction through various kernel sizes. It enhances the network depth and a higher performance level. Also, the network employs 1×1 convolution to govern the volume size passed for additional processing in the inception module. It is nothing but a collection of pooling and convolution operations executed parallelly to extract features with the aid of various scales. GoogLeNet network consists of 24 million parameters due to which it has lesser computing complexities as associated with VGG-16 and AlexNet. Instead, of FCL network employs a Global Average Pooling layer. Eventually, in ILSVRC-2014, GoogLeNet had got an error of 6.67%. The GoogLeNet architecture is as displayed in Fig. 6.    True Positive (TP) is referring to as a benign identifies as a benign (or glioma is identifying as glioma). True Negative(TN) is referring to as a malignant identified as a malignant (or meningioma is identifying as meningioma). False Positive(FP) is referring to as a benign identified as a malignant (or glioma is identifying as meningioma). False Negative(FN) is referring to as a malignant identified as a benign (or meningioma identifying as glioma).

A. Analysis of Brain Tumor Detection method
The results of the tumor detection from brain MRI is as shown in Fig. 7(a-f).
The input brain MRI image is as shown in Fig. 7(a), is chosen for analysis. First, the image is pre-processed using a median filter and then binarized using the thresholding method. The binary mask is again processed by erosion and dilation operations and selects the most massive mask, as displayed in Fig. 7(b). This mask is multiplied with the input image to get a skull stripped image, as shown in Fig.7(c). The brain tumor segmentation uses the thresholding method to select a region of interest. Threshold output, as displayed in Fig. 7(d). The detected tumor is shown in Fig. 7(e) and declared as a tumorous image with the percentage of area covered by the tumor in the brain MRI Fig. 7(f).  Table V shows the input brain MRI in the second column. Images in the first three rows contain non-tumorous images, while the next three rows contain tumorous images. The respective segmented output is shown in the third column. The non-tumorous images contain no white pixels (1's); hence % area of the tumor is zero while the tumorous images show respective values. The area of the tumor could help the doctors in the analysis and planning of surgery.

B. Analysis of Benign and Malignant Classification Method
The qualitative analysis of malignant and benign classification using the AlexNet CNN algorithm is as displayed in Fig. 8.
Qualitative analysis of benign vs. malignant classification is performed on the testing database. The input samples of the benign and malignant brain MRI areas are shown in Fig. 8(a) and Fig. 8(c) and a resultant class of the AlexNet are displaying in Fig. 8(b) and Fig. 8(d), respectively.
The training progress of AlexNet is as displayed in Fig. 9.
The quantitative analysis of malignant and benign classification using the AlexNet, Vgg16, ResNet18, ResNet50, and GoogLeNet CNN algorithm is as displayed in Table VI, and its graphical analysis is showing in Fig. 10.
This approach is more generalized and shows better accuracy on the testing dataset. The relative examination of this system with state-of-art methods shows the dominancy of the proposed AlexNet method.

C. Analysis of Glioma and Meningioma Classification Method
Qualitative analysis performs on the testing dataset for classification of Glioma vs. Meningioma. The results are displaying in Fig. 11. The input samples of the Glioma and Meningioma brain MRI display in Fig. 11(a), and Fig. 11(c) and a resultant class of the GoogLeNet are shown in Fig. 11(b) and Fig. 11(d), respectively. 380 | P a g e www.ijacsa.thesai.org The training progress of GoogLeNet is as displayed in Fig.  12.
The quantitative analysis of malignant and benign classification using the AlexNet, GoogLeNet, ResNet18, and ResNet50 CNN algorithm is as displayed in Table VII.
The graphical analysis of the proposed approaches with state of the art method is given in Fig. 13. The approach of GoogLeNet is more generalized and shows better accuracy on the testing dataset. The relative analysis of the proposed system with state-of-art approaches shows the dominancy of the proposed GoogLeNet approach.

V. CONCLUSION
In this paper, a technique for brain tumor detection and grading of tumorous MRIs into malignant and benign as well as malignant brain MRI into glioma and meningioma is proposed. The brain tumor detection is executed by preprocessing techniques followed by skull stripping and brain tumor segmentation. This approach promisingly segments the brain tumor from MRI. The tumorous images are further classified into malignant and benign using CNN based AlexNet transfer learning algorithms. The proposed method achieved a precision of 0.9375, recall of 1, and f-measure of 0.9677.
Similarly, the malignant MRI further classified into Glioma and Meningioma using CNN based GoogLeNet transfer learning algorithm. GoogLeNet model successfully got a precision of 0.95, recall of 1, f-measure of 0.9743, and accuracy of 0.9750. The proposed approaches (malignant vs. benign or glioma vs. meningioma) shows better results than existing methods.
The deep neural networks, particularly CNN, are rarely used for boundary detection problems. Therefore, the uses of deep neural networks can be a future direction for brain tumor segmentation and detection problem. In addition to this, the 3D brain boundary detection can be possible with this method. In the case of classification of dissimilar types of brain MRI (malignant vs. benign or glioma vs. meningioma), the system can be made more robust and generalized by training the deep neural networks on extensive data. Also, the system will be extended for further classification of low-grade and high-grade glioma as well as meningioma.