How minatharwat93/skin-burn-classification-using-efficientnetb3 works
Project type and purpose
• This is a specialized ML-powered web service: a FastAPI application that hosts a TensorFlow Lite image-classification model (EfficientNetB3) for skin-burn degree detection.
• Offline development happens in a Jupyter Notebook; deployment and inference happen via a REST API (main.py).
File structure
• Top-level artifacts:
• Skin Burn Classification Using EfficientNetB3.ipynb: model development/training
• Data.txt: lists dataset sources
• EfficientNetB3_skin_burn_model.tflite: the inference model
• main.py: FastAPI server code
• requirements.txt & runtime.txt: dependency specification & runtime constraints
• Procfile: deploy script for Heroku (or similar PaaS)
• No separate “frontend” directory—this is an API-only backend service.
Key architectural insights from README
• Offline pipeline: data ingestion → preprocessing → model training (TensorFlow/Keras) → evaluate → convert to TensorFlow Lite.
• Online inference pipeline: image upload → preprocessing → TFLite inference → JSON response (class, probabilities, first-aid instructions).
• Deployment: Uvicorn ASGI server, optionally on Heroku/Docker.
Main components
a. Offline Training Pipeline
• Data sources (public datasets)
• Jupyter Notebook (Python, TensorFlow/Keras)
• Trained Keras model → TFLite converter → *.tflite
b. Model Store
• File system (packaged with the service) or object store
c. API Service (Online Inference)
• FastAPI application (main.py)
• Preprocessing module (resize, normalize, quantize)
• TFLite Interpreter component
• First-aid logic & metadata (lookup tables in code)
• Uvicorn ASGI server
d. Client / Consumer
• HTTP client / Mobile app / cURL / Swagger UI
e. Deployment Environment
• PaaS (Heroku via Procfile) or container
• Python runtime (specified in runtime.txt)
Relationships & interactions
• Offline: Notebook reads Data.txt → trains model → outputs .tflite
• Deployment: .tflite + service code pushed to PaaS
• At runtime: Client → POST /predict → FastAPI receives file → preprocessing → pass image tensor to TFLite → inference results → FastAPI builds JSON → response back to client
Architectural patterns & design principles
• Separation of concerns:
• Training vs. Inference
• Model storage vs. API code
• Stateless microservice: each /predict request is independent
• Lightweight model format: TFLite for fast, small-footprint inference
• 12-factor app compliance via Procfile, runtime.txt, and environment variables
Essential details to capture
• Preprocessing steps (resize to 240×240, normalize, quantize)
• Model loading at startup vs. per‐request
• API endpoints (/predict)
• Response payload structure (predicted_class, probabilities, first_aid)
• Dependencies (TensorFlow Lite runtime, FastAPI, Uvicorn)