In this project, we developed an application for brain tumour classification based on histopathological data. We utilize the Digital Brain Tumour Atlas dataset, which contains information about a variety of tumour types. The project includes data preprocessing, analysis, implementation of interpretability methods, the entire Godot code used for the frontend as well as the backend flask server.
This project used Conda to manage the environment. Get it here.
You can create a new conda environment with the following command:
conda env create -f environment.yml
Activate using
conda activate brain-tumour-classification
If you have issues installing the environment, try installing the failed packages manually using pip.
Here's a brief overview of the important files/folders:
application/
: Contains the Godot frontend project, providing a user interface for image upload and classification result display.
finetuning/
: This directory contains helper classes used for the VGG16 finetuning on our data.
Data analysis.ipynb
: This Jupyter notebook is used for performing an exploratory data analysis on the preprocessed data, and training a convolutional neural network to classify tumor types.
Data preprocessing.ipynb
: This Jupyter notebook is used for loading the annotation data, defining a script for downloading the histopathological data, and preprocessing it.
Model_Interpretability.ipynb
: A notebook for visualizing key image areas used by the VGG16 model for predictions using techniques like Grad-CAM.
Tensorboard_runs_analysis.ipynb
: Notebook for examining the model's performance during training using the data recorded with tensorboard.
VGG16 Training.ipynb
: This notebook trains a VGG16 model on our dataset.
annotation.csv
: This CSV file contains metadata about the patients and tumors.
processed/
: This directory contains the processed histopathological data.
flask_server.py
: A Python script that sets up a Flask server, creating an API for the VGG16 model. Users can submit images for classification.
send_img.py
: A Python script for testing the API by sending test.png to it and saving the result in the /results directory.
For more information, including usage guide for the application and model card, please visit the wiki!
The executable for the frontend can be downloaded from here.
To download and process the data, you need to get an authorization token. To get it, first request access to the dataset. Then inspect the network traffic in the browser (F12 for Chrome) and search for the header Authorization
. You can then insert the token value into the corresponding variable in Data preprocessing.ipynb
.
To get preprocessed data at various sizes (256x256, 512x512, 1024x1024, 2048x2048), visit: https://1drv.ms/f/s!Anworwr0CwTdgeZTf9tN6CZCkzE39Q?e=S5YkaE
The VGG-16 models, one pretrained on ImageNet and one trained from scratch can be found here.