An end-to-end system for automated Diabetic Foot Ulcer (DFU) grade classification, treatment recommendation, explainability, and report generation — integrated with a mobile app and powered by deep learning and Supabase.
This project enables users to upload DFU images via a mobile app, which are then processed through a series of AI and retrieval pipelines to generate a treatment report based on the ulcer grade and visual similarity to past cases.
- Users capture and upload DFU images through the ADPM mobile app.
- Images are uploaded to Supabase Storage, and a URL is generated for downstream tasks.
- Images undergo resizing, normalization, and augmentation to prepare for model inference.
- The preprocessed image is passed through a ConvNext model to:
- Predict the Wagner grade of the ulcer.
- Extract feature embeddings for KNN-based retrieval.
- Store Feature Embeddings for retrieval using KNN with cosine similarity.
- Map Recommended Treatment based on the predicted grade.
- A K-Nearest Neighbors (KNN) search is performed using cosine similarity to retrieve visually and contextually similar past DFU cases.
- A segmentation heatmap is generated using YOLOv1-seg to highlight the ulcer area, providing model explainability.
- A PDF report is compiled with:
- Predicted ulcer grade
- Similar case references
- Segmentation overlay
- Recommended treatments
- The report is uploaded to Supabase.
- A download link is sent to the user via the mobile app.
Component | Technology |
---|---|
Frontend | React Native |
Backend | Python, FastAPI |
Image Storage | Supabase Storage |
Classification | ConvNext(2022) |
Segmentation | YOLOv11-seg(2024) |
Similarity Search | KNN + Cosine Similarity |
Database | Supabase (PostgreSQL) |
Reporting | PDF Generator (e.g. ReportLab) |
python -m venv venv
On Windows: venv\Scripts\activate
pip install --upgrade pip pip install fastapi uvicorn torch torchvision timm pillow ultralytics python-multipart scikit-learn fpdf python-multipart numpy pandas matplotlib jupyter reportlab
pip install torchcam pip install pdf2image
pip freeze > requirements.txt
echo "✅ Virtual environment 'venv' created." echo "👉 Open Command Palette in VS Code (Ctrl+Shift+P), then run: Python: Select Interpreter" echo "👉 Choose the one from './venv' folder"
uvicorn main:app --reload
Endpoint: POST http://127.0.0.1:8000/docs/
This project is licensed under the MIT License.
Contributions, issues, and feature requests are welcome!
You can fix the repo and submit a pull request.