xuxuxuxuxu commited on
Commit
df7b338
·
verified ·
1 Parent(s): 8e48df6

3e64138956884942116d3956b0472ef645539db36d9cbc4e5c4a5dd88ef812aa

Browse files
Files changed (2) hide show
  1. README.md +120 -68
  2. archives/annotations-00000.tar +2 -2
README.md CHANGED
@@ -6,70 +6,70 @@ tags:
6
  - visual-grounding
7
  - auxiliary-training
8
  - parent-child
9
- pretty_name: PathGrounding - ZoomPath Auxiliary Training v4
10
  ---
11
 
12
  # PathGrounding
13
 
14
- Private, portable auxiliary training data for single-step pathology image
15
- grounding. Each record includes a parent image, an exact child crop, its bounding
16
- box in parent coordinates, a text question, and organ/MPP/training-level metadata
17
- when available. There are **618,432 parent-child pairs from seven sources**, using
18
- **34,193 distinct parent images**.
19
 
20
- This is not the ZoomPath v4 benchmark, does not include raw WSIs, and does not
21
- inherit the benchmark's doctor review. Source licenses and restrictions remain
22
- in the package; RefPath is gated and is not assumed redistributable. Keep this
23
- repository private unless all upstream redistribution permissions are checked.
 
24
 
25
- ## Data
 
 
 
 
26
 
27
- | Source | Pairs |
 
 
28
  | --- | ---: |
29
- | RefPath train | 28,908 |
30
- | PanNuke | 187,831 |
31
- | NuInsSeg | 25,718 |
32
- | NuCLS | 35,848 |
33
- | BCSS | 6,153 |
34
- | Lizard | 325,966 |
35
  | MIDOGpp | 8,008 |
36
- | **Total** | **618,432** |
37
-
38
- `partition` is `training`. Original `source_split`/fold information is preserved;
39
- no new train/val/test split is imposed. Keep targets from the same parent together
40
- when defining a later split. Nominal MPP and training scale estimates are flagged
41
- as approximate, especially the heuristic 20x/40x assignment for RefPath.
42
 
43
- ## Download And Restore
 
 
 
 
44
 
45
- Python 3.10+ is required. Authenticate with an account that has repository access:
 
46
 
47
  ```bash
48
  pip install -U huggingface_hub pillow
49
  hf auth login
50
- hf download xuxuxuxuxu/PathGrounding \
51
- --repo-type dataset --local-dir /data/pathgrounding-download
52
- python /data/pathgrounding-download/tools/restore_package.py \
53
- /data/pathgrounding-download /data/zoompath_training_v4
54
  ```
55
 
56
- Alternatively, call `huggingface_hub.snapshot_download` with the same repository,
57
- `repo_type="dataset"`, and `local_dir="/data/pathgrounding-download"`, then run
58
- the restore command. Interrupted downloads can be resumed.
59
-
60
- The images and per-parent annotations are stored in uncompressed TAR shards
61
- (approximately 2 GiB each) rather than 686,000 individual repository files.
62
- Restoration verifies every shard's SHA-256 checksum and recreates the original
63
- relative paths. It does not resize images or rewrite annotations/questions.
64
- Restoration can be rerun after interruption; it rewrites image/annotation files
65
- from the verified archives. Use a dedicated output directory.
66
-
67
- The data package is approximately 54 GB. Allow roughly 115 GB of free space to
68
- retain both downloaded archives and the restored package.
69
-
70
- ## Training Reader
71
 
72
  ```bash
 
 
73
  export PYTHONPATH=/data/zoompath_training_v4:$PYTHONPATH
74
  ```
75
 
@@ -79,37 +79,89 @@ from training_data import AuxiliaryTrainingReader
79
  reader = AuxiliaryTrainingReader("/data/zoompath_training_v4")
80
  row = next(reader.iter_records(dataset="refpath_train"))
81
  sample = reader.load_pair(row)
82
-
83
- parent = sample["parent_image"]
84
- child = sample["child_image"]
85
  question = sample["question"]
86
  selected_box = sample["child_bbox_xyxy_in_parent"]
87
- all_valid_boxes = sample["valid_target_bboxes_xyxy_in_parent"]
 
88
  organ, mpp, level = sample["organ"], sample["mpp"], sample["level"]
89
  ```
90
 
91
- Coordinates are integer pixel XYXY, top-left origin, half-open edges. The child
92
- is exactly the selected parent crop. `level` is `high`/`mid`/`low`, not a WSI
93
- pyramid index; MPP is in microns per pixel. Unsupported metadata remains null.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
- For multi-target training, use **all valid boxes**, not every box in the parent
96
- annotation file and not just the selected box. The reader applies the exact
97
- label/expression filter and checks `target_count`. Unselected matching targets
98
- are valid alternatives, not negatives. Stream `manifest.jsonl`; row-uniform
99
- sampling is not parent/query-uniform sampling.
100
 
101
  ## Layout And Validation
102
 
103
  | Repository path | Contents |
104
  | --- | --- |
105
- | `package/` | Manifest, index, reader, documentation, validation and source metadata |
106
- | `archives/` | Parent images, child crops and all per-parent annotations |
107
- | `tools/restore_package.py` | Checksum verifier and portable restoration tool |
108
- | `release_manifest.json` | File checksums, sizes, archive inventories and source counts |
109
-
110
- The restored package's `README.md` documents the full schema, provenance,
111
- approximate scale mapping, valid-target semantics and source restrictions.
112
- `validation.json` reports the completed export audit: all rows checked for
113
- structure/metadata and 700 deterministic crop pixel samples, with zero errors.
114
- The original source audit is preserved separately; the 700-sample export audit
115
- is not a claim that every exported image was rechecked pixel-by-pixel.
 
 
 
 
 
 
 
 
 
 
6
  - visual-grounding
7
  - auxiliary-training
8
  - parent-child
9
+ pretty_name: PathGrounding - Quality-Filtered Auxiliary Training
10
  ---
11
 
12
  # PathGrounding
13
 
14
+ Public, portable auxiliary training data for single-step pathology grounding.
15
+ The main package contains **235,346 quality-filtered parent-child pairs from
16
+ seven sources**, with **38,836 distinct parent images**. It replaces the earlier
17
+ unfiltered 618,432-pair main release.
 
18
 
19
+ **SegPath is a separate, optional package under `segpath/`: 2,193,058 pairs and
20
+ 105,864 parents.** It is not merged into the main manifest, counts, reader or
21
+ sampling configuration. It is disabled by default. Download it explicitly only
22
+ when needed; its mostly small semantic-region boxes differ from the larger
23
+ region-of-interest navigation targets in ZoomPath v4.
24
 
25
+ These are auxiliary training data, not the ZoomPath v4 benchmark. They contain no
26
+ raw WSIs and have not inherited the benchmark's doctor/pathologist review.
27
+ Upstream licenses and restrictions apply; RefPath is gated and redistribution
28
+ permission is not assumed; users must follow all relevant upstream terms.
29
+ SegPath is CC-BY-NC-SA 4.0.
30
 
31
+ ## Main Package
32
+
33
+ | Source | Retained pairs |
34
  | --- | ---: |
35
+ | BCSS | 2,836 |
36
+ | Lizard | 31,446 |
 
 
 
 
37
  | MIDOGpp | 8,008 |
38
+ | NuCLS | 32,538 |
39
+ | NuInsSeg | 20,521 |
40
+ | PanNuke | 111,605 |
41
+ | RefPath train | 28,392 |
42
+ | **Main total, excluding SegPath** | **235,346** |
 
43
 
44
+ Each record includes parent/child images, an exact parent-relative child box,
45
+ text question, organ and available scale metadata. `partition` is `training`;
46
+ original source split/fold information is retained, with no new train/val/test
47
+ split. Keep all related targets/parents, and source slides when identifiable,
48
+ together when defining later splits.
49
 
50
+ Python 3.10+ is required. Authenticate with an account that has repository access.
51
+ The explicit allow-list below does **not** download SegPath:
52
 
53
  ```bash
54
  pip install -U huggingface_hub pillow
55
  hf auth login
 
 
 
 
56
  ```
57
 
58
+ ```python
59
+ from huggingface_hub import snapshot_download
60
+
61
+ snapshot_download(
62
+ repo_id="xuxuxuxuxu/PathGrounding",
63
+ repo_type="dataset",
64
+ local_dir="/data/pathgrounding-download",
65
+ allow_patterns=["README.md", "release_manifest.json", "package/**",
66
+ "archives/**", "tools/restore_package.py"],
67
+ )
68
+ ```
 
 
 
 
69
 
70
  ```bash
71
+ python /data/pathgrounding-download/tools/restore_package.py \
72
+ /data/pathgrounding-download /data/zoompath_training_v4
73
  export PYTHONPATH=/data/zoompath_training_v4:$PYTHONPATH
74
  ```
75
 
 
79
  reader = AuxiliaryTrainingReader("/data/zoompath_training_v4")
80
  row = next(reader.iter_records(dataset="refpath_train"))
81
  sample = reader.load_pair(row)
82
+ parent, child = sample["parent_image"], sample["child_image"]
 
 
83
  question = sample["question"]
84
  selected_box = sample["child_bbox_xyxy_in_parent"]
85
+ valid_boxes = sample["valid_target_bboxes_xyxy_in_parent"]
86
+ ignored_boxes = sample["ignored_target_bboxes_xyxy_in_parent"]
87
  organ, mpp, level = sample["organ"], sample["mpp"], sample["level"]
88
  ```
89
 
90
+ The main images and annotations are uncompressed TAR shards, approximately
91
+ 2 GiB each. Restoration verifies SHA-256 and recreates relative paths without
92
+ resizing or changing questions. It is resumable by rerunning the command.
93
+ Use a dedicated output directory and allow space for both the downloaded shards
94
+ and the restored package. Exact byte totals are in `release_manifest.json`.
95
+
96
+ Coordinates are integer pixel XYXY, top-left origin, half-open edges. Children
97
+ are exact crops. For multi-target supervision, use all eligible `valid_boxes`,
98
+ not every annotated box or only the selected one. Source-supported answers
99
+ rejected by quality filtering remain `ignored_boxes`, never negatives.
100
+ The reader checks the exact label/expression and target count. Stream JSONL;
101
+ uniform row sampling is not uniform parent/query sampling.
102
+
103
+ `level` means the training category `high`/`mid`/`low`, not a WSI pyramid index.
104
+ MPP is microns per pixel; nominal RefPath magnification/MPP are approximate and
105
+ explicitly flagged. Unsupported metadata remains null.
106
+
107
+ ## Optional SegPath
108
+
109
+ Download only the independent SegPath package:
110
+
111
+ ```python
112
+ from huggingface_hub import snapshot_download
113
+
114
+ snapshot_download(
115
+ repo_id="xuxuxuxuxu/PathGrounding",
116
+ repo_type="dataset",
117
+ local_dir="/data/pathgrounding-download",
118
+ allow_patterns=["segpath/**", "tools/verify_segpath_package.py"],
119
+ )
120
+ ```
121
+
122
+ ```bash
123
+ python /data/pathgrounding-download/tools/verify_segpath_package.py \
124
+ /data/pathgrounding-download/segpath
125
+ export PYTHONPATH=/data/pathgrounding-download/segpath:$PYTHONPATH
126
+ ```
127
+
128
+ Use `AuxiliaryTrainingReader("/data/pathgrounding-download/segpath")` in a
129
+ separate reader/import context from the main package. The SegPath reader loads
130
+ images and annotations directly from eight native, uncompressed marker TARs;
131
+ no extraction is required. Reserve approximately 210 GiB plus download-cache
132
+ headroom. `segpath/release_manifest.json` gives the exact total and checksums.
133
+
134
+ Only official training patches are included. Targets are 8-connected semantic
135
+ mask regions, **not cell instances or WSI navigation paths**. Questions use full
136
+ labels. Known organs are retained; unknown organs are null. All rows record 40x,
137
+ approximate MPP `[0.25, 0.25]`, and training level `high`.
138
 
139
+ SegPath's `sampling_config.json` sets `enabled_by_default: false` and
140
+ `default_mix_probability: 0.0`. No combined manifest is provided. An explicitly
141
+ chosen future experiment should cap its contribution and sample marker, then
142
+ parent/query, then target, rather than concatenate rows and sample uniformly.
 
143
 
144
  ## Layout And Validation
145
 
146
  | Repository path | Contents |
147
  | --- | --- |
148
+ | `package/` | Main manifest, index, reader, quality policy, decisions, reports and provenance |
149
+ | `archives/` | Main parent/child images and per-parent annotations |
150
+ | `release_manifest.json` | Main-only inventory, counts, sizes and SHA-256 checksums |
151
+ | `tools/restore_package.py` | Main package checksum verification and restoration |
152
+ | `segpath/` | Independent optional SegPath manifest, index, TARs, reader and provenance |
153
+ | `segpath/release_manifest.json` | SegPath-only inventory, counts, sizes and checksums |
154
+ | `tools/verify_segpath_package.py` | SegPath checksums and sample loading check |
155
+
156
+ Both packages report `pass` with zero errors in their own `validation.json` and
157
+ `quality_validation.json`. The main export checks all 235,346 rows and 38,836
158
+ annotation views, with 700 deterministic crop-pixel samples. SegPath checks all
159
+ 2,193,058 rows and 105,864 annotation views, with 1,000 deterministic crop-pixel
160
+ rechecks; its source audit reconstructs every retained parent's original mask.
161
+ These automated audits are not a claim of a new manual or physician review.
162
+
163
+ The main package preserves historical source metadata showing SegPath excluded
164
+ from that build; this is intentional and does not invalidate the independent
165
+ validated `segpath/` release. Read each package's methods, quality policy,
166
+ filter results and provenance before training. Pin a Hub commit revision for
167
+ reproducible downloads.
archives/annotations-00000.tar CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:88cd521c4fb64ca027fea2f348bba39a314a55dad91b9a028e52361cdf243bd3
3
- size 285358080
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31f467ba323acf29cface50a8b4debcee8581d6dd8a4e3a7eb53e56e3533410d
3
+ size 621434880