xiangjx commited on
Commit
8c32a7f
·
verified ·
1 Parent(s): ee30bde

README: concise overview of he2mif/, he2st/ and the new sdk/ folder

Browse files
Files changed (1) hide show
  1. README.md +12 -107
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  license: other
3
  license_name: mixed-per-folder
4
- license_details: he2mif/ is MIT (MIPHEI-ViT Orion-CRC release); he2st/ is CC BY-NC-SA 4.0 (HEST-1k)
5
  pretty_name: MuPaD examples
6
  tags:
7
  - pathology
@@ -17,119 +17,24 @@ size_categories:
17
 
18
  # MuPaD examples
19
 
20
- Small, ready-to-run slices of the datasets behind the MuPaD finetuning
21
- projects in [github.com/jinxixiang/MUPAD](https://github.com/jinxixiang/MUPAD).
22
- Each folder mirrors the layout of the full dataset, so the released code runs
23
- on it unchanged: the demos, prediction and scoring, and short training runs.
24
 
25
- ```
26
- he2mif/ H&E -> 16-channel mIF (5-HE2mIF) ORION-CRC tiles, 393 MB, MIT
27
- he2st/ H&E -> single-cell transcriptomics (6-HE2ST) HEST-1k Xenium slides, 12.4 GB, CC BY-NC-SA 4.0
28
- ```
29
-
30
- Download one folder at a time:
31
 
32
  ```bash
33
  huggingface-cli download xiangjx/MuPaD-examples --repo-type dataset --include "he2mif/*" --local-dir examples
34
- tar xf examples/he2mif/ORIONCRC_dataset_tile_20x.tar -C examples/he2mif
35
  huggingface-cli download xiangjx/MuPaD-examples --repo-type dataset --include "he2st/*" --local-dir examples
36
  ```
37
 
38
- The mIF slice ships as one tar: its 2,536 small tiles as loose files would hit
39
- the Hub's API rate limit on download.
40
-
41
- ## he2mif/ORIONCRC_dataset_tile_20x.tar
42
-
43
- A 393 MB slice of the **ORION-CRC** tile dataset at 20x (512 x 512 px H&E,
44
- 333 x 333 px 17-channel mIF and nuclei masks), in the same layout as the full
45
- [Zenodo record 15340874](https://zenodo.org/records/15340874):
46
-
47
- ```
48
- he/ H&E tiles (.jpeg)
49
- if/ mIF tiles, 17 channels (.tiff, uint8)
50
- nuclei/ nuclei instance masks (.tiff, int32 slide-global labels)
51
- csv_nuclei_pos/ per-slide nuclei positivity tables (.csv)
52
- train_dataframe.csv 600 tiles, 100 from each of 6 training slides
53
- val_dataframe.csv 120 tiles, 60 from each of the 2 validation slides
54
- test_dataframe.csv 120 tiles, 60 from each of the 2 test slides
55
- demo_dataframe.csv the 2 validation tiles shown in 5-HE2mIF/demo.ipynb
56
- slide_dataframe.csv, channel_stats.json
57
- ```
58
-
59
- **Selection.** Tiles with tissue (`Hoechst_prop >= 0.2`) were sampled uniformly
60
- at random per slide (seed 0), so the split is representative of tissue tiles,
61
- not cherry-picked. The two demo tiles are the exception: one from each
62
- validation slide, both in the top few percent of the split by patch PCC
63
- (0.62 and 0.53 against a split median of ~0.32), chosen to make the demo
64
- legible. Treat the demo as a best case; score the val or test split here for
65
- representative numbers.
66
-
67
- **Positivity tables.** The full per-slide `csv_nuclei_pos/*.csv` run to
68
- 300 MB each. Here each is cut down to the nuclei that appear in the selected
69
- tiles' masks (every mask label was found), 1-3 MB per slide, which is all the
70
- stage-1 loss weighting needs.
71
-
72
- Extract it and point the code at it:
73
-
74
- ```bash
75
- tar xf examples/he2mif/ORIONCRC_dataset_tile_20x.tar -C examples/he2mif
76
- export ORION_DATA_ROOT=$PWD/examples/he2mif/ORIONCRC_dataset_tile_20x
77
- ```
78
 
79
- Source: the MIPHEI-ViT processed Orion-CRC release, redistributed under its
80
- **MIT license**.
81
-
82
- > G. Balezo et al. "MIPHEI-ViT: Multiplex Immunofluorescence Prediction from
83
- > H&E Images using ViT Foundation Models," 2025.
84
-
85
- ## he2st/
86
-
87
- Two Xenium breast cancer slides from [HEST-1k](https://github.com/mahmoodlab/HEST),
88
- processed for H&E → single-cell spatial transcriptomics with MuPaD-512 (`6-HE2ST`).
89
-
90
- | slide | split | subject | tiles | cells |
91
- |---|---|---|---|---|
92
- | NCBI917 | train | B7 | 945 | 52,688 |
93
- | NCBI920 | val | B5 | 2,527 | 187,016 |
94
-
95
- Both come from *Single-Cell Spatial Transcriptomics of Archival Human Lung and
96
- Breast Tumor FFPE Samples* (HEST v1.3.1). NCBI920 is a validation slide: the
97
- model never trains on it, it only selects the checkpoint.
98
-
99
- ```
100
- cache/<slide>/ the tile cache (scripts/preprocess_slides.py)
101
- he.npy (n_tiles, 512, 512, 3) uint8 H&E, 100 µm tiles
102
- expr.npy (n_cells, 90) float16 log1p expression, tile by tile
103
- contours.npy tile-local cell contours at 512 px
104
- contour_offsets.npy start of each cell's contour
105
- cell_seg.npy each row's index into the xenium_seg polygons
106
- tiles.parquet per tile: origin (full-res px), cell_start, n_cells
107
- meta.json pixel size, subject, genes, ...
108
- features/musk/<slide>/
109
- emb_cell.npy (n_cells, 1024) float16 MUSK feature of every cell (he2st.embed_musk)
110
- HEST1k/ the raw HEST-1k files these were built from
111
- wsis/ st/ xenium_seg/ cells/ metadata/ HEST_v1_3_1.csv (these two rows)
112
- splits_example.json train = NCBI917, val = test = NCBI920, for a smoke run
113
- ```
114
-
115
- Rows of `expr.npy`, `emb_cell.npy` and every per-cell prediction are the same
116
- cells in the same order. Tile `t` holds rows `[cell_start, cell_start + n_cells)`.
117
-
118
- Point the code at it:
119
-
120
- ```bash
121
- export HEST_ROOT=$PWD/examples/he2st/HEST1k HE2ST_CACHE=$PWD/examples/he2st/cache \
122
- HE2ST_MUSK_FEATURES=$PWD/examples/he2st/features/musk
123
- ```
124
 
125
- The cache can be rebuilt from `HEST1k/` with
126
- `python scripts/preprocess_slides.py --slides NCBI917,NCBI920` (into an empty
127
- `HE2ST_CACHE`), which reproduces `cache/` exactly. To score a model on the
128
- held-out slide, pass `--slides NCBI920` to `scripts/export_mupad_cells.py` and
129
- `scripts/score.py`. To smoke-test training, set
130
- `HE2ST_SPLITS=$PWD/examples/he2st/splits_example.json`.
131
 
132
- Source: derived from **HEST-1k** (Jaume et al., "HEST-1k: A Dataset for Spatial
133
- Transcriptomics and Histology Image Analysis", NeurIPS 2024), redistributed
134
- under its **CC BY-NC-SA 4.0** license: non-commercial use, with attribution,
135
- and derivatives under the same license.
 
1
  ---
2
  license: other
3
  license_name: mixed-per-folder
4
+ license_details: he2mif/ is MIT (MIPHEI-ViT Orion-CRC release); he2st/ is CC BY-NC-SA 4.0 (HEST-1k); sdk/ redistributes two H&E slides under their original releases' terms (ORION-CRC, HEST-1k)
5
  pretty_name: MuPaD examples
6
  tags:
7
  - pathology
 
17
 
18
  # MuPaD examples
19
 
20
+ Example data for [MuPaD](https://github.com/jinxixiang/MUPAD) (paper code) and the [MuPaD SDK](https://github.com/jinxixiang/mupad-sdk) (whole-slide inference).
 
 
 
21
 
22
+ | folder | contents | size | licence |
23
+ |---|---|---|---|
24
+ | `he2mif/` | ORION-CRC tiles for `5-HE2mIF`: 840 H&E / 17-channel mIF / nuclei tiles in the Zenodo [15340874](https://zenodo.org/records/15340874) layout, as one tar | 0.4 GB | MIT |
25
+ | `he2st/` | two HEST-1k Xenium breast slides for `6-HE2ST` (NCBI917 train, NCBI920 val): raw HEST files, the 100 µm tile cache and per-cell MUSK features | 12.4 GB | CC BY-NC-SA 4.0 |
26
+ | `sdk/` | the two held-out H&E whole-slide images the SDK's end-to-end checks run on: ORION-CRC CRC11 (0.325 µm/px) and HEST-1k NCBI920 (0.087 µm/px); H&E only, see `sdk/README.md` | 6.9 GB | original terms |
 
27
 
28
  ```bash
29
  huggingface-cli download xiangjx/MuPaD-examples --repo-type dataset --include "he2mif/*" --local-dir examples
30
+ tar xf examples/he2mif/ORIONCRC_dataset_tile_20x.tar -C examples/he2mif # tiles ship as one tar
31
  huggingface-cli download xiangjx/MuPaD-examples --repo-type dataset --include "he2st/*" --local-dir examples
32
  ```
33
 
34
+ **he2mif.** Tiles with tissue were sampled uniformly per slide: 600 train, 120 val, 120 test, plus the two demo tiles of `5-HE2mIF/demo.ipynb` (a best case, not typical). Point the code at it with `ORION_DATA_ROOT=$PWD/examples/he2mif/ORIONCRC_dataset_tile_20x`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ **he2st.** `cache/<slide>/` is the tile cache, `features/musk/<slide>/emb_cell.npy` the per-cell MUSK features, `HEST1k/` the raw inputs they were built from (`wsis/ st/ xenium_seg/ cells/ metadata/`). Rows of `expr.npy`, `emb_cell.npy` and every prediction are the same cells in the same order. Set `HEST_ROOT=$PWD/examples/he2st/HEST1k HE2ST_CACHE=$PWD/examples/he2st/cache HE2ST_MUSK_FEATURES=$PWD/examples/he2st/features/musk`; `splits_example.json` makes a one-slide smoke run.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ **sdk.** `python scripts/e2e_mif_orion.py` and `python scripts/e2e_expression_ncbi920.py` in the SDK download these slides themselves; the ground truth (Orion mIF, Xenium counts) comes from the original ORION-CRC and HEST-1k releases.
 
 
 
 
 
39
 
40
+ Sources: ORION-CRC tiles from the MIPHEI-ViT release (Balezo et al., 2025; MIT); HEST-1k (Jaume et al., NeurIPS 2024; CC BY-NC-SA 4.0, non-commercial, attribution, share-alike).