DermAI is a Flask-based application designed to classify skin lesions using ML models that supports two model options which are CNN (image-only) and CNN + Metadata (image with metadata)
├── app.py # Backend Logic/Model Logic
├── templates/
│ └── index.html # Web UI
├── data/
│ ├── test/ # Directory for test images
│ └── test.csv # Metadata for test images
├── models/
│ ├── best_cnn_model_traced.pt # CNN model
│ └── best_cnn_metadata_model_traced.pt # CNN model with metadata
├── static/
│ ├── group.png
│ └── styles.css
├── Dockerfile
├── cloudbuild.yaml # Google Cloud Build configuration
├── requirements.txt # Python dependencies
└── README.md
- Python 3.8+
- Flask 2.x
- PyTorch 2.0+
- Docker (optional)
- Google Cloud Build and Cloud Run (for deployment)
- Dependencies listed in
requirements.txt
git clone https://github.com/sofiahanim/skinlesionclassificationDermAI.git
cd skinlesionclassificationDermAI
pip install -r requirements.txt
python app.py
The application will be accessible at http://127.0.0.1:5000
-
Model Options:
- CNN provide basic classification using images only
- CNN + Metadata enhanced classification with images and additional metadata such as age, sex, anatomical site
-
Predictions:
- Upload skin lesion images (PNG/JPG/JPEG)
- Choose the model type and view predictions with confidence scores
-
Test Data Browser:
- Search and view test data in a table format
- Preview and download test images
- Navigate to Cloud Build in the Google Cloud Console
- Create a new trigger:
- Connect GitHub repo
- Set the trigger to build on branch
main
- Use
cloudbuild.yaml
file for build configuration
- Once the build is complete, go to Cloud Run in the Google Cloud Console
- Deploy container image created by Cloud Build
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/skin-lesion-classification', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/skin-lesion-classification']
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'run'
- 'deploy'
- 'skin-lesion-classification'
- '--image'
- 'gcr.io/$PROJECT_ID/skin-lesion-classification'
- '--platform'
- 'managed'
- '--region'
- 'us-central1'
- '--allow-unauthenticated'
- Update the
project-id
andregion
placeholders incloudbuild.yaml
with actual values - The application will be accessible at URL provided eg:
https://skin-lesion-classification-[id].run.app