- Overview
- Features
- Installation
- Usage
- Modules
- Running the Classifier
- Technologies
- Contributing
- License
- Contact
BTI is a high-accuracy (99.3%) brain tumor detection, classification, and diagnosis system using state-of-the-art deep learning methods. This project leverages powerful neural networks to analyze MRI scans and predict the presence and type of brain tumors, assisting in timely diagnosis and treatment planning.
The dataset used contains 3064 T1-weighted contrast-enhanced images from 233 patients with three kinds of brain tumors:
- Meningioma: 708 slices
- Glioma: 1426 slices
- Pituitary Tumor: 930 slices
- High Accuracy: Achieves 99.3% accuracy in brain tumor detection and classification.
- Deep Learning: Utilizes advanced deep learning techniques for image analysis.
- Comprehensive Diagnosis: Provides detailed classification of tumor types for better diagnosis.
- Clone the repository:
git clone https://github.com/garbhitsh/bti.git
- Navigate to the project directory:
cd bti
- Install dependencies:
pip install -r requirements.txt
Predict using the trained model:
bash python predict.py --image_path [path_to_image]
- brain_tumor_dataset_preparation.ipynb - An IPython notebook that contains preparation and preprocessing of the dataset for training, validation, and testing.
- torch_brain_tumor_classifier.ipynb - An IPython notebook that contains all the steps, processes, and results of training, validating, and testing our brain tumor classifier.
- test.py - A Python script that accepts a path to an image as input, which then classifies the image into one of the three classes.
- deploy.py - A Python script integrated with a Flask server that starts the web interface on a local server where users can upload MRI images of the brain and get classification results.
Note: We have included a few images for testing under the test_images directory.
-
Download the classifier model
.pt
file from this drive link and place it in a folder namedmodels
in the same directory where the files of this repository are present. -
Before running the programs, kindly install the requirements as given in the Installation section of this README.
-
Use the test.py script to classify an image via the terminal:
python test.py
-
Use deploy.py to access the classifier as an interactive web interface:
python deploy.py
- Numpy - For linear algebra operations
- Torch - PyTorch Deep Learning Framework
- OS - To use Operating System methods
- Random - To set random seed for reproducibility
- Pandas - For DataFrame creation and CSV handling
- Time - For date-time operations
- Seaborn - For sophisticated visualizations
- Pickle - For saving and loading binary files of training data
- Scikit-Learn - For evaluating the classifier and cross-validation split
- Matplotlib - For visualizing images, losses, and accuracy
- Google Colab Drive - For storage and loading operations on Google Colab
Contributions are welcome! Please fork the repository and submit a pull request for review.
- Fork the project.
- Create your feature branch:
git checkout -b feature/YourFeatureName
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/YourFeatureName
- Open a pull request.
This project is licensed under the MIT License