Classifying brain tumor images using a pre-trained deep learning model. The app allows users to upload MRI images and predicts the type of brain tumor present in the image.
The model is trained on the Brain Tumor MRI Datasetwhich consist of 7023 images of human brain MRI images which are classified into 4 classes: glioma - meningioma - no tumor and pituitary.
The neural network was developed using nada_ai
from Nillion and was trained to meet size constraints while maintaining robust performance metrics:
Precision | Recall | F1-Score | Support | |
---|---|---|---|---|
Glioma | 0.99 | 0.97 | 0.98 | 300 |
Meningioma | 0.97 | 0.97 | 0.97 | 306 |
No Tumor | 0.99 | 1.00 | 0.99 | 405 |
Pituitary | 0.99 | 1.00 | 0.99 | 300 |
Accuracy | 0.99 | 1311 | ||
Macro Avg | 0.99 | 0.98 | 0.98 | 1311 |
Weighted Avg | 0.99 | 0.99 | 0.99 | 1311 |
Test Accuracy: 98.55%
In order to host the model on Nillion one must run the provider.ipynb notebook.
The model is hosted on the Nillion testnet, and we employ a Streamlit webapp allowing users to upload a brain tumor image and quickly receive a prediction. The service is currently free, with transaction costs on the testnet covered by our wallet.
To use the prediction service, please follow the isntruction on the next step:
- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate
- Install all the required library by:
pip install -r requirements.txt
- Create an .env file according to
https://docs.nillion.com/network-configuration
and place it inside/nillion/quickstart/nada_quickstart_programs
- Run the streamlit platfor with:
Streamlit run main.py
- Upload an image of a MRI
- Receive your prediction.
The image is processed privately without being stored on any server, ensuring user data remains confidential.