Following are the main contents to follow, you can jump to any section:
Brain tumor detection is a critical task in the field of medical imaging, as it plays a crucial role in diagnosing and treating brain tumors, which can be life-threatening. With the advancement of machine learning and artificial intelligence (AI), vision AI has emerged as a promising approach for accurate and efficient brain tumor detection from medical images. In this project, we aim to develop a vision AI system for brain tumor detection using a level 2 MLOps (Machine Learning Operations) architecture, which includes a robust dvc (Data Version Control) pipeline and a Docker image for seamless production deployment.
MLOps, also known as DevOps for machine learning, is an iterative and collaborative approach that integrates machine learning models into the software development process, ensuring the reliability, scalability, and maintainability of ML models in production. Level 2 MLOps architecture focuses on advanced versioning and reproducibility, ensuring that the ML pipeline is well-documented and can be easily replicated in different environments.
The ultimate goal of our vision AI project is to develop a robust and scalable brain tumor detection system that can be easily deployed in production environments. By leveraging the level 2 MLOps architecture. It will help to minimize the healthcare operational cost and increase the effectiveness of the services by assisting the healthcare provider in accurate decision-making.
Complete Project Data Pipeline is available at DagsHub Data Pipeline
Dataset : Brain Tumor MRI Dataset Jupyter Notebooks : Model Traninig Notebooks
The sample images of Glioma, Meningioma, Pituitary and Normal patients are shown in figure below:
Dataset Name : Brain Tumor MRI Dataset (Glioma vs Meningioma vs Pituitary vs Normal) Number of Class : 4 Number/Size of Images : Total : 7023 (151 MB) Training : 5712 Testing : 1311
We have achieved following results with DenseNet121 model for detection of Glioma, Meningioma, Pituitary and Normal patients from Brain MRI images.
Performance Metrics Test Accuracy : 98.9% Precision : 99.00% Sensitivity (Glioma) : 100% Sensitivity (Meningioma) : 99% Sensitivity (Pituitary) : 100% Sensitivity (Normal) : 99% F1-score : 99.00% AUC : 1.0
1. Python 2. Data Version Control (DVC) 3. Docker 4. Machine learning algorithms 5. MLFlow 6. Cloud Computing 7. SMTP Server
1. DockerHub 2. Google Cloud Storage (GCS) 3. Google Artifact Registry 4. GitHub 5. DaghsHub 6. CircleCI 7. Google App Engine
-
Ensure you have Python 3.7+ installed.
conda create -n venv python=3.10
conda activate venv
OR
- Create a new Python virtual environment with pip:
virtualenv venv
source venv/Scripts/activate
Install dependencies
pip install -r requirements.txt
Clone the project
git clone https://github.com/Hassi34/brain-tumor-classification.git
Go to the project directory
cd brain-tumor-classification
# MLFlow
MLFLOW_TRACKING_URI=""
MLFLOW_TRACKING_USERNAME=""
MLFLOW_TRACKING_PASSWORD=""
#DockerHub
DOCKERHUB_ACCESS_TOKEN=""
DOCKERHUB_USERNAME=""
#GCP
JSON_DCRYPT_KEY=""
GCLOUD_SERVICE_KEY=""
CLOUDSDK_CORE_PROJECT=""
GOOGLE_COMPUTE_REGION=""
GOOGLE_COMPUTE_ZONE=""
#Alerts
EMAIL_PASS=""
SERVER_EMAIL=""
EMAIL_RECIPIENTS=""
dvc repro
To run the following commands, ensure you have the docker installed on your system.
In case you have not already pulled the image from the Docker Hub, you can use the following command:
docker pull hassi34/brain-tumor-classification
Now once you have the docker image from the Docker Hub, you can now run the following commands to test and deploy the container to the web
docker images
Use the following command to run a docker container on your system:
docker run --name <CONTAINER NAME> -p 80:8080 -d <IMAGE NAME OR ID>
Check if the container is running:
docker ps
If the container is running, then the API services will be available on all the network interfaces
To access the API service, type localhost
in the browser.
This project is production ready for similar use cases and will provide the automated and orchestrated pipeline.
MIT Β© Hasanain
Let's connect on LinkedIn