How dharunkumar-v/ai-skin-cancer-detection works
This repository is a skin-lesion classification application plus its model-training and evaluation workflow. The user uploads an image through the web app; the route saves it, calls inference, and renders a label, confidence, and heatmap. Note that the web inference currently generates a colorized-image placeholder, while src/gradcam.py contains a separate Grad-CAM workflow and is not called by the route. Training, evaluation, and preprocessing links reflect the sampled source; the dataset itself is not present in the tree.
Main entry points: evaluate.py Test evaluation · model_utils.py Prediction helper · train.py Model training · gradcam.py Grad-CAM workflow
Components 15
Web inference
- Upload and results
webapp/templates/index.html - Page styling
webapp/static/style.css - FastAPI routes
webapp/main.py - Prediction helper
src/model_utils.py
Model workflow
- Image transforms
src/transforms.py - Data preparation
src/preprocess.py - Dataset loader
src/dataset.py - Model training
src/train.py - Test evaluation
src/evaluate.py
Explainability
- Grad-CAM workflow
src/gradcam.py
Files and data
- Saved weights
models/best_model.pth - Uploaded images
- Generated outputs
- HAM10000 input data
Other components
- Image uploader
Connections 24
- Image uploader → Upload and results: uploads image
- Upload and results → FastAPI routes: submits request
- FastAPI routes → Upload and results: renders results
- FastAPI routes → Uploaded images: saves image
- FastAPI routes → Prediction helper: calls inference
- Prediction helper → Uploaded images: reads image
- Prediction helper → Saved weights: loads weights
- Prediction helper → Image transforms: gets transforms
- Prediction helper → Uploaded images: writes heatmap
- Data preparation → HAM10000 input data: reads metadata and images
- Model training → Data preparation: loads and splits data
- Model training → Image transforms: gets transforms
- Model training → Dataset loader: creates datasets
- Dataset loader → HAM10000 input data: reads image files
- Model training → Saved weights: saves best weights
- Test evaluation → Data preparation: loads test split
- Test evaluation → Image transforms: gets transforms
- Test evaluation → Dataset loader: creates test dataset
- Test evaluation → Saved weights: loads weights
- Test evaluation → Generated outputs: saves confusion matrix
- Grad-CAM workflow → Saved weights: loads weights
- Grad-CAM workflow → Image transforms: gets transforms
- Grad-CAM workflow → HAM10000 input data: reads image
- Grad-CAM workflow → Generated outputs: saves visualization