Final Major Project Report
Final Major Project Report
A
Major Project Report
Submitted in the partial fulfillment of the requirement for the award of
Bachelor of Engineering
In
Computer Science and Engineering
Submitted to
APRIL 2023
Samrat Ashok Technological Institute
Vidisha (M.P.)
Department of Computer Science & Engineering
CERTIFICATE
This is to certify that the Major Project entitled as “BRAIN TUMOR DETECTION” submitted
by Pragati Bisen, Om Patle, Pranay Patle, Prashant Patel, Enrolment No. 0108CS191076,
0108CS191075, 0108CS191077, 0108CS191078 in the partial fulfilment of the requirements for
the award of degree of Bachelor of Engineering in the specialization of Computer Science and
Engineering from Samrat Ashok Technological Institute, Vidisha (M.P.) is a record work
carried out by him under my supervision and guidance. The matter presented in this report has
not been presented by him elsewhere for any other degree or diploma.
“We, Pragati Bisen, Om Patle, Pranay Patle, Prashant Patel Enrollment No.
(0108CS191076, 0108CS191075, 0108CS191077, 0108CS191078) hereby declare that the
work which is being presented in the Major Project entitled Brain Tumor Detection Using
Convolutional Neural Network submitted in partial fulfillment of the requirement for the award
of the degree of Bachelor of Engineering in Computer Science and Engineering. The work
has been carried at Samrat Ashok Technological Institute, Vidisha is an authentic record of
my own work carried out under the guidance of Prof Shaila Chugh (Assistant Professor,
Department of Computer Science & Engineering), Samrat Ashok Technological Institute,
Vidisha (M.P).
The matter embodied in this report has not been submitted by me for the award of any other
degree or diploma.
Date:
I would like to express my deepest appreciation and gratitude to all the people who have
supported and contributed to the completion of this project.
Firstly, I would like to thank my project guide Prof. Shaila Chugh ma’am for her invaluable
guidance, patience and encouragement throughout the project. She has played a pivotal role in
successful completion of my project by guiding me at each step and , correcting the mistakes,
helping me improve my project. Without her expertise and assistance project would not be
possible.
I would also like to thank my project coordinator Prof. Usha Tigga ma’am for constant support
and encouragement and helping me do things with time.
I would also like to thank my HOD professor Kanak Saxena ma’am for her constant guidance
and support which has been instrumental in shaping my career.
I would also like to extend my thanks to Dr. R.K. Pandit sir, our director, for providing me with
the opportunity to undertake this project and for inspiring and motivating me throughout my
academic journey.
Lastly, I am grateful for the support and assistance provided by the departmental staff, who have
created a conducive learning environment that has enabled me to grow both personally and
academically.
I would like to express my heartfelt appreciation to all those who have supported me in various
ways, both big and small, and have contributed to the successful completion of this project.
Thank you all for your invaluable encouragement and support.
Brain tumors are among the most common and aggressive forms of cancer that affect humans.
Early detection and diagnosis of brain tumors are crucial for effective treatment and management
of the disease. In recent years, deep learning techniques, particularly convolutional neural
networks (CNNs), have shown promising results in the detection and diagnosis of various types
of cancers, including brain tumors.
In this study, we propose a CNN-based model for the detection of brain tumors in MRI scans.
The model is trained on a dataset comprising of brain MRI scans of patients with and without
tumors. The proposed model consists of several layers of convolutional and pooling operations
followed by a dense layer for classification. The input images are preprocessed and resized to a
uniform size of (224 x 224 x 3) before being fed into the model.
The results obtained from the model show a high accuracy in classifying the presence of tumors
in brain MRI scans. The model also shows good generalization performance on an independent
test set, indicating its potential usefulness in clinical practice.
Overall, the proposed CNN-based model shows promise as a tool for assisting radiologists in the
detection of brain tumours, which can help in the early diagnosis and treatment of brain cancer.
The model can also be adapted and extended for the detection and diagnosis of other types of
cancers and medical conditions.
1. Introduction
Cancer is a critical health concern that poses a significant challenge to humanity. It is the second
leading cause of death after cardiovascular disorders, with every sixth death attributed to cancer.
Brain tumours, due to their aggressive nature, low survival rate, and heterogeneous
characteristics, are the most dangerous and deadly among different types of cancer. Brain
tumours have various forms based on their location, shape, and texture, such as meningioma,
glioma, pituitary, acoustic neuroma, and lymphoma. The incidence of brain tumor is highest for
glioma (45%), followed by meningioma (15%) and pituitary tumours (15%).
Proper diagnosis of the tumor type is vital in predicting patient survival and deciding on
treatments that range from surgery to chemotherapy and radiotherapy. Magnetic resonance
imaging (MRI) is a high-precision medical imaging technique used for cancer detection and
diagnosis, producing clear images of the body's internal organs in 2D and 3D formats without
causing pain or requiring surgery.
However, identifying the tumor type through MRI is time-consuming, difficult, and error-prone,
requiring highly experienced radiologists. Due to the tumor diversity and the lack of visible
features in MRI images, human-based manual diagnoses can be unreliable. Additionally,
underdiagnosis of brain tumor can reduce the response to treatments and the survival rate.
Therefore, the use of artificial intelligence (AI) techniques, such as computer-aided diagnosis
(CAD) systems, has become essential in diagnosing medical images, such as MRI images.
The CAD system involves various stages, such as the pre-processing phase, where noise is
removed from images, the segmentation stage, where the lesion area is identified and isolated
from the rest of the images, the feature extraction stage, where the most important features
representing the tumor are extracted, and the classification stage, where each image is classified,
and abnormality is predicted. Many machine learning algorithms have been used to classify MRI
images, but recently, deep learning techniques, which do not require manual features, have
gained significant popularity for diagnosing MRI images.
In conclusion, the proper diagnosis of brain tumors is essential in planning treatments and
monitoring patients' conditions, and the use of AI techniques, such as deep learning models, can
significantly aid radiologists in accurately diagnosing MRI images.
This project aims to develop a CNN-based model for the classification of MRI Images into
tumorous and non-tumorous.The proposed model consists of a deep convolutional neural
network (CNN) architecture.
The model involves several stages, including the preprocessing phase where noise is removed
from the images, the segmentation stage where the lesion area is identified and isolated, the
feature extraction stage where the most important features are extracted, and the classification
stage where each image is classified and abnormality is predicted.
The project aims to develop a CAD system that can accurately classify brain MRI images as
tumorous or non-tumorous using a deep CNN architecture. The successful development of this
system can have a significant impact on the early detection and treatment of brain tumors.
The forthcoming chapters of this report will provide a detailed description of the methodology
used in this project, including data collection and pre-processing, feature selection, and model
development. The results of the project will be presented and discussed, followed by a
conclusion and recommendations for future research.
1.1 Dataset :
The dataset contains two folders: yes and no which contain 253 brain MRI images. The folder
yes contains 155 Brain MRI Images that are tumorous and the folder no contains 98 Brain MRI
Images that are non-tumorous.
Since this is a small dataset, there wasn't enough examples to train the neural network. Also, data
augmentation was useful in tackling the data imbalance issue in the data.
Developing a machine learning-based brain tumor detection model is a challenging task that
requires overcoming several obstacles. Some of the major obstacles that we faced during our
works are: -
1) One of the most significant hurdles is the limited amount of data available for training the
model, which can result in overfitting and prevent the model from generalizing well. We
used data augmentation to overcome this problem.
2) The class imbalance problem is another challenge, where the number of positive cases is
often much lower than negative cases, leading to inaccurate detection.
3) The class imbalance problem is another challenge, where the number of positive cases is
often much lower than negative cases, leading to inaccurate detection.
4) To avoid overfitting, the model's complexity must be optimized by experimenting with
different architectures and training strategies
5) Lastly, interpretability is a challenge as it is difficult to understand how the model is
making its predictions
Overall, developing an accurate and reliable brain tumor detection model requires careful
consideration of these challenges to provide clinicians with a valuable tool in their efforts to
improve patient outcomes.
2.2 Techniques for developing Brain Tumor Model: -
Several techniques have been developed for brain tumor detection using machine learning
models. Here are some of the commonly used techniques:
1. Convolutional Neural Networks (CNN): CNN is a popular technique used for image
classification, including brain tumor detection. It involves learning a set of features
directly from the images through the convolution operation.
2. Transfer Learning: Transfer learning involves reusing pre-trained models to develop a
new model for a specific task. This technique has been used successfully for brain tumor
detection.
3. Support Vector Machines (SVM): SVM is a supervised learning algorithm that can be
used for classification tasks. It has been used to classify brain tumor images by extracting
image features and training the SVM model.
4. Deep Belief Networks (DBN): DBN is a type of artificial neural network that has been
used for brain tumor detection. It can automatically learn hierarchical representations of
the input data.
5. Random Forest: Random Forest is an ensemble learning algorithm that uses decision
trees to classify input data. It has been used for feature selection and classification in brain
tumor detection.
6. Autoencoder: An autoencoder is a neural network that can learn a compressed
representation of the input data. It has been used for brain tumor detection to reduce the
dimensionality of the input data and improve model performance.
These techniques have been used to develop accurate and reliable models for brain tumor
detection, each with its strengths and weaknesses. The selection of the appropriate technique
depends on the available data, the complexity of the problem, and the desired accuracy and
interpretability of the model.
Table 2.1: Pros and cons of some commonly used techniques
CNN Can learn complex Requires large amounts of Image classification tasks, including brain
features directly data, computationally tumor detection
from images, high expensive
accuracy
Transfer Can leverage pre- Limited to the capabilities Brain tumor detection using limited data,
Learning trained models, of pre-trained models, transfer learning between different
requires less data may not generalize well to modalities
and time, improved different datasets
accuracy
SVM Good accuracy, May not perform well Binary classification tasks, including
can handle high- with imbalanced datasets, brain tumor detection
dimensional data, computationally
easy to interpret expensive
DBN Can automatically Requires large amounts of Image classification tasks, including brain
learn hierarchical data, computationally tumor detection
representations of expensive
the input data,
good performance
on large datasets
Random Can handle high- May not generalize well Image classification tasks, including brain
Forest dimensional data, to different datasets, may tumor detection
feature selection, overfit with noisy data
computationally
efficient
Autoencoder Can reduce Requires large amounts of Image classification tasks, including brain
dimensionality and data for training, may not tumor detection
noise, better generalize well to
performance with different datasets
limited data
3. PROBLEM STATEMENT
Brain tumor is a life-threatening medical condition that requires early detection and treatment. It
is a complex and challenging task for medical professionals to accurately detect brain tumors
from MRI scans due to the variation in the size, location, and shape of the tumor. Early detection
of brain tumors can significantly increase the chances of successful treatment, making it crucial
to develop a reliable and efficient brain tumor detection system.
The traditional method of detecting brain tumors is through manual inspection of MRI scans by
experienced radiologists. However, this process is time-consuming and prone to human errors,
leading to a delay in diagnosis and treatment.
To overcome these limitations, the use of machine learning techniques in brain tumor detection
has gained significant attention in recent years. Machine learning algorithms can be trained using
a large dataset of MRI scans to accurately detect brain tumors with high accuracy and efficiency.
The algorithm can also learn to identify subtle differences in MRI scans, which may not be
noticeable to the human eye.
The aim of this project is to develop a machine learning algorithm for brain tumor detection
using MRI scans. The project involves the following steps:
Preprocessing of the MRI scans: The MRI scans will be preprocessed to remove noise, artifacts,
and other unwanted features. This step is critical in improving the image quality and enhancing
the tumor's visibility in the MRI scans.
Feature extraction: The preprocessed MRI scans will be analyzed to extract relevant features that
capture the essential information needed for tumor detection. Various techniques such as wavelet
transform, Fourier transform, and principal component analysis can be used for feature
extraction.
Training of the machine learning algorithm: The extracted features will be used to train a
machine learning algorithm such as a neural network or support vector machine. The algorithm
will be trained using a dataset of labeled MRI scans to learn the patterns and characteristics of
brain tumors.
Testing and validation: The trained algorithm will be tested and validated on new MRI scans to
evaluate its accuracy and performance. The testing and validation phase is critical in ensuring the
algorithm's reliability and efficiency in detecting brain tumors.
The outcome of this project will be a reliable and efficient brain tumor detection system that can
assist medical professionals in early diagnosis and treatment planning. This project can
potentially have a significant impact on patient outcomes and healthcare costs.
4. Proposed work
The input shape of the model is a tuple with dimensions (240, 240, 3), which represents the
width, height, and number of channels of the image, respectively. The model takes an input
placeholder as a tensor with the defined input shape.
The first layer in the model architecture is a zero-padding layer that pads the input with zeroes.
The padding size is set to (2,2) resulting in an output shape of (?, 244, 244, 3).
This is followed by a convolutional layer with 32 filters, each with a size of (7, 7). The layer has
a stride of (1, 1) and is followed by batch normalization and Relu activation. The resulting output
shape is (?, 238, 238, 32).
The next layer is a max pooling layer with a pool size of (4, 4), resulting in an output shape of (?,
59, 59, 32). This is followed by another max pooling layer with the same pool size, resulting in
an output shape of (?, 14, 14, 32).
The output from the max pooling layer is flattened and passed through a dense layer with one
output unit and sigmoid activation, representing the binary classification for tumor detection. The
resulting output shape is (?, 1).
Here the ‘?’ represents the batch size in keras, as the batch size is typically not fixed, but rather
determined at runtime based on the number of samples being processed in each batch during
training or evaluation.
The model is compiled using the Adam optimizer with binary cross-entropy loss and accuracy as
the evaluation metric.
The proposed CNN model has shown promising results in the detection of brain tumors in
previous studies. In comparison to traditional machine learning models,CNNs have demonstrated
superior performance in identifying complex features in medical images. This model can be used
as a tool to aid physicians in the detection of brain tumors in medical imaging.
Figure 4.1 : Summary of model
Training Data:
Validation Data:
Testing Data:
F1 score: 0.8829431438127091
Conclusion: -
Now the model detects brain tumors with: -
Brain tumor detection using convolutional neural network (CNN) is a critical research area that
has the potential to significantly improve the diagnosis of brain tumors. Our major project in
college aimed to investigate the effectiveness of using CNN for brain tumor detection.
Our project involved collecting a dataset of magnetic resonance images (MRIs) of the brain,
including both normal brain tissue and brain tumors. We preprocessed the dataset by cropping
and resizing the images to a standard size and normalizing the pixel values. We then trained a
CNN model on the preprocessed dataset using Keras, a deep learning library.
We evaluated the performance of the model on a separate test dataset, which was not used during
the training phase. Our results showed that the CNN model achieved an accuracy of over 90%,
which is a promising result for brain tumor detection. Moreover, the model demonstrated high
precision, recall, and F1 score values, which are important metrics for evaluating the
performance of a classification model.
To further evaluate the performance of our model, we plotted the receiver operating
characteristic (ROC) curve and calculated the area under the curve (AUC) score. The ROC curve
is a graphical representation of the trade-off between sensitivity and specificity, and the AUC
score is a measure of the model's ability to distinguish between positive and negative cases. Our
results showed that the CNN model achieved a good balance between sensitivity and specificity,
as indicated by the high AUC score.
We also compared the performance of our proposed CNN model with other state-of-the-art
models for brain tumor detection. Our comparative analysis showed that the CNN model
outperformed the other models in terms of accuracy, demonstrating its potential as an effective
diagnostic tool.
In conclusion, our project presents a promising approach to brain tumor detection using deep
learning techniques. The results demonstrate the effectiveness of using CNN for brain tumor
detection and its potential as an effective clinical tool for aiding radiologists in the diagnosis of
brain tumors. Our project provides a foundation for further research in this area, which could
lead to the development of more accurate and efficient diagnostic tools for brain tumors. Overall,
we believe that our project contributes to the advancement of the field of medical imaging and
has the potential to improve patient outcomes.
Reference :-
DOI: https://doi.org/10.1155/2022/8330833
3) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7087133/
4) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7087133/
5) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7087133/