Sumanth Brain Tumour Report

You might also like

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

ABSTRACT

It is very difficult for doctors to detect a brain tumor at an early stage. MRI images are more
susceptible to noise and other environmental disturbances. Therefore, it becomes difficult for
doctors to determine the tumor and its causes. So, we came up with a system in which the
system will detect a brain tumor from images. Here we are converting an image to a
grayscale image. We apply filters to the image to remove noise and other environmental
clutter from the image. The system will process the selected image using preprocessing steps.
At the same time, different algorithms are used to detect the tumor from the image. But the
edges of the image will not be sharp in the early stages of a brain tumor. So here we are
applying image segmentation to the image to detect the edges of the images. We have
proposed an image segmentation process and a variety of image filtering techniques to obtain
image characteristics. Through this entire process, accuracy can be improved. This system is
implemented in the Python.
1. INTRODUCTION

Brain tumor detection is a critical task in the field of medical imaging, as early and accurate
diagnosis is essential for effective treatment planning and patient outcomes. Image processing
techniques have emerged as a valuable approach for detecting brain tumors from various
imaging modalities, such as MRI, CT scans, and PET scans. These techniques enable
automated and objective analysis of medical images, reducing reliance on subjective human
interpretation. By leveraging advanced algorithms and computational methods, image
processing can assist healthcare professionals in identifying and localizing brain tumors,
estimating their size and characteristics, and monitoring their progression over time. This
study focuses on the application of image processing techniques for brain tumor detection,
aiming to develop efficient and accurate systems that aid in early diagnosis, reduce
radiologists' workload, and improve healthcare delivery. This paper will discuss the key
image processing steps involved, including preprocessing, feature extraction, segmentation,
and classification, highlighting the challenges and advancements in the field and the potential
for future research to enhance brain tumor detection using image processing techniques.

1.1 PROJECT DESCRIPTION


This work proposes two different methodologies for segmenting a tumor on an MRI image
and determining the type of tumor. For this, one segmentation technique and one clustering
were implemented. Among the various brain problems, the most common and
life-threatening problem these days is a brain tumor. About 11,000 people are diagnosed with
a brain tumor every year [1]. Annually, about 1 lakh of 50 thousand cancer patients are
affected by a brain tumor [2]. A render chain in which the image is preprocessed to remove
noise. A brain tumor develops due to unusual cell growth in the brain [3].

1.1.1 PROBLEM STATEMENT

There are some problems, such as it taking a large amount of time, and segmentation of MR
image by different experts may vary significantly. Moreover, the result of tumor detection
may vary under different circumstances by the same physician, and the brightness and
contrast of the display screen can vary the segmentation results. For these reasons, the
automatic detection of brain tumors becomes significant. Automatic detection of brain tumors
can increase the probability of survival of a tumor. In the medical field, there is no standard
method that can be
constructed for brain-tumor detection. Several research works are attempting to detect brain
tumors automatically with improved accuracy, exactness, and speed of computation by
minimizing manual effort

1.1.2 OBJECTIVE OF STUDY

● Medical imaging technique is used to create visual representation of interior of the


human body for medical purposes and noninvasive possibilities can be diagnosed by this
technology.
● The various types of medical imaging technologies based on noninvasive approach like;
MRI, CT scan, Ultrasound, SPECT, PET and X-ray.
● When compared to other medical imaging techniques, Magnetic Resonance Imaging
(MRI) is majorly used and it provides greater contrast images of the brain and cancerous
tissues.
● Therefore, brain tumor identification can be done through MRI images. This paper
focuses on the identification of brain tumor using image processing techniques.

1.1.3 METHODOLOGY USED

Convolutional Neural Network


Past layers are interconnected with weights of the kernel. To upgrade the qualities of
information image by back propagation calculation. Since feature maps of all units shared by
the kernels. It will serve to reduces over fitting. Each data of neighborhood is taken by
utilizing kernels. Kernel is a major source of context information. Activation function is
applied to the output of neural network
Convolutional Layers Objective of the convolution layer is to take or extract the features
from the input [image], just the part of picture is link to the following convolution layer.
Figure 1. Zero-padding process

Padding Padding is incorporating a zero layer outside the input volume so the data on border
won't be lost and we can get a similar dimension of output as input volume. Here we are
using zero padding.
Activation Function Non- linear activation function ReLU (Rectifier Activation function) is
used to provide accurate results than classical sigmoid functions. f (x) = max (x, 0) 1

Figure 2. Max pooling process.


Pooling Layer It is used for combining spatially nearby features. Max-pooling is generally
used to join features. It decreases the dimension of input image and controls over-fitting.
Figure 3. Full connection layer
Full Connected Layer Finally Fully Connected layer gives the classified image based on
training data set

Pseudo Code for CNN algorithm:

Algorithm
Begin
Choose an initial vector of parameters ?? and learning rate α
Repeat until an approximate minimum is obtained
Randomly shuffle examples in the training set
For i=1,2,…,n{\displaystyle i=1,2,…,n} ??=1,….,n do:
w:=w-n ∇ Q (w).{\displaystyle\!w:=w-\eta\nabla Q _{i}(w).}f=f-α∇Qi(f)
EndFor
EndRepeat
End
Thresholding

Thresholding and Otsu Thresholding are the two types of thresholding used in our system.
The binary inversion is given by the mathematical equation as:

dst(x,y) = {0 if src(x,y) >thresh val otherwise

Since we are working with bimodal images, Otsu's algorithm tries to find a threshold value (t)
which is given by the relation:
σ2w(t) = q1(t) σ21(t)+q2(t) σ22…………(1)

Where,

q1(t) = ∑ti=1P(i) & q2(t) = ∑ti=t+1P (i)


𝑝(𝑖)
σ21(t) =∑ti=1[i=u1(t)]2 𝑞1(𝑡)
𝑝(𝑖)

& σ22(t) =∑ti=t+1[i=u2(t)]2 𝑞2(𝑡)


𝑝(𝑖) 𝑝(𝑖)
u1(t) = ∑ti=1 i 𝑞1(𝑡) & u2(t) = ∑ti=t+1 i 𝑞2(𝑡) ………..(2)

It actually finds a value of t which lies in between two peaks such that variances to both
classes are minimal.

2. LITERATURE SURVEY
In[1] H. Mohsen, E.-S. A. El-Dahshan, E.-S. M. El-Horbaty and A.-B. M. Salem,
“Classification using deep learning neural networks for brain tumors,” Deep Learning is a
new machine learning field that gained a lot of interest over the past few years. It was widely
applied to several applications and proven to be a powerful machine learning tool for many of
the complex problems. In this paper we used Deep Neural Network classifier which is one of
the DL architectures for classifying a dataset of 66 brain MRIs into 4 classes e.g. normal,
glioblastoma, sarcoma and metastatic bronchogenic carcinoma tumors. The classifier was
combined with the discrete wavelet transform (DWT) the powerful feature extraction tool and
principal components analysis (PCA) and the evaluation of the performance was quite good
over all the performance measures.

In[2] H. B. Menze, A. Jakab, S. Bauer, K. Farahani and K. Justin, “The Multimodal Brain
Tumor Image Segmentation Benchmark,” This paper presents a model which is based on
machine learning algorithms to detect brain tumours from magnetic resonance images with
high accuracy. A Convolutional Neural Network (CNN) has been used as the algorithm for
feature extraction, and segmentation. The dataset used has been acquired from an internet
website. The results show that this technique is promising and the accuracy of 97.79% has
been achieved.

In[3] S. Huda, J. Yearwood, H. F. Jelinek, M. M. Hassan, G. Fortino and M. Buckland, This


paper aims to achieve a fast, affordable, and objective diagnosis of this genetic variant of
oligodendroglioma with a novel data mining approach combining a feature selection and
ensemble-based classification. In this paper, 63 instances of brain tumor with
oligodendroglioma are obtained due to prevalence and incidence of the tumor variant. In
order to minimize the effect of an imbalanced healthcare data set, a global optimization-based
hybrid wrapper-filter feature selection with ensemble classification is applied. The
experiment results show that the proposed approach outperforms the standard techniques
used in brain tumor classification problem to overcome the imbalanced characteristics
of medical data.

In[4] J. Seetha and S. S. Raja, Used The brain tumors, are the most common and aggressive
disease, leading to a very short life expectancy in their highest grade. Thus, treatment
planning is a key stage to improve the quality of life of patients. Generally, various image
techniques such as Computed Tomography (CT), Magnetic Resonance Imaging (MRI)and
ultrasound image are used to evaluate the tumor in a brain, lung, liver, breast, prostate…etc.
Especially, in this work MRI images are used to diagnose tumor in the brain. However the
huge amount of data generated by MRI scan thwarts manual classification of tumor vs
non-tumor in a particular time. But it having some limitation (i.e) accurate quantitative
measurements is provided for limited number of images. Hence trusted and automatic
classification scheme are essential to prevent the death rate of human. The automatic brain
tumor classification is very challenging task in large spatial and structural variability of
surrounding region of brain tumor. In this work, automatic brain tumor detection is proposed
by using Convolutional Neural Networks (CNN) classification. The deeper architecture
design is performed by using small kernels. The weight of the neuron is given as small.
Experimental results show that the CNN archives rate of 97.5% accuracy with low
complexity and compared with the all other state of arts methods.

In[5] P. Meena and V. Janani, “IMAGE SEGMENTATION FOR TUMOR DETECTION,”


Used Image segmentation on surgical images plays a vital role in diagnosing and analyzing
the anatomy of human body. The area of image segmentation has made an extensive ideology
for classifying biomedical images. One such application for segmenting and classifying MRI
brain images using fuzzy based control theory is proposed in this project. A special technique
called FIS is used in brain image segmentation. The proposed FIS technique plays a
promising part i n identifying the tumour in brain image. In FIS technique, fuzzy rules are
coined which helps in segmenting the image. Key Terms: MRI brain images; FIS technique;
Segmentation; Tumour detection

In[6] Sakshi Ahuja et al., used transfer learning and superpixel technique for detection of
brain tumor and brain segmentation respectively. The dataset used was from BRATS 2019
brain tumor segmentation challenge and this model was trained on the VGG 19 transfer
learning model. Using the superpixel technique the tumor was divided between LGG and
HGG images. This resulted in an average of dice index of 0.934 in opposition to ground truth
data.

In[7] Hajar Cherguif et al., used U-Net for the semantic segmentation of medical images. To
develop a good convoluted 2D segmentation network, U-Net architecture was used. BRATS
2017 dataset was used for testing and evaluating the model proposed. The U-Net architecture
proposed had 27 convolutional layers, 4 deconvolutional layers, Dice coef of 0.81.

In[8] Chirodip Lodh Choudhury made the use of deep learning techniques involving deep
neural networks and also incorporated it with a Convolutional Neural Network model to get
the accurate results of MRI scans. A 3-layer CNN architecture was proposed which was
further connected to a fully Connected Neural Network. F-score equal to 97.33 and an
accuracy equal to 96.05% was achieved.

In[9] Ahmad Habbie MRI T1 weighted images were taken and using semi-automatic
segmentation analyzed the possibility of a brain tumour using an active contour model. The
performance of morphological active contour without edge, snake active contour and
morphological geodesic active contour was analyzed. MGAC performed the best among all
three as suggested by the data.

In[10] Neelum used a concatenation approach for the deep learning model in this paper and
the possibility of having a brain tumor was analyzed. Pre trained deep learning models which
are Inception - v3 and DenseNet201 were used to detect and classify brain tumors. Inception -
v3 model was pre trained to extract the features and these features were concatenated for
tumor classification. Then, the classification part was done by a softmax classifier.

In[11] Ms. Swati Jayade et al.,[6] used Hybrid Classifiers. The classification of tumors was
done into types, malignant and benign. Feature dataset here was prepared by Gray level Co-
occurrence Matrix (GLCM) feature extraction method. A hybrid method of classifiers
involving KNN and SVM classifiers was proposed to increase efficiency.

In[12] Zheshu Jia the author made a fully automatic heterogeneous segmentation in which
SVM (Support Vector Machine) was used. For training and checking the accuracy of tumor
detection in MRI images, a classification known as probabilistic neural network classification
sytem had been used. Multi spectral brain dataset is used and this model focused on the
automated segmentation of meningioma.

In[13] DR. Akey Sungheetha, DR. Rajesh Sharma R. used Gabor transform along with the
soft and hard clustering for detecting the edges in the CT and MRI images. A total of 4500
and 3000 instances of MRI images and CT were used respectively. K-means clustering was
used for the separation of similar features into sub-groups To represent the images in the form
of histogram properties, the author used Fuzzy c means.

In[14] Parnian Afshar used a bayesian approach for the classification of brain tumor using
capsule networks. To improve the results of tumor detection, capsule network instead of CNN
was used as CNN can loose the important spatial information. The team proposed BayesCap
framework. To test the proposed model they used a benchmark brain tumor dataset.
In[15] N. Abiwinanda, M. Hanif, S. T. Hesaputra, A. Handayani and T. R. Mengko This
Paper is Misdiagnosis of brain tumor types will prevent effective response to medical
intervention and decrease the chance of survival among patients. One conventional method to
differentiate brain tumors is by inspecting the MRI images of the patient’s brain. For large
amount of data and different specific types of brain tumors, this method is time consuming
and prone to human errors. In this study, we attempted to train a Convolutional Neural
Network (CNN) to recognize the three most common types of brain tumors, i.e., the Glioma,
Meningioma, and Pituitary. We implemented the simplest possible architecture of CNN; i.e.,
one each of convolution, max-pooling, and flattening layers, followed by a full connection
from one hidden layer. The CNN was trained on a brain tumor dataset consisting of 3064 T-1
weighted CE-MRI images publicly available via figshare Cheng (Brain Tumor Dataset, 2017
[1]). Using our simple architecture and without any prior region-based segmentation, we
could achieve a training accuracy of 98.51% and validation accuracy of 84.19% at best.
These figures are comparable to the performance of more complicated region-based
segmentation algorithms, which accuracies ranged between 71.39 and 94.68% on identical
dataset Cheng (Brain Tumor Dataset, 2017 [1], Cheng et al. (PLoS One 11, 2017 [2]).

2.1 EXISTING AND PROPOSED SYSTEM

In existing system, brain cancer was detected using image processing techniques. Initially a
brain CT scan image is acquired and the pre-processing techniques are applied on it. Then
pre-processed image is segmented. In these systems, the techniques used in the detection of
the brain cancer were confined to segmentation. These approaches are also suffered from
certain issues which can be removed by improving the technology used in it. Furthermore, all
the work has done only for detecting whether it’s cancerous or not but none detected to which
stage does the cancer belong.
The proposed method for detecting a brain tumor includes three diagnostic tasks:
pre-processing, segmentation, and feature extraction. At a later stage, we calculate and
classify the area based on this. As mentioned above, the obtained CT image is preprocessed.
The preprocessed image is segmented and later we extract features from the segmented
image. Finally, we classify the image based on the extracted features. In this project, we
described our goal in two parts, the first half concerns the detection of a brain tumor, that is,
the presence of a tumor on the provided MRI. The other part, that is, the second part, contains
the classification of the tumor. In general, the diagram of our process. The input images will
go through various stages. The first step in brain tumor detection involves taking the input of
the MRI image as shown above. The MRI image will undergo preprocessing and
segmentation techniques. The aim of preprocessing is make to improvements to the image
data that enhance the image features which are important for further processing. Image
segmentation is the process of dividing a digital image into multiple segments that will be
helpful in further Processes. In feature extraction, all the features from the input images will
be extracted and then the acquired features will be compared with the trained data set. In the
end, after comparing with the trained data set the output will tell whether the tumor is present
or not. If there exists the tumor the output will be abnormal or else the output will be as
normal.

2.2 FEASIBILITY STUDY


Preliminary investigation examines project feasibility, the likelihood the system will be useful
to the organization. The main objective of the feasibility study is to test the Technical,
Operational and Economical feasibility for adding new modules and debugging old running
system. All system is feasible if they are unlimited resources and infinite time. The feasibility
study is a management-oriented activity. The objective of a feasibility study is to find out if
an information system project can be done and to suggest possible alternative solutions.
There are aspects in the feasibility study portion of the preliminary investigation:

● 2.2.1 Technical Feasibility

● 2.2.2 Operational Feasibility

● 2.2.3 Economical Feasibility


2.2.1 TECHNICAL FEASIBILITY

It refers to whether the software that is available in the market fully supports the present
application. It studies the pros and cons of using a particular software for the development
and its feasibility. It also studies the additional training needed to be given to the people to
make the application work. The technical requirements are then compared to the technical
capability of the organization. The systems project is considered technically feasible if the
internal technical capability is sufficient to support the project requirements. The analyst
must find out whether current technical resources can be upgraded or added to in a manner
that fulfills the request under consideration

2.2.2 OPERATIONAL FEASIBILITY

It refers to the feasibility of the product to be operational. Some products may work very well
at design and implementation but may fail in the real time environment. It includes the study
of additional human resource required and their technical expertise. It dependent on human
resources available for the project and involves projecting whether the system will be used if
it is developed and implemented. It measures of how well a proposed system solves the
problems, and takes advantage of the opportunities identified during scope definition and
how it satisfies the requirements identified in the analysis phase of system development. It
reviews the willingness of the organization to support the proposed system. In order to
determine this feasibility, it is important to understand the management commitment to the
proposed project.

2.2.3 ECONOMIC FEASIBILITY

It refers to the benefits or outcomes we are deriving from the product as compared to the total
cost we are spending for developing the product. It the more or less same as the older system,
then it is not feasible to develop the product. Economic analysis could also be referred to as
cost/benefit analysis. It is the most frequently used method for evaluating the effectiveness of
a new system. In economic analysis the procedure is to determine the benefits and savings
that are expected from a candidate system and compare them with costs. If benefits outweigh
costs, then the decision is made to design and implement the system. An entrepreneur must
accurately weigh the cost versus benefits before taking an action.
2.3 TOOLS AND TECHNOLOGIES USED

Python:
Python is a general-purpose interpreted, interactive, object-oriented, and high-level
programming language. It was created by Guido van Rossum during 1985- 1990 Python is a
high-level, interpreted, interactive and object-oriented scripting language. Python is designed
to be highly readable. It uses English keywords frequently where as other languages use
punctuation, and it has fewer syntactical constructions than other languages. Python is a
MUST for students and working professionals to become a great Software Engineer specially
when they are working in Web Development Domain.
triggered by the user.
I will list down some of the key advantages of learning Python:
1.Python is Interpreted − Python is processed at runtime by the interpreter. You do not need
to compile your program before executing it. This is similar to PERL and PHP.
2.Python is Interactive − You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.
3.Python is Object-Oriented − Python supports Object-Oriented style or technique of
programming that encapsulates code within objects.
4Python is a Beginner's Language − Python is a great language for the beginner-level
programmers and supports the development of a wide range of applications from simple text
processing to WWW browsers to games.

Tkinter:
Python provides a standard GUI library named Tkinter, Tkinter module helps in creating GUI
applications in a fast and easy way. Tkinter provides 15 types of widgets. Some common
ones are Button, Label, Frame, Menu. The message, Radio button, Text, Scrollbar.
Tkinter is the standard GUI library for Python. Python when combined with Tkinter
provides a fast and easy way to create GUI applications. Tkinter provides a powerful
object-oriented interface to the Tk GUI toolkit.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform
the following Steps:
1.Import the Tkinter module.
2.Create the GUI application main window.
3.Add one or more of the above-mentioned widgets to the GUI application.
4.Enter the main event loop to take action against each event

NumPy:
In Python we have lists that serve the purpose of arrays, but they are slow to process. NumPy
aims to provide an array object that is up to 50x faster than traditional Python lists. The array
object in NumPy is called ndarray, it provides a lot of supporting functions that make
working with ndarray very easy. Arrays are very frequently used in data science, where speed
and resources are very important.
The NumPy library contains multidimensional array and matrix data structures (you’ll find
more information about this in later sections). It provides nd array, a homogeneous
n-dimensional array object, with methods to efficiently operate on it. NumPy can be used to
perform a wide variety of mathematical operations on arrays.

Pandas:
Pandas is defined as an open-source library that provides high-performance data
manipulation in Python. The name of Pandas is derived from the word Panel Data, which
means an Econometrics from Multidimensional data. It is used for data analysis in Python
and developed by Wes McKinney in 2008.
Data analysis requires lots of processing, such as restructuring, cleaning or merging, etc.
There are different tools are available for fast data processing, such as NumPy, SciPy, Python,
and Pandas. But we prefer Pandas because working with Pandas is fast, simple and more
expressive than other tools.

Seaborn:
Seaborn is an amazing visualization library for statistical graphics plotting in Python. It
provides beautiful default styles and color palettes to make statistical plots more attractive. It
is built on top matplotlib library and is also closely integrated with the data structures from
pandas. Seaborn aims to make visualization the central part of exploring and understanding
data. It provides dataset-oriented APIs so that we can switch between different visual
representations for the same variables for a better understanding of the dataset.
Some of the plots available in Seaborn are:
● Line plot
● Count plot
● Bar chart
● Pair plot
● Scatter plot
● Histogram

Flask:
Flask is a micro web framework written in Python. It is classified as a microframework
because it does not require particular tools or libraries.[2] It has no database abstraction layer,
form validation, or any other components where pre-existing third-party libraries provide
common functions.
To understand what Flask is you have to understand a few general terms:
1.WSGI: Web Server Gateway Interface (WSGI) has been adopted as a standard for Python
web application development. WSGI is a specification for a universal interface between the
web server and the web applications.
2.Werkzeug: It is a WSGI toolkit, which implements requests, response objects, and other
utility functions. This enables building a web framework on top of it. The Flask framework
uses Werkzeug as one of its bases.
3.jinja2: jinja2 is a popular templating engine for Python. A web templating system combines
a template with a certain data source to render dynamic web pages.

2.4 HARDWARE AND SOFTWARE REQUIREMENTS

HARDWARE REQUIREMENT

Processor Pentium CoreI5 and Higher


RAM 4GB or more.
Hard Disk 500GB or more.
Monitor 15 inch Color Monitor
Keyboard 102/104 Keys
Mouse Optical Mouse

Table 1 : Hardware requirements


SOFTWARE REQUIREMENT

Operating System Windows 10


Front End Python
Back End SQLite3

Table 2: Software requirements


3. SOFTWARE REQUIREMENT SPECIFICATION
3.1 USERS

Firstly, in the step first the MRI images are pre-processing and enhanced for the further
process. The second step is of image segmentation for the tumor detection. In the third step
the feature extraction is done by using thresholding technique. In the last and final step, the
classification is done on MRI Images

3.2 FUNCTIONAL REQUIREMENTS


● Select Brain tumor image
● Converting to gray scale
● image segmentation for the tumor detection
● Performs feature extraction
● Classifies in benign and malignant

3.3 NON-FUNCTIONAL REQUIREMENTS


We will describe here the non-functional requirements for our system
• Throughput: The throughput for all the actions should be high in-order to maintain the
reliability.
• Accuracy: System should correctly execute process, display the result i.e., given alert at that
particular time accordingly. System should be able to analyze the sense of the timing as much
accurate as possible.
• Response Time: The response time of the system should be deterministic at all times and
very low, i.e it should meet every deadline. Thus, the system will work in real time for the
people.
• High Speed: System should process requested task in parallel for various users to give quick
response then system must wait for process completion
4. SYSTEM DESIGN (High Level or Architectural Design)

4.1 SYSTEM PERSPECTIVE

Figure 1. System Architecture

Brain Tumor Segmentation using CNN is done mainly by using three modules.
[1] Image Preprocessing
[2] Image Classification

1. IMAGE PREPROCESSING

Digital image processing employs highly sophisticated algorithms for various virtual pictures.
Digital image processing acquired many advantages when compared to analog photograph
processing. Many algorithms are implemented at input statistics which avoids problem of
noise distortion
A. Image Intensification
Image intensification results in obtaining an image which is more suitable for future tasks. It
includes noise removal, deblurring, filtering. It needs to satisfy two conditions:
(i)The expected information must exist in the image.
(ii)The expected information must not be swamped by noise. It is of two types Qualitative
and Quantitative.
Spatial Domain
Spatial Domain technique directly deals with the image pixels and manipulates to achieve the
desired enhancement.
B. Frequency Domain
We process an image by changing the frequency components in an image without involving
any convolutional operations.
C. Filtering Technique
Filtration of an image was done for removing commotion, edge detection and increasing the
contrast. Filtering can be of sequential and non-sequential. Sequential filters are often known
as convolutional filters as they work with matrix operation employment. Non-Sequential
filters perform in equalization to Median filtering.
D. Median Filtration Methodology
Median Filtration is a non-sequential technique for expelling commotion from images. It is
broadly preferred as it obtains effectiveness in evacuating clamor without any disturbance to
edges. This method is at most preferred in the removal of “pepper and salt” type of noise.
MSE = Sum (Sum ((I (1,1) – K (1,1)). ^2)) / (row * col) (1)
PSNR = 10 * log10(255 * 255 / MSE) (2)

MSE = Mean Square Error


PSNR = Peak Signal to Noise Ratio

2. IMAGE CLASSIFICATION

CNN Methodology
The most recognized and efficient algorithm in the area of multi median deep learning is
CNN. Similar to the ones which are related to framework, it consists of data layer, covered
layer and yield layer. They execute any one from the given methods (i)intricacy
(ii)agglomeration
4.2 CONTEXT DIAGRAM

Figure 2. Context Diagram

In this diagram the modules used Read dataset shows the list of datasets of brain tumor
images. It preprocesses the images which converts color image to gray color and removes the
noise from an image. It performs feature extraction and classifies the image is tumor edor
normal.
5. DETAILED DESIGN

5.1 USE CASE DIAGRAMS

Figure 1. Use Case Diagram

Use case diagram shows us how the entities in the application are related to each other
Sequence Diagram
5.2 SEQUENCE DIAGRAM

Figure 2. Sequence Diagram

A sequence diagram, also known as an event diagram, is a type of interaction diagram that
depicts how different processes interact with one another and in what order.
6. SYSTEM IMPLEMENTATION

1. Image Acquisition and Preprocessing: The first step in the implementation of brain tumor
detection using image processing involves acquiring the medical images, such as MRI scans
or CT scans. The acquired images are then preprocessed to enhance image quality, reduce
noise, and standardize the images for further analysis.
2. Feature Extraction: In this step, relevant features are extracted from the preprocessed
images. These features may include shape-based features, texture features, or intensity-based
features. Feature extraction techniques aim to capture unique characteristics of brain tumors
that can differentiate them from healthy brain tissue.
3. Segmentation: Segmentation plays a crucial role in isolating the tumor region from the rest
of the brain tissue. Various image segmentation algorithms, such as thresholding,
region-growing, or clustering techniques, can be employed to separate the tumor region based
on intensity, texture, or spatial information.
4. Classification: Once the tumour region is segmented, a classification algorithm is applied
to determine whether the detected region corresponds to a tumour or healthy tissue. Machine
learning algorithms, such as support vector machines (SVM), artificial neural networks
(ANN), or random forests, can be trained on labelled data to classify the segmented regions
accurately.
5. Post-processing and Analysis: After classification, post-processing techniques are
employed to refine the results and remove any false positives. Morphological operations,
such as erosion, dilation, or region filling, can be used to improve the accuracy of the
detected tumour regions. Additionally, quantitative analysis, such as calculating tumour size,
shape, or volume, can provide valuable information for further clinical assessment.
6. Evaluation and Validation: The implemented system needs to be evaluated and validated to
assess its performance. This involves comparing the results of the automated tumour
detection system with ground truth annotations provided by medical experts. Measures such
as sensitivity, specificity, accuracy, and area under the receiver operating characteristic
(ROC) curve can be used to evaluate the system's performance and validate its effectiveness.
6.1 CODING
Main.py
from tkinter import *
from tkinter import message box
from PIL import ImageTk, Image
import sqlite3
import os
root = Tk ()
root. Geometry ('1366x768')
root. Title ("Convolutional Neural Network Based BrainTumor Detection using MRI
Images")
canv = Canvas (root, width=1366, height=768, bg='white')
canv. Grid (row=2, column=3)
img = Image. Open ('back.png')
photo = ImageTk.PhotoImage(img)
canv. create image (1,1, anchor=NW, image=photo)
def reading ():
os. System ('python Tumormain.py')
def rdata ():
os. System ('python loaddataset.py')
def pre ():
os. System ('python preprocess.py')
def clf ():
os. System ('python ML.py')
Button (root, text='Detect Brain Tumour', width=23, bg='yellow', fg='black’, font= ("bold",
10), command=readimg). place (x=100, y=200)
Button (root, text='Read Dataset', width=23, bg='yellow', fg='black’, font=("bold", 10),
command=rdata).place(x=100, y=250)
Button (root, text='Preprocessing', width=23, bg='yellow', fg='black’, font=("bold", 10),
command=pre). place (x=100, y=300)
Button (root, text='Classification', width=23, bg='yellow', fg='black', font=("bold",
10)command=clf).place(x=100, y=350)
root. Mainloop ()

Readimg.py
import sqlite3
import sys
import matplotlib as plt
from tkinter import *
from tkinter import ttk
import tkinter. file dialog
from tkinter. file dialog import askopenfilename # Open dialog box
from PIL import Image, ImageTk
import cv2, time
def open_File ():
filename = askopenfilename (filetypes= [("images","*. *")])
img = cv2.imread(filename)
conn = sqlite3.connect('Form. dB')
cursor = conn. cursor ()
cursor. Execute ('delete from imgsave')
cursor. Execute ('INSERT INTO imgsave (img) VALUES(?)’, (filename,))
conn. commit ()
cv2.imshow("X-Ray", img) # I used cv2 to show image
cv2.waitKey(0)
# filename. Close ()
rw = Tk () # Create window
rw. Geometry ('1366x768')
rw. Title ("X-Ray")
canv = Canvas (rw, width=1366, height=768, bg='white')
canv. Grid (row=2, column=3)
img = Image. Open ('back.png')
photo = ImageTk.PhotoImage(img)
canv. create image (1,1, anchor=NW, image=photo)
Label (rw, text='Select Image', width=14, bg='white', fg='red’, font= ("bold", 10)). place
(x=500, y=400)
Button (rw, text='Browse Image', width=14, bg='brown', fg='white', command=open_File,
font= ("bold", 10)). place (x=650, y=400)
rw. Mainloop ()
6.2 SCREEN SHOTS

Figure 1. Main
Figure 2. Read dataset

Figure 10. Tumor detection

Figure 11. View tumor region


Figure 12. Classification of patient
7. SOFTWARE TESTING

7.1 TESTING STRATEGIES

Some testing strategies for brain tumor detection using image processing include:
1. Functional Testing: Verify that each component or module performs its intended function
correctly, such as image enhancement, segmentation, feature extraction, classification, and
localization.
2. Integration Testing: Test the interactions and integration between different components to
ensure they work seamlessly together and produce accurate results.
3. Performance Testing: Assess the system's performance in terms of processing speed,
memory usage, and response time to ensure it meets the performance requirements.
4. Validation Testing: Validate the system's accuracy by comparing the detected tumors with
ground truth data to ensure correct identification and classification.

5. Usability Testing: Evaluate the system's user-friendliness, such as the ease of use, interface
design, and overall user experience.

7.2 LEVEL OF TESTING


7.2.1 UNIT TESTING

In unit testing for brain tumor detection using image processing, individual units or modules
of the system are tested independently to ensure their correctness and functionality. This
involves testing each component or algorithm in isolation, providing inputs and verifying the
expected outputs. The goal is to identify any bugs, errors, or unexpected behaviors at the unit
level and ensure that each unit performs its intended function accurately.

7.2.2 INTEGRATION TESTING

In integration testing for brain tumor detection using image processing, the focus is on testing
the interactions and integration between different components or modules of the system. This
involves ensuring that the various image processing techniques and algorithms work
seamlessly together, that data is correctly passed between different components, and that the
system as a whole function as intended. The goal is to identify and address any issues or
inconsistencies that may arise during the integration process to ensure a robust and reliable
system.

7.2.3 SYSTEM TESTING

In system testing for brain tumor detection using image processing, the entire system is tested
to ensure its overall functionality, integration, and performance. This involves testing the
different components, such as image enhancement, segmentation, feature extraction,
classification, localization, and post-processing, as well as their interactions and the overall
flow of the system. The goal is to validate that the system accurately detects brain tumors,
produces reliable results, and meets the specified requirements.

7.2.4 VALIDATION TESTING

In validation testing for brain tumor detection using image processing, the system is tested to
ensure it accurately detects and classifies brain tumors. This involves verifying that the image
processing techniques correctly enhance the images, segment the tumor regions accurately,
extract relevant features, classify tumors correctly, localize tumors in the original image,
apply post-processing techniques effectively, and compare the results with ground truth data
to evaluate the system's performance.

7.3 TEST CASES

Test Form Description Expected Actual


Number Result Result
1 Pre-processing Apply image Enhanced Enhanced
enhancement image with image with
techniques. improved tumor improved tumor
viability visibility
2 Segmentation Segment tumor Segment tumor Segment tumor
region region region
3 Feature Extract tumor Extract features Extracted
Extraction features for tumour class features for
classification tumor
classification
4 Classification Classify tumor as Correct Correct
begin or classification classification
malignant result
5 Localization Locate tumor in Accurate tumor Accurate tumor
the original localization localization
image

7.4 TEST RESULTS

Figure 13. Model Accuracy

Logistic Regression : 0.9824561403508771


Decision Tree : 0.9415204678362573
Random Forest: 0.9532163742690059
SVM: 0.9766081871345029
Model accuracy

8. CONCLUSION
In conclusion, the application of image processing techniques for brain tumor detection offers
significant potential for improving diagnostic accuracy, treatment planning, and patient
outcomes. By leveraging advanced algorithms and computational methods, image processing
enables automated and objective analysis of medical images, reducing reliance on subjective
interpretation. The implementation of brain tumor detection involves image acquisition and
preprocessing, feature extraction, segmentation, classification, post-processing, and
evaluation. These steps collectively contribute to the accurate identification and localization
of brain tumors, allowing for timely interventions and personalized treatment plans. While
challenges such as image variability, segmentation accuracy, and algorithm robustness
persist, ongoing research and advancements in image processing continue to address these
limitations. Future directions may involve the integration of machine learning and deep
learning techniques for enhanced detection and classification, as well as the development of
standardized protocols and validation studies to ensure the reliability and generalizability of
the implemented systems. Ultimately, the utilization of image processing in brain tumor
detection holds great promise for improving neuroimaging practices and advancing the field
of brain tumor management.
9. FUTURE ENHANCEMENT

1. Integration of multi-modal imaging: Incorporating multiple imaging modalities, such as


MRI, CT, and PET scans, can provide complementary information about brain tumours.
Future enhancements could focus on developing image processing techniques that
effectively integrate and analyse data from multiple modalities, improving the accuracy
and reliability of tumour detection.
2. Deep learning-based approaches: Deep learning algorithms, such as convolutional
neural networks (CNNs) and recurrent neural networks (RNNs), have shown remarkable
success in various image analysis tasks. Future enhancements could explore the
application of deep learning architectures for brain tumour detection, enabling more
accurate and automated detection and classification of tumours.
3. Real-time and interactive systems: Developing real-time and interactive image
processing systems can enable radiologists and clinicians to visualize and manipulate
medical images in real-time, aiding in on-the-fly analysis and decision-making. Such
systems can also incorporate feedback mechanisms, allowing users to provide input and
refine the detection process.
4. Integration of clinical data: Integrating clinical data, such as patient history, genetic
information, and treatment response, with image processing techniques can enhance the
accuracy and personalized nature of tumour detection. Future enhancements could
explore methods to incorporate clinical data into the image processing pipeline for
improved tumour characterization and treatment planning.
5. Explain ability and interpretability: As image processing techniques become more
complex, it becomes crucial to develop methods that provide explanations and
justifications for the decisions made by the algorithms. Future enhancements could
focus on developing explainable AI techniques that provide insights into the features
and patterns used by the algorithms to detect and classify brain tumours.
6. Validation and benchmarking: Conducting rigorous validation studies and creating
benchmark datasets are essential for evaluating the performance of different image
processing techniques. Future enhancements could involve the development of
standardized datasets and evaluation protocols, facilitating fair comparisons between
different algorithms and promoting reproducibility in the field of brain tumor detection
using image processing techniques.

BIBLIOGRAPHY

[1] H. Mohsen, E.-S. A. El-Dahshan, E.-S. M. El-Horbaty and A.-B. M. Salem,


“Classification using deep learning neural networks for brain tumors,” Future Computing and
Informatics Journal, pp. 68-71, 2018
[2] H. B. Menze, A. Jakab, S. Bauer, K. Farahani and K. Justin, “The Multimodal Brain
Tumor Image Segmentation Benchmark,” IEEE Transactions on Medical Imaging, pp.
1993-2024, 2014. Manav Sharma, Pramanshu Sharma, Ritik Mittal, Kamakshi Gupta Journal
of Electronics and Informatics, December 2021, Volume 3, Issue 4 307
[3] S. Huda, J. Yearwood, H. F. Jelinek, M. M. Hassan, G. Fortino and M. Buckland, “A
hybrid feature selection with ensemble classification for Imbalanced Healthcare Data: A case
study for brain tumor diagnosis,” IEEE Access, pp. 9145-9154, 2016.
[4] J. Seetha and S. S. Raja, “Brain tumor classification using Convolutional Neural
Networks,” Biomedical and Pharmacology Journal, pp. 1457-1461, 2018.
[5] P. Meena and V. Janani, “IMAGE SEGMENTATION FOR TUMOR DETECTION,” A
Monthly Journal of Computer Science and Information Technology, pp. 244-248, 2013.
[6] Sakshi Ahuja, B.K Panigrahi, and Tapan Gandhi, “Transfer Learning Based Brain Tumor
Detection and Segmentation using Superpixel Tech- nique ,” in International Conference on
Contemporary Computing and Applications, IEEE, 2020.
[7] Hajar Cherguif, Jamal Riffi, Mohamed Adnane Mahrez, Ali Yahaouy, and Hamid Tairi,
“Brain Tumor Segmentation Based on Deep Learn- ing,” in International Conference on
Intelligent Systems and Advanced Computing Sciences (ISACS), IEEE, 2019.
[8] Chirodip Lodh Choudhary, Chandrakanta Mahanty, Raghvendra Kumar, and Borjo
Kishore Mishra, “Brain Tumor Detection and Classification using Convolutional Neural
Network and Deep Neural Network,” in International Conference on Computer Science,
Engineering and Ap- plications (ICCSEA), IEEE, 2020.
[9] Ahmad Habbie Thias, Donny Danudirdjo, Abdullah Faqih Al Moubarak, Tati Erawati
Rajab, and Astri Handayani, “Brain Tumor Semi-automatic Segmentation on MRI
T1-weighted Images using Active Contour Mod- els,” in International Conference on
Mechatronics, Robotics and Systems Engineering (MoRSE), IEEEE, 2019.
[10] Neelum Noreen, Sellapan Palaniappam, Abdul Qayyum, Iftikhar Ah- mad, Muhammad
Imran, “Attention-Guided Version of 2D UNet for Automatic Brain Tumor Segmentation,”
IEEE Access, Volume: 8.
[11] Ms. Swati Jayade, D.T. Ingole, and Manik D.Ingole, “MRI Brain Tumor Classification
using Hybrid Classifier,” in International Conference on Innovative Trends and Advances in
Engineering and Technology, IEEEE, 2019.
[12] Zheshu Jia and Deyun Chen, “Brain Tumor Detection and Classification of MRI images
using Deep Neural Network,” in IEEE access, IEEE 2020.
[13] Sungheetha, Akey, and Rajesh Sharma. ”GTIKF-Gabor-Transform In- corporated
K-Means and Fuzzy C Means Clustering for Edge Detection in CT and MRI.” Journal of Soft
Computing Paradigm (JSCP) 2, no. 02 (2020): 111-119
[14] Pranian Afshar, Arash Mohammadi, and Konstantinos N.Plataniotis, “BayesCap: A
Bayesian Approach to Brain Tumor Classification Using Capsule Networks,” IEEE Signal
Processing Letters(Volume 27),2020.
[15] N. Abiwinanda, M. Hanif, S. T. Hesaputra, A. Handayani and T. R. Mengko, “Brain
tumour classification using Convolutional Neural Network,” IFMBE Proceedings,
pp. 183-189, 2018.

You might also like