This repository contains 8 PyTorch model weights forming a 3-level hierarchical cascade for automated pressure sore detection and staging. The cascade progressively narrows from detecting any wound, to separating severity groups, to fine-grained stage classification — mirroring clinical decision-making.
Image
│
▼
[Level 1 — PS vs No-PS] BCEWithLogitsLoss · sigmoid
MaxVit_T (linear head)
ResNet50 (mlp head)
│
├─ NO → "No pressure sore detected"
└─ YES ▼
[Level 2 — Early (Stage I/II) vs Advanced (III/IV)] BCEWithLogitsLoss · sigmoid
ConvNeXt_Base (mlp head)
EfficientNet_V2_L (linear head)
│
├─ EARLY ──────────────────────┐
└─ ADVANCED ───────┐ │
▼ ▼
[Level 3b] [Level 3a]
Stage III vs Stage IV Stage I vs Stage II
ConvNeXt_Large (MSH) EfficientNet_V2_L (mlp)
ViT_B_16 (mlp) ConvNeXt_Tiny (linear)
CrossEntropyLoss BCEWithLogitsLoss · sigmoid
WrappedModel pattern Direct-attachment pattern
↓ Confidence gate 0.65 ↓ ↓ Confidence gate 0.65 ↓
Confidence gating: if the Level 3 ensemble confidence falls below 0.65 the prediction is still returned, but annotated with an uncertainty warning and flagged for clinical review (details["level_3"]["gated"] == True).
Level 2 — Early vs Advanced (test set: 125 images)
Model
Head
Dropout
Optimizer
Scheduler
Accuracy
Macro F1
AUC-ROC
ConvNeXt_Base
mlp
0.1025
AdamP
CosineAnnealingLR
0.9520
0.9520
0.9857
EfficientNet_V2_L
linear
0.3564
AdamP
CosineAnnealingLR
0.9600
0.9600
0.9916
Level 3a — Stage I vs Stage II (test set: 63 images)
Model
Head
Dropout
Optimizer
Scheduler
Accuracy
Macro F1
AUC-ROC
EfficientNet_V2_L
mlp
0.1949
AdamP
StepLR
0.9048
0.9047
0.9849
ConvNeXt_Tiny
linear
0.1601
Lion
CosineAnnealingLR
0.9683
0.9682
0.9909
Level 3b — Stage III vs Stage IV (test set: 63 images)
Model
Head
Dropout
Optimizer
Scheduler
Accuracy
Macro F1
AUC-ROC
ConvNeXt_Large
multi_stage_head
0.6594
Lion
ReduceLROnPlateau
0.7778
0.7773
0.8861
ViT_B_16
mlp
0.5445
AdamW
ReduceLROnPlateau
0.7937
0.7934
0.8569
Stage III vs Stage IV is the hardest sub-task — subtle visual differences between full-thickness tissue loss with and without exposed bone/muscle make it challenging even for clinicians. The confidence gate at Level 3b (0.65) flags the most uncertain predictions.
Training Details
All models were trained on a curated dataset of ~1,000 pressure sore images collected from public medical databases, with stratified 70/20/10 train/validation/test splits.
Freeze schedule: backbone frozen for initial epochs, then progressively unfrozen (2-stage)
Early stopping: patience 8–10 epochs on validation loss
Hyperparameters: selected by Optuna trials (learning rate, weight decay, dropout, head type)
Mixed precision: fp16 via Accelerate
Architecture notes:
L1, L2, L3a: head is attached directly to the backbone's native classifier slot (model.classifier[2] for ConvNeXt, model.heads.head for ViT, etc.). Saved state dict has flat keys.
L3b: WrappedModel wrapper — backbone classifier slot replaced with nn.Identity, a separate head receives raw feature embeddings. Saved state dict has backbone.* / head.* key prefixes.