File size: 8,396 Bytes
76eb7b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
library_name: pytorch
language:
- en
tags:
- medical-imaging
- ct
- feature-extraction
- research
---
# Proj2Rep-CTFM

**CT projections to image foundation-model representations.**

Proj2Rep predicts CT-FM embeddings from CT detector measurements, using a measurement denoiser, analytic back-projection and a learned encoder. It produces 512-dimensional slab embeddings and regional features for representation research in chest and abdomen CT.

Paper: *Proj2Rep: Predicting image foundation-model representations from CT detector measurements*.

![Proj2Rep measurement-to-embedding workflow](figures/workflow.png)

**Input:** prepared CT projections and scanner geometry. **Output:** CT-FM feature representations. Denoising is already part of inference.

## Results at a glance

Selected **routine-dose, full-view** results from the latest release (RC3):

- **0.970 chest / 0.959 abdomen Pearson r** in five-fold patient-level cross-validation of the measurement-encoder recipe.
- **0.945 Refined / 0.933 Adaptive r** in the separate 117-patient manufacturer-adaptation evaluation.
- **Refined R² = 0.886**, compared with **0.873** for the unrefined parent, in that adaptation evaluation.

![Routine-dose results](figures/routine_results.png)

Left: held-out fold models, 197 patients. Right: manufacturer adaptation, 117 patients. Bars show pointwise 95% whole-patient bootstrap intervals (2,000 resamples), conditional on trained fits. The two panels use distinct evaluation protocols. Chest and pooled abdomen are the primary cross-validation groups; the two abdomen manufacturer rows subdivide the pooled abdomen group.

## Demo images

![Scanner reference, before and after denoising, with matched zooms](figures/routine_demo.png)

Routine-dose chest example at the same anatomical position and display window (−1250 to 450 HU). **Left:** scanner reference. **Middle:** back-projection of the original measurements. **Right:** back-projection after the learned measurement denoiser. The lower row enlarges the cyan-marked regions using the same normalized crop. These are stored preprocessing outputs from the all-development denoiser, shown as a qualitative illustration; the held-out results are reported separately below. Denoising operates on projections before back-projection; the model then encodes the resulting volume into embeddings.

400 dpi PNGs and vector PDFs: [results](figures/routine_results.pdf) · [routine-dose demo](figures/routine_demo.pdf) · [workflow](figures/workflow.pdf).

## Choose a model

| Model | Folder | Intended use |
|---|---|---|
| **Proj2Rep-Universal** | `universal/` | Encoder and denoiser trained on all 197 development scans; general embedding extraction within the supported data conventions |
| **Proj2Rep-Adaptive** | `adaptive/` | GE/Siemens base encoders with chest/abdomen readouts, two support draws, full or 1/2, 1/4, 1/8 views |
| **Proj2Rep-Refined** | `refined/` | GE/Siemens encoders refined with full-view support data; full-view inference only |

Manufacturer denoisers are in `preprocessing/`. Adaptive uses ten target patients per body region and a readout matched to view stride. Refined uses ten chest and ten abdomen support patients per manufacturer. Draws 0 and 1 are alternative support selections, not independent evaluation cohorts. The CLI retains `--model adapter` for Adaptive compatibility.

## Cross-validation results

197 patients (99 chest, 98 abdomen), five folds, routine dose and full views. Results describe the held-out fold models of the Universal training recipe. The released Universal checkpoint was subsequently fitted to all 197 development scans.

| Group | Patients | Measurement r (95% CI) | Trained image r | Measurement R² |
|---|---:|---|---:|---:|
| Chest | 99 | 0.970 (0.967–0.972) | 0.968 | 0.940 |
| Abdomen | 98 | 0.959 (0.955–0.962) | 0.957 | 0.919 |
| Abdomen GE | 49 | 0.944 (0.938–0.950) | 0.941 | 0.890 |
| Abdomen Siemens | 49 | 0.956 (0.951–0.961) | 0.954 | 0.913 |

[Routine-dose CV estimates](results/cv.csv). Pearson r measures association with the routine-image CT-FM features; R² additionally reflects scale and offset agreement.

## Adaptation results

117 evaluation patients, 3,432 slabs, routine dose and full views. Overall scores equally weight four manufacturer/body-region strata. The two support draws use the same evaluation patients.

| Group | Patients | Adaptive r (95% CI) | Refined r (95% CI) | Refined R² |
|---|---:|---|---|---:|
| GE chest | 29 | 0.952 (0.946–0.957) | 0.955 (0.949–0.961) | 0.906 |
| GE abdomen | 29 | 0.913 (0.893–0.934) | 0.923 (0.912–0.934) | 0.846 |
| Siemens chest | 30 | 0.938 (0.926–0.950) | 0.958 (0.953–0.964) | 0.913 |
| Siemens abdomen | 29 | 0.931 (0.921–0.938) | 0.942 (0.933–0.948) | 0.881 |

Overall Adaptive r: **0.933 (0.927–0.940)**; Refined r: **0.945 (0.941–0.948)**.

Refinement improves R² over the unrefined parent by **0.013** (95% CI 0.012–0.015). This is an absolute R² difference, evaluated on the same patients.

[Overall estimates](results/overall.csv) · [Manufacturer and region estimates](results/adaptation.csv).

## Run inference

Install the download utility with `pip install -U huggingface_hub`. Download the repository:

```python
from huggingface_hub import snapshot_download
snapshot_download("markjiang1/Proj2Rep-CTFM", local_dir="Proj2Rep-CTFM")
```

Install a suitable PyTorch build, then from the downloaded directory:

```bash
pip install -r requirements.txt
python infer.py --help
python infer.py scan --case /data/C001 --region chest --model adapter --draw 0 --source routine --view-stride 1 --output embeddings.npz
python infer.py scan --case /data/L004 --region abdomen --model refined --draw 1 --source routine --view-stride 1 --output refined.npz
python -m proj2rep encode --cases /data/C001 --work universal --folds -1 --out embeddings/
```

The case directory must follow the projection and geometry conventions; see [input preparation and public API](USAGE.md). Ordinary CT image files alone are insufficient. Universal returns slab positions (`z0`), slab embeddings (`slab`) and regional embeddings (`regions`). Keep `manifest.json` and scanner conventions with the models; they are required runtime inputs.



## Smaller downloads

For **Universal-only embedding extraction**, download about **321 MB** of runtime files instead of the full **2.24 GB** repository:

```bash
hf download markjiang1/Proj2Rep-CTFM --local-dir Proj2Rep-Universal \
  --include 'config.json' 'universal/*' 'proj2rep/*' 'requirements.txt' 'README.md' 'USAGE.md' 'LICENSE'
cd Proj2Rep-Universal
pip install -r requirements.txt
python -m proj2rep encode --cases /data/C001 --work universal --folds -1 --out embeddings/
```

Use the complete package for Adaptive or Refined. Download sizes describe the current files and exclude installed dependencies. Keep `config.json` in filtered downloads so normal Hub download counting remains available. Add `--revision <commit-id>` to pin a reproducible version.

## Current release

This repository distributes the latest release (RC3). Earlier packaging snapshots contained identical weights and have been removed. Universal, Adaptive and Refined are distinct functional configurations within this single release.

## Evaluation scope

This card presents selected routine-dose, full-view CT-FM embedding-agreement results for chest and abdomen from GE and Siemens scanners. Clinical outcome validation is outside this evaluation. Pearson correlation was added post hoc using saved predictions.

Code: [MIT license](LICENSE). Upstream terms: [CT-FM model card](https://huggingface.co/project-lighter/ct_fm_feature_extractor).

## Download the complete model package

```bash
hf download markjiang1/Proj2Rep-CTFM --local-dir Proj2Rep-CTFM
```

This downloads the model files together with `config.json`, the package metadata used by Hugging Face's native download counter. Use the inference instructions above to load the model. The package metadata does not replace the runtime model configuration.

Download totals appear on this repository's model page. Hugging Face counts requests for designated files; downloading individual weight files without the configuration may not register. Counts represent Hub requests, not unique users. See [Hugging Face download statistics](https://huggingface.co/docs/hub/models-download-stats).