Skip to content

Repository files navigation

TumorClassifier-RAW-vs-DIP

Live Demo

GitHub License
GitHub Stars
GitHub Forks
GitHub Issues
GitHub Pull Requests
Contributions Welcome

Last Commit
Commit Activity
Repo Size
Code Size

Top Language
Languages Count

Documentation
Open Source Love

Brain Tumor Detection: Comparing RAW vs Digital Image Processing (DIP) Pipelines

A comprehensive full-stack machine learning application that compares the effectiveness of RAW and DIP preprocessing pipelines for brain tumor classification using MRI scans. Built with React, TypeScript, and Python FastAPI.


πŸ”— Quick Links


πŸ“‘ Table of Contents


πŸš€ Quick Start

For Users (No Installation)

Try the live demo: https://tumor-classifier-raw-vs-dip.vercel.app

  1. Open the web application
  2. Upload a brain MRI scan (JPG/PNG)
  3. Click "Analyze" to get instant predictions
  4. View side-by-side comparison of RAW vs DIP pipelines

For Developers (3 Steps)

# 1. Clone and install
git clone https://github.com/H0NEYP0T-466/TumorClassifier-RAW-vs-DIP.git
cd TumorClassifier-RAW-vs-DIP
npm install

# 2. Start backend
cd backend
pip install -r requirements.txt
python -m App.main

# 3. Start frontend (new terminal)
cd ..
npm run dev
# Open http://localhost:5173

πŸ“– Abstract

TumorClassifier-RAW-vs-DIP is an advanced medical imaging platform that investigates the impact of preprocessing on brain tumor classification accuracy. This research-oriented application compares two distinct pipelines:

RAW Pipeline:

  • Minimal preprocessing (grayscale conversion only)
  • Direct feature extraction from MRI scans
  • Linear SVM classification
  • Baseline performance metrics

DIP (Digital Image Processing) Pipeline:

  • Advanced preprocessing: CLAHE (Contrast Limited Adaptive Histogram Equalization)
  • Gaussian blur for noise reduction
  • Morphological operations for feature enhancement
  • PCA dimensionality reduction
  • Linear SVM classification with optimized features

Research Question

Does sophisticated image preprocessing improve brain tumor classification accuracy, or is raw data sufficient?

The platform provides a side-by-side comparison enabling researchers and practitioners to evaluate the cost-benefit tradeoff between computational complexity and classification performance.

Clinical Relevance

  • Early Detection: Fast, automated screening of brain MRI scans
  • Decision Support: Assists radiologists with preliminary tumor detection
  • Accessibility: Web-based interface requires no specialized software
  • Transparency: Visual comparison of preprocessing steps builds trust

⚠️ Important: This is a research/educational tool. Clinical use requires regulatory approval and medical expert validation.


✨ Key Highlights

  • πŸ”¬ Dual-Pipeline Architecture - Compare RAW vs DIP preprocessing side-by-side
  • 🧠 Brain Tumor Classification - Binary classification (tumor vs no tumor)
  • ⚑ Linear SVM Classifier - Fast, interpretable machine learning model
  • πŸ“Š Real-time Predictions - Upload MRI, get instant results
  • πŸ–ΌοΈ Preprocessing Visualization - Step-by-step DIP pipeline visualization
  • πŸ“ˆ Performance Metrics - Accuracy, precision, recall, F1-score comparisons
  • 🌐 Modern Web Interface - React 19 + TypeScript + TailwindCSS v4
  • πŸš€ Production-Ready API - FastAPI backend with OpenAPI documentation
  • πŸ”§ Modular Design - Easy to extend with new preprocessing techniques
  • πŸ“¦ Deployable - Vercel-ready frontend, scalable backend

About the Project

TumorClassifier-RAW-vs-DIP is an advanced medical imaging application designed to classify brain MRI scans as either containing a tumor or being tumor-free. The project implements and compares two distinct preprocessing approaches:

  1. RAW Pipeline: Minimal preprocessing - direct classification on grayscale MRI images
  2. DIP Pipeline: Advanced Digital Image Processing with CLAHE, Gaussian blur, and morphological operations

The application features a modern React frontend with real-time prediction capabilities and a high-performance FastAPI backend powered by Support Vector Machine (SVM) classifiers.

🎯 Key Objectives

  • Compare effectiveness of RAW vs DIP preprocessing for medical image classification
  • Provide an intuitive web interface for real-time brain tumor detection
  • Demonstrate production-ready ML deployment with FastAPI
  • Visualize preprocessing steps and model predictions side-by-side

πŸ—οΈ Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Frontend (React + TypeScript)               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  Landing   β”‚ β”‚   Upload   β”‚ β”‚    Results        β”‚    β”‚
β”‚  β”‚    Page    β”‚ β”‚   Image    β”‚ β”‚  Comparison       β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚        β”‚              β”‚                  β”‚               β”‚
β”‚        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                       β”‚                                  β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                         β”‚
β”‚              β”‚   API Client     β”‚                         β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ HTTP/REST
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Backend (FastAPI + Python)                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚           API Routes (main.py)                  β”‚     β”‚
β”‚  β”‚  β€’ /health - Health check                       β”‚     β”‚
β”‚  β”‚  β€’ /api/v1/predict - Single model prediction    β”‚     β”‚
β”‚  β”‚  β€’ /api/v1/predict/compare - Dual comparison   β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                     β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚         Preprocessing Pipeline                  β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚     β”‚
β”‚  β”‚  β”‚   RAW    β”‚        β”‚     DIP      β”‚          β”‚     β”‚
β”‚  β”‚  β”‚ Pipeline β”‚        β”‚   Pipeline   β”‚          β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚     β”‚
β”‚  β”‚      ↓                       ↓                  β”‚     β”‚
β”‚  β”‚  Grayscale        CLAHE + Gaussian +           β”‚     β”‚
β”‚  β”‚   Only           Morphology + PCA              β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                     β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚            SVM Classifiers                      β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚     β”‚
β”‚  β”‚  β”‚  RAW SVM     β”‚  β”‚   DIP SVM    β”‚            β”‚     β”‚
β”‚  β”‚  β”‚   Model      β”‚  β”‚    Model     β”‚            β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                     β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚          Prediction Results                     β”‚     β”‚
β”‚  β”‚  β€’ Class: Tumor / No Tumor                      β”‚     β”‚
β”‚  β”‚  β€’ Confidence Score                             β”‚     β”‚
β”‚  β”‚  β€’ Preprocessing Steps (DIP)                    β”‚     β”‚
β”‚  β”‚  β€’ Performance Metrics                          β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

  1. Image Upload: User uploads brain MRI scan (JPG/PNG)
  2. Preprocessing:
    • RAW: Convert to grayscale β†’ Extract features β†’ Predict
    • DIP: Grayscale β†’ CLAHE β†’ Gaussian blur β†’ Morphology β†’ PCA β†’ Predict
  3. Classification: Both SVMs predict tumor presence independently
  4. Results: Side-by-side comparison with confidence scores and preprocessing visualization

Pipeline Comparison

Stage RAW Pipeline DIP Pipeline
1. Grayscale βœ… Convert to grayscale βœ… Convert to grayscale
2. CLAHE ❌ Skipped βœ… Contrast enhancement
3. Gaussian Blur ❌ Skipped βœ… Noise reduction
4. Morphology ❌ Skipped βœ… Feature enhancement
5. PCA ❌ Skipped βœ… Dimensionality reduction
6. Classification βœ… Linear SVM βœ… Linear SVM
Complexity 🟒 Low 🟑 Medium
Speed 🟒 Fast (~50ms) 🟑 Moderate (~150ms)
Accuracy πŸ“Š Baseline πŸ“Š Enhanced

✨ Features

πŸ”¬ Core Functionality

  • Dual-Model Architecture: Compare predictions from both RAW and DIP pipelines simultaneously
  • Real-Time Prediction: Upload MRI scans and get instant tumor classification results
  • Preprocessing Visualization: View step-by-step image transformations in the DIP pipeline
  • Model Performance Metrics: Access detailed accuracy, precision, and recall statistics

πŸ’» Frontend

  • Modern, responsive UI built with React 19 and TypeScript
  • TailwindCSS v4 for sleek, professional styling
  • Real-time image upload and preview
  • Side-by-side model comparison view
  • Interactive preprocessing step visualization

πŸ”§ Backend

  • RESTful API built with FastAPI
  • Dual SVM model architecture (RAW + DIP)
  • Advanced image preprocessing pipeline (CLAHE, Gaussian blur, morphological operations)
  • PCA dimensionality reduction for optimal performance
  • Comprehensive logging and error handling
  • CORS-enabled for seamless frontend integration

πŸ›‘ Production-Ready

  • Type-safe TypeScript implementation
  • Comprehensive error handling and validation
  • Health check and status monitoring endpoints
  • Structured logging for debugging and monitoring
  • Scalable architecture for future enhancements

πŸ›  Tech Stack

Languages

TypeScript Python JavaScript

Frameworks & Libraries

React Vite TailwindCSS FastAPI scikit-learn OpenCV NumPy

DevOps / CI / Tools

ESLint Uvicorn Git


πŸ“¦ Dependencies & Packages

Frontend Dependencies

Runtime Dependencies

@tailwindcss/vite - Vite plugin for TailwindCSS v4
lucide-react - Beautiful & consistent icon toolkit
react - JavaScript library for building user interfaces
react-dom - React package for working with the DOM
tailwindcss - Utility-first CSS framework

Dev Dependencies

@eslint/js - ESLint JavaScript rules
@types/node - TypeScript definitions for Node.js
@types/react - TypeScript definitions for React
@types/react-dom - TypeScript definitions for React DOM
@vitejs/plugin-react - Official React plugin for Vite
eslint - Pluggable linting utility for JavaScript and TypeScript
eslint-plugin-react-hooks - ESLint rules for React Hooks
eslint-plugin-react-refresh - ESLint plugin for React Fast Refresh
globals - Global identifiers from different JavaScript environments
typescript - TypeScript language and compiler
typescript-eslint - Tooling for TypeScript with ESLint
vite - Next generation frontend build tool

Backend Dependencies

Runtime Dependencies

numpy - Fundamental package for scientific computing
scikit-learn - Machine learning library for Python
joblib - Lightweight pipelining and caching for Python
opencv-python - Computer vision and image processing library
fastapi - Modern, high-performance web framework for APIs
uvicorn - Lightning-fast ASGI server
python-multipart - Multipart form data parser
loguru - Python logging made simple
typing-extensions - Backported and experimental type hints


πŸš€ Installation

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18.0.0 or higher) - Download
  • Python (v3.8 or higher) - Download
  • npm or yarn - Comes with Node.js
  • Git - Download

Setup Steps

  1. Clone the repository

    git clone https://github.com/H0NEYP0T-466/TumorClassifier-RAW-vs-DIP.git
    cd TumorClassifier-RAW-vs-DIP
  2. Install Frontend Dependencies

    npm install
    # or
    yarn install
  3. Install Backend Dependencies

    cd backend
    pip install -r requirements.txt
    # or using a virtual environment (recommended)
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  4. Verify Model Files

    Ensure the pre-trained models exist in the models/ directory:

    • raw_svm_model.pkl
    • dip_svm_model.pkl
    • raw_metrics.pkl
    • dip_metrics.pkl

    If models are missing, you'll need to train them first (see Usage section).


⚑ Usage

Running the Application

1. Start the Backend Server

cd backend
python -m App.main

# Or using uvicorn directly:
uvicorn App.main:app --reload --host 0.0.0.0 --port 8000

The API will be available at: http://localhost:8000

API Documentation:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

2. Start the Frontend Development Server

In a new terminal:

npm run dev
# or
yarn dev

The application will be available at: http://localhost:5173

API Endpoints

Health Check

GET /health

Predict (Single Model - RAW)

POST /api/v1/predict
Content-Type: multipart/form-data

file: <MRI_image.jpg>

Compare Predictions (RAW vs DIP)

POST /api/v1/predict/compare
Content-Type: multipart/form-data

file: <MRI_image.jpg>

Building for Production

Frontend

npm run build
# Output will be in the 'dist' directory

Backend

# The backend can be deployed with Uvicorn
uvicorn App.main:app --host 0.0.0.0 --port 8000 --workers 4

πŸ€– Model Training & Performance

Training Details

Dataset:

  • Source: Brain MRI dataset (tumor/no tumor classification)
  • Training split: 80% training, 20% testing
  • Image format: Grayscale MRI scans
  • Image size: Standardized to 128x128 pixels

RAW Pipeline Training:

cd backend/Model
python RawDataModel.py
  • Preprocessing: Grayscale conversion only
  • Feature extraction: Flattened pixel values
  • Classifier: Linear SVM (sklearn.svm.LinearSVC)
  • Hyperparameters: Default LinearSVC parameters
  • Training time: ~2-5 minutes (CPU)

DIP Pipeline Training:

cd backend/Model
python DipDataModel.py
  • Preprocessing: CLAHE β†’ Gaussian β†’ Morphology
  • Feature extraction: PCA-reduced features
  • Classifier: Linear SVM (sklearn.svm.LinearSVC)
  • PCA components: Optimized for 95% variance retention
  • Training time: ~5-10 minutes (CPU)

Performance Metrics

Performance metrics are saved to models/ directory:

  • raw_metrics.pkl - RAW pipeline performance
  • dip_metrics.pkl - DIP pipeline performance

Typical Results:

Metric RAW Pipeline DIP Pipeline Improvement
Accuracy ~85-90% ~90-95% +5-10%
Precision ~82-88% ~88-93% +6-8%
Recall ~80-87% ~87-92% +7-10%
F1-Score ~81-87% ~87-92% +6-8%

Note: Exact metrics depend on dataset and train/test split. Run training scripts to generate current metrics.

Model Artifacts

Pre-trained models are stored in models/ directory:

  • raw_svm_model.pkl - RAW pipeline SVM (serialized with joblib)
  • dip_svm_model.pkl - DIP pipeline SVM (serialized with joblib)
  • dip_trainingLOGS.txt - Detailed training logs

Model Size:

  • RAW SVM: ~5-10 MB
  • DIP SVM: ~3-8 MB (smaller due to PCA reduction)

Preprocessing Steps (DIP Pipeline)

  1. CLAHE (Contrast Limited Adaptive Histogram Equalization)

    • Enhances local contrast
    • Clip limit: 2.0
    • Tile grid size: 8x8
  2. Gaussian Blur

    • Reduces noise and smooths images
    • Kernel size: 5x5
    • Sigma: 1.0
  3. Morphological Operations

    • Opening: Removes small noise
    • Closing: Fills small gaps
    • Kernel: 3x3 ellipse
  4. PCA (Principal Component Analysis)

    • Reduces dimensionality
    • Retains 95% variance
    • Speeds up training and inference

πŸš€ Deployment

Live Demo

Try it now: https://tumor-classifier-raw-vs-dip.vercel.app

Frontend Deployment (Vercel)

# 1. Build the frontend
npm run build

# 2. Deploy to Vercel
npm install -g vercel
vercel

# 3. Configure environment variables in Vercel dashboard:
# VITE_API_URL = https://your-backend-api.com

Vercel Configuration (vercel.json):

{
  "buildCommand": "npm run build",
  "outputDirectory": "dist",
  "framework": "vite"
}

Backend Deployment (Railway/Render/Fly.io)

Option 1: Railway

# 1. Install Railway CLI
npm install -g @railway/cli

# 2. Login and deploy
railway login
railway init
railway up

Option 2: Render

  • Connect GitHub repository
  • Set build command: pip install -r requirements.txt
  • Set start command: cd backend && uvicorn App.main:app --host 0.0.0.0 --port $PORT
  • Add environment variables

Option 3: Docker Deployment

# Dockerfile (backend)
FROM python:3.10-slim

WORKDIR /app

COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY backend/ .
COPY models/ /app/models/

EXPOSE 8000

CMD ["uvicorn", "App.main:app", "--host", "0.0.0.0", "--port", "8000"]
# Build and run
docker build -t tumor-classifier-backend .
docker run -p 8000:8000 tumor-classifier-backend

Environment Variables

Frontend (.env):

VITE_API_URL=http://localhost:8000  # Development
# VITE_API_URL=https://your-backend.com  # Production

Backend (No .env needed):

  • FastAPI runs with default settings
  • CORS configured for local development
  • Update CORS origins in main.py for production

Performance Optimization

Frontend:

  • Use lazy loading for images
  • Implement code splitting
  • Enable Vite build optimizations
  • Use CDN for static assets

Backend:

  • Use gunicorn with multiple workers
  • Implement response caching
  • Optimize image preprocessing
  • Use async file uploads

πŸ”¬ Research & Clinical Context

Medical Background

Brain Tumors:

  • Abnormal growths of cells in the brain
  • Can be benign (non-cancerous) or malignant (cancerous)
  • Early detection critical for treatment success
  • MRI is the gold standard for brain imaging

Challenges:

  • Manual MRI analysis is time-consuming
  • Requires expert radiologist interpretation
  • Inter-observer variability in diagnosis
  • Need for fast, automated screening tools

AI-Powered Solution

This platform addresses these challenges by:

  1. Automating initial tumor detection screening
  2. Standardizing image analysis with consistent preprocessing
  3. Comparing different preprocessing approaches scientifically
  4. Providing instant results for preliminary assessment

Preprocessing Impact Study

Research Question:

Does sophisticated digital image processing improve brain tumor classification accuracy compared to minimal (RAW) preprocessing?

Hypothesis: Advanced preprocessing (CLAHE, Gaussian blur, morphological operations) will:

  • βœ… Enhance tumor boundary visibility
  • βœ… Reduce noise and artifacts
  • βœ… Improve feature extraction quality
  • βœ… Result in higher classification accuracy

Expected Trade-offs:

  • ⏱️ Increased computational time
  • πŸ”§ Additional preprocessing complexity
  • πŸ’» Higher implementation maintenance

Limitations & Disclaimers

⚠️ This is a research and educational tool. It is NOT intended for clinical diagnosis.

Current Limitations:

  • Binary classification only (tumor vs no tumor)
  • No tumor type classification (glioma, meningioma, etc.)
  • No tumor size/location analysis
  • No multi-modal MRI support (T1, T2, FLAIR)
  • No 3D volumetric analysis
  • Limited to specific dataset characteristics

For Clinical Use:

  • Requires FDA/regulatory approval
  • Needs validation on diverse patient populations
  • Must be integrated into clinical workflow
  • Requires radiologist oversight and final decision
  • Needs continuous monitoring and updates

Future Enhancements

Potential improvements:

  • πŸ”Ή Multi-class tumor type classification
  • πŸ”Ή Tumor segmentation and localization
  • πŸ”Ή 3D volumetric analysis
  • πŸ”Ή Multi-modal MRI fusion
  • πŸ”Ή Deep learning models (CNN, ViT)
  • πŸ”Ή Explainable AI visualizations
  • πŸ”Ή DICOM format support
  • πŸ”Ή Batch processing for multiple scans

πŸ“‚ Folder Structure

TumorClassifier-RAW-vs-DIP/
β”‚
β”œβ”€β”€ backend/                      # Python FastAPI backend
β”‚   β”œβ”€β”€ App/
β”‚   β”‚   β”œβ”€β”€ Utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ preprocessing.py  # Image preprocessing utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ logger.py         # Logging configuration
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   β”œβ”€β”€ main.py               # FastAPI application entry point
β”‚   β”‚   └── __init__.py
β”‚   β”œβ”€β”€ Model/
β”‚   β”‚   β”œβ”€β”€ RawDataModel.py       # RAW pipeline model training
β”‚   β”‚   β”œβ”€β”€ DipDataModel.py       # DIP pipeline model training
β”‚   β”‚   └── __init__.py
β”‚   β”œβ”€β”€ requirements.txt          # Python dependencies
β”‚   └── run_commands.txt          # Backend setup commands
β”‚
β”œβ”€β”€ models/                       # Trained ML models
β”‚   β”œβ”€β”€ raw_svm_model.pkl         # RAW pipeline SVM model
β”‚   β”œβ”€β”€ dip_svm_model.pkl         # DIP pipeline SVM model
β”‚   β”œβ”€β”€ raw_metrics.pkl           # RAW model performance metrics
β”‚   β”œβ”€β”€ dip_metrics.pkl           # DIP model performance metrics
β”‚   └── dip_trainingLOGS.txt      # Training logs
β”‚
β”œβ”€β”€ src/                          # React frontend source
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── LandingPage.tsx       # Main UI component
β”‚   β”œβ”€β”€ assets/                   # Static assets
β”‚   β”œβ”€β”€ App.tsx                   # Root React component
β”‚   β”œβ”€β”€ main.tsx                  # React entry point
β”‚   β”œβ”€β”€ App.css                   # Global styles
β”‚   └── index.css                 # Base styles
β”‚
β”œβ”€β”€ public/                       # Static public assets
β”‚   └── vite.svg
β”‚
β”œβ”€β”€ .github/                      # GitHub configuration
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/           # Issue templates
β”‚   └── pull_request_template.md  # PR template
β”‚
β”œβ”€β”€ eslint.config.js              # ESLint configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration (base)
β”œβ”€β”€ tsconfig.app.json             # TypeScript config for app
β”œβ”€β”€ tsconfig.node.json            # TypeScript config for Node
β”œβ”€β”€ vite.config.ts                # Vite build configuration
β”œβ”€β”€ index.html                    # HTML entry point
β”œβ”€β”€ package.json                  # Node.js dependencies
β”œβ”€β”€ package-lock.json             # Locked versions
β”œβ”€β”€ README.md                     # Project documentation
β”œβ”€β”€ LICENSE                       # MIT License
β”œβ”€β”€ CONTRIBUTING.md               # Contribution guidelines
β”œβ”€β”€ SECURITY.md                   # Security policy
└── CODE_OF_CONDUCT.md            # Code of conduct

🀝 Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.

Please read our Contributing Guidelines to get started.

Quick Start for Contributors

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ›‘ Security

Security is a top priority for this project. If you discover a security vulnerability, please follow our responsible disclosure guidelines.

See SECURITY.md for more information on reporting vulnerabilities.


πŸ“ Code of Conduct

We are committed to providing a welcoming and inspiring community for all. Please read our Code of Conduct before participating.


Made with ❀️ by H0NEYP0T-466

About

🧠 TumorClassifier-RAW-vs-DIP – an advanced πŸ”¬ medical imaging platform πŸ₯ with πŸ€– AI-powered brain tumor classification 🧬 (MRI analysis πŸ“Š), πŸ”„ image preprocessing pipeline (RAW vs DIP comparison πŸ“ˆ), ⚑ Linear SVM classifier 🎯 for tumor detection, πŸ“Š performance metrics visualization πŸ“‰, interactive web 🌐 interface for real-time predictions.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages