How nico-curti/deepskin works
Project type and purpose
• Deepskin is an open-source Python library and CLI tool for automated wound analysis from smartphone images.
• It implements a two-step pipeline: (1) deep-learning based semantic segmentation of wound and peri-wound regions (U-Net model with active semi-supervised learning support), (2) hand-crafted feature extraction and regression for PWAT score prediction.
Key directories and files
• deepskin/ : core Python modules
• __main__.py – CLI entry point
• model.py & checkpoints.py – model definition & checkpoint management
• segmentation.py – U-Net segmentation wrapper
• imgproc.py – morphology ops for peri-wound ROI
• features.py – texture/morphology feature extractors
• pwat.py – regression model for PWAT scoring
• constants.py – fixed parameters
• docs/ : Sphinx docs and notebooks demonstrating usage
• environment.yml / requirements.txt / setup.py / pyproject.toml : build & dependency configs
• .github/workflows/ : CI pipelines for tests and docs
Major components
a. User Interface
• CLI (deepskin command) and Python API
b. Pipeline Controller
• __main__.py orchestrates steps based on CLI flags
c. Segmentation Subsystem
• Model loader (checkpoints.py)
• Deep Learning model (model.py)
• Segmentation wrapper (segmentation.py)
d. Image Processing Subsystem
• Morphological operations to derive peri-wound mask (imgproc.py)
e. Feature Extraction Subsystem
• Feature calculators (features.py)
f. PWAT Prediction Subsystem
• Regression model (pwat.py)
g. Persistence & I/O
• Read/write images and masks (OpenCV I/O)
• Save results (console, PNG files)
h. External Dependencies
• TensorFlow / Keras, OpenCV, NumPy, scikit-learn, etc.
Data flow and interactions
• CLI calls Pipeline Controller →
• invokes Segmentation Subsystem: loads model → predicts wound mask
• sends mask → Image Processing Subsystem for peri-wound mask
• passes ROIs → Feature Extraction Subsystem → feature vectors
• passes features → PWAT Prediction Subsystem → PWAT score
• outputs mask & score back to User
Architectural patterns & design principles
• Modular layering: separation of concerns between segmentation, image processing, feature extraction, and prediction.
• Plugin-style extensibility: new segmentation models or feature sets can be added in dedicated modules.
• Single responsibility: each Python module handles one pipeline step.
• CLI front-controller pattern via __main__.
Technologies & frameworks
• Python 3.5+
• TensorFlow/Keras for U-Net model
• OpenCV for image I/O & morphology
• NumPy/Pandas for data handling
• scikit-learn (or similar) for regression
• Sphinx for documentation
• GitHub Actions for CI
Final checklist for the engineer
• Technologies, file names, and interactions.