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.
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.
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.
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:
The confusion matrix for the test set is shown below:
Here are 10 random images from the test set along with their predicted and true labels:
This project was created by Abdullah Al Omar Galib. The dataset used in this project was obtained from Kaggle.
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 |