This project addresses the problem of brain tumor classification from Magnetic Resonance Imaging (MRI) scans using deep learning techniques. The system is designed to provide accurate tumor detection from MRI data, highlighting the potential of deep learning in assisting medical diagnosis.
- Brain Tumor Classifier
- Project's Goal
- Dataset
- Technologies and Tools
- Fine-Tuning Process
- Project structure
- How to download
- Performance and Results
The primary goal of this project is to create a simple and efficient pipeline capable of fine-tuning a pre-trained convolutional neural network to solve a multi-class classification task. This system is designed to distinguish between healthy and pathological brain scans by including a "no tumor" class. The project aims to achieve good performance in classifying three types of brain tumors.
The dataset used in this work consists of 6000 MRI scans (Paper, site). The images cover four classes: glioma, pituitary, meningioma, and no tumor. To ensure the trained model generalizes well, the images are taken from three different perspectives or planes: Coronal, Sagittal, and Axial.
![]() |
![]() |
Images and their transformed version.
The project was developed in Python using the PyTorch library. For the classification task, a Deep Convolutional Neural Network called ResNet18 was adopted as the backbone architecture due to its efficiency in image recognition. ResNet18 is a Residual Network with 18 layers and contains 11.2 million parameters.
Since the dataset is not large enough to train the entire model from scratch, a technique called fine-tuning was used.
The fine-tuning technique consists of the following main steps:
-
Copy the values of the pre-trained parameters into the model.
-
Rework the last one or two layers of the model, for example, by changing the number of output neurons to match the four classes being considered.
-
Freeze the values of all parameters except for the ones added in the previous step.
-
Train the new layers only.
-
Un-freeze the previous layers and fine-tune and continue training.
Brain_Tumor_Classifier/
├── data/
│ └── … (datasets used for training-testing)
├── model/
│ └── … (model definitions, pretrained ResNet18 fine-tuned code)
├── utils/
│ └── … (utility functions, helpers for training, evaluation, data loading)
├── .gitignore # to ignore temporary files
├── README.md # main documentation of project
└── train_model_v1.ipynb # notebook for training-
Clone the repository
git clone https://github.com/Ultimi-Sumiti/Brain_Tumor_Classifier.git
-
Navigate into the project directory
cd Brain_Tumor_Classifier -
Install dependencie
pip install -r requirements.txt
The experiments demonstrated strong classification performance with an accuracy that confirmed the model's reliability across different views. The results highlight the potential of deep learning frameworks in medical diagnosis. State-of-the-art applications of similar frameworks in computer vision have shown that their performance can be more reliable than that of many doctors from a statistical point of view.
Below are the results from the experiments.
|
|
|
First training (all layers frozen except for the last one)
|
Fine tuning (no frozen layer)
|







