Skip to content

CodeBy-HP/Chest-Cancer-Classification

Repository files navigation

🫁 Chest Cancer Classification using Deep Learning

Python TensorFlow FastAPI Docker AWS MLflow


📌 Overview

An end-to-end deep learning project for detecting Adenocarcinoma cancer from chest CT scan images. The project is designed with production-grade MLOps practices, covering everything from data ingestion and training to deployment with automated CI/CD pipelines.


✨ Key Features

🧠 Machine Learning

  • Transfer Learning using EfficientNetB0
  • Modular, reusable training pipeline
  • MLflow for experiment tracking & model versioning
  • DVC for reproducible data and pipeline management

🚀 Production Application

  • FastAPI-based REST API
  • Simple web UI with image upload support
  • Model lazy loading & caching for fast inference
  • Health-check endpoint for monitoring

⚙️ MLOps & DevOps

  • CI/CD pipelines using GitHub Actions
  • Dockerized application for consistent deployment
  • AWS ECS ready deployment workflow
  • Environment-based configuration for secrets

🛠️ Tech Stack

Core ML / DL

  • TensorFlow & Keras
  • EfficientNetB0
  • NumPy, Pandas

MLOps

  • MLflow
  • DVC
  • DagHub

Backend & API

  • FastAPI
  • Uvicorn
  • Python-multipart

Frontend

  • HTML + TailwindCSS
  • Vanilla JavaScript

DevOps & Cloud

  • Docker
  • GitHub Actions
  • AWS ECS & ECR

📁 Project Structure

├── .github/
│   └── workflows/
│       └── main.yaml              # CI/CD pipeline
├── artifacts/
│   ├── data_ingestion/            # Raw & processed data
│   ├── prepare_base_model/        # Base & updated models
│   └── training/                  # Trained models & logs
├── config/
│   └── config.yaml                # Central configuration
├── src/cnnClassifier/
│   ├── components/                # Core ML components
│   ├── pipeline/                  # Training & inference pipelines
│   ├── config/                    # Configuration manager
│   ├── entity/                    # Dataclasses
│   ├── utils/                     # Utility helpers
│   └── constants/
├── templates/
│   └── index.html                 # Web UI
├── app.py                         # FastAPI app
├── main.py                        # Training pipeline entry
├── dvc.yaml                       # DVC pipeline
├── params.yaml                    # Model parameters
├── requirements.txt
├── Dockerfile
├── .dockerignore
└── README.md

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • Docker (optional)
  • AWS CLI (for cloud deployment)

Local Setup

  1. Clone the repository

    git clone https://github.com/CodeBy-HP/Chest-Cancer-Classification.git
    cd Chest-Cancer-Classification
  2. Create & activate virtual environment

    python -m venv venv
    source venv/bin/activate  # Linux / macOS
    # venv\\Scripts\\activate  # Windows
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    cp .env.example .env
    # update credentials inside .env
  5. Run the application

    python app.py

    Visit: http://localhost:8000


🐳 Docker Setup

# Build image
docker build -t chest-cancer-classifier .

# Run container
docker run -p 8000:8000 --env-file .env chest-cancer-classifier

📊 Training Pipeline

# Run full training pipeline
python main.py

# Or via DVC
dvc repro

Star this repository if you find it useful

About

An end-to-end deep learning project for detecting Adenocarcinoma cancer from chest CT scan images.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published