Major Project 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

CHAPTER 1

INTRODUCTION

1. BRAIN TUMOR
The abnormal mass of cells results in tumor either in the brain or another
portion of the body. Any tumors are dangerous. Proper diagnosis and early
detection can prevent thepatient from a big danger. The tumor inside the brain is
known as brain tumor and some tumors are called brain cancer. The children,
middle age and also old age peoples can be affected by a brain tumor. Many
kinds of brain tumors available but basically, it is two types, primary and
secondary. And in the huge concept, the tumor is divided also tumors are
explained in later sections into two types those are Benign tumor and
Malignant tumor

Figure 1.1: Illustration of a Brian Tumor

Medical imaging is the technique and process of creating visual representations


of the interior of a body for clinical analysis and medical intervention, as well as
visual representation of the function of some organs or tissues. Medical imaging
seeks to reveal internal structures hidden by the skin and bones, as well as to
diagnose and treat disease. Medical imaging also establishes a database of normal
anatomy and physiology to make it possible to identify abnormalities.

1
The medical imaging processing refers to handling images by using the
computer. This processing includes many types of techniques and operations
such as image gaining, storage, presentation, and communication. This process
pursues the disorder identification and management. This process creates a data
bank of the regular structure and function of the organs to make it easy to
recognize the anomalies. This process includes both organic and radiological
imaging which used electromagnetic energies (X-rays and gamma), sonography,
magnetic, scopes, and thermal and isotope imaging. There are many other
technologies used to record information about the location and function of the
body. Those techniques have many limitations compared to those modulates
which produce images.
An image processing technique is the usage of a computer to manipulate the
digital image. This technique has many benefits such as elasticity, adaptability,
data storing, and communication. With the growth of different image resizing
techniques, the images can be kept efficiently. This technique has many sets of
rules to perform in the images synchronously. The 2D and 3D images can be
processed in multiple dimensions.

1.1 BRAIN ANATOMY


The brain tumor is one all the foremost common and, therefore, the deadliest
brain diseases that have affected and ruined several lives in the world. Cancer is a
disease in the brain in which cancer cells ascends in brain tissues. Conferring to a
new study on cancer, more than one lakh people are diagnosed with brain
tumors every year around the globe.

Regardless of stable efforts to overcome the complications of brain tumors,


figures show unpleasing results for tumor patients. To contest this, scholars are
working on computer vision for a better understanding of the early stages of
tumors and how to overcome using advanced treatment options.
Magnetic resonance (MR) imaging and computed tomography (CT) scans of the
brain are the two most general tests to check the existence of a tumor and
recognize its position for progressive treatment decisions. These two scans are
still used extensively for their handiness, and the capability to yield high-
definition images of pathological tissues is more. At present, there are several
2
other conducts offered for tumors, which include surgery, therapies such as
radiation therapy, and chemotherapy. The decision for which treatment relies on
the many factors such as size, kind, and grade of the tumor present in the MR
image. It’s conjointly chargeable for whether or not cancer has reached the other
portions of the body.
Precise sighting of the kind of brain abnormality is enormously needed for
treatment operations with a resolution to diminish diagnostic errors. The precision
is often makeshift utilizing computer-aided diagnosis (CAD) systems. The
essential plan of computer vision is to produce a reliable output, which is an
associate estimation to assist medical doctors in image understanding and to
lessen image reading time. These advancements increase the steadiness and
correctness of medical diagnosis however, segmenting an MR image of the tumor
and its area itself a very problematic job. The occurrence of tumors in specific
positions within the brain image without distinguishing picture intensities is an
additional issue that makes a computerized detection of brain tumor and
segmentation a problematic job.

1.2 PROBLEM STATEMENT


Our technology deals with automated brain tumor detection and classification.
Normally the anatomy of the brain is analyzed by MRI scans or CT scans. The
aim of the paper is tumor identification in brain MR images. The main reason for
detection of brain tumors is to provide aid to clinical diagnosis. The aim is to
provide an algorithm that guarantees the presence of a tumor by combining
several procedures to provide a foolproof method of tumor detection in MR brain
images. The methods utilized are filtering, erosion, dilation, threshold, and
outlining of the tumor such as edge detection.

The advancement of medical technology has paved the way for innovative
approaches to tackle critical health issues, such as the automated detection and
classification of brain tumors. In this context, magnetic resonance imaging (MRI)
and computed tomography (CT) scans play a pivotal role in the meticulous
analysis of brain anatomy. The focal point of this research lies in the accurate
identification of brain tumors within MRI scans. This not only facilitates the
swift and precise diagnosis of patients but also enhances the overall clinical
3
decision-making process.

The crux of the proposed paper revolves around the development of an algorithm
that ensures the reliable and consistent identification of brain tumors. This
algorithm synergistically amalgamates various techniques to establish a foolproof
method for detecting tumors in MR brain images. It orchestrates a symphony of
procedures, including filtering, erosion, dilation, thresholding, and the intricate
outlining of tumors through edge detection. By harmonizing these techniques, the
algorithm aspires to provide a holistic and comprehensive framework that can
effectively discern the presence of brain tumors with a high degree of confidence.

In an era where medical accuracy and timely interventions are of paramount


importance, this research stands as a testament to the potential of technology in
revolutionizing healthcare. By harnessing the power of computational analysis
and image processing, the proposed algorithm holds promise in not only assisting
clinicians but also in potentially transforming the landscape of brain tumor
diagnosis and treatment.

The focus of this project is MR brain images tumor extraction and its
representation in simpler form such that it is understandable by everyone. The
objective of this work is to bring some useful information in simpler form in front
of the users, especially for the medical staff treating the patient. The aim of this
work is to define an algorithm that will result in extracted image of the tumor
from the MR brain image. The resultant image will be able to provide
information like size, dimension and position of the tumor, and its boundary
provides us with information related to the tumor that can prove useful for various
cases, which will provide a better base for the staff to decide the curing
procedure. Finally, we detect whether the given MR brain image has tumor or not
using Convolution Neural Network.

1.3 SCOPE
Our aim is to develop an automated system for enhancement, segmentation and
classification of brain tumors. The system can be used by neurosurgeons and
healthcare specialists. The system incorporates image processing, pattern
analysis, and computer vision techniques and is expected to improve the

4
sensitivity, specificity, and efficiency of brain tumor screening. The primary goal
of medical imaging projects is to extract meaningful and accurate information
from these images with the least error possible. The proper combination and
parameterization of the phases enables the development of adjunct tools that can
help on the early diagnosis or the monitoring of the tumor identification and
locations.

1.4 TECHNOLOGY USED


The program employs a fusion of cutting-edge technologies to revolutionize brain
tumor detection and classification. Leveraging advanced medical imaging
techniques, the project employs Magnetic Resonance Imaging (MRI) scans as
primary inputs. It harnesses the power of image processing to enhance the quality of
MRI images through anisotropic filtering, mitigating noise and artifacts.
Deep learning is at the core of the project, with Convolutional Neural Networks
(CNNs) being the chosen architecture. CNNs excel at automatically learning intricate
features from images, enabling accurate tumor detection and classification.
Furthermore, the program integrates threshold segmentation, a computer vision
technique, to segment tumor regions distinctly from background tissues.
To enhance the model's robustness and generalization capabilities, data augmentation
is performed using ImageDataGenerator. This augmentation technique introduces
variations into the training data, making the model more adept at handling diverse
scenarios.
The program leverages modern Python libraries such as Keras, OpenCV, and scikit-
image for model development, image manipulation, and performance evaluation.
Through this amalgamation of advanced imaging, machine learning, and deep
learning technologies, the project aims to not only improve brain tumor diagnosis
accuracy but also contribute to the broader landscape of medical image analysis
research.

5
6
CHAPTER 2
LITERATURE SURVEY

In Medical diagnosis, robustness and accuracy of the prediction algorithms are


very important, because the result is crucial for treatment of patients. There are
many popular classification and clustering algorithms used for prediction. The
goal of clustering a medical image is to simplify the representation of an image
into a meaningful image and make it easier to analyze. Several Clustering and
Classification algorithms are aimed at enhancing the prediction accuracy of
diagnosis process in detecting abnormalities.
In the literature survey we provide a brief summary of the different methods that
have been proposed for clustering over the period of 2002 to 2018.We have been
though 15 papers each of which has a unique approach towards segmentation in
some parameter or the other. The summaries of each of the papers are provided
below.

Research Paper 1
Sivaramakrishnan And Dr. M. Karnan “A Novel Based Approach for
Extraction Of Brain Tumor In MRI Images Using Soft Computing
Techniques,” International Journal Of Advanced Research In Computer
And Communication Engineering, Vol. 2, Issue 4, April 2013.

In the study conducted by A. Sivaramakrishnan et al. (2013) [1], a novel and


efficient method for detecting brain tumor regions in images was proposed. The
approach combined the Fuzzy C-Means (FCM) clustering algorithm with
histogram equalization to achieve accurate tumor area extraction from MRI
images. The image decomposition process utilized principal component analysis
and wavelet coefficient reduction to effectively manage image complexity. By
employing the FCM clustering algorithm, the research successfully identified and
isolated tumor regions within MR images. This technique holds promise in
enhancing the precision of brain tumor localization and has implications for
improved medical diagnosis and treatment planning. The integration of FCM

7
with histogram equalization showcases the potential synergy between machine
learning and image enhancement techniques for advanced medical image
analysis.

Research Paper 2
“Brain Tumor Detection based on Machine Learning Algorithms” by
Komal Sharma (Research Scholar M.E - CSE CU, Gharuan Mohali, Punjab,
INDIA) ,Akwinder Kaur (Assistant Professor M.E - CSE CU, Gharuan
Mohali, Punjab,INDIA) and Shruti Gujral (Assistant Professor M.E - CSE
CU, Gharuan Mohali, Punjab, INDIA) published in International Journal
of Computer Applications (0975 – 8887) Volume 103 – No.1, October 2014.

The focus of this paper involves the application of machine learning algorithms
for brain tumor detection in MRI scans. The study is structured into three key
phases: preprocessing procedures are initially applied to enhance brain MRI
images, followed by the extraction of texture features through the utilization of
Gray Level Co-occurrence Matrix (GLCM). Finally, a machine learning-based
classification process is executed. The methodology's sequential flow
underscores its effectiveness: preprocessed images serve as a foundation, GLCM-
derived texture features capture crucial information, and machine learning
algorithms enable accurate tumor classification. This integrated approach
showcases the synergy between image preprocessing, texture analysis, and
machine learning, collectively contributing to the advancement of brain tumor
detection within MRI scans. The study's framework has the potential to bolster
diagnostic accuracy and streamline medical decision-making processes through
automated detection and classification techniques.

Research Paper 3
“Brain Tumor Detection using Deep Learning and Image Processing” by
Aryan Sagar Methil Narsee Monjee (Institute of Management Studies
Mumbai, India) at Proceedings of the International Conference on Artificial
Intelligence and Smart Systems (ICAIS-2021).

This paper presents an innovative approach for brain tumor detection in diverse
8
brain images. It introduces a multi-stage process involving initial image
preprocessing steps such as histogram equalization and opening, followed by the
application of a convolutional neural network (CNN) for classification. The study
not only delves into the chosen preprocessing techniques but also explores
alternative methods and their influence on the dataset. The experimental phase
encompasses a dataset encompassing varied tumor characteristics. Notably, the
CNN achieved exceptional results, attaining a recall rate of 98.55% on the
training set and an impressive 99.73% on the validation set. These findings
underscore the paper's robust methodology, promising significant advancements
in accurate brain tumor detection.

Research Paper 4
“Brain Tumor Detection Using Deep Neural Network and Machine
Learning Algorithm” Masoumeh Siar (Department of Computer
Engineering Science and Research Branch, Islamic Azad University
Tehran), Iran Mohammad (Teshnehlab Department of Electrical
Engineering K.N. Toosi University of Technology Tehran, Iran).

In the realm of medical image analysis and classification, algorithms have


garnered substantial attention recently. Through the presented experiments, our
research demonstrates the preeminent performance of a neural network
classification algorithm post-MRI image preprocessing. Remarkably, Lazy-IBk
follows closely in second place, while Naïve Bayes and the J48 decision tree
exhibit comparatively lower performance. Enhancing the accuracy further
necessitates a refined dataset comprising high-resolution images sourced directly
from MRI scanners. Additionally, the potential of classifier boosting techniques
stands poised to elevate accuracy even more, potentially positioning this tool as a
valuable asset within medical facilities addressing brain tumors.

Research Paper 5
“Comparative Study of various techniques using Deep Learning for Brain
Tumor Detection” Deepali Vikram Goel(Research Scholar, Kalinga

9
University, Raipur), Vivek Deshpande2 (Research Co-Guide, Kalinga
University, Raipur) in 2020 International Conference for Emerging
Technology (INCET) Belgaum, India. Jun 5-7, 2020.

Detecting brain tumors within complex brain images poses a significant


challenge due to image intricacies and noise-related issues that impact accuracy.
To address this, image segmentation and MRI (magnetic resonance imaging)
techniques have emerged as valuable tools in medical diagnostics, aiding brain
and medical image examinations. Particularly, image segmentation plays a
pivotal role in extracting essential features from medical images like MRI, CT
scan, and Mammography. This paper presents a comprehensive exploration of
brain disease detection using deep learning methodologies. It encompasses a
systematic review and comparative analysis of recent advancements in brain
disorder detection via deep learning. By scrutinizing the latest research in this
domain, the paper identifies gaps in knowledge and understanding. Through this
comprehensive review, it is evident that deep learning techniques offer promising
potential for enhancing brain tumor detection accuracy. However, the analysis
also uncovers various research gaps that need further attention. By delving into
the intricate nuances of brain image analysis, this paper aims to contribute to the
ongoing evolution of medical image processing, ultimately improving the
accuracy of brain tumor detection and positively impacting healthcare practices.

Research Paper 6
“Brain Tumor Detection Using Shape features and Machine Learning”
Algorithms Dena Nadir George, Hashem B. Jehlol, Anwer Subhi
Abdulhussein Oleiwi published in International Journal of Scientific &
Engineering Research, Volume 6, Issue 12, December-2015.

The proposed methodology employs a dual-classifier approach based on


supervised techniques, aimed at enhancing the accuracy of brain tumor detection.
The first classifier utilized is the C4.5 decision tree algorithm, known for its
effectiveness in handling complex decision-making scenarios. The second
classifier chosen is the Multi-Layer Perceptron (MLP) algorithm, which excels in
its capability to learn intricate patterns within data.The central objective of these
10
classifiers is to efficiently categorize brain scans into two categories: normal or
abnormal. Within the category of abnormal scans, the system further
differentiates between benign tumors and five distinct types of malignant tumors.
This multi-tiered classification enhances diagnostic precision, providing
invaluable insights for medical professionals.The approach's effectiveness is
substantiated by its performance on a dataset comprising 174 brain Magnetic
Resonance (MR) images. With the application of the MLP algorithm, an
impressive precision rate of approximately 95% is achieved. This
accomplishment underscores the potential of combining advanced classification
algorithms with medical imaging data to revolutionize brain tumor diagnosis. By
harnessing the power of both decision tree-based and neural network-based
classifiers, this methodology presents a robust framework for accurate and
efficient brain tumor classification. Its ability to discern minute differences
within brain images can significantly contribute to early tumor detection and
timely medical interventions.

Research Paper 7
“Deep learning based brain tumor classification and detection system” by
Ali ARI∗, Davut Hanbay(Department of Computer Engineering, Faculty of
Engineering, İnönü University, Malatya, Turkey) published in Turkish
Journal of Electrical Engineering & Computer Science in October 2018.

The treatment of brain cancer heavily relies on the expertise of physicians, which
underscores the critical need for an automated tumor detection system. This
system proves indispensable in supporting radiologists and doctors in swiftly and
accurately identifying brain tumors. The proposed methodology unfolds across
three pivotal stages: preprocessing, classification using the Extreme Learning
Machine Local Receptive Fields (ELM-LRF), and image processing for tumor
region extraction. Commencing with preprocessing, noise is eradicated through
nonlocal means and local smoothing techniques, ensuring the subsequent stages
work on pristine data. In the second phase, cranial magnetic resonance (MR)
images undergo classification as either benign or malignant using ELM-LRF.
The third stage encompasses tumor segmentation to distinctly define the tumor
regions. Notably, this study concentrated solely on cranial MR images with

11
discernible masses, seeking to expedite physicians' decision-making processes. In
rigorous experimental trials, the classification accuracy for cranial MR images
soared to an impressive 97.18%. The discerning evaluation underscored that the
proposed approach eclipsed recent counterparts in the field, affirming its superior
performance. These empirical findings collectively accentuate the method's
efficiency and its potential as an invaluable asset in computer-aided brain tumor
detection endeavors. By automating tumor detection and classification, this
method presents a transformative leap towards enhancing medical diagnostics
and expediting treatment initiation.

Research Paper 8
Brain tumor diagnosis based on metaheuristics and deeplearning An Hu1(
Neurosurgery, The PLA Navy Anqing Hospital, Anqing, Anhui, China) |
Navid Razmjooy Neurosurgery(Department of Electrical Engineering,

Tafresh University, Tafresh, Iran) on 6 September 2020.

This study introduces a novel approach employing metaheuristic techniques for


the early detection of brain tumors. The method unfolds through a strategic
sequence of three primary stages: tumor segmentation, feature extraction, and
classification hinging on a deep belief network. To optimize the selection of
features and image classification, an enhanced version of the seagull optimization
algorithm is harnessed. This algorithmic refinement ensures the extraction of the
most pertinent features for accurate classification. In a broader context, this study
propels a significant stride toward enhancing brain tumor detection, a critical
aspect of medical diagnostics. The method's efficacy is substantiated through
comprehensive simulation results, meticulously evaluated against a range of
existing methods. Notably, the comparative analysis underscores the proposed
method's dominance, exhibiting markedly improved performance metrics
encompassing the Correct Detection Rate (CDR), False Alarm Rate (FAR), and
False Rejection Rate (FRR). These indices collectively gauge the system's
precision, its resistance to false alarms, and its sensitivity to potential tumor
cases. The study's culmination heralds a substantial breakthrough in early brain
tumor detection, underpinned by the fusion of metaheuristic algorithms and deep
12
learning principles. The proposed method not only outperforms existing
methodologies but also accentuates the potential for integrating advanced
computational techniques into the medical domain, thereby fostering more
accurate and timely diagnosis. This research underscores the pivotal role of
computational intelligence in augmenting medical decision-making processes and
underscores the potential for further advancements in the field of medical
imaging and diagnostics.

Research 9
Kaur, Jaskirat & Agrawal, Sunil & Renu, Vig.(2012). “A Comparative
Analysis of Thresholding and Edge Detection Segmentation Techniques”.
International Journal of Computer Applications.vol.39.pp. 29-34.
10.5120/4898-7432.

In this study, a comprehensive exploration was undertaken to establish and


evaluate various clustering procedures for the segmentation process. The
objective was to enhance the precision and efficacy of image segmentation, a
crucial phase in medical image analysis. The research delved into diverse styles
of clustering techniques, with a focus on their performance in distinct scenarios.
A significant contribution to this endeavor was made by Kaur, who introduced a
systematic approach for assessing selected clustering techniques. The assessment
was anchored in the concept of stability, meticulously gauging the resilience of
these techniques across various conditions. This innovative approach aimed to
offer a robust framework for selecting optimal clustering techniques, further
refining the segmentation process. Integral to this assessment were diverse
performance metrics, including sensitivity, specificity, and accuracy. These
metrics served as quantifiable benchmarks to measure the efficacy of the
clustering techniques in producing accurate and reliable segmentations. This
study underscores the importance of methodological evaluation in image
segmentation, offering valuable insights into the intricate process of selecting and
fine-tuning clustering techniques for optimal outcomes.

13
Research Paper 10
Marroquin J.L., Vemuri B.C., Botello S., Calderon F. (2002) An Accurate
and Efficient Bayesian Method for Automatic Segmentation of Brain MRI.
In: Heyden A., Sparr G., Nielsen M., Johansen P. (eds) Computer Vision —
ECCV 2002. ECCV 2002. Lecture Notes in Computer Science, vol 2353.
Springer, Berlin, Heidelberg.

In the scholarly work by Marroquin et al. [10], a pioneering automated 3D


segmentation approach for brain MRI scans is introduced, signifying a significant
advancement in medical imaging and diagnostic capabilities. This innovative
method deviates from conventional single multiplicative magnificence by opting
for a distinctive parametric model, thereby mitigating the potential influence on
the intensities of a given attribute. The focal point of this research centers around
leveraging a brain atlas to facilitate nonrigid transformation, effectively mapping
the anatomical nuances of a typical brain. This transformative process
subsequently assumes a pivotal role in delineating brain structures from non-
brain tissues, effectively computing prior probabilities and automating the
initialization process. The crowning jewel of this approach is the employment of
the MPM-MAP (Maximum a Posteriori-Maximum a Posteriori) algorithm, which
serves as the cornerstone for attaining optimal segmentation outcomes.The
study's outcomes underscore the profound advantages offered by the MPM-MAP
algorithm, positioning it as a more robust alternative in contrast to the traditional
EM (Expectation-Maximization) method, especially when estimating posterior
marginal errors. An intriguing revelation is the computational efficiency inherent
in the MPM-MAP algorithm, which, in pursuit of optimal segmentation, solely
necessitates the solution of linear systems. This computational lightness is a
notable asset, enhancing the method's feasibility for real-world application and
potentially expediting medical diagnostic workflows. In essence, this research
carves a path towards more accurate and automated segmentation of brain MRI
scans, underpinned by the prowess of parametric modeling and advanced
algorithms. The strides made in this study amplify the potential for efficient and
accurate medical image analysis, subsequently contributing to enhanced
diagnostic precision and medical decision-making.

14
Research Paper 11
Minz, Astina, and Chandrakant Mahobiya. “MR Image Classification Using
Adaboost for Brain Tumor Type.” 2017 IEEE 7th InternationalAdvance
Computing Conference (IACC) (2017): 701-705.

The first segment, pre-processing, serves as the foundation for subsequent stages.
Within this phase, the focus lies on noise reduction within the datasets and the
transformation of images into grayscale, ensuring uniformity and consistency.
This transformation aids in minimizing the impact of varying image
characteristics, thereby contributing to enhanced classification accuracy.Further
enhancing the pre-processing phase, Median filtering and thresholding
segmentation techniques are employed. The former smoothens the image,
reducing the influence of outliers or irregularities, thus optimizing the input for
downstream processes. Thresholding, on the other hand, plays a pivotal role in
segregating relevant features from the background. This process essentially
creates a binary image, enabling subsequent algorithms to focus solely on critical
aspects of the image. Astina Minz et al.'s work not only underscores the
importance of robust pre-processing techniques but also underscores the potential
of the AdaBoost algorithm in classifying brain images. By amalgamating
advanced data transformation and classification methodologies, this study
contributes substantially to the field of medical image analysis and computer-
assisted diagnostics. The systematic approach presented in this study stands as a
testament to the ever-evolving capabilities of machine learning in revolutionizing
healthcare and medical image interpretation.

15
CHAPTER 3
PROPOSED DESIGN & METHODOLOGY

3.1 Motivation for Brain Tumor Classification Project


The Brain Tumor Classification Project is driven by a fundamental concern for
enhancing medical diagnostics and patient care. Brain tumors, often elusive and
perilous, pose significant challenges to early detection and accurate diagnosis. This
project seeks to leverage the power of modern machine learning techniques to create a
robust classification model capable of distinguishing between brain tumor images
categorized as 'No Tumor' and 'Tumor'.

Early detection of brain tumors is pivotal in promoting positive patient outcomes. By


harnessing deep learning and image analysis, we endeavor to empower medical
professionals with a tool that not only expedites diagnosis but also augments its
accuracy. In a realm where time is of the essence, the fusion of cutting-edge
technology and medical expertise holds the potential to transform the landscape of
brain tumor detection.

The motivation for this project lies in the following factors:

Medical Impact: A successful brain tumor classification model could lead to quicker
intervention, more informed treatment plans, and an overall improvement in patient
prognosis. The goal is to contribute to the arsenal of medical tools used for disease
detection.

16
Technological Innovation: This project embodies the symbiosis of medicine and
technology. By harnessing the power of machine learning, we aim to create a solution
that combines human expertise with computational efficiency.

Learning and Exploration: The project offers an opportunity to delve into the world
of medical imaging, anisotropic filtering, threshold segmentation, and convolutional
neural networks. It's a journey of continuous learning and exploration at the
intersection of healthcare and artificial intelligence.

Real-World Application: The model developed here has real-world implications. Its
potential integration into medical practices could make a tangible difference in the
lives of patients and medical professionals.

Contributing to the Field: As the field of medical imaging continues to evolve, this
project adds a drop to the ocean of knowledge. It contributes to the ongoing
advancements in healthcare technologies.

Fig 3.1 Visual representation of brain tumor


17
Through rigorous image preprocessing and the construction of a robust
classification model, we aim to make strides in brain tumor detection. This
project strives to highlight the immense potential of interdisciplinary
collaboration, where technology and medicine unite for a common cause.

3.2 AIM OF PROJECT


Brain Tumor Detection using Machine Learning.

3.3 OBJECTIVES
3.3.1 Preprocessing of images

a) Noise removal from MRI images by using

b) Edge Enhancement.

c) Threshold Segmentation.

3.3.2 Model making

a) Making a Sequential Model for CONVOLUTIONAL NEURAL


NETWORK (CNN).

3.3.3 Model Training and Testing

3.3.4 Creating an Android Application using flask.

3.4 DESIGN METHODOLOGY

The "Brain Tumor Detection Project" involves multiple stages, each contributing to
the successful development and evaluation of a model capable of detecting brain
tumors from medical images. The project's workflow can be broken down into several
key blocks, as outlined below:

Dataset Preparation

In the initial phase of the project, the "Dataset Preparation" block is pivotal in
assembling and structuring the essential data for training the brain tumor detection
18
model. This dataset predominantly encompasses magnetic resonance imaging (MRI) scans of
the brain. These images encompass instances where brain tumors are present (positive cases)
as well as scenarios where tumors are absent (negative cases). The dataset, sourced from
Kaggle, undergoes careful curation, ensuring proper categorization for supervised learning.
This organized dataset serves as the foundation upon which the subsequent phases of
preprocessing, model building, training, and evaluation are built, facilitating the creation of an
effective brain tumor detection system.

Preprocessing

Once the dataset is collected, the preprocessing block comes into play. In this phase,
the images undergo several transformations and enhancements to ensure they are
suitable for training. This includes resizing all images to a consistent input size, often
using techniques like interpolation. Additionally, data augmentation techniques such
as rotation, flipping, and shifting might be applied to augment the dataset artificially
and enhance the model's robustness.

Model Building

In the pivotal "Model Building" block, the primary objective is to intricately craft the
architecture of a neural network designed to discern brain tumors. Convolutional
Neural Networks (CNNs) shine in this role due to their efficacy in processing image-
based data. This entails a layered approach wherein convolutional, activation, and
pooling layers are meticulously organized. These layers work in synergy to extract
intricate features embedded within the images. Such an architecture enables the model
to progressively uncover hierarchical patterns, crucial for distinguishing between
healthy and tumor-affected regions within the brain scans. The network's ability to
capture nuanced characteristics empowers it to achieve precise and accurate tumor
detection, thus underscoring its pivotal role in the project's success.

Training and Evaluation

The "Training and Evaluation" block holds paramount importance in the project's
lifecycle. In the training phase, the model engages with the meticulously curated
dataset, imbibing intricate patterns. The model actively seeks to minimize
discrepancies between predicted and actual labels by iteratively recalibrating its
internal parameters. Evaluation occurs on an independent validation dataset, gauging

19
the model's proficiency. Metrics encompassing accuracy, loss, precision, recall, and
F1-score are computed. These metrics serve as critical yardsticks to quantify the
model's effectiveness, offering insights to refine its architecture and optimize its
performance for accurate brain tumor detection.

Performance Evaluation

In the "Performance Evaluation" block, an exhaustive assessment of the model's


proficiency in precisely detecting brain tumors transpires. This involves generating
insightful metrics such as confusion matrices, ROC curves, and precision-recall
curves. These metrics provide in-depth insights into the model's true positive and false
positive rates, its capacity to distinguish tumor presence, and the equilibrium between
precision and recall. This rigorous evaluation aids in comprehending the model's
operational strengths and potential areas of enhancement, reinforcing its reliability
and effectiveness.

The diagram visually represents the project's workflow, from dataset preparation to
performance evaluation. Each block plays a vital role in contributing to the success of
the brain tumor detection model. The seamless progression from data collection and
enhancement to model training, validation, and ultimately real-world testing ensures
the model's readiness for deployment in clinical settings. The project's holistic
approach, combining advanced neural network architectures, data preprocessing
techniques, and rigorous performance evaluation, underscores the significance of
artificial intelligence in the medical field. It highlights the potential of technology to
assist healthcare professionals in diagnosing critical conditions and contributing to
patient care.

20
Fig 3.2 Design Methodology
21
3.5 DEEP LEARNING
Deep learning has demonstrated remarkable success in tasks like image and speech
recognition, natural language processing, medical diagnosis, and even playing
complex games like Go. The deep architecture enables the models to discover
intricate patterns and relationships in data, enabling them to make highly accurate
predictions or decisions. The training process typically involves adjusting the
numerous parameters of the model to minimize the difference between predicted and
actual outcomes.

3.5.1 What is Deep Learning?


Deep learning is a cutting-edge subset of artificial intelligence and machine learning
that aims to replicate the intricate processing abilities of the human brain. At its core
are neural networks composed of interconnected nodes, or neurons, organized into
multiple layers. This architecture is termed "deep" due to its capacity to accommodate
many hidden layers, enabling the model to learn progressively complex
representations from data. Deep learning excels at extracting intricate patterns and
features from vast datasets, making it particularly effective in tasks involving
images, speech, text, and sequences. By iteratively adjusting the weights and biases of
these neurons, the model learns to recognize and differentiate subtle variations in data.
This ability to discern intricate relationships contributes to its exceptional
performance in tasks like image and speech recognition, language translation, and
even autonomous driving.

One of the standout features of deep learning is its capacity for end-to-end learning.
This means that the model can ingest raw data and directly produce meaningful
outputs, bypassing the need for handcrafted feature engineering. However, deep
learning models often require substantial amounts of labeled data and computational
power for training.

22
In essence, deep learning has revolutionized AI by enabling systems to autonomously
learn intricate representations and patterns from data, mimicking human cognitive
capabilities. Its potential to tackle complex and previously unsolved challenges has
made it a driving force in the advancement of modern AI applications.

Fig 3.3 Deep Learning

23
3.6: BRAIN TUMOR IMAGE CLASSIFICATION USING
CONVOLUTIONAL NEURAL NETWORK
Classification is the best approaches for identification of images like any kind of
medical imaging. All classification algorithms are based on the prediction of image,
where one or more features and that each of these features belongs to one of several
classes.

An automatic and reliable classification method Convolutional Neural Network


(CNN) will be used since it is robust in structure which helps in identifying every
minute details. A Convolutional Neural Network (ConvNet/CNN) is a Deep Learning
algorithm which can take in an input image, assign importance to various
aspects/objects in the image and be able to differentiate one from the other. The
preprocessing required in a ConvNet is much lower as compared to other
classification algorithms. While in primitive methods.

Filters are hand-engineered, with enough training, ConvNet have the ability to learn
these filters/characteristics.

A ConvNet is able to successfully capture the spatial and temporal dependencies in an


image through the application of relevant filters. The architecture performs a better
fitting to the image dataset due to the reduction in the number of parameters involved
and reusability of weights. In other words, the network can be trained to understand
the sophistication of the image better. The role of the ConvNet is to reduce the images
into a form which is easier to process, without losing features which are critical for
getting a good prediction.

For this step we need to import Keras and other packages that we’re going to use in
building the CNN. Import the following packages:

 Sequential is used to initialize the neural network.


 Convolution2D is used to make the convolutional network that deals with
the images.
 MaxPooling2D layer is used to add the pooling layers.
 Flatten is the function that converts the pooled feature map to a single column
that is passed to the fully connected layer.

24
 Dense adds the fully connected layer to the neural network.

3.6.1 SEQUENTIAL:

To initialize the neural network, we create an object of the Sequential class.

classifier = Sequential ()

3.6.2 CONVOLUTION :

To add the convolution layer, we call the add function with the classifier object and
pass in Convolution2D with parameters. The first argument feature_detectors which is
the number of feature detectors that we want to create. The second and third
parameters are dimensions of the feature detector matrix.

We used 256 feature detectors for CNNs. The next parameter is input shape which is
the shape of the input image. The images will be converted into this shape during pre-
processing. If the image is black and white it will be converted into a 2D array and if
the image is coloured it will be converted into a 3D array.

In this case, we’ll assume that we are working with coloured images. Input_shape is
passed in a tuple with the number of channels, which is 3 for a coloured image, and
the dimensions of the 2D array in each channel. If you are not using a GPU it’s
advisable to use lower dimensions to reduce the computation time. The final
parameter is the activation function. Classifying images is a nonlinear problem. So, we
use the rectifier function to ensure that we don’t have negative pixel values during
computation. That’s how we achieve non-linearity.

classifier.add (Convolution2D (256, 3, 3, input_shape = (256, 256, 3),

activation=’relu’)).

3.6.3 POOLING:

25
The Pooling layer is responsible for reducing the spatial size of the convolved feature.
This is to decrease the computational power required to process the data through
dimensionality reduction. Furthermore, it is useful for extracting dominant features
which are rotational and positional invariant, thus maintaining the process of
effectively training of the model.

• There are two types of Pooling: Max Pooling and Average Pooling.

Max Pooling returns the maximum value from the portion of the image covered by the
Kernel. On the other hand, Average Pooling returns the average of all the values from
the portion of the image covered by the Kernel. Generally, we use max pooling .

In this step we reduce the size of the feature map. Generally, we create a pool size of
2x2 for max pooling. This enables us to reduce the size of the feature map while not
losing important image information.

3.6.4 FLATTENING:
In this step, all the pooled feature maps are taken and put into a single vector for
inputting it to the next layer.

The Flatten function flattens all the feature maps into a single long column.

classifier.add (Flatten ()).

26
Fig 3.4 CNN Sequential Model

3.6.5 FULLY CONNECTION:

The next step is to use the vector we obtained above as the input for the neural
network by using the Dense function in Keras. The first parameter is output which is
the number of nodes in the hidden layer. You can determine the most appropriate
number through experimentation. The higher the number of dimensions the more
computing resources you will need to fit the model. A common practice is to pick the
number of nodes in powers of two.

Classifier.add (Dense (output = 64)).

The next layer we have to add is the output layer. In this case, we’ll use the sigmoid
activation function since we expect a binary outcome. If we expected more than two
outcomes, we would use the SoftMax function.

The output here is 1 since we just expect the predicted probabilities of the classes.

classifier.add (Dense (output=1, activation=’sigmoid’)).

27
Fig 3.5 Proposed CNN Model.

28
3.7 SYSTEM CONFIGURATION
3.7.1 SOFTWARE REQUIREMENTS
 Windows 11
 Python 3.6.2 or above,
 PIP and NumPy 1.13.1
 Pycharm
 Keras
 Tensorflow

Python
Python is an interpreted, high-level, general purpose programming language
created by Guido Van Rossum and first released in 1991, Python's design
philosophy emphasizes code Readability with its notable use of significant
Whitespace. Its language constructs and object-oriented approach aim to help
programmers write clear, logical code for small and large-scale projects. Python
is dynamically typed and garbage collected. It supports multiple programming
paradigms, including procedural, object-oriented, and functional programming.

PIP
It is the package management system used to install and manage software
packages written in Python.

NumPy
NumPy is a general-purpose array-processing package. It provides a
multidimensional array object, and tools for working with these arrays. It is the
fundamental package for scientific computing with Python. It contains various
features including these important ones:

• A powerful N-dimensional array object


• Sophisticated (broadcasting) functions
• Tools for integrating C/C++ and Fortran code
• Useful linear algebra, Fourier transform, and random numbers
29
Pandas is the most popular python library that is used for data analysis. It
provides highly optimized performance with back-end source code is purely
written in C or Python. We can analyze data in pandas with
1. Series
2. Data frames

Anaconda
Anaconda is a free and open-source distribution of the Python and R
programming languages for scientific computing that aims to simplify package
management and deployment. Package versions are managed by the package
management system anaconda. The Anaconda distribution includes data-science
packages suitable for Windows, Linux, and macOS. Anaconda distribution comes
with 1,500 packages selected from PYPI as well as the conda package and virtual
environment manager. It also includes a GUI, Anaconda Navigator, as a graphical
alternative to the command-line interface (CLI).

Jupyter Notebook
Anaconda distribution comes with 1,500 packages selected from PyPI as well as
the conda package and virtual environment manager. It also includes a GUI,
Anaconda Navigator, as a graphical alternative to the command line interface
(CLI). A Jupyter Notebook document is a JSON document, following a versioned
schema, and containing an ordered list of input/output cells which can contain
code, text mathematics, plots and rich media, usually ending with the “. ipynb"
extension.

Tensor Flow
Tensor flow is a free and open-source software library for dataflow and
differentiable programming across a range of tasks. It is a symbolic math library,
and is also used for machine learning applications such as neural networks. It is
used for both research and production at Google.

30
Keras
Keras is an open-source neural-network library written in Python. It is capable of
running on top of TensorFlow, Microsoft Cognitive Toolkit, R, Theano, or Plaid
ML.
Designed to enable fast experimentation with deep neural networks, it focuses
on being user-friendly, modular, and extensible. Keras contains numerous
implementations of commonly used neural-network building blocks such as
layers, objectives, activation functions, optimizers, and a host of tools to make
working with image and text data easier to simplify the coding necessary for
writing deep neural network code.

OpenCV
OpenCV (Open source computer vision) is a library of programming functions
mainly aimed at real-time computer vision. Originally developed by Intel, it was
later supported by willow garage then Itseez (which was later acquired by Intel).
The library is cross platform and free for use under the open source BSD license.
OpenCV supports some models from deep learning frameworks like TensorFlow,
Torch, PyTorch (after converting to an ONNX model) and Caffe according to a
defined list of supported layers. It promotes Open Vision Capsules. which is a
portable format, compatible with all other formats.

3.7.2 HARDWARE CONFIGURATION

• Processor: Intel core i5 or above.


• 64-bit, quad-core, 2.5 GHz minimum per core
• Ram: 8 GB or more
• Hard disk: 10 GB of available space or more.
• Display: Dual XGA (1024 x 768) or higher resolution monitors
• Operating system: Windows

31
CHAPTER 4

RESULT AND DISCUSSIONS

4.1 Result of Preprocessing Stage


At the beginning of the preprocessing, the study has done a pre-preprocessing
operation that is not included in the original method of this study. This study does
require a gray image as an input, all data of the database of this study are in gray
format. In another workplace of Python and after that, the converted image is used as
an input of this method in this study.

Fig 4.1 Input Image

4.1.2 Filtered image

An anisotropic filter is a specialized image enhancement technique applied to MRI


(Magnetic Resonance Imaging) images. It recognizes and enhances structures with
distinct orientations, such as blood vessels or nerve pathways. By adapting to the local
orientation of features, this filter accentuates specific anatomical details while
minimizing noise and irrelevant variations. In medical applications, anisotropic
filtering helps healthcare practitioners accurately visualize intricate structures, aiding

32
in diagnosis and treatment planning. This technique significantly improves the clarity
and utility of MRI images, enabling medical professionals to extract essential
information and make informed decisions about patient health.

Fig 4.2 Filtered Image

4.1.3 Edge Detection Technique

Edge Detection is a fundamental technique in MRI-based brain tumor detection. It


involves setting a threshold value to distinguish between tumor and non-tumor
regions within an image. Pixels with intensity values exceeding the threshold are
classified as tumor areas, while those below are considered healthy tissue. This
method helps isolate potential tumor regions by simplifying complex images into
binary categories. However, its efficacy relies on accurate threshold selection, which
can vary due to image noise and intensity variations. While simple, threshold
segmentation remains a crucial initial step in automated brain tumor detection
pipelines, aiding in highlighting potential areas of interest for further analysis.

33
Fig. 4.3. Edge Detected Image

4.1.4 Threshold Segmentation

Threshold segmentation is a fundamental image processing technique used in brain


tumor detection from MRI images. It involves setting a threshold value to separate
pixels or regions of interest from the background. In the context of brain tumor
detection, thresholding helps isolate abnormal tissue, like tumors, by distinguishing it
from healthy brain tissue. By converting the grayscale MRI image into a binary
format, where pixels above the threshold become foreground (tumor) and below it
become background, threshold segmentation simplifies the detection process. While
simple, its effectiveness relies on careful threshold selection and preprocessing to
accurately identify tumor regions in brain MRI scans.

Fig. 4.4 Threshold Segmented Binary Image

34
4.1.5 Morphological Operation and Dilation

Morphological operations are vital image processing techniques used in brain tumor
detection from MRI images. Specifically, dilation is a core operation within this
context. It involves expanding regions of interest in an image, making them larger and
more prominent. In brain tumor MRI analysis, dilation is applied to enhance the
detected tumor regions. By enlarging the tumor area while retaining its original shape,
dilation aids in accurately capturing tumor boundaries and extent. This process is
crucial for accurate diagnosis and treatment planning. It helps distinguish tumor-
affected areas from healthy tissue, providing medical professionals with a clearer
understanding of the tumor's size and location. This enhances the efficacy of brain
tumor detection, contributing to better patient care and improved medical decision-
making.

Fig 4.5 Dilated Image Fig 4.6 Morphological operation

35
4.1.6 Training Data

Fig 4.7 Training Data Epochs=10

4.1.7 Sample Result

Fig 4.8 No Tumour Detected


36
Fig. 4.9. Image having Tumour

4.1.8 Performance analysis


On experimentation, it was observed that the proposed methodology seems to be
outperformed when compared to all different set of images. Among all the
images, the proposed Convolutional Neural Network (CNN) based approach
seems too much better in terms of quality of the output in 64 *64 images when
compared to its other sized images which are represented in table and charts.

TABLE 1 Represents the true positive, true negative, false positive and false
negative values of the proposed approach for different set of images.

Different set of True True Negative False Positive False Negative


Images Positive (%) (%) (%)

64*64 Images 83.7 84.5 16.3 15.5


128 * 128 Images 82.4 84.1 17.6 15.9

256 * 256 Images 82.1 83.7 17.9 16.3

37
Performance Analysis Chart

False Negative (%)

False Positive (%)

True Negative (%)

True Positive (%)

0 10 20 30 40 50 60 70 80 90

512 * 512 Images 256 * 256 Images 128 * 128 Images

Fig. 4.10 Represents the performance of CNN

38
CHAPTER 5
CONCLUSION

In this project, we embarked on a journey to develop an automated brain tumor


classification system using a convolutional neural network (CNN). The primary
objective was to accurately distinguish between images of brain scans with and
without tumors. Through this endeavor, we not only gained hands-on experience in
building and training deep learning models but also explored various image
preprocessing techniques and augmentation strategies.

Our approach began with collecting and preprocessing a dataset containing brain scan
images. We employed image augmentation techniques to enhance the diversity of our
training data, which included rotation, width and height shifts, and horizontal flipping.
These augmentations aimed to mitigate overfitting and improve the model's
generalization capability.

The architecture of our CNN model was carefully designed, consisting of


convolutional and pooling layers to extract essential features from the images. We
used multiple convolutional layers with activation functions and max-pooling
operations to progressively reduce the spatial dimensions of the data. The fully
connected layers towards the end of the model further refined these features and
provided the final classification results.

Training and evaluation of the model were crucial phases of this project. We
monitored the model's performance using training and validation accuracy and loss
curves. Our model showcased promising accuracy on both the training and validation
datasets, indicating its capability to effectively differentiate between tumor and non-
tumor brain scans. The confusion matrix provided deeper insights into the
classification results, highlighting areas of correct and incorrect predictions.

To ensure the model's robustness, we incorporated data augmentation directly into the
training process. This technique further boosted the model's ability to generalize to
new, unseen data, which is paramount in real-world scenarios.
39
In conclusion, this project demonstrated the potential of deep learning techniques,
specifically CNNs, in the domain of medical image classification. Our model
showcased promising results in classifying brain scans with and without tumors,
offering a glimpse into the potential applications of AI in healthcare diagnostics.
However, it's important to note that the model's performance can be further improved
with larger and more diverse datasets, as well as advanced architectures and
optimization techniques. This project has provided us with valuable insights into both
the technical aspects of building deep learning models and the ethical considerations
associated with AI in healthcare.

As we move forward, there is a great deal of untapped potential in the realm of


medical image analysis, and our project serves as a stepping stone into this exciting
field. Through continuous refinement and collaboration, we can contribute to the
development of reliable tools that aid medical professionals in providing accurate and
efficient diagnoses.

40
CHAPTER 6
FUTURE SCOPES

While our project has successfully developed a brain tumor classification system
using convolutional neural networks, there are several avenues for further exploration
and enhancement in this domain. The following are some potential directions for
future research and development:

1. Performance Enhancement: Our current model achieved promising accuracy, but


there is always room for improvement. Fine-tuning the model architecture,
experimenting with different network depths, exploring more advanced regularization
techniques, and optimizing hyperparameters could lead to even better classification
results.

2. Advanced Architectures: Investigating more advanced architectures such as


ResNet, DenseNet, and EfficientNet could provide substantial performance gains.
These architectures are designed to address issues like vanishing gradients and
information bottleneck, potentially leading to better feature extraction.

3. Transfer Learning: Leveraging pre-trained models on larger datasets, particularly


in the medical imaging domain, can significantly boost model performance. These
models can serve as feature extractors and be fine-tuned on our specific dataset,
potentially accelerating convergence and enhancing accuracy.

4. Data Augmentation Variations: Exploring more diverse and tailored data


augmentation strategies could further improve the model's generalization ability.
Techniques like random elastic deformations, brightness adjustments, and zooming
can create a more robust model against variations in input data.

5. Multi-Modal Fusion: Incorporating multiple modalities such as MRI, CT, and


PET scans into the classification pipeline could offer a more comprehensive
diagnostic approach. Fusion of information from various modalities may enhance
accuracy and provide a more holistic view of tumor detection.

41
6. Interpretable AI: As AI models make more critical decisions in medical domains,
interpretability becomes paramount. Exploring techniques to visualize and understand
the model's decision-making process can enhance its credibility and facilitate
collaboration between AI systems and medical professionals.

7. Online Learning: Developing a system that can continuously learn from new data
can keep the model up-to-date with the latest medical knowledge. Implementing an
online learning mechanism could allow the model to adapt to evolving tumor patterns
and improve long-term diagnostic accuracy.

8. Clinical Integration: Collaborating with medical professionals for real-world


validation and clinical testing is a crucial step. Integrating the AI system into the
clinical workflow, getting feedback from radiologists, and addressing their needs can
help refine the model and ensure its practical utility.

9. Ethical Considerations: As AI penetrates healthcare, ethical considerations around


data privacy, patient consent, bias, and accountability become paramount. Future
research could focus on developing guidelines and frameworks to ensure responsible
deployment of AI in medical diagnostics.

10. Global Accessibility: Developing lightweight models that can run on resource-
constrained devices can democratize access to medical diagnostics, especially in
remote and underserved areas.

In conclusion, our brain tumor classification project is a stepping stone into a dynamic
field that offers numerous possibilities for innovation and positive impact on
healthcare diagnostics. As technology continues to evolve and the medical community
embraces AI, our project's outcomes provide a strong foundation for continued
research and development that can contribute to more accurate and efficient brain
tumor detection, ultimately benefiting patients and medical professionals alike.

42

You might also like