Brain Tumor Detection Using KNN

Categories: BrainMind


Abstract- Brain tumour detection is a difficult task and it's very important to analyze the structure of the tumour correctly so an automatic method is used now a day for the detection of the tumour. This method saves time as well as it reduces the error which occurs in the method of manual detection. This proposed method is a new technique which not only detect tumour but also calculate percentage area occupied by tumour cells compared with total brain cells.

Firstly, tumor regions from an MR image are segmented using a OSTU Algorithm. KNN&LLOYED are used for detecting and differentiating tumour affected tissues with not affected tissues. Perform wavelet transform on the converted grayscale image and extracted 12 features like contrast, correlation, energy, homogeneity etc. DB5 wavelet transform is used for feature extraction.


The development of additional phones frequently shapes a mass of tissue called a development or tumour. Cerebrum tumour is one of the real reasons for death among individuals.

Get quality help now
Bella Hamilton
Bella Hamilton
checked Verified writer

Proficient in: Brain

star star star star 5 (234)

“ Very organized ,I enjoyed and Loved every bit of our professional interaction ”

avatar avatar avatar
+84 relevant experts are online
Hire writer

The manifestations of a mind tumour rely upon tumour size, sort and area. Indications might be caused when a tumour pushes on a nerve or damages a piece of a cerebrum. Additionally they might be caused when a tumour obstructs the liquid that moves through and around the or when the mind swells since develop of liquid. Cerebral pains, queasiness and heaving, Changes in discourse, vision or hearing, issue adjusting or strolling, changes in temperament, identity or capacity to focus, issues with memory, muscle snapping or tingling, deadness or shivering in the arms or legs.

Get to Know The Price Estimate For Your Paper
Number of pages
Email Invalid email

By clicking “Check Writers’ Offers”, you agree to our terms of service and privacy policy. We’ll occasionally send you promo and account related email

"You must agree to out terms of services and privacy policy"
Write my paper

You won’t be charged yet!

Precise identification of the kind of mind variation from the norm is exceedingly fundamental for treatment arranging which can limit the lethal outcomes. [2]

Manual discovery of mind tumour is a repetitive activity and takes a great deal of time and not precise, shifts starting with one specialist then onto the next. Exact outcomes can be acquired just through PC supported robotized frameworks. Other than being exact, these procedures must scope rapidly keeping in mind the end goal to apply them for continuous applications. Cerebrum tumour can be analyzed by utilizing attractive reverberation imaging (MRI), ultrasonic, CT pictures and X-beams. Attractive Resonance Imaging is an essential instrument utilized in numerous fields of prescription and is equipped for producing a definite picture of any piece of the human body. X-ray remains for Magnetic Resonance Imaging. An MRI scanner utilizes intense magnets to enrapture and energize hydrogen cores (single proton) in human tissue, which creates a flag that can be distinguished and it is encoded spatially, bringing about pictures of the body. The MRI machine produces radio recurrence (RF) beat that particularly ties just to hydrogen. The framework sends the beat to that particular territory of the body that should be inspected. Because of the RF beat, protons here retain the vitality expected to influence them to turn in an alternate heading. This is implied by the reverberation of MRI. The RF beat influences the protons to turn at the larmour recurrence, in a particular bearing. This recurrence is discovered in light of the specific tissue being imaged and the quality of the principle attractive field. [5]

Grouping of the mind tumour is likewise a vital undertaking for treatment arranging. There are two sorts of tumour which are-benevolent (non-destructive) and threatening (carcinogenic) tumours. Ordinary strategies include intrusive systems, for example, biopsy, lumbar cut and flag tap technique, to identify and group cerebrum tumour into benevolent and harmful which are exceptionally agonizing and tedious. Wavelet investigation is a viable strategy fit for uncovering parts of information which other flag examination procedures. Breaking down the pictures at numerous levels, the technique can remove better points of interest from them and thusly enhances the nature of the picture. What's more, wavelet examination is equipped for compacting or de-noising a flag without considerable debasement. Wavelet examination is of at most significance if there should arise an occurrence of fragile data, for example, if there should be an occurrence of therapeutic imaging [7]

Related Work:

In below section, different methods are used in literature by different authors who summarized based on main categories such as segmentation, feature extraction and classification method used.

Different methods Used in previous research work.

Jin Liu, Min Li, Jianxin Wang et al, studies the MRI based brain tumour segmentation which is more and more attractive because of non-invasive imaging and good soft tissue contrast of Magnetic Resonance Imaging (MRI) images. They purposed to provide a comprehensive overview for MRI-based brain tumour segmentation methods. Then, the pre-processing operations and the state of the art methods of MRI-based brain tumour segmentation are introduced. [1]

Pavel Dvorak and Bjoern Menze et al, Indeed, even under treatment, patients don't make due all things considered over 14 months after conclusion [3]. Current medicines incorporate surgery, chemotherapy, radiotherapy, or a blend of them. X-ray is particularly helpful to evaluate gliomas in clinical practice, since it is conceivable to procure MRI arrangements giving corresponding data. The exact division of glioma's and its intra-tumoral structures is vital for treatment arranging, as well as for follow-up assessments. Be that as it may, manual division is tedious and subjected to between and intra-rater blunders difficult to describe. In this manner, doctors more often than not utilize harsh measures for assessment. Hence, precise self-loader or programmed strategies are required [4]

V.Karthikeyan, B. Menze and K.Sreedhar et al, the tumour mass impact change the course of action of the encompassing typical tissues. Along these lines, the emphasis is on planning structures as opposed to creating handmade elements, which may require particular learning. CNNs have been utilized to win a few question acknowledgment [6], [12] and natural picture division [5] challenges. Since a CNN works over patches utilizing pieces, it has the benefit of considering and being utilized with crude information. In the eld of mind tumour division, late proposition additionally explore the utilization of CNNs [11].

J.Selvakumar, A.Lakshami & T.Arivoli et al, deals with analysis of image Intensification carried out various methodologies used in Mathematical Morphological [MM] theory on poor lighting images. They, Some Morphological Transformation have been processed through Block Analysis, Morphological Operation and Opening by Reconstruction on dark Images. Analysis of above mention methods illustrated through the processing of images with filtering techniques along with different dark background images. [7]

Raunaq Rewari, implement the enhancement of the digital images by using the global morphological technique to detect the background features of the images which is characterized by poor lighting. The first operator employs information from blocked analysis, while the second transformation utilizes the opening by reconstruction, which is employed to define the multi background.. Finally, the performances of the proposed operators are processing through the images with different backgrounds, the majority of them with poor lighting condition. [8]

Stefan Bauer, Roland Wiest et al, are the creators decided on 2D lters despite the fact that 3D lters can exploit the 3D way of the pictures; however it builds the computational load. The vast spatial and basic fluctuation in mind tumours is additionally an essential worry that we think about utilizing information growth. [9]

K.Sreedhar and B.Panlal, taken automation of brain tumour segmentation remains a challenging problem mainly due to significant variations in its structure. An automated brain tumour segmentation algorithm using deep convolutional neural network (DCNN) is presented in this paper. [12]

Nikesh T. Gadare, Dr. S. A. Ladhake, et al, used some Morphological Transformation which processed through Block Analysis, Morphological Operation and Opening by Reconstruction on dark Images. Basically, Image enhancement and Background detection is illustrated through Weber's Law Operator... In Mathematical Morphology it has transformation which allows filtering of the Image with new contour leads to Opening by reconstruction and closing by reconstruction as well. [13]

Bjoern Menze and Pavel Dvorak worked on the medical images feature a high similarity in the intensities of nearby pixels and a strong correlation of intensity profiles across different image modalities. All the images deal with correlation used by local image patches. As well as, there is a high correlation between nearby labels in image, a feature that has been used in the "local structure prediction" of local label patches. They used local structure prediction approach for 3D segmentation tasks, systematically evaluating different parameters that are relevant for the dense annotation of anatomical structures. [14]

Vaishnavi S. Mehekare, Dr.S.R., Ganorkar, from all among cerebrum tumors, Glioma are the most widely recognized, forceful, prompting a short future in their most elevated evaluation. There are different proposes of automatic division strategy in light of Convolutional Neural Networks (CNN), investigating little kernel. The use of kernel permits outlining a more profound design, other than having a constructive outcome against over fitting, given the less number of weights in the system.. [15]

Proposed Methodology

Brain tumour is detected by using image processing techniques. Here we are using MATLAB software to detect tumour in MRI images. The block diagram of proposed system is shown in figure below.

Block wise description of proposed system is as follows:


Pre-processing images commonly involves removing low-frequency background noise, normalizing the intensity of the individual particles images, removing reflections, and masking portions of images. Image pre-processing is the technique of enhancing data images prior to computational processing.

Image conversion

A RGB image or greyscale image is one in which the value of each pixel is a single sample representing only an amount of light, that is, it carries only intensity information. Images of this sort, also known as black-and-white or gray monochrome, are composed exclusively of shades of gray. The contrast ranges from black at the weakest intensity to white at the strongest.

Taking into consideration, image is converted into black and white. As we know tumour is large enough to not considered as small bound, hence we will remove small pixel bound.

Wavelets transform

The Daubechies wavelets, based on the each wavelet type of this class, there is a scaling function (called the father wavelet) which generates an orthogonal multi resolution analysis. the scaling filter associated with the Daubechies wavelet specified by wname. Where f is a real-valued vector.

Feature extraction

Different operations are performed to extract features from input image. Such as contrast, correlation, energy, means, standard deviation, entropy, root mean square etc.


KNN & LLOYED for classification of tissue into cancerous or normal. If they are normal tissue or non-infectious then system displays no tumour detected on MATLAB output window. If tumour is detected then following process took place.

Apply Low Pass & High pass filter for smoothing the of tumour MRI Image.

OSTU Thresholding is used for encircling the affected areas. As large as possible circle (maximum radius circle) is drawn which can contains maximum affected areas and then subsequent small circle are drawn.

A circle is chosen with same centre as maximum radius circle from above step with 60% large radius so that it can cover complete affected areas called region of interest.

Thresholding is performed to calculate area of tumour cells or relative area of tumour cells. This can be calculated as follows:

% Area=no. of tumour pixelsno. of total brain pixelsX 100

  • step 5 Segment the tumour
  • step 6 Classify the tumour
  • step 7 Display the resulting Image

Flow Chart: Below figure shows the flow diagram.


  • Start
  • Take input original MRI brain image
  • Convert it into gray scale
  • Filter the image using LPF & HPF
  • Morphological operations on image
  • Take OSTU Segmentation
  • LLOYD clustering to segment tumor
  • Use KNN to find Equlidian distance
  • Hybrid feature extraction using 2 stage Discrete Wavelet Transform
  • Calculate contrast, colleration, Energy, Mean, RMS, Standard Deviation, Smoothness
  • Tran image using PNN & RBF
  • Classify the tumour
  • Find the percentage of tumour
  • Stop


Below Figures, shows the output result of all steps used with KNN and LLOYD clustering. These figure shows that all outperforming the existing methods of classification on available dataset images.

Image Processing Technique Resulting Image

  • Original Image & Resize Image -495303175
  • Low Pass Filtered Image -4000424130
  • High Pass Filtered Image -4000514605
  • Morphological Processing -4000536195
  • OSTU Thresholding - 39814534290

LLOYD Clustering

Segmented Tumor

Image Feature

  • Contrast - 4.6787
  • Correlation - 0.5147
  • Energy - 0.4659
  • Homogeneity - 0.8131
  • Mean - 0.3217
  • Standard Deviation - 1.4570
  • Entropy - 3.0240
  • RMS - 0.3217
  • Variance - 1.4588
  • Smoothness - 0.9992
  • Kurtosis - 21.9046
  • Skewness - 4.1910

Brain Classifier Percentage

Malignant 80%

Bennie 45%


Features of tumour cells are extracted efficiently from the MRI image which is further processed by classifier system. In this research work KNN & Lloyd are used to calculate the area occupied by brain tumour. Low pass and High Pass filter along with morphological operation like dilation and erosion effectively remove noise. In future Scope MRI brain tumour will be classify using CNN & Deep Learning algorithm To obtain good result of MRI image, it can be possible by using Neural Network.


  • [1] Saniya Ansari, Dr U. S sutar "an efficient method of segmentation for handwriting devnagri word recognization" international journal of scientific & engineering research (IJSER) volume 6 issue 5 May 2015 ISSN 2229-5518 pp230-235
  • [2] Saniya Ansari, Dr U. S sutar "an efficient method of segmentation for handwriting devnagri word recognization" international journal of computer applications ISSN (0975-8887) volume -126 September 2015 edition
  • [3]S. Bauer et al., "A review of x-ray based therapeutic picture examination for mind tumour thinks about," Physics in solution and science, vol. 58, no. 13, pp. 97 - 129, 2013.
  • [4] S'ergio Pereira, Adriano Pinto, Victor Alves and Carlos A. Silva,"Brain TumourSegmentation utilizing Convolutional Neural Networks in MRI Images",2016.
  • [5] Pavel Dvorak and BjoernMenze,"Structured Prediction with Convolutional Neural Networks for Multimodal Brain TumourSegmentation, MICCAI-BRATS 2015.
  • [6] Sheela.V. K and Dr. S. Suresh Babu,"Processing Technique for Brain TumourDetection and Segmentation," International Research Journal of Engineering and Technology Volume: 02, June-2014
  • [7] Jaypatel and Kaushal Doshi, "An investigation of Segmentation Method for recognition of Tumourin Brain", Advance in Electronic and Electric Engineering, 2014.
  • [8] B. Menze et al., "The multimodal mind tumourpicture division benchmark (whelps)," IEEE Transactions on Medical Imaging, vol. 34, no. 10, pp. 1993 -2024, 2015.
  • [9] J.Selvakumar, A.Lakshami&T.Arivoli,"Brain TumourSegmentation and Its Area Calculation utilizing K-mean Clustering and Fuzzy C-Mean Algorithm",IEEE-International Conference On Advances In Engineering,March30,2012.
  • [10] Raunaq Rewari, "Programmed TumourSegmentation Using Convolutional Neural Network."
  • [11] Stefan Bauer, Roland Wiest and Lutz-P Nolte,"A Survey Of MRI-based restorative picture examination for Brain TumourStudies".
  • [12] Vaishnavi* Dr. P. Eswaran "Enhanced Color Image Enhancement Scheme utilizing Mathematical Morphology ", Volume 3, Issue 4, April 2013 IJARCSSE.
  • [13] V.Karthikeyan*1, V.J.Vijayalakshmi*2, P.Jeyakumar*3, A Novel Approach For The Enrichment Of Digital Images Using Morphological Operators, 2013.
  • [14] K.Sreedhar and B.Panlal, Enhancement of images using morphological transformation, 2012.
  • [15] Nikesh T. Gadare*, Dr. S. A. Ladhake, Prof. P. D. Gawande , Mathematical Morphology based Image Enhancement and Background Detection 2014.
  • [16] Pavel Dvorak1,2 and Bjoern Menze3 Structured Prediction with Convolutional Neural Networks for Multimodal Brain Tumor Segmentation, 2015.
  • [17] Vaishnavi S. Mehekare, Dr.S.R.Ganorkar, A Survey on Brain Tumor Detection Using Neural Network 2017.
  • [18] Samjith Raj C.P. and Shreeja R, Automatic brain tumor tissue detection in T-1 weighted MRI 2017.
  • [19] Manisha, Radhakrishnan.B and Dr. L.Padma Suresh, Tumor Region Extraction using Edge Detection Method in Brain MRI Images 2017
  • [20] V. Zeljkovic1, C. Druzgalski2, Y. Zhang1, Z. Zhu1, Z. Xu1, D. Zhang1, P. Mayorga3, Automatic Brain Tumor Detection and Segmentation in MR Images 2014.
  • [21] Anatoly Sorokin, Evgeny Zhvansky, Konstantin Bocharov, and Vsevolod Shurkhay, Alexander Potapov, Multi-label classification of brain tumor mass spectrometry data 2017.
  • [22] Alexis Arnaud, Florence Forbes, Nicolas Coquery, Nora Collomb, Benjamin Lemasson, and Emmanuel L. Barbier, Fully Automatic Lesion Localization and Characterization: Application to Brain Tumours using Multi parametric Quantitative MRI Data 2018.
  • [23] Swathi P S,  Brain Tumor Detection and Classification Using Histogram Thresholding and ANN 2015
  • [24] Ms. Priya Patil, Ms. Seema Pawar, Ms. Sunayna Patil, Prof. Arjun Nichal, A Review Paper on Brain Tumour Segmentation and Detection 2017.
  • [25] Moitra D and Mandal R Review of Brain Tumor Detection using Pattern Recognition Techniques 2017
  • [26] Neha Rani Brain Tumor Detection and Classification with Feed Forward Back-Prop Neural Network 2016.
  • [27] M. Avula, and Lakkhkula, et al., Bone Cancer from MRI Scan Imagery using Mean pixel intensity, The International Conference of Electronic Computer Technology, pp, 112-116, 2014.
Updated: Feb 22, 2021
Cite this page

Brain Tumor Detection Using KNN. (2019, Dec 17). Retrieved from

Brain Tumor Detection Using KNN essay
Live chat  with support 24/7

👋 Hi! I’m your smart assistant Amy!

Don’t know where to start? Type your requirements and I’ll connect you to an academic expert within 3 minutes.

get help with your assignment