--- license: other pretty_name: ConnectomeBench2 tags: - connectomics - proofreading - 3d - electron-microscopy - mesh size_categories: - 100K **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. ## Context: Connectomic Proofreading **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**): - **False Splits** — corrected via merge corrections - **False Merges** — corrected via split corrections *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. 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. ## Renderings (geometry and EM imaging data) ![channel decomposition: synapse 2-mask vs junction single-mask](figures/channel_decomposition.png) (top: synapse merge-pair — both masks populated; bottom: junction control — single-mask only, mask B / seg B empty) **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: | ch | content | |---|---| | 0 | silhouette | | 1 | depth | | 2 | normal_x | | 3 | normal_y | | 4 | normal_z | | 5 | mask A | | 6 | mask B (empty in single-segment renders) | 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. **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. **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: | ch | content | |---|---| | 0 | raw EM intensity | | 1 | segment A mask | | 2 | segment B mask | 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. 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`. ## Loading ```python from datasets import load_dataset ds = load_dataset("jeffbbrown2/ConnectomeBench2", split="train") sample = ds[0] # sample["em_xy_before"] is a PIL Image (HF auto-decodes) # sample["geometry"] is bytes — decode with: import io, numpy as np geom = np.load(io.BytesIO(sample["geometry"]))["arr_0"] # shape (3, 7, 224, 224) float16 ``` Or with raw `pyarrow`: ```python import pyarrow.parquet as pq import numpy as np, io df = pq.read_table("train/train-00000.parquet").to_pandas() geom = np.load(io.BytesIO(df.iloc[0]["geometry"]))["arr_0"] ``` The `metadata/{train,val,test}.parquet` sidecars contain identifier/label/modality columns only (no image bytes) — useful for fast filtering or inspection. ## Columns ### Identifiers - **`combined_sample_hash`** — primary key (md5 hex 32-char of `f"{source_archive}|{source_archive_sample_hash}"`); guaranteed unique across the dataset. - **`source_archive_sample_hash`** — legacy 12-char hex hash from upstream; kept for traceability, not unique alone. - **`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). ### Sample identity - **`sample_type: str`** — single source of truth for what kind of sample this row is. Five values: - `merge_edit` — positive merge-correction edit - `split_edit` — positive split-correction edit - `adjacent_control` — synthetic negative for merge-correction (segments adjacent to genuine correction) - `junction_control` — putative junction in proofread neuron (negative merge-error-id sample) - `synapse_control` — synapse pair across neurons (negative merge-correction) - **`same_neuron: bool`** — derived from sample_type: - `True` for `merge_edit`, `junction_control` - `False` for `split_edit`, `adjacent_control`, `synapse_control` - **`species: str`** — `fly` / `mouse` / `human` / `zebrafish`. ### Image content - **`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}`. - **`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. - **`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. - **`has_em: bool`** — true if any `em_*_before` column is non-null. True for every row in v2. - **`has_after_mask: bool`** — true iff the three `split_mask_*` columns are populated. Only ever true for `sample_type == split_edit`. - **`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). ### Task routing & labels - **`task_routing: list[str]`** — which downstream task(s) this row can serve as training data for. Computed from `sample_type` + `has_after_mask`: - `false_split_correction` — merge-correction task. Fires for `sample_type ∈ {merge_edit, synapse_control, adjacent_control}`. - `false_merge_identification` — merge-error binary classification. Fires for `sample_type ∈ {split_edit, junction_control}`. - `split_mask_generation` — pixel-level split prediction. Fires for `sample_type == split_edit` AND `has_after_mask`. - **`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). - **`false_merge_identification_label: int | null`** — `1` for `split_edit`, `0` for `junction_control`, **null** for the other three. Same filtering rule. **Usage note.** Downstream training scripts must load the appropriate `geometry` flavor per task: - **Merge Correction** of false splits should use **dual-segment** `geometry` (rows where `sample_type ∈ {merge_edit, adj_ctrl, syn_ctrl}`) - **Split Correction** of false merges should use **single-segment** `geometry` (rows where `sample_type ∈ {split_edit, junction_ctrl}`) - 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) Otherwise, ground-truth task or label information may leak to the model and bias performance. ### Train/val/test split - **`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. ### Other - **`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`, … ## Counts - **716,485 rows** total · ~74/12/14 train (531,734) / validation (82,822) / test (101,929) - All rows have `geometry` + 4 EM views; 127,445 split_edits additionally have 3 split-mask views - **~5.1M model-level samples** counting per-modality views (3 geom views + 4 EM views) × 716,485 + 3 split-mask views × 127,445 - 903 parquet shards (~250 MB each) — 669 train / 105 val / 129 test ## Layout ``` README.md shards.csv metadata across shards (path, sha256, n_samples, size) train/train-*.parquet WebDataset-style parquet shards with image bytes val/val-*.parquet test/test-*.parquet metadata/ sidecar parquets with identifiers + labels (no bytes) train.parquet val.parquet test.parquet demo.parquet stratified mini-shard (one-line preview) figures/ channel_decomposition.png ``` ## Sources & License Derived from the following upstream connectomic proofreading datasets: - **MICrONS** (mouse cortex) - **FlyWire** (Drosophila brain) - **H01** (human cortex) - Zebrafish larval connectome License = `other`; users must comply with upstream licenses (which may differ across species/sources). Final outbound license will be set after upstream license review. ## Citation If you use ConnectomeBench2, please cite: ``` Brown, J., Farkas, T., Razgar, G., Boyden, E. S. ConnectomeBench2: A unified benchmark for automated connectomic proofreading. (2026, in submission). Brown J. and Farkas T. contributed equally as first authors. ``` Please also cite the upstream connectome sources used by this dataset: - MICrONS (mouse cortex): https://www.microns-explorer.org/cortical-mm3 - FlyWire (Drosophila): https://flywire.ai/ - H01 (human cortex): https://h01-release.storage.googleapis.com/landing.html - Zebrafish (fish1): https://fish1-release.storage.googleapis.com/index.html ## Changelog ### v2 (June 2026) - **Row count**: 401,170 → 716,485 - **EM coverage**: now 100% across all sample types (was partial in v1) - **`geometry_single` column removed**: only `geometry` exists now; its dual-vs-single semantics derive from `sample_type` / `metadata.is_merge` - **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) - **Split-mask columns added**: `split_mask_{front,side,top}` PNG per-view labels for `split_edit` rows - **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. - **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`) - **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) - **Source archives**: 10 → 8 (`unified_{sp}` and `unified_controls_{sp}` × 4 species) To load the old version: `load_dataset("jeffbbrown2/ConnectomeBench2", revision="v1-may06")`.