3e64138956884942116d3956b0472ef645539db36d9cbc4e5c4a5dd88ef812aa
Browse files- README.md +120 -68
- 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 -
|
| 10 |
---
|
| 11 |
|
| 12 |
# PathGrounding
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
**34,193 distinct parent images**.
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
| --- | ---: |
|
| 29 |
-
|
|
| 30 |
-
|
|
| 31 |
-
| NuInsSeg | 25,718 |
|
| 32 |
-
| NuCLS | 35,848 |
|
| 33 |
-
| BCSS | 6,153 |
|
| 34 |
-
| Lizard | 325,966 |
|
| 35 |
| MIDOGpp | 8,008 |
|
| 36 |
-
|
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
as approximate, especially the heuristic 20x/40x assignment for RefPath.
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 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 |
-
|
|
|
|
| 88 |
organ, mpp, level = sample["organ"], sample["mpp"], sample["level"]
|
| 89 |
```
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
sampling is not parent/query-uniform sampling.
|
| 100 |
|
| 101 |
## Layout And Validation
|
| 102 |
|
| 103 |
| Repository path | Contents |
|
| 104 |
| --- | --- |
|
| 105 |
-
| `package/` |
|
| 106 |
-
| `archives/` |
|
| 107 |
-
| `
|
| 108 |
-
| `
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
The
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31f467ba323acf29cface50a8b4debcee8581d6dd8a4e3a7eb53e56e3533410d
|
| 3 |
+
size 621434880
|