You are on page 1of 27

A SYNOPSIS

ON
Brain Tumor Detection

Bachelor of Technology
In
Computer Science & Engineering

Submitted by: -

Kajal Seth 202010101110104


Farhan Khan 202010101110095
Shikhar Patel 202010101110098
Anmol Verma 202010101110111

Under the Supervision of


Mr. Neeraj Kumar
(Assistant Professor)

Department of Computer Science and Engineering


Shri Ramswaroop Memorial University
2023-24

i
CERTIFICATE

This is to certify that the project entitled “Brain Tumor Detection” submitted by Kajal
Seth (202010101110104) ,Shikhar Patel (202010101110098) , Farhan Khan
(202010101110095), Anmol Verma (202010101110111) for partial fulfillment of degree
of Bachelor of Technology in Computer Science and Engineering is a record of bona-fide
work carried out by them under our supervision at the Department of Computer Science
and Engineering, Shri Ramswaroop Memorial University, Lucknow - Deva Road,
Barabanki, Uttar Pradesh.

(Mr. Neeraj Kumar) (Dr. Satya Bhushan Verma)


Assistant Professor Dean
Department of CSE Department of CSE
Shri Ramswaroop Memorial University Shri Ramswaroop Memorial University

Mr. Neelesh Mishra


Assistant Professor
Department of CSE
Shri Ramswaroop Memorial University

ii
ACKNOWLEDGEMENT

It gives us a great sense of pleasure to present the project report undertaken during
B.Tech Third year at SRMU Barabanki . We owe special debt of gratitude towards our
respected project guide MR. Neeraj Kumar for their constant support and guidance
throughout the course of our work. Their sincerity, thoroughness and perseverance have
been a constant source of inspiration for us. It is only their efforts that our endeavors have
been light of the day.

We would not like to miss the opportunity to acknowledge the contribution of dean
MR.Satya Bhushan Verma, Head of Department of Computer Science and Engineering
for her kind assistance and cooperation during the development of our project.

iii
DECLARATION
We hereby declare that this submission is our own work and that to the best of our
knowledge and belief, it contains no material previously published or written by another
person nor material which to a substantial extent has been accepted for the award of any
other degree or diploma of the university or other institute of higher learning, except
where due acknowledgment has been made in the text.

Name: Kajal Seth


Roll No.: 202010101110104

Name: Shikhar Patel


Roll No.: 202010101110098

Name: Farhan Khan


Roll No.: 202010101110095

Name: Anmol Verma


Roll No.: 202010101110111

Date:

iv
ABSTRACT

Now a day’s tumor is second leading cause of cancer. Due to cancer large no of
patients are in danger. The medical field needs fast, automated, efficient and reliable
technique to detect tumor like brain tumor. Detection plays very important role in
treatment. If proper detection of tumor is possible then doctors keep a patient out of
danger. Various image processing techniques are used in this application. Using this
application doctors provide proper treatment and save a number of tumor patients. A
tumor is nothing but excess cells growing in an uncontrolled manner. Brain tumor cells
grow in a way that they eventually take up all the nutrients meant for the healthy cells
and tissues, which results in brain failure. Currently, doctors locate the position and the
area of brain tumor by looking at the MR Images of the brain of the patient manually.
This results in inaccurate detection of the tumor and is considered very time
consuming. A tumor is a mass of tissue it grows out of control. We can use a Deep
Learning architectures CNN (Convolution Neural Network) generally known as NN
(Neural Network) and VGG 16(visual geometry group) Transfer learning for detect the
brain tumor. The performance of model is predict image tumor is present or not in
image. If the tumor is present it return yes otherwise return no.

v
iii

iv

6
10

13

13

14

19
20

21

22

23

24
25

26
vi
=
Table of Figure

1. Image of brain tumor........................................................................................... 8

2. (a) Normal MRI image of brain........................................................................... 9

(b) tumor contain MRI image of brain................................................................. 9

3. Image of benign tumor and malignant tumor...................................................... 12

4. Human Biological Neuron................................................................................... 15

5. Structure of ANN................................................................................................. 16

6. Working of CNN model for brain tumor detection............................................. 18

7. 0 level DFD.......................................................................................................... 19

8. 1 level DFD.......................................................................................................... 20

9. Python libraries used in project........................................................................... 24

10. Software used in project...................................................................................... 24

vii
INTRODUCTION
1.1 BRAIN TUMOR DETECTION SYSTEM

The human body is made up of many organs and brain is the most critical and vital
organ of them all. One of the common reasons for dysfunction of brain is brain tumor. A
tumor is nothing but excess cells growing in an uncontrolled manner. Brain tumor cells
grow in a way that they eventually take up all the nutrients meant for the healthy cells
and tissues, which results in brain failure. Currently, doctors locate the position and the
area of brain tumor by looking at the MR Images of the brain of the patient manually.
This results in inaccurate detection of the tumor and is considered very time consuming.
A Brain Cancer is very critical disease which causes deaths of many individuals.
The brain tumor detection and classification system is available so that it can be diagnosed
at early stages. Cancer classification is the most challenging tasks in clinical diagnosis.

Fig.1 image of brain tumor

8
This project deals with such a system, which uses computer, based procedures to
detect tumor blocks and classify the type of tumor using Convolution Neural Network
Algorithm for MRI images of different patients. Different types of image processing
techniques like image segmentation, image enhancement and feature extraction are used
for the brain tumor detection in the MRI images of the cancer-affected patients.
Detecting Brain tumor using Image Processing techniques its involves the four
stages is Image Pre-Processing, Image segmentation, Feature Extraction, and
Classification. Image processing and neural network techniques are used for improve the
performance of detecting and classifying brain tumor in MRI images.
Automated defect detection in medical imaging using machine learning has
become the emergent field in several medical diagnostic applications. Its application in
the detection of brain tumor in MRI is very crucial as it provides information about
abnormal tissues which is necessary for planning treatment. Studies in the recent
literature have also reported that automatic computerized detection and diagnosis of the
disease, based on medical image analysis, could be a good alternative as it would save
radiologist time and also obtain a tested accuracy.

Fig. 2(a) normal MRI image of brain (b) tumor contain MRI image of brain
9
Furthermore, if computer algorithms can provide robust and quantitative
measurements of tumor depiction, these automated measurements will greatly aid in the
clinical management of brain tumors by freeing physicians from the burden of the
manual depiction of tumors.
The machine learning based approaches like Deep ConvNets in radiology and
other medical science fields plays an important role to diagnose the disease in much
simpler way as never done before and hence providing a feasible alternative to surgical
biopsy for brain tumors.
In this project, we attempted at detecting and classifying the brain tumor and
comparing the results of binary and multi class classification of brain tumor with and
without Transfer Learning (use of pre-trained Keras models like VGG16, ResNet50 and
Inception v3) using Convolutional Neural Network (CNN) architecture.

10
1.2 Type of Brain Tumor
Primary brain tumors include tumors that originate from the tissues of the brain or
the brain's immediate surroundings. Primary tumors are categorized as glial (composed
of Glial cell) or non-glial (developed on or in the structures of the brain, including
nerves, blood vessels and glands) and benign or malignant.

Types of brain tumor

Benign Malignant

Chordomas Craniopharyngiomas Meningiomas Astrocytoma Ependymomas sarcoma

TYPES OF BENIGN BRAIN TUMORS –


• Chordomas are benign, slow-growing tumors that are most prevalent in people ages 50
to 60. Their most common locations are the base of the skull and the lower portion of
the spine.

• Meningiomas are the most common benign intracranial tumors, comprising 10 to 15


percent of all brain neoplasms, although a very small percentage are malignant.

• Craniopharyngiomas typically are benign, but are difficult tumors to remove because
of their location near critical structures deep in the brain. They usually arise from a
portion of the pituitary gland so nearly all patients will require some hormone
replacement therapy.

11
TYPES OF MALIGNANT BRAIN TUMORS –
• Astrocytoma are the most common glioma, accounting for about half of all primary
brain and spinal cord tumors. Astrocytoma developed from star-shaped glial cells called
astrocytes, part of the supportive tissue of the brain. They may occur in many parts of
the brain, but most commonly in the cerebrum. People of all ages can develop
astrocytoma, but they are more prevalent in adults.

• Ependymomas are derived from a neoplastic transformation of the ependymal cells


lining the ventricular system and account for two to three percent of all brain tumors.

Fig.3 image of benign tumor and malignant tumor

12
1.3 Objective

To build an efficient system for automating the process of detecting brain tumors
which is less time consuming and more accurate than the manual system.
I. To provide doctors good software to identify tumor and their causes.
II. Save patient’s time.
III. Provide a solution appropriately at early stages.
IV. Get timely consultation.

MODEL DESCRIPTION

• Data Enhancing and Filtering: Filter data to remove unwanted entries

• Feature Extraction: Extract skin pattern by CNN-Sequential.

• Categorizing Data: Divide dataset into two parts infected and safe

• Model Training: Train the model on large datasets for accuracy

• Model Testing: Test the accuracy and create chart accordingly

• Save model: Importable file for complete model for deployment

• Model Deployment: Deploy the UI created for general use on Kaggle.

13
PROGRAM DESCRIPTION

The tool is developed in a step-based manner using top-down algorithm. Necessary


data has been taken from google images, grouped into features and classified manually.
It starts with data Gathering where a new directory with 3 times the original samples
were stored to gathered data to adapt to the features easily corresponding to large dataset
size. The dataset is then divided into training and test based on 9:1 ratio. Training data has
to be sent to a neural network. This neural network is originally created by we and is based
on VGG16, GoogleNET.Alexnet and similar algorithms but with a difference in taking
much less time and resources to process the results of a CNN.
Sequential deep learning neural network is utilized comprising of a total of 24 layers
with 9Conv2D layers, 4 Maxpooling layers, 7 Dropout layers, 3 Dense layers and a Flatten
layer giving out a total of 4,447 million trainable parameters in the network.
The loss segment utilized is categorical sparse cross entropy as the data is classical
based with high entropy of variations. Optimizer used is Adam and metrics focused on is
accuracy.
Early stopping is utilized for best model fitting based on validation loss of the training
Model is then trained for 27 epochs with 64 parameters and is finally saved under h5 file
for future use.
The model sees a constant reducing validation and training loss and statically
increasing accuracy on number of epochs that the model train upon. Computer Vision and
Image IL. libraries are utilized to test any image with the model and predict if the cow
possesses an infection or is probably safe. The testing accuracy of the model is found
promising being over 81% over the random unbiased sample.

Dataset –
The dataset is taken from the Kaggle. This dataset contains 2 types of images.
1. 1500 images contain brain tumor.
2. 1500 images not contain brain tumor.
For training of model, we use 501 images. And for testing purpose we use 101 images.

14
CONVOLUTIONAL NEURAL NETWORKS

Introduction to Convolution Neural Networks

The idea of convolution neural network (CNN) is derived from “Artificial Neural
Network” (ANN).
Here is the basic idea about ANN.

Artificial Neural Network:

Figure 4 - Human Biological Neuron

The 86 billion neurons that make up the human brain are connected to other neurons
by axons. Stimuli from the environment or inputs from sensory organs are accepted
by dendrites, which then produce electric impulses that quickly travel through the
neural network. A neuron can then choose to send the message to another neuron to
handle the problem or does not send it forward.
The phrase "artificial neural network" is borrowed from biological neural networks,
which help to form the structure of the human brain. Artificial neural networks also
feature neurons that are interconnected to one another in different levels of the

15
networks, much like the human brain, which has neurons that are interconnected to
one another. Nodes are the name for these neurons .
Artificial neural networks are used in artificial intelligence to simulate the network
of neurons that make up the human brain, giving computers the ability to interpret
information and make decisions in a manner similar to that of a person. Computers
are programmed to function exactly like a network of interconnected brain cells to
create an artificial neural network .

Architecture of Artificial Neural network:


Learning the components of a neural network is necessary for understanding the
concept of the architecture of an artificial neural network. A vast number of artificial
neurons, also known as units, are placed in a sequence of layers that create a neural
network .
Artificial Neural Network primarily consists of three layers:

Figure 5 - Structure of ANN

Input Layer: As the name suggests, it accepts inputs in several different formats
provided by the programmer.

Hidden Layer: The hidden layer presents in-between input and output layers. It
16
performs all the calculations to find hidden features and patterns.

Output Layer: The input goes through a series of transformations using the hiddenlayer,
which finally results in output that is conveyed using this layer. The artificial neural
network takes input and computes the weighted sum of the inputs and includes a bias. This
computation is represented in the form of a transfer function

17
Working of CNN model

Fig.4 Working of CNN model for brain tumor detection

Layer of CNN -
o Convolution 2D
o Dropout
o Flatten
o Dense
o Activation

➢ Convolution 2D: In the Convolution 2D extract the featured from inputimage.


It given the output in matrix form.
➢ MAX Poolig2D: In the MAX polling 2D it takes the largest element from
rectified feature map.
➢ Dropout: Dropout is randomly selected neurons are ignored during training.
➢ Flatten: Flatten feed output into fully connected layer. It gives data in list form.
➢ Dense: A Linear operation in which every input is connected to every output
by weight. It followed by nonlinear activation function.
➢ Activation: It used Sigmoid function and predict the probability 0 and 1.
➢ In the compile model used binary cross entropy because we have two layers 0 and 1.

18
Data flow Diagram
4.1 0 level DFD –
This is the Zero Level DFD of Brain Tumor Detection, where the high-level process of
Detection and notification is elaborated. It is a basic overview of the CNN based pattern
identification. It symbolizes the flow of data and presents a structure of the model created in the
form of charts to be easily read and understood by all.
• High Level Entities and process flow of the Brain Tumor Detection:
• Data Gathering
• Pre-Processor
• Neural Network Generator
• Model Trainer
• Model Generator

Fig.6 0 level DFD

19
4.2 1-level DFD –

This is the One Level DFD of Brain Tumor Detection, where we have elaborated the deep-
level process of Detection and notification. It is the complete description of the sub-
systems of the project.

Fig. 7 1 level DFD

20
Requirement Analysis

5.1 Hardware Required –

• High-performance CPUs and GPUs: The CNN algorithm requires a lot of computing
power, so high-performance CPUs and GPUs are essential for efficient processing of the data.
Processor Intel I3 11th GEN
GPU/ Graphic Card 8GB

• Memory: The size of the input data can be quite large, especially when dealing with medical
images such as MRI scans. Sufficient memory is required to store the input data and the
intermediate results of the algorithm.

• Storage: The input data and the trained CNN model need to be stored for future use. The
storage system should have high-speed read and write capabilities to minimize the data
transfer time.

Storage 16 GB

• Networking: If the data is stored remotely or distributed across multiple systems, a high-
speed networking infrastructure is necessary for efficient data transfer.

21
5.2 Software Required –

• Deep learning framework: A deep learning framework is required to train and deploy the
CNN model. Popular deep learning frameworks include TensorFlow, PyTorch, and Keras.

• Data preprocessing tools: Preprocessing tools are required to prepare the medical image data
for input to the CNN. These tools may include image resizing, normalization, and data
augmentation.

• Training tools: Training tools are required to train the CNN model on the input data. These
tools may include tools for monitoring the training process, selecting optimal hyperparameters,
and visualizing the training results.

• Testing and evaluation tools: Testing and evaluation tools are required to evaluate the
performance of the trained CNN model. These tools may include metrics such as accuracy,
sensitivity, specificity, and receiver operating characteristic (ROC) curves.

• Visualization tools: Visualization tools are used to visualize the input data, the intermediate
results of the CNN, and the final classification results. These tools may include tools for
displaying medical images, feature maps, and saliency maps.

• Deployment tools: Deployment tools are required to deploy the trained CNN model into a
production environment. These tools may include tools for optimizing the model for
deployment, packaging the model for deployment, and integrating the model into a larger
software system.
• Specialized hardware: There are some specialized hardware options available for accelerating
the computation of CNNs, such as field-programmable gate arrays (FPGAs) and application-
specific integrated circuits (ASICs). These options may provide faster and more energy-
efficient computation than traditional CPUs and GPUs.

22
5.3 Libraries used –
• TensorFlow: TensorFlow is an open-source deep learning library developed by Google. It
provides a comprehensive set of tools for building and training deep neural networks, including
CNNs.
• Keras: Keras is a high-level deep learning library that runs on top of TensorFlow. It provides

an easy-to-use interface for building and training deep neural networks, including CNNs.
• PyTorch: PyTorch is an open-source deep learning library developed by Facebook. It

provides a dynamic computational graph and a flexible programming interface for building
and training deep neural networks, including CNNs.
• scikit-learn: scikit-learn is a popular machine learning library in Python. It provides a wide

range of tools for data preprocessing, model selection, and evaluation, which are useful for
building and evaluating CNN models.
• OpenCV: OpenCV is an open-source computer vision library that provides a wide range of

functions for image processing and analysis. It is useful for preprocessing the medical images
before inputting them to the CNN.
• NumPy: NumPy is a fundamental library for scientific computing in Python. It provides

efficient arrays and matrices for storing and manipulating numerical data, which is useful for
processing the input data and the intermediate results of the CNN.
• Matplotlib: Matplotlib is a plotting library in Python that provides a wide range of tools for
visualizing data. It is useful for visualizing the input data, the intermediate results of the CNN,
and the final classification results.

23
Fig.8 Python libraries used in project

5.4 Software used –

• Kaggle community platform

• Google Drive for storage

• GitHub for file storage

Fig.9 image of software used in project

24
Future Scope

The future scope of brain tumor detection using CNN is promising and wide-ranging. Here are
some potential areas of advancement:
• Improved accuracy and sensitivity: As CNN algorithms continue to advance, there is a

potential for improved accuracy and sensitivity in brain tumor detection. This could result in
more accurate diagnoses, earlier detection, and improved treatment outcomes.
• Integration with other medical imaging technologies: CNNs can be integrated with other

medical imaging technologies, such as PET scans and fMRI, to provide a more comprehensive
picture of the brain. This could lead to more accurate and personalized treatment plans.
• Transfer learning: Transfer learning is a technique that involves training a CNN on a large

dataset and then applying that knowledge to a smaller dataset. This technique could be applied
to brain tumor detection, where a CNN is trained on a large dataset of brain images, and the
knowledge is transferred to a smaller dataset of new brain images.
• Real-time detection: With advancements in computing power and hardware, there is a

potential for real-time detection of brain tumors using CNNs. This could lead to faster
diagnoses and more timely treatment.
• Multi-modal image fusion: It involves combining multiple types of medical imaging data,

such as MRI and PET scans, to create a more complete picture of the brain.
CNN can be used to process data and provide more accurate diagnoses.

In summary, the future scope of brain tumor detection using CNN is vast, with potential
advancements in accuracy, sensitivity, integration with other medical imaging technologies,
transfer learning, real-time detection, and multi-modal image fusion. These advancements
could lead to more accurate diagnoses, earlier detection, and improved treatment outcomes for
patients with brain tumors.

25
REFERENCES

[1] Fritz AI - “ Brain Tumor Detection”, “https://www.fritz.ai/ Brain Tumor t-


detection/”, April 15,2023.
[2] “Brain tumor Detection Using Deep Learning” was carried out by 18CP813:
Parmar Ankita, at Birla Vishvakarma Mahavidyalaya (Engineering College) An
Autonomous Institution for partial fulfillment of Master of Technology (Computer
Engineering) with Specialization in Software Engineering
[3] Wikipedia, “Python”, “https://en.wikipedia.org/wiki/Python_(programming
_language)”, April 18, 2023.
[4] Wikipedia, “OpenCV”, “https://en.wikipedia.org/wiki/OpenCV”, April 18,
2023.
[5] W3schools, “NumPy”, “https://www.w3schools.com/python/numpy/numpy_
intro.asp”, April 18, 2023.
[6] Wikipedia, “PyCharm”, “https://en.wikipedia.org/wiki/PyCharm”,
April 18,2023. Java-t-point, “Artificial Neural Network”,
“https://www.javatpoint.com/artificial-neural-network”, April 28, 2023.
[7] “Convolutional Neural Networks”, “https://datahackers.rs”, April 29,
2023.
[8] “Datasets”, “https://www.kaggle.com/code/mayush06/brain-
tumour/edit/run/110930729”, April 30,2023.

26
27

You might also like