Home

Brain Tumor Detection Using Deep Learning (CNN)

Author: Famous Ghanyo Tay

A brain tumor is an abnormal growth of tissue in the brain or central spine that can disrupt proper brain function. It is the abnormal growth of tissues in brain. If the tumor originates in the brain, it is called a primary brain tumor. Primary brain tumors can be benign or malignant. Benign brain tumors are not cancerous.

Project Scope

The Brain Tumor Detection Project is an artificial intelligence project designed to detect the presence of brain tumors in medical images such as MRI scans. This project utilizes deep learning techniques to analyze the images and classify them as either having a tumor or being tumor-free.

Brain

Dataset

The data for this project is available at kaggle. The dataset contains 3 folders, "Yes", "No", and "Pred" which contains 3060 Brain MRI Images.

Folder Description
Yes It has 1500 Brain MRI Images that are tumorous
No It has 1500 Brain MRI Images that are non-tumorous
Pred It has a mixture of 60 Brain MRI Images for prediction

Requirements

The Network Architecture

Architecture

Network Description

Model Evaluation

The model's performance was evaluated alongside Support Vector Machine Model trained initially. Some of the metrics used include:

ROC Curve

CNN Model

CNN ROC Curve

SVM Model

SVM ROC Curve

As seen above, the CNN model achieved an AUC of 0.98, indicating excellent performance in distinguishing between positive and negative cases in brain tumor detection. On the other hand, the SVM model achieved an AUC of 0.97, which is slightly lower but still indicates a strong discriminatory ability. Considering the AUC values alone, the CNN model appears to perform marginally better than the SVM model.

Confusion Matrix

CNN Model

CNN Confusion Matrix

SVM Model

SVM Confusion Matrix

Based on the plots of the confusion matrix, the CNN model shows higher true positive and true negative values compared to the SVM model. This suggests that the CNN model has better accuracy in correctly predicting both the presence and absence of tumors.

Training Time

The CNN model outperformed the SVM model in terms of training time, taking approximately 55 seconds compared to the SVM model's 449 seconds. This can be attributed to the CNN's specialized architecture for image analysis tasks like brain tumor detection, while the SVM's optimization process and support vector complexity contributed to its longer training time. The CNN's faster training time offers advantages for dealing with large datasets and situations where quick model training is desired. Overall, the CNN model demonstrated a notable advantage over the SVM model in terms of training efficiency.

CNN Model Testing With Unseen Data

The model was tested with 60 new MRI Brain images and the model performed very well. I displaced 20 of them as can be seen below.

Prediction Image

Demonstration

Click here to view the notebook on nbviewer

Link to Github Repo