Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔬 DermaMNIST AI

Advanced Deep Learning Network for Dermatoscopic Lesion Triage

PyTorch FastAPI Next.js Docker


⚠️ Research & Demonstration Only: This system is an educational benchmark trained on the MedMNIST v2 DermaMNIST dataset. It is not an FDA-approved medical diagnostic device and must never be used for actual clinical decision-making.


📖 Overview

DermaMNIST AI is a full-stack, production-ready machine learning application designed to classify dermatoscopic images into one of 7 distinct skin lesion categories. Transitioning from a raw Jupyter Notebook to a deployable microservice architecture, this project features an ultra-fast REST API and a premium, glassmorphic Next.js web interface.

🧠 Model Diagnostics

  • Input Tensor: 3 × 28 × 28 (RGB)
  • Architecture: 7-Class Diagnostic Triage (SimpleCNN / ResNet18)
  • Base Accuracy: ~69.99%
  • Macro OvR AUC: ~0.8803

🛠️ Architecture & Tech Stack

The application is decoupled into a frontend client and a stateless backend inference API, connected seamlessly via Docker.

Frontend (/frontend)

  • Framework: Next.js 14+ (App Router)
  • Styling: Tailwind CSS (Dark HUD / Glassmorphic Aesthetic)
  • Language: TypeScript
  • Features: Drag-and-drop file upload, fluid animations, dynamic layout shifts, visual probability distribution bars.

Backend (/backend)

  • Framework: FastAPI
  • ML Engine: PyTorch (torch, torchvision)
  • Features: Asynchronous request handling, deterministic preprocessing pipeline, CORS configuration, isolated virtual environment (Dockerized).

🚀 Running Locally

The easiest way to run the entire stack locally is using Docker.

Prerequisites

  • Docker installed on your machine.

Installation

  1. Clone the repository:

    git clone https://github.com/0xNunana/DermaMNIST.git
    cd DermaMNIST
  2. Spin up the services:

    docker-compose up --build
  3. Access the application:


🌍 Deployment Strategy

This repository is structured for effortless cloud deployment using split hosting.

1. Backend API (Render / Google Cloud Run)

The backend requires a Docker container environment to serve the PyTorch model.

  1. Connect your GitHub repository to Render.
  2. Create a new Web Service.
  3. Set the Root Directory to backend.
  4. Render will automatically build the Dockerfile and expose your API.
  5. Note the generated URL (e.g., https://your-api.onrender.com).

2. Frontend UI (Vercel)

Next.js applications deploy natively to Vercel with zero configuration.

  1. Connect your GitHub repository to Vercel.
  2. Select the frontend folder as the Root Directory.
  3. Add the Environment Variable:
    • NEXT_PUBLIC_API_URL = https://your-api.onrender.com
  4. Deploy!

Security Tip: Once the frontend is live, go back to your backend hosting platform and set the ALLOWED_ORIGINS environment variable to your frontend's Vercel URL to secure the API.


🔬 Supported Lesion Classes

  1. Actinic Keratoses and Intraepithelial Carcinoma
  2. Basal Cell Carcinoma
  3. Benign Keratosis-like Lesions
  4. Dermatofibroma
  5. Melanoma (High Risk)
  6. Melanocytic Nevi
  7. Vascular Lesions

🏛️ Research & Attribution

The underlying DermaMNIST model and experimental work were developed as part of a collaborative academic project at the OTH Regensburg as part of the International Summer School 2026: Trustworthy AI – Machine Learning Meets Blockchain programme, under the supervision of Tobias Rueckert.

Model & Research Contributors

  • Sean Chye
  • Tan Xian Guang
  • Paul Yao Kudaya
  • Tan Zheng Liang

Deployment & Engineering

  • Paul Yao Kudaya

This deployment extends the original collaborative research work with a production-oriented web interface and model inference service, providing an interactive demonstration of the trained computer vision model.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages