Skip to content

FastAPI-based Brain Tumor Detection system following MLOps principles, enabling efficient model deployment, automated data handling, and seamless API integration for real-time predictions

Notifications You must be signed in to change notification settings

RijoSLal/BrainTumorDetection_MLOPS

Repository files navigation

BrainTumorDetection_MLOPS

Overview

BrainTumorDetection_MLOPS is a FastAPI-based brain tumor detection system designed with MLOps principles for efficient model deployment, automated data handling, and seamless API integration. The system uses MLflow for model tracking, DVC for data versioning, and DAGsHub as the central server for both MLflow and DVC. It employs a Vision Transformer (ViT) model for accurate tumor detection from medical images.

Features

  • FastAPI-based API for real-time predictions.
  • MLflow integration to track model performance and experiments.
  • DVC (Data Version Control) for handling datasets efficiently.
  • DAGsHub as a unified platform for MLflow and DVC.
  • Automated pipeline for data processing and deployment.

Tech Stack

  • FastAPI - Web framework for serving the model.
  • MLflow - Model tracking and experiment logging.
  • DVC - Data versioning and management.
  • DAGsHub - Hosting and integration for MLflow and DVC.

Installation & Setup

1. Clone the Repository

git clone https://github.com/RijoSLal/BrainTumorDetection_MLOPS.git
cd BrainTumorDetection_MLOPS

2. Set Up Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure MLflow & DVC

Initialize DVC and Add Remote Storage

dvc init
dvc remote add origin https://dagshub.com/yourusername/BrainTumorDetection_MLOPS.dvc

Set Up MLflow Tracking

export MLFLOW_TRACKING_URI=https://dagshub.com/yourusername/BrainTumorDetection_MLOPS.mlflow

5. Run the FastAPI Server

uvicorn main:app --host 0.0.0.0 --port 8000

API Endpoints

Predict Tumor

  • Endpoint: /docs
  • Method: POST
  • Payload:
    {
      "image": "base64_encoded_image"
    }
  • Response:
    {
      "prediction": "No abnormal growth detected. However, consult a doctor for confirmation"
    }

Contributing

Feel free to contribute.

License

This project is licensed under the MIT License.

About

FastAPI-based Brain Tumor Detection system following MLOps principles, enabling efficient model deployment, automated data handling, and seamless API integration for real-time predictions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published