Spaces:
Sleeping
Sleeping
File size: 2,902 Bytes
63353cd a7c73c5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | ---
title: AMDRisk
emoji: 📉
colorFrom: indigo
colorTo: pink
sdk: gradio
sdk_version: 6.14.0
python_version: '3.13'
app_file: app.py
pinned: false
license: mit
short_description: Predicting risk of late AMD using Deep Learning
---
# AMD Risk Prediction
PyTorch reimplementation of the DeepSeeNet-based AMD progression risk framework from Peng et al., *npj Digital Medicine* 2020, **“Predicting risk of late age-related macular degeneration using deep learning.”**
- Extracts DeepSeeNet hidden features from drusen and pigment abnormality models.
- Fits Cox proportional hazards models using image-derived features plus age and smoking status.
## Feature Extraction
- Input: paired baseline CFPs
- `LE_PATHNAME`
- `RE_PATHNAME`
- Models used:
- `deepseenet/weights/drus.pt`
- `deepseenet/weights/pig.pt`
- Image preprocessing:
- RGB conversion
- validation transform from `deepseenet/augmentations.py`
- default input size: `1024 × 1024`
- Feature source:
- penultimate layer of each DeepSeeNet classifier
- final linear layer input captured by forward hook
- Feature layout:
```text
LE_DRUS_000 ... LE_DRUS_127
RE_DRUS_000 ... RE_DRUS_127
LE_PIG_000 ... LE_PIG_127
RE_PIG_000 ... RE_PIG_127
````
- Total feature dimension:
```text
128 × 2 models × 2 eyes = 512 features / patient
```
- Output:
```text
data/areds1_deepseenet_features.npz
```
- Stored arrays:
- `features`: `(N, 512)`
- `patids`: `(N,)`
- `feature_names`: `(512,)`
## Cox Model Training
- Survival labels from endpoint-specific JSON files:
- `Status_late_amd`
- `Status_anyga`
- `Status_nv`
- Time-to-event column:
- `Survival_in_years`
- Predefined fold split:
- train: folds `3, 4, 5, 6, 7, 8, 9`
- validation: fold `2`
- test: folds `0, 1`
- Stage 1 baseline:
- structured grading features only
```text
LE_DRUS
RE_DRUS
LE_PIG
RE_PIG
age
smkever
````
* Stage 2 DeepSeeNet features:
* selected hidden features from 512-dimensional feature vector
* plus `age`
* plus `smkever`
* Preprocessing:
* low-variance feature filtering
* train-only `StandardScaler`
* same scaler applied to validation/test
* Cox model:
* `lifelines.CoxPHFitter`
* L2 penalization
* default penalizer: `0.01`
* Feature-selection tweaks:
* global top-k selection
* rank features by univariate train-set concordance
* examples: `--top-k 8`, `--top-k 16`
* block-balanced top-k selection
* select top-k features separately from each block:
```text
LE_DRUS_*
RE_DRUS_*
LE_PIG_*
RE_PIG_*
```
* Block-balanced example:
```text
--top-k-per-block 4
4 LE_DRUS features
4 RE_DRUS features
4 LE_PIG features
4 RE_PIG features
+ age
+ smkever
= 18 total features
```
* Rationale:
* avoids one highly correlated feature block dominating global top-k
* improves stability of Cox fitting
* closer in spirit to grouped/correlation-aware feature selection
|