Data Mining Approach for Detection and Classification of Brain Tumor

Tumor is a mass or cells inside the brain that grows abnormally in one’s brain. Brain tumor is of two types primary and secondary. Primary tumors are hailed from brain cells and secondary tumors take place from cancer cells spread to one’s brain from other organs like lungs or breast. The Magnetic Resonance Imaging (MRI) is widely used because it gives high resolution and better-quality images. The main problem with the images is the inhomogeneity, unsharp boundaries and irregular noise which affects the results. Inhomogeneity means presence of some irrelevant information that must be removed. Unsharp boundaries are the most common problem in the images, they give blurry effect on the images that is why the information is not clear. To overcome these problems, we use the bilateral filter with the other techniques for the effective detection and segmentation. The proposed framework presents the detection and classification of the brain tumor. Bilateral filter is used to remove noise and preserves details. Bilateral filter is the best to preserve edges, sharpens the boundaries and takes care about the details of the image. By doing segmentation and classification we get the tumor detected.


INTRODUCTION
rain is the most complex organ of the human body. It contains billions of neurons and all of these must work properly [1]. Inside the brain the cells grow abnormally that causes the brain tumor. Brain tumor is a very dangerous disease. So, the detection should be fast and accurate. Tumorous cells affect the healthy cells which are close to the affected cells. A tumor causes brain swelling and increase pressure inside the skull.
Tumor has two types one is benign and the other is malignant [2]. Benign tumor is noncancerous while the malignant is cancerous. Among the existing technologies, the Computed Tomography (CT) and MRI are very well-known. The mostly used technique is the MRI. The advantage of this technique is that it does not use ionizing radiation where the CT scan uses it which may be harmful for the skin on repeated exposure. MRI is used for the localization of mass of the tumor cells. Brain tumor detection is very challenging subject for research in biomedical imaging. In these days MRI is used to detect the normal and abnormal growth of the brain cells. For the detection of the tumor inside the brain, segmentation of images is done manually so it consumes lots of time [3].
In medical imaging a lot of image analysis applications are developed for the early detection which involves segmentation of the infected area. In this modern world medical imaging analysis had been digitized. The accurate digitization of a medical image is a challenging task. The digitization should consume less time. The main task of image processing and  54 computer vision applications is to segment the medical images accurately. The main problem in medical images is the irregular noise, inhomogeneity and unsharp boundaries. MRI and other medical images contain complex structures that require correct and most accurate segmentation for diagnosis purpose.
A very challenging task is the detection of the brain tumor on which one must take care about image segmentation. An infected part of the body is scanned using different applications and techniques like MRI, X-rays or CT scans. MRI technique gives the best possible information of the human soft tissues. The focus of the study in this paper is that we have proposed a method of brain tumor identification by using edge preserving bilateral filtering.
Firstly the pre-processing of the input image is done followed by noise removal by the Bilateral filter. For the segmentation watershed algorithm is used that extracts important features then classifies the tumor using the Support Vector Machine (SVM) and Naïve Bayes algorithms. As a result we will get the tumor part detected.

LITERATURE REVIEW
For the detection of the brain tumor multiple techniques are developed by different researchers but every technique has advantages and disadvantages. Mostly the researchers used MRI images because it gives a high-quality image [4]. The related research is done on the same domain by Sushma et al. [5] using k-means clustering and bilateral filtering. They proposed the system for efficient detection of brain tumor.
Another research is done by Raj and Shreeja [6]. They used multiple steps like K-means clustering and Hierarchical Centroid Shape Descriptor (HCSD), feature extraction and classification method. From feature extraction they extracted the multiple features of the tumor region by using the Gray Level Co-Occurrence Matrix (GLCM). KNN was used for the classification of the tumor based on the extracted features from the training and testing data.
In this regard Mathew and Anto [7] used anisotropic filter for noise removal and for feature extraction they used the Discrete Wavelet Transform (DWT). For segmentation they used the extracted features as an input. At the end they classified the tumor using the SVM. Moreover, Gamage and Ranathunga [8] did the tumor detection using image processing techniques. They used multiple filters for preprocessing like Median, Mean, Hybrid, Weiner, Modified hybrid and Morphology based De-noising filters to get the best possible results. Segmentation was done with the Threshold, Region-based and Fuzzy C and K means techniques, after that the features were extracted. They focused on some important features like size, shape, composition and location of an image then applied the classification on the obtained results and got the tumor detected.
One more appreciable work was presented by Gupta et al. in [9]. They used the statistical features like Kurtosis and skewness accompanying morphological features. They used the T2 weighted images to find out the high-grade tumor from low-grade tumor. For the classification they used multiple classifiers like SVM with K-fold cross validation, Linear Discriminant Analysis (LDA) and Naïve Bayes (NB). They achieved the highest accuracy with the SVM (Linear Kernel).
Similar work was carried-out by Singh and Ansari in [10]. Firstly they used multiple filters for preprocessing i.e. Gaussian, Median, Averaging, Adaptive and Un-Sharp masking filters. They used the normalized histogram and segmentation. K-means clustering algorithm was used for segmentation. Then for the classification they used the NB and SVM. They compared the results of both classifiers and achieved highest accuracy with SVM. Another related work included three steps [11] firstly the MRI image was preprocessed using Median Filter then Features were extracted using the GLCM, Finally, tumors were classified by using ML algorithms like Multi-Layer Perceptron (MLP) and NB. One more research related to the brain tumor detection was carried-out by using Computer Aided Systems [12]. They used multiple steps to detect and segment the Tumor, firstly they preprocessed the MRI image using median filter for noise removal then segmented the image using the Global threshold method, finally post-processed the images using Morphological erosion and dilation technique. By using this technique, they acquired the results. Another related research was done in [13] with the filter (FS) and correlation (KC) based classification. They analyzed and compared different methods like Relief F, Joint Mutual Information (JMI), Mutual Information Based Feature Selection (MIBFS), Minimum Redundancy Maximum Relevance (mRMR) and Conditional Mutual Information Maximization (CMIM). Similarly, Hemanth et al. [22] designed and implemented the detection of the brain tumor by using the Convolution neural networks with other classifiers. They preprocessed the data with bilateral filter and then applied averaging filtering technique which was time consuming.

PROPOSED METHODOLOGY
This paper proposes the edge preserving bilateral filtering-based [23] detection and classification method based on multiple steps. To test the accuracy of our proposed system, BRATS 2017 dataset has been used. The system is implemented in MATLAB 2016b. The Fig. 1 shows the steps of the presented work and details are described later.

Input image
Firstly, we input the 3D MRI image. The inputted image is 3D MRI medical image with .mha format and has resolution of 1 mm 3 voxels.

Preprocessing
The first step of tumor detection is pre-processing, it is used to enhance the image and remove noise for detecting the region of interest. When the MRI images are corrupted by noise the accuracy of the image is reduced [14]. Noise removal is an important task for segmentation because watershed algorithm does not work on the noisy images. For de-noising the image, we use edge preserving bilateral filtering method.
Bilateral filter is de-noising and smoothing filter, it sharpens the edges and preserves the details. It operates in the domain and the range of the image. Bilateral filter has two kernel parameters: the range and the spatial kernel, these two kernels are used to measure the range and spatial distances between the neighbors with its center pixels [23]. These kernels are based on the Gaussian distribution as shown in Fig. 2.

Fig. 2: Bilateral Filter Process
The output of the Bilateral filter at a pixel location x is calculate as: where N(x) is the neighborhood of I(x)r and d are two parameters for controlling the weights in intensity and spatial domains respectively. In this formula, the constant C can be computed as: By using the bilateral filter, we get the noise free image. These images are ready for the segmentation process given below.

Segmentation
Image segmentation is a technique of partitioning an image into different groups of pixels which are like each other with respect to some criteria. Different groups do not interact with each other. Segmentation algorithms are not pixel oriented, they work on area orientation. The segmentation splits up the image into connected areas [15]. Watershed segmentation partitions the image into two sets watershed lines and catchment basins. Catchment basins are related to image regions and watershed lines are related to region boundaries. There are two main approaches of segmentation: the region and frontier approach [16].
Watershed combines these two approaches to give powerful technique for rapid detection of regions and edges. Watershed algorithm is gradient based segmentation technique. The region of the images is connected and closed. It uses bounding boxes which reduce the time to segment large nunber of slices.

Feature Extraction
After segmentation the quantitative information from the image is extracted using the feature extraction process. Meaningful features are extracted which minimize the original data because extracting the tumor region from the brain MRI image is complicated due to the complex structure of the brain [17]. Multiple parameters are considered such as color features, size, shape, texture, location and composition of an image. We are using information gain for extracting the information. Information gain is all about calculating entropy for every feature present in the information.
Entropy is used to measure the randomness of a variable. By measuring the value, one can easily find the highly useful information for classification [18]. As the value of entropy is high the feature contains more information. If the targeted attribute is up to k different samples, the entropy is calculated as: where pc is a proportion that belongs to class c. Logarithm has its base 2.

IG S, a E s " E S|a
The above equation calculates the information gain based on the training example S by observing that a random variable has some value a.

Support Vector Machine
Support vector machine is used for the data analysis and classification problems. It is a supervised learning model. SVM is also good for large amount of data. SVM is based on the hyperplane which divides the data into multiple classes based on dissimilar attributes [19]. The data is divided into two classes on an optimal hyperplane/line as Shown in Fig.3.

Naïve Bayes
Naïve Bayes Classifier (NBC) provides the understanding to the clinician that how they can obtain the results of classification. Bayes theorem works on the priority basis and calculates the probability of occurrences [20]. The only way to quantifying the uncertainty from the given amount of data is NBC which is also suitable for noisy and incomplete data as shown in Fig. 4. Without constructing the new models' attributes, it can easily be expanded. This algorithm uses the equation (5) and (6)  Advantages of the Bayes classifier are that it is simple to implement, Only one-time scan is required. By calculating the probabilities of the membership in each class the missing values would be easily handled [21].

Measures for Performance Evaluation
The two data mining techniques SVM and Naïve Bayes are compared. By using the confusion matrix, we can derive the matrices and convert them into falsepositive (FP) and true-positive (TP) matrices.

Accuracy Measure
By measuring the accuracy one can find that how the single record is classified correctly.TP refers to true positive and TN refers to true negative records which are truly classified by the classifiers. Similarly, FP refers to false-positive and FN refers to false-negative which are incorrectly classified. The accuracy measures we use in this paper are specificity and sensitivity.

Confusion matrix
The confusion matrix based on four classification indices: true positive, true negative, false positive and false negative as shown in Table 1. Confusion matrix not only shows the errors made by the classifier but also shows the types of errors made by the classifier.

Cross Validation
Cross-validation is used to estimate that how much the machine learning models are skilled. It is mostly used in machine learning problems to select and compare a model for a given prediction problem. Cross validation is also used to validate the model.

Sensitivity Analysis
Sensitivity analysis is used to determine under some conditions that how the dependent variable is affected by the values of an independent variable. Sensitivity analysis is used in a boundary. Sensitivity refers to the true positive rate which means that how many positives are identified correctly.

Specificity Analysis:
Specificity analysis is also called true negative rate. It is used to measure the true negative rate of the model that is correctly identified.

Performance Analysis
Out of 4000 samples around 30 three dimensional images were tested and results are obtained as shown in Fig. 5 and Fig. 6. 3D brain MRI images are taken as input and preprocessed by the bilateral filter which preserves edges and removes noise. Bilateral filter works on the weighted average of the neighboring pixels as the Gaussian convolution works. The main focus of this filter is that to affect another pixel, a pixel should contain the similar value as they contain the nearby location, as a result the image is smooth enough and noise free for the segmentation. Then watershed segmentation is applied and obtain the results, after segmenting the images classifier is applied. Firstly the results are observed by applying SVM and then by applying Naïve Bayes classifier. Both classifiers give good and accurate results, but the Naive Bayes gives more accurate results as compared to SVM.
We have considered the 3D images. The drawback of using 2D images is that while segmenting the tumor patient may have an infected part on other side of the brain but in 2D view it is not visible. For the absence, presence or find the size of the tumor brain must be analyzed by all views. That is why we are using 3D images.

Comparison of different filters
We compare the bilateral filter with the Gaussian and median filter. The bilateral filter is a popular filter that is used for smoothening images and reducing noise from them. By using this filter, the intensity of each pixel is replaced with a weighted average of intensity values from nearby pixels. The Gaussian filter with sigma value equals to 2 has been used. If the value of sigma increases, the image gets more blur and difficult for segmentation. The median filter moves through the image pixel by pixel and replaces each value with the median value of neighboring pixels. This filter does not preserve edges and the images are not smooth enough as shown in the Fig. 7.

Comparison of Accuracies with different Filters
The Gaussian filter is used for preprocessing the parameters (mean, standard deviation, variance and time) causes smoothness to the image and removes sharpness that can cause blurring to the image and difficulties to detection as we increase the value of standard deviation it gives more blur results as shown in Fig. 8 and 9. When we decrease the value of standard deviation it gives better results as shown in Fig. 10 and 11. Now the median filter is used for preprocessing for the detection of the tumor, the parameters (s, mean, avg, time, m) cause smoothness and remove sharpness as the average value increases, the image gets more blur and difficult for further process and does not detect the tumor correctly as shown in the Fig. 12 and 13, then we practice it by decreasing the average value by 1/35 which gives much better results as shown in Fig. 14  and 15 but it does not preserves edges, so that is the main reason we have chosen bilateral filter for the detection of the tumor.

Confusion Matrix
The Confusion Matrix of Naïve Bayes and SVM is shown in Fig. 16 Naïve Bayes gives 95.65% accuracy which is the highest accuracy as compared to the SVM.

Accuracy
We calculate the accuracy of Naïve Bayes and SVM by testing 30 samples. The accuracy shown in Fig. 17 describes that the Naïve Bayes has the highest accuracy up to 95% and SVM has the accuracy up to 89%. Naïve bayes performs well because of the probability of the true positive and false positive values.

Sensitivity and Specificity
Sensitivity measures the true positive rate of given samples and specificity measures the true negative rate from a sample. In this regard the graph shows that the Naive Bayes has the sensitivity of .92% and specificity of .99% and SVM has the sensitivity of .89% and specificity is .92% as shown in Fig. 18, which means that the Naïve Bayes gives more true positive results and predicts that the patients have the tumor disease and SVM gives less positive prediction.

SVM 10-Fold Cross Validation
The 10-fold cross validation is presented in Table 4 and 5 which show the sensitivity and specificity of the samples up to 10-folds. Specificity and sensitivity depend on the true positive (TP) true negative (TN) false positive (FP) and false negative (FN). The graph represents the overall true positive and false positive rate of both classifiers as shown in Fig. 19. In SVM the true positive rate is 42 and false positive rate is 0 which gives the sensitivity up to .93% and specificity up to 1%. In the Naïve Bayes overall, true positive rate is 44 and false positive rate is 2 which gives sensitivity up to .97% and specificity up to .93%. It means that the Naïve Bayes has more accurate results as compared to SVM.

CONCLUSION AND FUTURE WORK
The presented work effectively classifies the tumor area. The record of 2000 patients consists of almost 4000 3D MRI images out of these 30 samples have been tested to validate the results. Moreover, by using the 3D MRI images, the detection of brain tumor is improved. Therefore, it proves to be a good approach for the treatment at right time. 3D MRI image is selected as an input and preprocessed using edge preserving bilateral filter to remove noise and make image available for the segmentation. After that the preprocessed image is segmented by using watershed algorithm.
The extracted information is used for the classification by using the support vector machine and Naïve Bayes algorithms. At first, we apply the SVM algorithm and get the results and later on apply Naïve Bayes and obtain results, both classifiers give the best results, but we found that the Naïve Bayes gives the more accurate results as compared to the SVM classifier.

LIMITATIONS AND FUTURE WORK
In this proposed system, we can not find out the size, stage, and shape of the tumor due to short period of time. In future, this work will be extended by calculating the stage, shape and size of the tumor and may use the neural networks for the detection of the tumor.