DermaScan AI is a comprehensive skin lesion classification and monitoring system that leverages advanced Deep Learning and Generative AI to provide accurate diagnoses and detailed medical insights. The platform connects patients with an AI-powered analysis tool and provides medical professionals with a dashboard to review cases and continuously improve the model through active learning.
- AI-Powered Analysis: Uses a custom Fusion Model combining EfficientNet for feature extraction and a Variational Autoencoder (VAE) for robust classification and anomaly detection.
- Generative AI Reports: Integrates Google Gemini AI to generate detailed medical reports including severity, prevalence, symptoms, risk factors, and treatment recommendations for detected conditions.
- Real-time Online Learning: Features a feedback loop where doctor corrections instantly fine-tune the model, effectively allowing the system to learn from new data without full retraining.
- Cross-Platform Mobile App: A user-friendly React Native mobile application for patients to capture and analyze skin conditions.
- Doctor Portal: A web-based dashboard for dermatologists to review patient scans, visualize data, and provide expert feedback.
The repository is organized into three main components:
DermaScan_app: The mobile application built with React Native and Expo.Dr_portal: The web portal for doctors built with React and Material UI.Dr_portal/MODEL: The Python backend hosting the FastAPI server and PyTorch models.
- Frontend (Mobile): React Native, Expo, Firebase, Victory Native (Charts).
- Frontend (Web): React.js, Material UI (MUI), Recharts, Leaflet.
- Backend / AI: Python, FastAPI, PyTorch (TorchVision), EfficientNet, Google Gemini API.
- Database / Infrastructure: Firebase (Auth, Firestore, Storage), Google Cloud Vision.
Ensure you have the following installed:
- Node.js (v18+ recommended)
- Python (v3.9+ recommended)
- Expo Go app on your mobile device (for testing the mobile app).
The backend handles image processing, inference, and the feedback loop.
cd Dr_portal/MODEL
# Create a virtual environment (optional but recommended)
python -m venv .venv
# Windows:
.venv\Scripts\activate
# Mac/Linux:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the FastAPI server
uvicorn api:app --reload --host 127.0.0.1 --port 8000The server will start at http://127.0.0.1:8000
The web portal allows doctors to view analytics and manage patient data.
cd Dr_portal
# Install dependencies
npm install
# Start the React development server
npm startThe portal will open at http://localhost:3000
The mobile application for independent user scanning.
cd DermaScan_app
# Install dependencies
npm install
# Start the Expo development server
npx expo startScan the QR code with the Expo Go app (Android/iOS) to run the app.
The core of DermaScan is a Fusion Model (FusionModel in api.py) which:
- Encodes images using a pre-trained EfficientNet-B3.
- Projects features into a latent space (VAE architecture).
- Classifies into 7 skin condition classes:
bkl(Benign keratosis)nv(Melanocytic nevi)df(Dermatofibroma)mel(Melanoma)vasc(Vascular lesions)bcc(Basal cell carcinoma)akiec(Actinic keratoses)
When a prediction is made, the backend also queries the Gemini API to fetch a context-aware medical summary for the user.
The system implements an online learning mechanism:
- A doctor corrects a diagnosis in the Portal.
- The image and new label are sent to the
/feedback/endpoint. - The model updates its weights immediately using the new example (
fine_tune.py). - The updated model is saved and reloaded automatically without server downtime.