Skip to content

Shubh3005/SkinIQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

134 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SkinIQ

A dermatologist in your pocket. SkinIQ scans a photo of your skin and classifies the condition using a deep learning model trained on the HAM10000 dataset, then pairs the result with personalized skincare routines and longitudinal progress tracking.

πŸ”— Live demo: skin-iq.vercel.app

Medical Disclaimer: SkinIQ is not a medical device and does not provide medical advice. Results are for informational purposes only. The underlying model was trained on dermoscopy images β€” not standard camera photos β€” and has meaningful accuracy limitations. Always consult a qualified dermatologist for any skin concern.


Features

  • Skin scan β€” upload or capture a photo; the ML backend classifies the condition and returns skin type, skin tone, detected condition, and clinical urgency
  • Skincare routines β€” personalized morning and evening routine steps based on your skin type, with a daily completion tracker
  • Routine calendar β€” monthly calendar with adherence visualization (morning / evening / both / none) and streak tracking
  • Scan history β€” all past scans stored per-user with thumbnails, date, and full details on tap
  • Progress tracking β€” view scan history over time to observe how your skin changes
  • Achievements β€” streak milestones unlock badges (3, 7, 14, 30 days) (coming soon)
  • SkinCare AI chat β€” conversational assistant for skincare questions (coming soon)
  • Authentication β€” email/password sign-up and sign-in via Supabase Auth

Tech Stack

Frontend

Layer Technology
Framework React 18 + TypeScript
Build tool Vite 5
Styling Tailwind CSS 3, ShadCN UI
Animation Framer Motion
Charts Recharts 2.12
Routing React Router 6
Backend client Supabase JS SDK v2

Backend (ML Inference)

Layer Technology
API framework FastAPI
Model EfficientNet-B3 (PyTorch)
Weights host HuggingFace Hub (sgupta7049/skiniq-efficientnet-b3)
Inference runtime CPU-only PyTorch 2.3
Deployment Railway (Docker)

Infrastructure

Service Role
Supabase PostgreSQL database, Auth, Row Level Security, Edge Functions
Vercel Frontend hosting
Railway FastAPI backend hosting
HuggingFace Hub Model weight storage and download

Architecture Overview

Browser (Vercel)
β”‚
β”œβ”€β”€ React SPA
β”‚   β”œβ”€β”€ Supabase JS SDK ──► Supabase (Auth + Postgres + RLS)
β”‚   β”‚                        β”œβ”€β”€ profiles
β”‚   β”‚                        β”œβ”€β”€ skin_scan_history
β”‚   β”‚                        β”œβ”€β”€ routine_logs
β”‚   β”‚                        β”œβ”€β”€ chat_history
β”‚   β”‚                        └── achievements
β”‚   β”‚
β”‚   └── fetch ──► FastAPI (Railway)
β”‚                  β”œβ”€β”€ POST /predict   ← base64 image
β”‚                  β”‚    └── EfficientNet-B3 (weights from HuggingFace Hub)
β”‚                  └── GET  /health

The frontend sends a base64-encoded image to the FastAPI /predict endpoint. The backend runs EfficientNet-B3 inference and returns a structured JSON response. Results are then saved to Supabase by the frontend.


ML Model

Model Card

Property Value
Architecture EfficientNet-B3
Dataset HAM10000 (Skin Cancer MNIST)
Task 7-class skin condition classification
Validation accuracy ~63%
Macro F1 0.66
Input size 224 Γ— 224 px, ImageNet normalization
Weights HuggingFace Hub: sgupta7049/skiniq-efficientnet-b3

Classes

Code Condition Clinical Urgency
akiec Actinic Keratosis Moderate
bcc Basal Cell Carcinoma High
bkl Benign Keratosis Low
df Dermatofibroma Low
mel Melanoma High
nv Melanocytic Nevus Low
vasc Vascular Lesion Low

Known Limitations

  • Dermoscopy vs. camera photos: HAM10000 was captured using dermoscopes β€” specialized medical imaging devices. SkinIQ accepts standard camera photos. This domain gap meaningfully degrades real-world accuracy.
  • 63% validation accuracy on a 7-class problem means roughly 1 in 3 predictions is incorrect even under ideal conditions.
  • Class imbalance: HAM10000 is heavily skewed toward nv (melanocytic nevus). The model may over-predict that class.
  • Skin tone bias: HAM10000 underrepresents darker skin tones. Performance on deeper skin tones is likely lower than the reported aggregate metrics.
  • Not a diagnostic tool. Do not use SkinIQ output to make health decisions.

Local Setup

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • A Supabase project (supabase.com)

1. Clone and install frontend

git clone https://github.com/Shubh3005/SkinIQ.git
cd SkinIQ
npm install

2. Configure environment variables

cp .env.example .env

Edit .env:

VITE_SUPABASE_URL=https://<your-project>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-anon-public-key>
VITE_AI_ENDPOINT=http://localhost:8000

Use the anon public key from Supabase Dashboard β†’ Project Settings β†’ API. Never use the service_role key in frontend code.

3. Set up the database

In the Supabase SQL editor, run in order:

supabase/migrations/001_schema.sql
supabase/migrations/002_rls.sql

Also disable email confirmation for local development: Supabase Dashboard β†’ Authentication β†’ Providers β†’ Email β†’ Confirm email: OFF.

4. Run the FastAPI backend

cd backend
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000

Model weights are downloaded automatically from HuggingFace Hub on first startup (~85 MB). No environment variables required.

5. Start the frontend

# from project root
npm run dev

App runs at http://localhost:5173.


Backend Deployment (Railway)

The backend/ directory contains a Dockerfile. Deploy via Railway:

  1. Create a new Railway project pointed at the backend/ directory
  2. Railway builds and runs the Docker image automatically
  3. Copy the Railway public URL and set it as VITE_AI_ENDPOINT in Vercel

Model weights download from HuggingFace Hub on container startup. No volumes or secrets required.


Project Structure

SkinIQ/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Index.tsx           # Home β€” routine calendar
β”‚   β”‚   β”œβ”€β”€ SkinAnalyzer.tsx    # Scan page
β”‚   β”‚   β”œβ”€β”€ Profile.tsx         # Profile + scan history
β”‚   β”‚   β”œβ”€β”€ SkinCareAI.tsx      # AI chat
β”‚   β”‚   └── Auth.tsx            # Sign in / register
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ routine-calendar/   # Calendar, daily steps, useRoutineCalendar hook
β”‚   β”‚   β”œβ”€β”€ skin-analyzer/      # Camera, results, useSkinAnalysis hook
β”‚   β”‚   └── profile/            # Scan history card, profile forms
β”‚   └── contexts/
β”‚       └── AuthContext.tsx
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                 # FastAPI app, lifespan model loading
β”‚   β”œβ”€β”€ model.py                # EfficientNet-B3 inference, HuggingFace download
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── Dockerfile
└── supabase/
    β”œβ”€β”€ migrations/
    β”‚   β”œβ”€β”€ 001_schema.sql      # 5 tables: profiles, skin_scan_history, chat_history, achievements, routine_logs
    β”‚   └── 002_rls.sql         # Row Level Security policies
    └── functions/              # Edge functions (fallback predict, history)

License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors