ML Final Project-1
ML Final Project-1
Abstract—This project focuses on detecting and segmenting The goal of this work is to develop a reliable brain tumor
brain tumors using image processing techniques. MRI scans are segmentation and detection system by combining CNNs with
processed with K-means clustering and then analyzed with a K-Means clustering. The principal aims of this study are
convolutional neural network (CNN).The research will be done
in two phases, image processing and applying neural network. to assess how well K-Means clustering performs in terms
Index Terms—Brain tumour, segmentation, K-means cluster- of preliminary segmentation, improve tumor identification
ing, Detection, CNN accuracy through the use of CNNs, and guarantee that the
method uses minimal CPU resources, making it appropriate
I. I NTRODUCTION for wider clinical applications. By combining CNNs with
For the diagnosis and treatment of diseases, including K-Means clustering, brain tumors in MRI scans should be
cancer, medical imaging is crucial. One of the most deadly identified more quickly and accurately, which should improve
forms of cancer, brain tumors can damage the central nervous patient outcomes by enabling an early diagnosis. Moreover,
system and increase morbidity and death. Brain tumors can the technique’s effective CPU-based methodology guarantees
often be seen via magnetic resonance imaging (MRI), which its applicability in diverse medical contexts, including
creates finely detailed pictures of the structure of the brain. those with restricted access to sophisticated computational
However, it takes a lot of time, work, and is prone to human resources.
error to manually identify and segment tumors from MRI
images. II. R ELATED W ORK
Accurate and efficient segmentation and detection of brain [1]Color based segmentation methods are mostly used in
tumors in MRI images is essential for effective treatment study of brain tumor but in this paper Threshold-based OTSU
planning. Radiologists use different manual methods that segmentation was used. The experimental results showed that
require a lot of labor, while automated approaches can be faster this method of OTSU segmentation is better than the con-
and more dependable. But current systems frequently fail to ventional way of using color segmentation and gray scaling.
strike a compromise between great efficiency and precision. This paper provided a minimum of 87 percent accuracy on
In order to meet the demand for an effective automated multiple datasets. The method performed better than existing
system for brain tumor segmentation and identification, this approaches in segmenting the tumor region from the rest of
study makes use of K-Means clustering for preliminary the brain.
segmentation and Convolutional Neural Networks (CNNs) for [2] This paper introduces a method combining Artificial
accurate detection. Neural Networks and Fuzzy K-means for brain tumor
segmentation from MRI images. It involves four stages: noise
Numerous investigations have looked into ways to automate removal, feature extraction, classification, and segmentation,
the segmentation and identification of brain tumors. Although achieving high accuracy, sensitivity, and specificity on the
K-Means clustering is well-liked for its ease of use and BRATS dataset. The proposed method improves overall
efficiency in picture segmentation, it lacks the accuracy accuracy by 8 percent compared to K-Nearest Neighbor
required for clinical use. On the other hand, CNNs’ techniques.
capacity to recognize complex patterns has allowed them to
demonstrate considerable promise in picture categorization [3]This paper presents a robust brain tumor segmentation
tasks. Although brain cancers have been identified using method using local contrast enhancement with OTSU and K-
CNNs, it is still difficult to strike a compromise between means clustering in different transform domains. The approach
high accuracy and computational efficiency, particularly when enhances performance with adaptive histogram equalization
dealing with constrained CPU resources. and is evaluated using multiple quality metrics, achieving
high precision and reliability. It is effective for both 2D and
3D images, demonstrating independence from specific input outperforming existing techniques in the literature. The authors
datasets. validate their approach on the BRATS dataset, highlighting its
[4] This paper proposes a method for brain tumor iden- robustness and reliability.
tification using MRI image segmentation, comprising pre-
III. M ETHODOLOGY
processing, feature extraction, feature selection, classification,
and segmentation stages. Improved Gabor Wavelet Transform A. Dataset
(IGWT) and the Oppositional Fruit Fly Algorithm (OFFA) The ”Brain MRI Images for Brain Tumour Detection,”
enhance feature processing, while a support vector machine which was assembled by Navoneel Chakrabarty, is the dataset
(SVM) classifier and rough K-means algorithm are used that was used in this investigation. There are two classes of
for classification and segmentation. The methodology shows 253 brain MRI images in it: normal and pathological. Each
improved performance in sensitivity, specificity, and accuracy image has a resolution of 630 by 630 pixels and is in the
compared to existing techniques. JPEG format. This dataset is a useful resource for creating and
[5] This study presents a computer-aided approach for assessing brain tumour detection and segmentation algorithms.
brain tumor segmentation using a combination of convolu- The meticulously labelled photos provide a strong basis for
tional neural networks (CNN) and multiple kernel K-means deep learning model training and validation, making it possible
clustering (MKKMC). CNN classifies MR images as normal to distinguish between regions of aberrant tumour growth and
or abnormal, while MKKMC segments the tumor in abnormal normal brain tissue. A thorough approach to model training
images. Experimental results indicate that the proposed CNN- is ensured by the inclusion of both normal and abnormal in-
MKKMC method achieves superior accuracy, sensitivity, and stances, which advances the creation of trustworthy diagnostic
specificity with reduced time cost compared to existing meth- instruments for the identification of brain tumours.
ods.
[6] This paper presents a method for detecting and classify-
ing brain tumors using MRI images, involving pre-processing,
skull stripping, and tumor segmentation. The approach em-
ploys CNN with AlexNet and GooLeNet architectures for B. Pre-processing
classification, utilizing transfer learning to address overfitting
issues. Performance is evaluated using precision, recall, F- Preprocessing is a method for actions with images at the
measure, and accuracy metrics, demonstrating the effective- lowest level of abstraction. In this module, the image is im-
ness of the proposed method. proved in order to remove any kind of unwanted distortion and
[7] This paper presents a method for automatic brain tumor enhance signal features required for further processing.Any
segmentation in MRI images using a convolutional neural net- kind of unwanted noise is removed from the image to achieve
work on the BraTS dataset. The approach accurately predicts a perfect image.
tumor regions and dimensions in 3D imaging, achieving a Image Filtering and Enhancement:
mean prediction accuracy of 91.718 percent , with high IoU • Gaussian Filter:It is applied to the image to reduce
and BF scores. The results demonstrate significant similarity noise and smoothen the image. This step is essential
between ground truth and predicted labels, making it effective as it helps in enhancing the overall image quality by
for accurate brain tumor diagnosis. [8] This paper presents attenuating high-frequency components, which often rep-
a hybrid approach for brain tumor segmentation using fuzzy resent noise.The Gaussian filter is a linear filter that
clustering and deep learning. The proposed method combines uses a Gaussian function to weigh the pixel values. The
the advantages of fuzzy C-means clustering and convolutional Gaussian function ensures that the weights decrease with
neural networks (CNNs) to enhance segmentation accuracy. increasing distance from the center of the filter.
Experimental results on the BRATS dataset demonstrate the Formula: The Gaussian function in 2D is defined as:
method’s effectiveness in accurately segmenting brain tumors 1 − x2 +y2 2
G(x, y) = e 2σ
with improved performance metrics. [9] This study intro- 2πσ 2
duces a novel deep learning-based framework for brain tumor where x and y are the distances from the center of the
segmentation using MRI images. The framework employs a kernel, and σ is the standard deviation of the Gaussian
modified U-Net architecture with attention mechanisms to distribution. The size of the kernel is typically (2k +
focus on relevant tumor regions. The method is validated 1) × (2k + 1), where k is chosen based on the desired
on the BRATS dataset, showing superior performance in smoothing level.
terms of Dice similarity coefficient and segmentation accu- Implementation: In our approach, a Gaussian filter with
racy compared to traditional U-Net and other state-of-the-art a kernel size of 7×7 is applied to the image. This specific
approaches. [10] This paper proposes an advanced method for kernel size helps in achieving a balanced smoothing effect
brain tumor detection and segmentation using MRI images. without overly blurring important features.
The approach utilizes a combination of transfer learning with • Bilateral filtering:It is used to enhance the edges while
pre-trained VGG16 and a custom CNN architecture. The preserving the important features of the image. Un-
method achieves high accuracy, sensitivity, and specificity, like Gaussian filtering, which considers only the spatial
closeness, bilateral filtering also takes into account the analyzing the tumor’s characteristics and planning appropriate
intensity difference between pixels, making it effective treatment strategies. We employ K-means clustering combined
in preserving edges.The bilateral filter is a non-linear with Otsu thresholding to achieve precise and reliable segmen-
filter that computes the output pixel value as a weighted tation results.
average of nearby pixels. The weights are determined by K-means Clustering: K-means clustering is a powerful un-
both the spatial distance and the intensity difference. supervised learning algorithm that segments the image into
Formula: distinct regions based on pixel intensity
∥xi − x∥2
1 X 1) Clustering Setup:
Ifiltered (x) = I(xi ) · exp −
Wp 2σd2 • The grayscale MRI image is reshaped into a single
xi ∈S
|I(xi ) − I(x)|2
column vector to prepare it for clustering. This
· exp − transformation converts the 2D pixel matrix into
2σr2
a 1D array, with each element representing the
where I is the input image, x is the current pixel, S is intensity value of a pixel.
the neighborhood of x, σd is the spatial standard devia- • K-means clustering is initialized with 3 clusters, as
tion, σr is the range standard deviation, and Wp is the it is hypothesized that this will effectively separate
normalization factor. Implementation: In our approach, the tumor from the other parts of the brain.
a bilateral filter with parameters σd = 9, σr = 75, and a
2) Cluster Assignment:
neighborhood size of 9 × 9 is applied. These parameters
• The K-means algorithm iteratively assigns each
are chosen to balance the trade-off between smoothing
and edge preservation. pixel to one of the 3 clusters based on its intensity
• Gray-scale conversion: Converting the enhanced image value, minimizing the variance within each cluster.
• Initial cluster centers are chosen randomly, and
from RGB to grayscale simplifies the image data by
reducing it to a single channel. This simplification is pixels are assigned to the nearest cluster center. The
essential for easier processing and analysis, particularly algorithm recalculates the cluster centers based on
in segmentation tasks where intensity variations are cru- the mean intensity values of the assigned pixels, re-
cial.The grayscale conversion involves transforming the peating this process until the assignments stabilize.
three color channels (Red, Green, Blue) into a single in- 3) Extracting Tumor Region:
tensity value. This is typically done by taking a weighted • After clustering, the labels (cluster assignments) are
sum of the three channels. reshaped back into the original image dimensions.
Formula: The standard formula for converting RGB to Each pixel in the label image is assigned a cluster
grayscale is: label (0, 1, or 2).
• The cluster with the maximum number of pixels,
Igray = 0.299 · R + 0.587 · G + 0.114 · B
typically representing the white region in the MRI,
where R, G, and B are the red, green, and blue channel is assumed to correspond to the tumor. Pixels be-
values, respectively. longing to this cluster are set to 255 (white), while
pixels in the other clusters are set to 0 (black),
creating a binary mask.The binary mask highlights
the tumor region, distinguishing it from the rest of
the image.
Fig. 1. Pre-processing
A. Conclusion
The tumor was extracted properly from the images and
trained upon them.This research presents findings on various
brain tumor classification techniques suitable for brain tumor
detection, along with an image segmentation algorithm for au-
tomated detection and classification. The optimal results were
achieved with minimal computational effort, showcasing the
efficiency of the proposed K-means algorithm in identifying
and classifying brain tumors. This approach is advantageous