Computer Aided Diagnosis of Magnatic Resonance Brain Tumors Images with Automatic Segmentation

Download Full-Text PDF Cite this Publication

Text Only Version

Computer Aided Diagnosis of Magnatic Resonance Brain Tumors Images with Automatic Segmentation

Dr. Umar S. Alqasemi

Associate Professor of Biomedical Engineering at King Abdul-Aziz University.

Jeddah 21589, Saudi Arabia.

Eng. Anas Y. Saleh,

    1. c student in Biomedical Engineering at King Abdul-Aziz University.

      Jeddah 21589, Saudi Arabia

      Abstract Brain tumor is one of the most dangerous and detrimental diseases around the world. One of powerful modalities to detect brain tumor is the Magnetic Resonance Imaging (MRI). However, there is a deficiency of expert radiologists to detect brain tumors at the beginning stages. For this reason and also to reduce the time and cost required to diagnosis this type of tumors; the computer aided diagnosis (CAD) systems were used in most of health institutions. The aim of this paper is to propose enhanced CAD system which has high accurate, reliable and enhanced segmentation method which utilized morphological operations with adjustment of image intensity values and colormap. The implemented CAD system utilized dataset available on Kaggle site and classified them to normal and abnormal with accuracy up to 100% with high reliability after accurate segmentation of the regions of interest (ROIs) was completed.

      Keywords Brain tumor, Magnetic Resonance Imaging (MRI), Computer Aided Diagnosis (CAD) & Segmentation.


        Brain tumor can be defined as abnormal proliferation of cells within the brain [1]. The brain tumor can be benign or malignant and each of them has several types. For an example Chordomas and Craniopharyngiomas are benign tumors where Gliomas is the most prevalent malignant tumors. Medical imaging modalities play a vital role in tumor detection and one of the best non-invasive modalities to detect the presence of brain tumor is Magnetic Resonance Imaging (MRI). The output images of MRI have superior accuracy comparing with other modalities. The most important challenge is the required time and cost to process this huge number of MRI images; where MRI modality take images from three planes i.e. sagittal, coronal and transverse plans. To process this huge number of images within acceptable time, Computer Aided Diagnosis (CAD) systems are used widely in the detection and classification of many different types of disorders [2]. The recent studies show the accuracy of CAD systems increased by time and also their reliability[2][3]. CAD system in general consists from four stages: preprocessing, segmentation, feature extraction and classification. Flowchart shown in Fig.1 shows how these stages incorporate with each other. This paper proposed enhanced CAD system which used an improved segmentation method. The results of proposed system are promising where the system achieved 100% accuracy using SVM classification method.

        Fig. 1. flow chart of CAD system.


        Ulku et al. [3] proposed CAD System to detect brain tumor based on the histogram equalization and morphological image processing methods. They used 128 MR images collected from 11 healthy people and 8 with tumor. They used MATLAB software in the pre-processing, segmentation, and feature extraction stages. After that the RapidMiner was utilized to classify normal and abnormal MR Images. The authors used histogram equalization in the pre-processing stage to increase the quality of digital medical images. In the segmentation stage, the regions of interest (ROIs) were extracted by using erosion and dilation techniques. Six classifiers were used to classify the images after ROIs were extracted in the segmentation stage. The achieved results are promising especially by using Support Vector Machines based on Particle Swarm Optimization (SVM-PSO) and K Nearest Neighbor Algorithms (KNN) classifiers, where these two classifiers provided 100% success based on accuracy of their results. However, they used also SVM classifier (as what used in this paper) and the achieved results are 90.53% accuracy for negative samples and 81.39% accuracy for positive samples. H. Abdalla et al. [4] proposed method used Artificial Neural Network (ANN) to realize the brain tumor based on magnetic resonance imaging. The authors divided their works into three phases. In the first phase, MRI images are pre-processed. Post-processing is the second phase; operations (as segmentation, morphological enhancement and feature extraction) are performed. The final phase is the designing of the neural networks by using feed- forward back propagation with supervised learning. The results and the performance of this system are promising, where the accuracy of the system is equal to 99%, and the achieved sensitivity is equal to 97.9%.

        B. Asodekar et al. [5] implemented system to detect brain tumor. Proposed CAD system utilizes the feature extraction based on the shape features which obtained from MRI images were extracted from MICCAI BraTS 2015 dataset. The extracted shape-based features were supplied to the machine learning algorithms which consist of support vector machine and random forest algorithm in order to classify the tumors as benign or malignant. The achieved accuracy for random forest is 86.66% and when used SVM they achieved accuracy equals to 81.42%.

        G. Gilanie et al. [6] proposed system to classify brain tumors MRI images according to types of brain tumors. The system used statistical analysis and Gabor filter which has an ability to exploit texture information of an image to perform texture-based analysis. Another reason to use Gabor filter is that it can encode texture into a lot of means with narrow orientations and frequencies. In the next stage the proposed method used SVM classifier to classify brain disorders. In this research the images have been classified into normal, cerebrovascular, degenerative, inflammatory, and neoplastic. The achieved results as follows: Accuracy up to 99.6% , sensitivity up to 100% , specificity up to 100% , precision up to 100% , and AUC value up to 1.

        K. Angel et al. [7] developed automatic detection and segmentation method, to realize and segment the brain tumors using MRI images. The first step in the proposed method is converting all images in the used dataset into one standard formatted image. After that Watershed segmentation was used to perform automatic segmentation process. The authors used MATLAB software to do segmentation in 2D and 3DSlicer software to do 3D visualization of the tumor. The last part of their system is the calculation of the volume of brain tumor. This system provided at the end 2D and 3D visualizations for surgical planning and assessment purposes.

        W. Ayadi et al. [8] implemented CAD system to detect MRI brain tumors. This system used Discrete Wavelet Transform (DWT) and Bag-of-Words (BoW) to extract image features. Support vector machine (SVM) was used in classification step. They used three datasets from Harvard medical school. Promising results were achieved regarding to accuracy and overall computation time, where the accuracy is 100% for DS-66 and DS-160, and 99.61% for DS-255.

        M. Abd-Ellah, et al. [9] developed CAD which is consist of two-stages for automatic detection and classification of brain tumors through magnetic resonance images. In the first stage, MRI images will be classified as Normal or Abnormal. In the second stage, the abnormal images will be classified as benign (Noncancerous) or malignant (Cancerous) tumor. The developed system used the following method; segmentation using K-means clustering, feature extraction using Discrete Wavelet Transform (DWT), feature reduction by applying Principal Component Analysis (PCA). he two- stage classification had been implemented using a support vector machine (SVM).They achieved 100% accuracy. However, they mentioned that the reliability of the system was limited due to small size of the used datasets.

        S. Ghahfarrokhi et al. [10] provided system to detect brain tumors and classify these detected tumors. The proposed CAD system used the complexity measures and texture features which were extracted from MRI images. They used

        Chaos theory to estimate complexity measures as Lyapunov Exponent (LE), Approximate Entropy (ApEn), and Fractal Dimension (FD). In addition, the texture features as Gray- Level Co-occurrence Matrix (GLCM) and Discrete Wavelet Transform(DWT)-based features were exploited. Three classifiers such as Support Vector Machine (SVM), K- Nearest Neighbors (KNN)algorithm, and Pattern net were used. The authors found the combination between using complexity measures and texture features with using of Pattern net classifier achieved the best accuracy (98.9%). When they used SVM the best achieved results are 96.7% , 94.6% and 94.4% for accuracy, specificity and sensitivity respectively.


        This section summarized the proposed CAD system in three steps: automatic segmentation process to detect and extract ROIs , feature extraction and selection process and the last stage is classification process. These stages were carried out using MATLAB R2019b software.

        1. Database

          The used MRI images in this proposed system were obtained from the available online database on Kaggle website. This database consists of two files: the first one is YES file which has 155 MRI images with tumors and the second file is NO file which has 98 MRI images without tumor. We used 170 images from this database; 85 normal images and 85 abnormal images. In our system around 75% of images used as training set and 25% as testing set. Fig.2 shows sample of MRI images from this dataset.

          Figure 2: Sample of brain MRI images. (a) brain tumor, (b) normal.

        2. Segmentation

          Segmentation can be defined as the process where the ROIs were detected and extracted[11]. In this stage this paper proposed enhanced method for automatic segmentation. Proposed method exploited Otsu Binarization to convert MRI images to binary image according to preset threshold as shown in the following equation:

          Where f(x,y) is an original gray value of the image, Z is a preset threshold value and fs (x,y) is a result of the equation which represents the binary image[5]. After that Opening morphological operation available in MATLAB software was used in addition of using image adjustment (imadjust) operation which adjusts image intensity values and colormap.

          As shown in Fig.3 this enhanced methodology leads to accurate segmentation to separates ROIs from images.

          Fig.3. (a) and (c) are original images. (b) and (d) tumors after segmentation process.

        3. Feature Extraction and Selection

        This is an important part in any CAD system where features of ROIs are extracted and only the useful ones are selected. Proposed system tested the statistical significance of all features and the most statistically significant features were selected. More than 30 features are tested and 18 of them had been selected. Quantiles (with different values such as 10%, 25%, 50%, and 75%) , Mode, Mean and Median are the selected features in our CAD system. After exploited these selected features, system achieved the best performance during brain tumor detection with short computation time as discussed in the section number 5.


        There are a lot of metrics used to assess the performance of CAD system and each metric measures a specific perspective [12]. The most famous one is the accuracy and its mathematical expression as in Eq.2:

        Where TP is true positive, TN is true negative, FP is false positive, FN false negative. Another important metric is Sensitivity which is defined as the ability to identify the presence of the disease and it can be calculated using Eq.3:

        The third used metric is Specificity which measures the ability to identify the absence of the disease, Eq.4 shows its formula:

        Positive Predictive Value (PPV) metric is defining the probability of having disease. Eq.5 is the mathematical expression for PPV:

        Negative Predictive Value (NPV) metric is defining the probability of not having disease. Mathematical expression is given as:


        The proposed CAD system achieved high accuracy and reliability, where the system achieved 100% accuracy by using SVM classifier with polynomial kernel after the proposed segmentation method was applied. KNN classifier when k=1 and k=2 also achieved good results. Table 1 summarizes the results for the best three classifiers in our system. Fig.4 shows the receiver operating characteristic (ROC) curves for these classifiers.

        Table1. Shows the results of SVM (Polynomial),KNN(k=1) and KNN(k=2) classifiers. Table2 compares between previous CAD systems and the proposed one.



        Results of the best used classifiers

        Metrics in(%)






        KNN (k=1)






        KNN (k=2)






        SVM (Polynomial)









        Fig.4. (a) ROC for classification by SVM (Polynomial); (b) ROC for classification by KNN (k=1); (c) ROC for classification by KNN (k=2)


        CAD system

        Used Classifier

        Feature Analysis



        Ulku et al. [3]



        Did not mention the types of extracted features.

        B. Asodekar et al. [5]


        shape-based features


        Low accuracy

        G. Gilanie et al. [6]


        Statistical and Gabor filter (texture-based)


        W. Ayadi et al. [8]


        DWT and BoW

        100 – 99.61

        3 datasets were used

        M. Abd-Ellah, et al. [9]


        DWT and PCA


        Limited reliability

        S. Ghahfarrokhi et al. [10]

        Pattern net

        LE, ApEn, FD, GLCM and DWT


        Proposed CAD


        1st order statistical features


        Simple with short computation time


In this paper we proposed enhanced CAD system which has classification accuracy up to 100% by using simple processing technique with short computation time and also proposed novel and efficient methodology for automatic segmentation process, where this paper proposed segmentation process which exploited morphological operations with adjustment of image intensity values and colormap. Many of previous systems have lower accuracy compared to this proposed system or have high accuracy equal to our system with limited reliability due to their small-size database as only 40 images. In this paper, ROIs were segmented from the MRI images which are available on Kaggle website as two files. The first file includes normal images, and the other one includes abnormal images. The proposed and implemented CAD system utilized around eighteen useful features to classify these cases into normal and abnormal. Proposed CAD system achieved 100% accuracy with high reliability as illustrated in the previous sections by exploiting simple statistical features and using SVM classification method. Future work will classify malignant and benign tumors to their types with taking into consideration required computation time.


  1. "General Information About Adult Brain Tumors". NCI. 14 April 2014. [Online]. Available:

  2. S. S. Khan and S. R. Surya, "Robust cell detection of histopathological brain tumor images and analyzing its textual features," 2017 2nd International Conference on Communication and Electronics Systems (ICCES). Coimbatore, 2017, pp. 879-884.

  3. E. E. Ulku and A. Y. Camurcu, "Computer aided brain tumor detection with histogram equalization and morphological image processing techniques," 2013 International Conference on Electronics, Computer and Computation (ICECCO). IEEE, 2013, pp. 48-51.

  4. H. E. M. Abdalla and M. Y. Esmail, "Brain Tumor Detection by using Artificial Neural Network," 2018 International Conference on Computer, Control, Electrical, and Electronics Engineering (ICCCEEE). IEEE, 2018, pp. 1-6.

  5. B. H. Asodekar, S. A. Gore and A. D. Thakare, "Brain Tumor analysis Based on Shape Features of MRI using Machine Learning," 2019 5th International Conference On Computing, Communication, Control And Automation (ICCUBEA). IEEE, 2019, pp. 1-5.

  6. Gilanie, G, Bajwa, UI, Waraich, MM, Habib, Z. Computer aided diagnosis of brain abnormalities using texture analysis of MRI images. International Journal Imaging Systems and Technology. 2019; 29: 260 271.

  7. K. S. Angel Viji and J. Jayakumari, "Automatic detection of brain tumor based on magnetic resonance image using CAD System with watershed segmentation," 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies. IEEE, 2011, pp. 145-150.

  8. W. Ayadi, W. Elhamzi, I. Charfi, B. Ouni and M. Atri, "Brain MRI classification using discrete wavelet transform and bag-of-words," 2018 International Conference on Advanced Systems and Electric Technologies (IC_ASET). IEEE, 2018, pp. 45-49.

  9. M. K. Abd-Ellah, A. I. Awad, A. A. M. Khalaf and H. F. A. Hamed, "Design and implementation of a computer-aided diagnosis system for brain tumor classification," 2016 28th International Conference on Microelectronics (ICM). IEEE, 2016, pp. 73-76.

  10. S. Ghahfarrokhi, S., & Khodadadi, H. (2020). Human brain tumor diagnosis using the combination of the complexity measures and texture features through magnetic resonance image. Biomedical Signal Processing and Control, 61, 102025.

  11. Guo, Y. and Ashour, A., 2019. Neutrosophic sets in dermoscopic medical image segmentation. Neutrosophic Set in Medical Image Analysis, pp.229-243.

  12. Simundic A. M. (2009). Measures of Diagnostic Accuracy: Basic Definitions. EJIFCC, 19(4), 203211.

Leave a Reply

Your email address will not be published. Required fields are marked *