fryabcfry's picture
Publish AMP-PD checkpoints, portable loaders and verified metrics
61b5997 verified
|
Raw History Blame Contribute Delete
5.94 kB
---
language:
- en
library_name: pytorch
tags:
- parkinsons
- proteomics
- tabular-regression
- ridge-regression
- autoencoder
- pca
- pls
- cross-validation
---
# CS4486 AMP-PD checkpoint collection
Existing fitted models from the CS4486 Parkinson's disease progression project.
- **Code:** https://github.com/feng-ruiyang/cs_ai_project
- **Checkpoints:** https://huggingface.co/fryabcfry/cs4486-amp-pd-checkpoints
- **Task:** predict UPDRS-1/2/3/4 at horizons 0/6/12/24 months.
- **Main inference inputs:** current visit month and current protein measurements. Visit IDs route requests; they are not predictive features.
## Results
SMAPE+1 is lower-is-better. The main comparisons use 248 patients, 1,068 clinical origins with proteins, and 12,578 observed labels.
| Model | Original split | Mean ± sample SD over split seeds 42/142/242 |
|---|---:|---:|
| Direct MLP baseline | 70.611 | Not run |
| Shared distribution MLP reference | 64.026 | 64.120 ± 0.166 |
| Selected AE + Ridge residual | 63.685 | 63.845 ± 0.181 |
| PCA + Ridge residual | 63.537 | 63.813 ± 0.517 |
| PLS + Ridge residual | 63.379 | 63.900 ± 0.496 |
PCA has the lowest three-split mean. Selected AE improves its same-split reference in all three splits and has the smallest variation among the protein methods. These are local CV results, not hidden Kaggle leaderboard scores.
## Contents
`checkpoints/` preserves the local experiment hierarchy:
| Directory | Contents |
|---|---|
| `retained/baseline_mlp/` | Five original CV folds and an all-patient model; preprocessing + direct regression MLP |
| `retained/pls/` | Five original CV folds; shared reference ensemble + PLS/Ridge parameters |
| `retained/selected_ae/` | Five original CV folds and an all-patient model; AE + reference ensemble + selected residual heads |
| `improvement_ablation_2026-11-16_v2/` | Rebuilt PCA and fixed-parameter ablation heads; loads neural dependencies from `retained/` |
| `three_split_seeds_2026-11-17/` | Five refitted model bundles for each of the three split seeds |
| `original_configs_2026-11-10/` | Earlier regression/distribution MLP checkpoints and preprocessing |
| `top_methods_2026-11-10/` | History-enabled adaptations of leading solution ideas |
| `isolated_inference_2026-11-10/` | Earlier frozen and retrained inference-boundary models |
| `top_nohistory_2026-11-10/` | Current-visit adapters with frozen and retrained models |
| `leakage_2026-11-10/` | Saved preprocessing from early controls; Ridge coefficients were not exported in that run |
History-enabled and `INVALID_*` diagnostic artifacts retain their original names. They are supplementary records, not main zero-history results. Old weights previously deleted locally are not recreated in this release.
`checkpoint_manifest.json` and `.csv` list every published parameter file, source-relative path, SHA-256 and any packaging transformation. Preprocessing arrays retain fitted statistics but omit dataset row-index arrays. Evaluation-probability dumps, raw clinical/protein/peptide data, participant-level OOF files and split membership tables are not included.
`code/ampd/` contains the inference source snapshot needed to load the current packages, including modules that may not yet be present in the linked GitHub revision. `load_models.py` provides portable convenience loaders. Ablation references are relative to the downloaded checkpoint root. Legacy pickle preprocessors require the matching Python package environment; current main model loaders use numeric arrays and PyTorch state dictionaries.
## Load a current model
Install `requirements.txt` and `huggingface_hub` in a separate environment, then:
```python
import sys
from huggingface_hub import snapshot_download
snapshot = snapshot_download('fryabcfry/cs4486-amp-pd-checkpoints')
sys.path.insert(0, snapshot)
from load_models import load_model
model = load_model('pls', fold=0, root=snapshot)
# Replace protein_vector with current measurements in model.spec['proteins'] order.
events = [{'visit_id': 'current_sample', 'visit_month': 12,
'proteins': protein_vector}]
prediction = model.predict(events)['pls'] # N x 16
```
Outputs are ordered by UPDRS component, with horizons 0, 6, 12, 24 inside each component. Missing protein values can be `None` or `NaN`.
| Loader name | Output key | Final all-patient model |
|---|---|---|
| `baseline_mlp` | `month_protein` | `fold='final'` |
| `selected_ae` | `selected_latent_r` | `fold='final'` |
| `pls` | `pls` | CV folds only |
| `pca` | `pca_full` | CV folds only |
| `ablations` | `ae_full`, `pca_full`, `pls_full`, and ablation names | CV folds only |
For repeated-split models:
```python
model = load_model('selected_ae', split_seed=142, fold=0, root=snapshot)
outputs = model.predict(events)
# outputs: reference, selected_ae, pca, pls
```
The split-seed loader returns all three residual predictions around the same reference. Full-data models have no separate test score; the reported metrics come from held-out CV folds. The original data must be obtained from the [Kaggle competition](https://www.kaggle.com/competitions/amp-parkinsons-disease-progression-prediction) to retrain the models.
## Related work
The report cites **SubspaceAD: Training-Free Few-Shot Anomaly Detection via Subspace Modeling** (Lendering, Akdag and Bondarev, CVPR 2026, pp. 28557–28566) as a related frozen-feature/subspace design. SubspaceAD uses a frozen DINOv2 image encoder, PCA and reconstruction residuals. Our selected AE is trained on training-patient proteins, frozen for latent screening, and followed by supervised Ridge prediction of UPDRS residuals. This collection does not contain DINOv2 or SubspaceAD pretrained weights.
Paper/project: https://clendering.github.io/SubspaceAD/
## Scope
This is a course research artifact for comparing input availability and protein representations. It is not a clinically validated prediction system.