jeffbbrown2 commited on
Commit
769041f
·
verified ·
1 Parent(s): ca6f535

Update README for v2 (716K rows, schema refresh)

Browse files
Files changed (1) hide show
  1. README.md +51 -48
README.md CHANGED
@@ -22,10 +22,12 @@ configs:
22
 
23
  # ConnectomeBench2
24
 
25
- ConnectomeBench2 is a unified benchmark for **automated proofreading of connectomic neural-segmentation data**. **401,170 samples** across 4 species (mouse, fly, human, zebrafish) and 5 sample types (real merge edits, real split edits, synthetic adjacent / junction / synapse controls), with the associated mesh geometry and electron-microscopy (EM) renderings.
26
 
27
  Downstream trainers should treat this dataset as the single source of truth for sample identity, labels, train/validation/test split, and which task(s) a row is valid for.
28
 
 
 
29
  ## Context: Connectomic Proofreading
30
 
31
  **Connectomics** scans and automatically segments neurons to create large-scale brain maps at cellular resolution. Two types of **segmentation errors** can occur in this process, which need to be corrected (= **proofreading**):
@@ -35,7 +37,7 @@ Downstream trainers should treat this dataset as the single source of truth for
35
 
36
  *Merge corrections* (of false splits) are applied to *multiple segments* that need to be correctly merged together. *Split corrections* (of false merges) are applied to *single segments* that need to be correctly split apart.
37
 
38
- For this reason, this dataset contains renderings of both *single-segment* (pre-split or post-merge) and *dual-segment* (post-split or pre-merge) mesh geometry, where possible. EM data is provided in dual format only — segmentation on imaging level is contiguous, so the single-version can be derived from the union of the dual.
39
 
40
  ## Renderings (geometry and EM imaging data)
41
 
@@ -43,7 +45,7 @@ For this reason, this dataset contains renderings of both *single-segment* (pre-
43
 
44
  (top: synapse merge-pair — both masks populated; bottom: junction control — single-mask only, mask B / seg B empty)
45
 
46
- **Geometry files** (the `geometry` and `geometry_single` columns) are compressed `.npz` payloads that decode to `(3, 7, 224, 224) float16` arrays — three 2D views (front, side, top) × seven channels:
47
 
48
  | ch | content |
49
  |---|---|
@@ -55,24 +57,11 @@ For this reason, this dataset contains renderings of both *single-segment* (pre-
55
  | 5 | mask A |
56
  | 6 | mask B (empty in single-segment renders) |
57
 
58
- Note that single and dual segment renders differ not only in mask channels, but also subtly differ in all other channels, due to slight differences in mesh geometry from merging/splitting.
59
-
60
- **Free split-mask labels.** For `split_edit` rows, the dual-segment render (post-split) provides ground-truth split-mask labels (Mask A / Mask B channels) for the corresponding single-segment render (pre-split) — split-mask-generation tasks get pixel-level supervision without extra labeling.
61
-
62
- **EM coverage.** EM views are not present on every sample. Coverage by `sample_type` (full dataset):
63
-
64
- | sample_type | rows | has_em |
65
- |---|---|---|
66
- | adjacent_control | 121,333 | 100% |
67
- | junction_control | 38,272 | 100% |
68
- | synapse_control | 18,182 | 100% |
69
- | merge_edit | 146,461 | 38% |
70
- | split_edit | 77,213 | 23% |
71
- | **total** | **401,170** | **63% (37% null)** |
72
 
73
- real human edits (merge_edit, split_edit) only got EM rendered on a stratified subset; synthetic controls all have EM. Filter by `has_em` if your task requires it.
74
 
75
- **EM imaging files** (`em_xy` / `em_xz` / `em_yz` / `em_best` columns) are PNG-encoded 3-channel slices:
76
 
77
  | ch | content |
78
  |---|---|
@@ -80,18 +69,18 @@ real human edits (merge_edit, split_edit) only got EM rendered on a stratified s
80
  | 1 | segment A mask |
81
  | 2 | segment B mask |
82
 
83
- Four imaging views per sample: three cardinal slices (xy, xz, yz) + a `best` slice at an oblique angle that maximizes the visible area of both segments (sum of their logs).
84
 
85
- For single-segment tasks, segment A and B should be merged (and B zeroed). The `best` view may leak some dual-label information (it takes both labels into account); we advise against testing single-segment tasks on `em_best`.
86
 
87
  ## Loading
88
 
89
  ```python
90
  from datasets import load_dataset
91
 
92
- ds = load_dataset("jeffbbrown2/connectomebench2-smoke", split="train")
93
  sample = ds[0]
94
- # sample["em_xy"] is a PIL Image (HF auto-decodes)
95
  # sample["geometry"] is bytes — decode with:
96
  import io, numpy as np
97
  geom = np.load(io.BytesIO(sample["geometry"]))["arr_0"] # shape (3, 7, 224, 224) float16
@@ -113,7 +102,7 @@ The `metadata/{train,val,test}.parquet` sidecars contain identifier/label/modali
113
  ### Identifiers
114
  - **`combined_sample_hash`** — primary key (md5 hex 32-char of `f"{source_archive}|{source_archive_sample_hash}"`); guaranteed unique across the dataset.
115
  - **`source_archive_sample_hash`** — legacy 12-char hex hash from upstream; kept for traceability, not unique alone.
116
- - **`source_archive`** — name of the originating render archive (e.g. `edits_and_adj_controls_fly`, `junction_controls_mouse`, `synapse_controls_fly`). 10 distinct values (5 archives × species).
117
 
118
  ### Sample identity
119
  - **`sample_type: str`** — single source of truth for what kind of sample this row is. Five values:
@@ -128,41 +117,40 @@ The `metadata/{train,val,test}.parquet` sidecars contain identifier/label/modali
128
  - **`species: str`** — `fly` / `mouse` / `human` / `zebrafish`.
129
 
130
  ### Image content
131
- - **`geometry`** — bytes; compressed npz (key `"arr_0"`) decoding to `(3, 7, 224, 224) float16`. Null when the sample has no dual-segment render.
132
- - **`geometry_single`** — same shape/dtype, single-segment version. Null when not present.
133
- - **`em_xy` / `em_xz` / `em_yz` / `em_best`** — PIL Images (3-channel PNG, `(224, 224, 3) uint8`). Null when the row has no EM views.
134
- - **`has_single_mask: bool`** — convenience flag.
135
- - **`has_dual_mask: bool`** — convenience flag.
136
- - **`has_em: bool`** — true if any `em_*` column is non-null.
137
- - **`present_slots: list[str]`** — modality tags actually present (e.g. `["geometry", "geometry_single", "em_xy", "em_xz", "em_yz", "em_best"]`).
138
 
139
  ### Task routing & labels
140
- - **`task_routing: list[str]`** — which downstream task(s) this row can serve as training data for:
141
- - `false_split_correction` — merge-correction task; fires when `sample_type ∈ {merge_edit, synapse_control, adjacent_control}` AND `has_dual_mask`.
142
- - `false_merge_identification` — merge-error binary classification; fires when `sample_type ∈ {split_edit, junction_control}` AND `has_single_mask`.
143
- - `split_mask_generation` — pixel-level split prediction; fires when `sample_type == split_edit` AND `has_single_mask`.
144
- - **`false_split_correction_label: bool`** = `same_neuron`. Populated for all rows; trainers filter by `task_routing`.
145
- - **`false_merge_identification_label: bool`** = `not same_neuron`. Populated for all rows; trainers filter by `task_routing`.
146
-
147
- **Usage note.** Downstream training scripts must load the appropriate geometry render per task:
148
- - **Merge Correction** of false splits should use **dual-segment** renders
149
- - **Split Correction** of false merges should use **single-segment** renders
150
- - Furthermore, fuse A/B channels of EM images and **discard `em_best`** (it sees both labels at oblique angle and can leak ground truth)
151
 
152
  Otherwise, ground-truth task or label information may leak to the model and bias performance.
153
 
154
  ### Train/val/test split
155
- - **`split: str`** — `train` / `validation` / `test`. ~80/10/10 split assigned by spatial location of the proofreading sample (`interface_point_nm`), matched via cube splits (50µm cubes tiling the volume and randomly split).
156
 
157
  ### Other
158
- - **`metadata: str`** — JSON-stringified original metadata struct. Parse with `json.loads`. Useful keys: `operation_id`, `source_operation_id`, `strategy`, `image_types`, `interface_point_nm`, `before_root_ids`, `after_root_ids`, …
159
 
160
  ## Counts
161
 
162
- - **401,170 rows** total · ~80/11/9 train (319,727) / validation (43,517) / test (37,926)
163
- - 251,499 rows with EM views; all 401,170 have geometry
164
- - **~2.2M model-level samples** (EM × 4 views + geom × 3 views), or **~2.8M** counting dual + single geom separately
165
- - 506 parquet shards (~240 MB each)
166
 
167
  ## Layout
168
 
@@ -206,3 +194,18 @@ Please also cite the upstream connectome sources used by this dataset:
206
  - FlyWire (Drosophila): https://flywire.ai/
207
  - H01 (human cortex): https://h01-release.storage.googleapis.com/landing.html
208
  - Zebrafish (fish1): https://fish1-release.storage.googleapis.com/index.html
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  # ConnectomeBench2
24
 
25
+ ConnectomeBench2 is a unified benchmark for **automated proofreading of connectomic neural-segmentation data**. **716,485 samples** across 4 species (mouse, fly, human, zebrafish) and 5 sample types (real merge edits, real split edits, synthetic adjacent / junction / synapse controls), with the associated mesh geometry and electron-microscopy (EM) renderings.
26
 
27
  Downstream trainers should treat this dataset as the single source of truth for sample identity, labels, train/validation/test split, and which task(s) a row is valid for.
28
 
29
+ > **v2 (June 2026)** — major schema refresh. The prior `v1-may06` release (401,170 rows) is preserved as a git tag; load it via `load_dataset("jeffbbrown2/ConnectomeBench2", revision="v1-may06")`. Breaking changes vs v1 are summarized in "Changelog" at the bottom.
30
+
31
  ## Context: Connectomic Proofreading
32
 
33
  **Connectomics** scans and automatically segments neurons to create large-scale brain maps at cellular resolution. Two types of **segmentation errors** can occur in this process, which need to be corrected (= **proofreading**):
 
37
 
38
  *Merge corrections* (of false splits) are applied to *multiple segments* that need to be correctly merged together. *Split corrections* (of false merges) are applied to *single segments* that need to be correctly split apart.
39
 
40
+ For this reason, this dataset contains renderings of both *single-segment* (pre-split or post-merge) and *dual-segment* (post-split or pre-merge) mesh geometry. Each row carries one `geometry` render whose dual-vs-single semantics is determined by the row's `sample_type`. EM data is provided in dual format only — segmentation on imaging level is contiguous, so the single-version can be derived from the union of the dual.
41
 
42
  ## Renderings (geometry and EM imaging data)
43
 
 
45
 
46
  (top: synapse merge-pair — both masks populated; bottom: junction control — single-mask only, mask B / seg B empty)
47
 
48
+ **Geometry files** (the `geometry` column) are compressed `.npz` payloads that decode to `(3, 7, 224, 224) float16` arrays — three 2D views (front, side, top) × seven channels:
49
 
50
  | ch | content |
51
  |---|---|
 
57
  | 5 | mask A |
58
  | 6 | mask B (empty in single-segment renders) |
59
 
60
+ The `geometry` column is **dual-segment** when `sample_type ∈ {merge_edit, adjacent_control, synapse_control}` and **single-segment** when `sample_type ∈ {split_edit, junction_control}`. The two flavors differ not only in mask channels but also subtly in all other channels, due to slight differences in mesh geometry from merging/splitting. See the per-row `metadata.is_merge` field (or equivalently, sample_type) to disambiguate.
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ **Free split-mask labels.** For `split_edit` rows, three additional PNG columns `split_mask_front`, `split_mask_side`, `split_mask_top` provide per-view, pixel-level ground truth for the post-split (dual) state, view-aligned with the single-segment `geometry` render. Split-mask-generation tasks consume these directly without extra labeling. Coverage: 127,445 / 145,338 split_edits (87.7%); the rest had no after-state available.
63
 
64
+ **EM imaging files** (`em_xy_before` / `em_xz_before` / `em_yz_before` / `em_best_before` columns) are PNG-encoded 3-channel slices of the before-edit state:
65
 
66
  | ch | content |
67
  |---|---|
 
69
  | 1 | segment A mask |
70
  | 2 | segment B mask |
71
 
72
+ Four imaging views per sample: three cardinal slices (xy, xz, yz) + a `best` slice at an oblique angle that maximizes the visible area of both segments (sum of their logs). The `_before` suffix is to be explicit that these reflect the pre-edit segmentation; no `_after` EM is rendered.
73
 
74
+ For single-segment tasks, segment A and B should be merged (and B zeroed). The `best` view may leak some dual-label information (it takes both labels into account); we advise against testing single-segment tasks on `em_best_before`.
75
 
76
  ## Loading
77
 
78
  ```python
79
  from datasets import load_dataset
80
 
81
+ ds = load_dataset("jeffbbrown2/ConnectomeBench2", split="train")
82
  sample = ds[0]
83
+ # sample["em_xy_before"] is a PIL Image (HF auto-decodes)
84
  # sample["geometry"] is bytes — decode with:
85
  import io, numpy as np
86
  geom = np.load(io.BytesIO(sample["geometry"]))["arr_0"] # shape (3, 7, 224, 224) float16
 
102
  ### Identifiers
103
  - **`combined_sample_hash`** — primary key (md5 hex 32-char of `f"{source_archive}|{source_archive_sample_hash}"`); guaranteed unique across the dataset.
104
  - **`source_archive_sample_hash`** — legacy 12-char hex hash from upstream; kept for traceability, not unique alone.
105
+ - **`source_archive`** — name of the originating render archive (e.g. `unified_mouse`, `unified_controls_fly`). 8 distinct values (`unified_{sp}` for ops/adj, `unified_controls_{sp}` for junction+synapse, × 4 species).
106
 
107
  ### Sample identity
108
  - **`sample_type: str`** — single source of truth for what kind of sample this row is. Five values:
 
117
  - **`species: str`** — `fly` / `mouse` / `human` / `zebrafish`.
118
 
119
  ### Image content
120
+ - **`geometry`** — bytes; compressed npz (key `"arr_0"`) decoding to `(3, 7, 224, 224) float16`. Always present in v2. Dual-segment when `sample_type {merge_edit, adj_ctrl, syn_ctrl}`, single-segment when `sample_type ∈ {split_edit, junction_ctrl}`.
121
+ - **`em_xy_before` / `em_xz_before` / `em_yz_before` / `em_best_before`** — PIL Images (3-channel PNG, `(224, 224, 3) uint8`). Always present in v2.
122
+ - **`split_mask_front` / `split_mask_side` / `split_mask_top`** — PIL Images, per-view after-state split GT for `split_edit` rows. Null for other sample types. ~87.7% coverage on split_edits.
123
+ - **`has_em: bool`** — true if any `em_*_before` column is non-null. True for every row in v2.
124
+ - **`has_after_mask: bool`** — true iff the three `split_mask_*` columns are populated. Only ever true for `sample_type == split_edit`.
125
+ - **`present_slots: list[str]`** — modality tags actually present (e.g. `["em_best_before", "em_xy_before", "em_xz_before", "em_yz_before", "geometry"]` or with `+ "split_mask_*"` for split_edits with after-mask).
 
126
 
127
  ### Task routing & labels
128
+ - **`task_routing: list[str]`** — which downstream task(s) this row can serve as training data for. Computed from `sample_type` + `has_after_mask`:
129
+ - `false_split_correction` — merge-correction task. Fires for `sample_type ∈ {merge_edit, synapse_control, adjacent_control}`.
130
+ - `false_merge_identification` — merge-error binary classification. Fires for `sample_type ∈ {split_edit, junction_control}`.
131
+ - `split_mask_generation` — pixel-level split prediction. Fires for `sample_type == split_edit` AND `has_after_mask`.
132
+ - **`false_split_correction_label: int | null`** `1` for `merge_edit`, `0` for `synapse_control` / `adjacent_control`, **null** for split_edit / junction_control. Trainers filter by `task_routing` (or check for non-null label).
133
+ - **`false_merge_identification_label: int | null`** `1` for `split_edit`, `0` for `junction_control`, **null** for the other three. Same filtering rule.
134
+
135
+ **Usage note.** Downstream training scripts must load the appropriate `geometry` flavor per task:
136
+ - **Merge Correction** of false splits should use **dual-segment** `geometry` (rows where `sample_type ∈ {merge_edit, adj_ctrl, syn_ctrl}`)
137
+ - **Split Correction** of false merges should use **single-segment** `geometry` (rows where `sample_type ∈ {split_edit, junction_ctrl}`)
138
+ - Furthermore, fuse A/B channels of EM images and **discard `em_best_before`** (it sees both labels at oblique angle and can leak ground truth)
139
 
140
  Otherwise, ground-truth task or label information may leak to the model and bias performance.
141
 
142
  ### Train/val/test split
143
+ - **`split: str`** — `train` / `validation` / `test`. Target ratios 75/12.5/12.5; observed ~74.2/11.6/14.2 (slight hash-based per-cube assignment noise at the scale of one volume). Assigned by spatial location of the proofreading sample `edit_point_nm` for operations and adjacent controls, `interface_point_nm` for junction controls, `synapse_ctr_pt_nm` for synapse controls — bucketed into 80µm cubes. Cube extent is the canonical segmentation-volume bbox per species (queried from CloudVolume), not the min/max of observed bank points.
144
 
145
  ### Other
146
+ - **`metadata: str`** — JSON-stringified original metadata struct. Parse with `json.loads`. Useful keys: `operation_id`, `source_operation_id`, `strategy`, `image_types`, `interface_point_nm`, `edit_point_nm`, `before_root_ids`, `after_root_ids`, `is_merge`, `species`,
147
 
148
  ## Counts
149
 
150
+ - **716,485 rows** total · ~74/12/14 train (531,734) / validation (82,822) / test (101,929)
151
+ - All rows have `geometry` + 4 EM views; 127,445 split_edits additionally have 3 split-mask views
152
+ - **~5.1M model-level samples** counting per-modality views (3 geom views + 4 EM views) × 716,485 + 3 split-mask views × 127,445
153
+ - 903 parquet shards (~250 MB each) — 669 train / 105 val / 129 test
154
 
155
  ## Layout
156
 
 
194
  - FlyWire (Drosophila): https://flywire.ai/
195
  - H01 (human cortex): https://h01-release.storage.googleapis.com/landing.html
196
  - Zebrafish (fish1): https://fish1-release.storage.googleapis.com/index.html
197
+
198
+ ## Changelog
199
+
200
+ ### v2 (June 2026)
201
+ - **Row count**: 401,170 → 716,485
202
+ - **EM coverage**: now 100% across all sample types (was partial in v1)
203
+ - **`geometry_single` column removed**: only `geometry` exists now; its dual-vs-single semantics derive from `sample_type` / `metadata.is_merge`
204
+ - **EM column renamed**: `em_{xy,xz,yz,best}` → `em_{xy,xz,yz,best}_before` (no `_after` EM exists; suffix makes the before-edit state explicit)
205
+ - **Split-mask columns added**: `split_mask_{front,side,top}` PNG per-view labels for `split_edit` rows
206
+ - **Flags reworked**: `has_single_mask`, `has_dual_mask` → `has_after_mask`. Use `metadata.is_merge` (or `sample_type`) to distinguish dual-vs-single geometry render.
207
+ - **Label semantics nullable**: `false_split_correction_label` / `false_merge_identification_label` are now non-null only for relevant sample types (was always populated in v1, derived from `same_neuron`)
208
+ - **Split assignment**: 80/10/10 → 75/12.5/12.5; 50µm → 80µm cubes; bbox now from CloudVolume (canonical) instead of bank min/max; per-sample-type coord choice (`edit_point_nm` for ops/adj, `interface_point_nm` for junction_ctrl, `synapse_ctr_pt_nm` for synapse_ctrl)
209
+ - **Source archives**: 10 → 8 (`unified_{sp}` and `unified_controls_{sp}` × 4 species)
210
+
211
+ To load the old version: `load_dataset("jeffbbrown2/ConnectomeBench2", revision="v1-may06")`.