← All workProject 01 of 05
JEPA Neuropathy Classifier
ML pipeline in Python that classifies diabetic peripheral neuropathy from plantar pressure data, using self-supervised (JEPA) features plus clinical data in an SVM classifier.
Problem
Can a model learn useful features from foot pressure maps without labels, then help tell apart walking events with and without diabetic peripheral neuropathy?
Approach
Each step is stored as four pressure maps. I crop them to the foot, resize them to 39×20, and rotate the foot upright. A transformer encoder learns from the maps with no labels (JEPA: it predicts hidden patches from the visible ones). Its output, plus clinical features, goes into an SVM or XGBoost model. Predictions are averaged per patient. Evaluation uses 5-fold cross-validation grouped by patient, so the same person is never in both training and test.
- Pressure mapfour per walking step
- Crop + rotate39×20, foot upright
- 3×4 patchessome hidden as targets
- JEPA encoderlearns with no labels
- Embeddingmean-pooled + clinical
- SVMRBF kernel
- Predictionaveraged per patient
- Context: the encoder sees these
- Target: predicted, not seen
Masking strategy
Half of the patches (32 of 65) are picked at random as targets.
One foot region is the target, by patch rows. Here: the forefoot (30 patches).
One region plus 20% of the other patches. Here: the rearfoot and 9 extra patches.
The context encoder only sees the context patches and predicts what the target patches look like. The answers come from an EMA copy of the encoder. No labels are used.
- Four pressure maps per walking event
- Crop to contact region, resize to 39×20, rotate foot axis vertical
- Z-score per fold (fit on train only)
- Transformer encoder pretrained with JEPA (3×4 patches, EMA target encoder, no labels)
- Mean-pooled embeddings + tabular features
- RBF SVM / XGBoost classifier
- Per-patient averaging
What I’d do differently
The SVM uses fixed settings (C = 1.0). I’d add nested cross-validation so they’re tuned inside each training fold without touching the test patients.