Skip to content

ahkatlio/CNN-for-Brain-Tumor

Repository files navigation

Brain Tumor CNN

This project is a convolutional neural network (CNN) that classifies brain MRI images as either healthy or containing a brain tumor. The CNN is implemented using Keras with a TensorFlow backend.

Dataset

The dataset used in this project is the Brain MRI Images for Brain Tumor Detection dataset from Kaggle. The dataset contains 253 MRI images in JPEG format, with 155 images containing brain tumors and 98 images without tumors.

Model

The CNN model used in this project consists of five convolutional layers with ReLU activation, followed by max pooling layers and a fully connected layer with a softmax activation. The model is trained using the categorical cross-entropy loss function and the Adam optimizer.

Results

The model achieves an accuracy of 92% on the test set, with a precision of 92% and a recall of 92%.

The plots of accuracy and loss during the training process are shown below:

Plot

The confusion matrix for the test set is shown below:

Confusion Matrix

Here are 10 random images from the test set along with their predicted and true labels:

Random Images

Credits

This project was created by Abdullah Al Omar Galib. The dataset used in this project was obtained from Kaggle.

Versions

Versions of frameworks used in this code:

Framework Version
Python 3.11.5
Pandas 2.1.0
NumPy 1.23.5
Matplotlib 3.8.0
OpenCV 4.8.0
Keras 2.14.0
TensorFlow 2.14.0
Seaborn 0.12.2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published