File size: 38,703 Bytes
9761ef8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff8b3dd
 
 
 
 
 
 
 
9761ef8
 
 
 
 
 
 
6b047d5
 
 
 
7b542b6
 
9761ef8
 
 
 
 
 
 
ff8b3dd
 
 
 
 
 
 
 
 
 
 
9761ef8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b047d5
9761ef8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7b542b6
9761ef8
7b542b6
 
 
 
 
9761ef8
 
 
7b542b6
 
 
 
 
9761ef8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b047d5
 
 
7b542b6
 
 
 
6b047d5
9761ef8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
---
license: cc-by-nc-4.0
language:
  - en
pretty_name: "SurgSync — Multi-modal dVRK Dataset (v1.0)"
size_categories:
  - 100K<n<1M
tags:
  - robotics
  - surgical-robotics
  - da Vinci Surgical System
  - da Vinci Research Kit (dVRK)
  - imitation-learning
  - multimodal
  - stereo-video
  - kinematics
  - action-recognition
  - surgical-phase-recognition
  - instrument-tracking
  - instrument-segmentation
  - 6d-pose-estimation
  - surgical-tool-pose
  - hand-eye-calibration
task_categories:
  - robotics
  - video-classification
  - image-segmentation
  - object-detection
  - keypoint-detection
  - other
# The HF dataset viewer is disabled intentionally — SurgSync's
# multi-modal structure (FFV1 video + Hive-partitioned parquets +
# per-episode JSON metadata + calibration files) does not fit the
# viewer's tabular preview model, and the FFV1 codec doesn't render in
# most browsers. For a browseable preview of episodes, tasks,
# annotations, and example clips, use the project page at
# https://surgsync.github.io/ instead.
viewer: false
---

# SurgSync — Multi-modal dVRK Dataset (v1.0)

> **Project page:** **https://surgsync.github.io/**
> **Toolkit (reader / packer / unpacker, processing pipelines, full
> docs, code examples):** **https://github.com/jackzhy96/dvrk_multimodal_data_collection**
> **Upstream use:** a subset of SurgSync has been incorporated into
> NVIDIA's **PhysicalAI-Robotics-Open-H-Embodiment** dataset collection
> under
> [`Surgical/jhu/lcsr/smarts`](https://huggingface.co/datasets/nvidia/PhysicalAI-Robotics-Open-H-Embodiment/tree/main/Surgical/jhu/lcsr/smarts).
> If you accessed the data through that redistribution, the citation
> is still the SurgSync ICRA 2026 paper — see [§ Citation](#citation).

This dataset card is intentionally a **summary only**. For schema
specifications, the loader API, packing / unpacking workflow, the
preprocessing pipelines (rectify, depth, optical flow, kinematic
heatmaps), and every command-line invocation, see the toolkit
repository linked above.

> 📺 **No HF dataset viewer.** SurgSync's structure (FFV1 video +
> Hive-partitioned parquets + per-episode JSON + calibration files)
> doesn't fit Hugging Face's tabular preview model, and FFV1 doesn't
> render in most browsers. The viewer is disabled by design — for a
> browseable preview of episodes, tasks, annotations, and example
> clips, **visit the project page at
> [surgsync.github.io](https://surgsync.github.io/)**. Programmatic
> access to the data is unchanged: use the toolkit's loader API
> (`dvrk_data_processing.surgsync.open_dataset(...)`) against either
> a local clone or `huggingface_hub.snapshot_download`'d copy.

---

## Dataset summary

**SurgSync** is a multi-modal recording of the **da Vinci Research
Kit (dVRK) Patient Side Manipulator** performing six dry-lab and
ex-vivo surgical tasks. Each episode bundles synchronized stereo + side
video, per-arm kinematics (ECM, PSM1, PSM2), frame-level contact /
phase / step / gesture annotation, and full camera + hand-eye
calibration. The release is packed in the **SurgSync** archive
format — bit-exact FFV1 video plus columnar Parquet — and is fully
invertible back to its original raw layout via `surgsync unpack`.

| | |
|---|---|
| **Episodes** | **205** |
| **Total frames** | **168,132** |
| **Total duration** | **≈ 6 h 37 m** of synchronized recordings (10 Hz master clock) |
| **Tasks** | **6** task partitions (see below) |
| **Recorder variants** | 109 online (real-time PSM Cartesian setpoints) + 96 offline (no Cartesian setpoint) |
| **Operator skill** | 74 Expert · 94 Intermediate · 37 Novice |
| **Case types** | 185 Ex-vivo · 20 Table-Top Phantom |
| **Raw image resolution** | 1920 × 1080 (stereo + side) |
| **Release size** | ≈ 670 GB on disk (3,912 SHA-256-tracked files) |
| **Format** | SurgSync release option **B** (raw FFV1 + per-modality parquets + calibration) |
| **schema / data version** | `1.0.0` / `1.0` |
| **License** | CC-BY-NC-4.0 |

> ⚠ **v1.0 ships raw modalities only — derived modalities are
> user-generated.** Rectified H.264 video, FoundationStereo **depth**,
> RAFT **optical flow**, kinematic-projection **heatmaps**, and
> hand-eye-projected `measured_cp_calibrated` / `setpoint_cp_calibrated`
> columns are **not bundled in this release**, but the toolkit ships
> every preprocessing stage that produces them — run
> `scripts/run_all_stages.py` against the unpacked raw clips and you
> can generate the full option-C layout locally with whatever GPU /
> pipeline version you prefer. The raw FFV1 + parquets that v1.0 ships
> are the source of truth; the derived streams are deterministic
> functions of (raw inputs × pipeline version). See
> [§ This release vs. the dataset described on surgsync.github.io](#this-release-vs-the-dataset-described-on-surgsyncgithubio)
> for what shipping derived modalities would add, and
> [§ Limitations](#known-limitations--data-quality-notes) for the
> per-modality details.

---

## Supported downstream tasks

Beyond the workflow-recognition tasks the dataset was primarily
collected for (phase / step / gesture / contact annotation),
SurgSync's combination of synchronized stereo video, full PSM
kinematics, and hand-eye-calibrated arm-to-camera transforms also
enables several **instrument-centric vision tasks**. The table below
lists the level of ground-truth supervision each task gets from the
release as it stands, distinguishing what works directly off the v1.0
bytes vs. what additional convenience comes from running the
toolkit's preprocessing pipeline yourself (see
[§ Limitations 2](#2-derived--preprocessed-streams-are-not-bundled-in-v10-but-the-toolkit-generates-them)
for the workflow).

| Task | Ground-truth source | Out of the box (v1.0) | After local preprocessing |
|---|---|:--:|:--:|
| **Instrument 6-DoF pose estimation** | PSM `measured_cp` (per-arm Cartesian pose at the tool tip) combined with hand-eye calibration files (`PSM{1,2}-registration-{dVRK,open-cv}.json`) projects the tool tip into the stereo-left / stereo-right camera frame. Both PSMs annotated per-frame. | ✅ (compute it yourself by composing `PSM*.parquet:measured_cp.*` with the hand-eye JSON; see toolkit's hand-eye-mapping pipeline) | ✅ (`PSM*.parquet:measured_cp_calibrated.*` columns populated by `gen_kinematic_heatmap_handeye.py` — drop-in, no client-side composition) |
| **Instrument tracking** | Same pipeline as 6-DoF pose — projected tool-tip pose gives a per-frame 2D image-plane location for each PSM in both stereo views. Frame-level contact annotation (`annotation.parquet:contact.PSM{1,2}`) marks when each tool is interacting with tissue, useful for filtering / evaluating contact-aware trackers. | ✅ (same client-side composition as above) | ✅ (`preprocess/heatmap_PSM{1,2}_{left,right}.mkv` Gaussian heatmaps centered on the projected tool tip — drop-in supervision for tracker training) |
| **Instrument segmentation** | **No pixel-level masks ship in either form.** Running the toolkit's preprocessing locally adds the kinematic-projection heatmaps, which provide a localized prior (where the tool tip is) usable as a weak label for SAM-style mask propagation or as a self-supervised cue. Users who need pixel-precise masks should run an off-the-shelf model (SAM2, FoundationModelStereo segmentation heads) or hand-annotate a subset. | ⚠ Possible only via external models / hand annotation | ⚠ Heatmaps available as weak supervision; pixel-precise masks still external |
| **Surgical phase / step / gesture recognition** | Per-frame verbalized labels in `annotation.parquet` (`phase`, `step`, `gesture.PSM{1,2}`) on every episode. | ✅ | — (no change; already in v1.0) |
| **Action recognition / imitation learning** | Per-frame PSM joint and Cartesian state + setpoints (`PSM{1,2}.parquet:measured_js`, `setpoint_js`, `setpoint_cp` on online episodes) paired with stereo + side video gives a state ↔ action ↔ observation tuple at the 10 Hz master clock. | ✅ (online_data partition for setpoint_cp; both partitions for measured states + setpoint_js) | — (no change; already in v1.0) |
| **Stereo depth estimation** | Bit-exact stereo pairs (`video_raw/stereo_{left,right}.mkv`) + stereo calibration (`calibration/stereo_calib_params.json`). | ✅ for *running* a stereo model on the pairs | ✅ Pre-computed FoundationStereo `preprocess/depth.mkv` ground-truth-like reference becomes available |
| **Optical flow** | Bit-exact monocular streams in `video_raw/`. | ✅ for *running* a flow model | ✅ Pre-computed RAFT `preprocess/flow_{left,right}.mkv` shipped |
| **Contact / interaction detection** | Frame-level binary `annotation.parquet:contact.PSM{1,2}` on every episode (205/205 coverage). | ✅ | — (no change) |

### Notes specific to the instrument-vision tasks

- **Cameras and arms.** PSM1 and PSM2 are the two operative arms.
  ECM is the endoscope arm — its kinematics give the camera's pose
  in world frame, which is used by the hand-eye solver but isn't a
  per-frame target itself. The stereo-left camera is the **master
  clock reference**; stereo-right and side share the same master
  timeline via per-modality `delta_to_master.<topic>_ns` offsets on
  `timestamp.parquet`.
- **Hand-eye calibration accuracy.** Two registration formats ship
  per arm: `<arm>-registration-dVRK.json` (from the dVRK's own
  calibration routine) and `<arm>-registration-open-cv.json` (from
  an OpenCV-based solver). They are not byte-equivalent — pick the
  one matching your downstream toolkit. See the hand-eye-mapping
  module in the toolkit repo for the recommended composition order.
- **Per-task vision-task coverage.** Suturing (92 episodes, 90,068
  frames) and dissection (70 combined episodes, 64,890 frames)
  dominate the release — pose / tracking models will see the most
  varied tissue interactions there. `peg_transfer` (18 episodes,
  table-top phantom) is closer to a controlled benchmark.
- **Two operative arms is the norm, not the exception.** Every
  episode in v1.0 carries both PSM1 and PSM2; bimanual handoffs are
  routinely present in `peg_transfer` and `tissue_manipulation`.
  Single-arm subsets are not provided — filter by PSM activity
  yourself if needed.

---

## This release vs. the dataset described on surgsync.github.io

The figures on the project page describe the **target / proposed**
dataset. This v1.0 release is a **subset**: nine episodes short and
without the derived modalities. The breakdown:

### Episode count: 205 (this release) vs. 214 (proposed on surgsync.github.io)

| Task group (project-page labels) | Proposed on surgsync.github.io | In this v1.0 release | Δ | How this release maps to the proposed groups |
|---|---:|---:|---:|---|
| Suturing & Knot Tying | 104 | 92  | **−12** | `single_interrupted_stitch` |
| Peg Transfer          | 18  | 18  |   0  | `peg_transfer` |
| Tissue Manipulation   | 21  | 25  | **+4**  | `tissue_manipulation` (this release carries 4 extra clips beyond the project-page count) |
| Dissection            | 71  | 70  | **−1**  | `cold_cut_dissection` (61) + `cold_cut_dissection_intestine` (8) + `cold_cut_dissection_skin_peel` (1) |
| **Total**             | **214** | **205** | **−9** | |

### Recorder-variant split

| | Proposed | This release | Δ |
|---|---:|---:|---:|
| Online-matching   | 112 | 109 | **−3** |
| Offline-matching  | 102 | 96  | **−6** |
| **Total**         | **214** | **205** | **−9** |

### Operator-skill split

The project page reports Novice / Experienced / Professional;
this release uses Novice / Intermediate / Expert (same three buckets,
different labels):

| | Proposed | This release | Δ |
|---|---:|---:|---:|
| Novice / Novice            | 37 | 37 |   0 |
| Experienced / Intermediate | 95 | 94 | **−1** |
| Professional / Expert      | 82 | 74 | **−8** |

### Derived modalities planned by surgsync.github.io — **not bundled in v1.0, but reproducible locally**

| Modality | Project page | v1.0 ships? | How to obtain |
|---|:--:|:--:|---|
| Stereo rectification (rectified H.264 video)        | planned | ❌ | toolkit: `gen_rectify_resize.py` |
| Depth estimation (FoundationStereo)                 | planned | ❌ | toolkit: `gen_depth_estimate.py` (GPU + FoundationStereo weights) |
| Optical flow (RAFT)                                 | planned | ❌ | toolkit: `gen_optical_flow_raft.py` (GPU) |
| Kinematic reprojection via Gaussian heatmap         | planned | ❌ | toolkit: `gen_kinematic_heatmap_handeye.py` |
| Hand-eye-projected kinematics (`*_calibrated.*`)    | planned | ❌ (columns exist in schema, NULL on every row) | side-effect of the kinematic-heatmap stage above |

The source raw clips for v1.0 were not run through the preprocessing
pipeline upstream of packing, so the packer had nothing to encode for
those streams. Every episode's `episode_meta.json` reflects this:
`has_video_raw=true`, `has_preprocess=false`, `has_preview=false`,
`has_calibrated_kinematic=false`.

**Users can generate these streams themselves.** The toolkit ships
every preprocessing stage as a Hydra-configured script under
`src/dvrk_data_processing/`. The end-to-end runner
`scripts/run_all_stages.py` chains rectify → kinematic heatmap →
depth → optical flow and emits a v1.1-equivalent `preprocess/` tree
next to the unpacked raw clips. Re-packing the augmented clips with
`surgsync build` then produces the option-C layout shown in
[§ Hypothetical layout *with* derived modalities](#hypothetical-layout-with-derived-modalities-v11-target).
Compute cost is GPU-bound (FoundationStereo dominates); end-to-end
processing of the full release takes ~1 day on a single high-end
consumer GPU.

### Other diffs worth flagging

- **Capture rate is by design, not a downsample artifact.** The
  project page describes the native capture at **stereo 1080p @ 60 Hz**
  and **side 1080p @ 30 Hz**. The packed release's per-frame master
  clock is **10 Hz** — chosen as a deliberate **trade-off between
  cross-modal time alignment and per-frame frequency**. At the native
  rates, individual topics drift several ms apart between samples
  (PSM kinematics at ~100 Hz, ECM at ~100 Hz, stereo-left header
  stamps at 60 Hz, side at 30 Hz), and a strict nearest-neighbor join
  would either reject many frames or accept high per-modality
  deltas. At 10 Hz the worst-case master ↔ topic delta sits well
  inside the alignment tolerance bands, so every shipped frame has
  every modality populated within spec. If you need higher temporal
  resolution for a downstream task, the native-rate samples are still
  recoverable through `surgsync unpack` (which re-emits the raw
  per-modality files at their original capture times). Native source
  frequencies are preserved per-modality on
  `PSM*.parquet:source_frequency_hz` and via the
  `delta_to_master.<topic>_ns` offsets on `timestamp.parquet`.
- **Subject demographics.** The project page references 13 human
  subjects (3 female / 10 male) as operators. This release does **not**
  ship per-episode operator identity — only the three-bucket skill
  level — in line with anonymization for the public archive.

---

## Tasks

| Task partition (this release) | Episodes | Frames |
|---|---:|---:|
| `single_interrupted_stitch`     | 92 | 90,068 |
| `cold_cut_dissection`           | 61 | 55,595 |
| `tissue_manipulation`           | 25 |  5,907 |
| `peg_transfer`                  | 18 |  7,267 |
| `cold_cut_dissection_intestine` |  8 |  7,176 |
| `cold_cut_dissection_skin_peel` |  1 |  2,119 |
| **Total** | **205** | **168,132** |

Per-task vocabulary (phase / step / gesture id → English phrase) ships
in `meta/tasks.jsonl`. The packer **verbalizes** ids at pack time, so
the per-frame annotation parquet columns carry full text — see
[§ Limitations 1](#1-tasksjsonl-vocab-is-best-effort-not-a-closed-enumeration)
for caveats around strict id→text joins.

---

## Modalities (what's in v1.0)

- **Video**`video_raw/{stereo_left, stereo_right, side}.mkv`
  (FFV1, bit-exact, 1920 × 1080). Every episode has stereo; side is
  present when a side camera was recorded.
- **Kinematics**`ECM.parquet`, `PSM1.parquet`, `PSM2.parquet` with
  measured / setpoint joint state, measured Cartesian pose / velocity,
  and (PSM1/2 only, online episodes only) `setpoint_cp.*`. Jaw
  position is carried for the PSMs. Units: m, rad, xyzw quaternions.
- **Annotations**`annotation.parquet` with `contact.PSM{1,2}`
  (int8 0/1), `gesture.PSM{1,2}` (verbalized text), `phase`
  (verbalized text), `step` (verbalized text).
- **Calibration** — raw `left.yaml` / `right.yaml`, stereo extrinsics,
  hand-eye `<arm>-registration-{dVRK,open-cv}.json` files, all copied
  byte-exact from the source clip.
- **Release-level meta** — `meta/{dataset.json, tasks.jsonl,
  episodes.parquet, episodes.jsonl, index.parquet, stats.parquet,
  modalities.json, manifest.json}`.

Full schema, column-by-column field descriptions, and the loader API
live in the toolkit repository.

---

## Layout on disk

### Packed release (this v1.0 — what HF actually ships)

```
<release_root>/
├── meta/                                       # release-level index + manifest
├── online_data/episodes/<task>/<clip_idx>/...  # 109 episodes (with setpoint_cp)
├── offline_data/episodes/<task>/<clip_idx>/... # 96 episodes (no setpoint_cp)
├── README.md   CHANGELOG.md                    # version-stamped docs
└── .logs/<run_id>.jsonl                        # structured per-clip pack outcomes
```

Per episode:

```
<dataset>/episodes/<task>/<clip_idx>/
├── episode_meta.json   modalities.json   time_sync_stat.json
├── timestamp.parquet   ECM.parquet   PSM1.parquet   PSM2.parquet   annotation.parquet
├── video_raw/{stereo_left, stereo_right, side}.mkv      # FFV1, bit-exact, 1920×1080
├── calibration/                                          # camera intrinsics/extrinsics + hand-eye
└── .surgsync_complete.json
```

### After unpacking (`surgsync unpack <release_root> --out <out>`)

The unpacker is **fully invertible**: every file in the original raw
clip layout is reconstructed from the packed parquets + MKVs. The
image bytes are **pixel** bit-exact (decoded ndarrays match
byte-for-byte); see [§ Limitations 10](#10-image-bytes--raw-image-bytes-after-unpack-pixel-bit-exact-not-byte)
for the PNG-encoder caveat. Per-episode layout produced by unpack:

```
<out>/<dataset>/<clip_idx>/
├── meta_data.json                                        # operator skill, case type, tool inventory, ...
├── image/
│   ├── left/<i>.png                                      # frame-aligned to master clock
│   ├── right/<i>.png
│   └── side/<i>.png                                      # only when a side camera was recorded
├── kinematic/
│   ├── ECM/<i>.json                                      # one file per frame, per arm
│   ├── PSM1/<i>.json
│   └── PSM2/<i>.json
├── annotation/
│   ├── contact_detection/<i>.json                        # {"PSM1": 0/1, "PSM2": 0/1}
│   ├── phase/<i>.json                                    # verbalized text (see note on id ↔ text mapping below)
│   ├── step/<i>.json                                     # verbalized text
│   └── gesture/<i>.json                                  # {"PSM1": "<verbalized text>", "PSM2": "<verbalized text>"}
├── time_syn/<i>.json                                     # per-frame per-topic master-clock deltas
├── camera_calibration/
│   ├── left.yaml   right.yaml   stereo_calib_params.json
├── hand_eye_calibration/
│   ├── PSM1-registration-dVRK.json     PSM1-registration-open-cv.json
│   └── PSM2-registration-dVRK.json     PSM2-registration-open-cv.json
└── .surgsync_unpacked.json                               # resume sentinel; presence means clip is done
```

Unpack is resume-friendly — re-running without `--force` skips clips
whose `.surgsync_unpacked.json` is present. The fidelity table for
every modality lives in `HOW_to_RUN_unpack.md` in the toolkit repo.

**Note on `phase` / `step` / `gesture` formats.** The unpacked JSONs
carry **verbalized text** for these fields — the packer enriches at
pack time using `workflow_description.json`, and the unpacker writes
back whatever the parquet carries. Both numeric ids and verbalized
text are first-class — the **id ↔ text mapping ships with the release**
in `meta/tasks.jsonl` (per task) and `workflow_description.json` (the
master vocabulary), so consumers can convert in either direction
depending on what their downstream code prefers. Numeric ids are a
compact, convenient shorthand for annotation tools; verbalized text
is friendlier for LLM-style pipelines that consume natural-language
labels directly.

```python
import json
tasks = {json.loads(line)["task"]: json.loads(line)
         for line in open("meta/tasks.jsonl")}
# id → text (forward, what the packer uses):
step_id_to_text = tasks["single_interrupted_stitch"]["step_vocab"]
# text → id (inverse, for re-encoding):
step_text_to_id = {v: k for k, v in step_id_to_text.items()}
# Caveat: ~1.8% of step rows carry text outside the task's own
# step_vocab (see § Limitations 1) — use a global union lookup if
# you need strict round-tripping.
```

### Layout *with* derived modalities (after you run the preprocessing pipeline locally)

The same per-episode tree gains a `video/`, `preprocess/`, and an
extra `calibration/rectify_params.json` once you run the toolkit's
preprocessing stages on the unpacked raw clips. **None of these
files are in the v1.0 release as shipped** (see
[§ Limitations 2](#2-no-rectified--depth--flow--heatmap--hand-eye-streams-in-v10)) —
they are produced locally by `scripts/run_all_stages.py` (or by
running each stage individually), then optionally re-packed via
`surgsync build` to emit an option-C release on your own disk. The
tree below shows what an episode looks like after that user-driven
processing pass, with `★ NEW` annotations on every file that the
preprocessing pipeline adds on top of v1.0:

```
<dataset>/episodes/<task>/<clip_idx>/
├── episode_meta.json   modalities.json   time_sync_stat.json
├── timestamp.parquet   ECM.parquet   PSM1.parquet   PSM2.parquet   annotation.parquet
│                                                      # ⇧ PSM{1,2}.parquet gains non-NULL
│                                                      #   measured_cp_calibrated.* and
│                                                      #   setpoint_cp_calibrated.* columns
├── video_raw/{stereo_left, stereo_right, side}.mkv    # unchanged from v1.0
├── video/                                              # ★ NEW — rectified + resized H.264
│   ├── stereo_left.mp4                                 #   CRF 18, yuv420p, 512×288
│   └── stereo_right.mp4
├── preprocess/                                         # ★ NEW — derived per-frame streams
│   ├── depth.mkv                                       #   FoundationStereo colorized depth viz
│   ├── flow_left.mkv                                   #   RAFT optical flow (left), colorized
│   ├── flow_right.mkv                                  #   RAFT optical flow (right), colorized
│   ├── heatmap_PSM1_left.mkv                           #   kinematic-projection Gaussian heatmap
│   ├── heatmap_PSM1_right.mkv                          #     (one stream per PSM × camera side)
│   ├── heatmap_PSM2_left.mkv
│   └── heatmap_PSM2_right.mkv
├── calibration/
│   ├── camera.json   left.yaml   right.yaml   stereo_calib_params.json
│   ├── rectify_params.json                             # ★ NEW — P1/P2/Q at rectified resolution
│   └── hand_eye/PSM{1,2}-registration-{dVRK,open-cv}.json
└── .surgsync_complete.json
```

After a local preprocessing pass and a re-pack with `surgsync build`,
the release-level flags in each `episode_meta.json` flip from `false`
to `true` to reflect the new content:

| Flag | v1.0 as shipped | After your local preprocessing + re-pack |
|---|:--:|:--:|
| `has_video_raw`            | ✅ | ✅ |
| `has_preprocess`           | ❌ | ✅ |
| `has_preview`              | ❌ | ✅ |
| `has_calibrated_kinematic` | ❌ | ✅ |

`meta/dataset.json:pipeline_versions.*` (`null` everywhere in v1.0)
will then carry the exact preprocessing-stage version that produced
each derived stream, so downstream users can pin against a specific
pipeline build for reproducibility.

---

## Conventions

| | |
|---|---|
| Master clock                | `stereo_left_capture_ros_header_stamp` (per-clip, rebased to 0; absolute t0 in `episode_meta.json:master_t0_ns`) |
| Alignment policy            | `nearest_neighbor_within_tolerance` |
| Alignment tolerance         | online 2 ms; offline image_side 33 ms; offline kinematic `1000 / source_frequency_hz` |
| Frame index basis           | master clock |
| Length / angle units        | meters / radians |
| Quaternion order            | xyzw (dVRK CRTK convention) |
| Master frame rate           | 10 Hz (by design — a deliberate trade-off between cross-modal time alignment and per-frame frequency; see [§ Other diffs worth flagging](#other-diffs-worth-flagging)) |
| Raw image size              | `[1920, 1080]` |
| Post-processing image size  | `[512, 288]` (preprocessing-pipeline target — not present in v1.0) |

---

## Known limitations + data-quality notes

The data on disk is internally self-consistent (sums add up, SHAs
match), but several **vocabulary** and **convention** items need
up-front disclosure.

### 1. `tasks.jsonl` vocab is best-effort, not a closed enumeration

**41 of 205 episodes (~20%)** carry verbalized `phase` and/or `step`
text drawn from a different task's vocabulary than the episode's own
partition. Counts per task (from `meta/index.parquet`):

| Task | Total frames | Orphan-phase rows | Cross-task step rows | Affected episodes |
|---|---:|---:|---:|---:|
| `single_interrupted_stitch` | 90,068 | **2,961** | **2,961** | 31 of 92 |
| `cold_cut_dissection`       | 55,595 | 0     | 21    | 4 of 61  |
| `tissue_manipulation`       |  5,907 | 1,868 | 0     | 6 of 25  |
| Others                      | 16,562 | 0     | 0     | 0        |
| **Total**                   | **168,132** | **4,829** | **2,982** | **41** |

Root cause: `workflow_description.json` carries a shared
"exposure" phase (`phase_id=0`) that isn't routed to any task by
`_task_routing`, and the v1.0 packer's `verbalize_step(value)` is
task-agnostic. Consequence:

- `meta/index.parquet` and per-episode `annotation.parquet` are the
  **source of truth** for verbalized strings.
- `meta/tasks.jsonl` is **documentation, not a closed enumeration** —
  strict `(task, step_id) → text` joins miss ~1.8% of step rows and
  ~2.9% of phase rows.
- `meta/stats.parquet:phase.vocab_size = 7` but `tasks.jsonl` lists
  only **6** phase strings — the gap is the orphan `phase_id=0`.

**v1.1 plan:** engage the existing `verbalize_step(value, task)`
overload in the packer and surface `phase_id=0` explicitly.

### 2. Derived / preprocessed streams are not bundled in v1.0 (but the toolkit generates them)

v1.0 ships **only the raw modalities** — bit-exact stereo + side
FFV1, per-modality parquets, and calibration. The preprocessing-stage
outputs are absent on disk:

- `video/stereo_left.mp4`, `video/stereo_right.mp4` (H.264 rectified)
- `preprocess/depth.mkv`
- `preprocess/flow_left.mkv`, `preprocess/flow_right.mkv`
- `preprocess/heatmap_PSM{1,2}_{left,right}.mkv`
- `calibration/rectify_params.json`
- `PSM{1,2}.parquet:measured_cp_calibrated.*` /
  `setpoint_cp_calibrated.*` (columns exist in schema; NULL on every row)

Per episode, `episode_meta.json` reflects this: `has_preprocess=false`,
`has_preview=false`, `has_calibrated_kinematic=false`, and
`meta/dataset.json:pipeline_versions.*` are all `null`.

**This is intentional, not a data-quality failure.** The raw FFV1 +
parquets are the source of truth. Derived modalities are deterministic
functions of (raw inputs × pipeline version), and the toolkit ships
every stage that produces them:

| Derived stream | Generator script (in the toolkit repo) | GPU? |
|---|---|:--:|
| Rectified H.264 video             | `src/dvrk_data_processing/raw_image_processing/gen_rectify_resize.py` | no |
| Hand-eye-projected kinematics + heatmaps | `src/dvrk_data_processing/kinematic_mapping/gen_kinematic_heatmap_handeye.py` | no |
| Depth estimation                  | `src/dvrk_data_processing/depth_estimation/gen_depth_estimate.py` (FoundationStereo) | yes |
| Optical flow                      | `src/dvrk_data_processing/optical_flow/gen_optical_flow_raft.py` (RAFT) | yes |
| End-to-end runner                 | `scripts/run_all_stages.py` (chains all of the above) | yes |

Workflow to obtain the full option-C layout on your own disk:

1. `surgsync unpack <release_root> --out <raw_out>` — reconstruct the
   raw clip tree from this v1.0 release.
2. `python scripts/run_all_stages.py path_config.data_dir=<raw_out>` —
   generates `preprocess/` and rectified `video/` next to each clip.
3. `surgsync build <raw_out> --out <option_c_root>` — re-packs with
   the derived streams included.

Compute cost: FoundationStereo dominates. End-to-end processing of
the full v1.0 release runs ~1 day on a single high-end consumer GPU
(e.g. RTX 4090 / A6000). Skip the depth/flow stages and the runtime
drops to a few hours.

### 3. ECM Cartesian setpoint is not shipped

The packer's ECM schema carries `setpoint_js` only — no `setpoint_cp`.
The reader exposes the same; the unpacker cannot reproduce that block.
PSMs are unaffected.

### 4. Gesture vocabulary is incomplete for 4 of 6 tasks

`meta/tasks.jsonl` ships an empty `gesture_vocab: {}` for
`peg_transfer`, `tissue_manipulation`, `cold_cut_dissection_intestine`,
and `cold_cut_dissection_skin_peel`. **77 episodes have no decodable
gesture annotations** because their task's vocabulary has no entries.
`gesture.PSM{1,2}` columns are NULL on those episodes.
`meta/modalities.json:topics_present_in_n_episodes.annotation.gesture.PSM*`
reports the **128/205** coverage authoritatively; a further
**35 episodes** have *partial* gesture coverage.

### 5. `single_interrupted_stitch.gesture_vocab["16"]` (`Cut suture`) is unused in v1.0

Gesture id `16` — **"Cut suture"** — is a valid entry in the suturing
gesture taxonomy, but no frame in v1.0 carries it because the
recording protocol for this release stops at the secured knot
(suture-tail cutting was not performed). The text in `tasks.jsonl`
includes a parenthetical editorial note flagging it as unobserved:

> `"Cut suture (We do NOT have this, but it should be defined) (Closing scissors or a cutting instrument to sever the suture tail at the target distance from the knot.)"`

The entry itself is correct — it's not a placeholder, just an unused
gesture in this release. Future recordings that include suture cutting
would populate it. The bracketed editorial note may be cleaned up in
v1.1 for cosmetic clarity, but the id mapping is stable across
versions.

### 6. Minor typos in `tasks.jsonl`

- `cold_cut_dissection.phase_description` — `"surigal"` → `"surgical"`.
- `tissue_manipulation.step_vocab["45"]``"roposition"``"reposition"`.

Cosmetic — text-as-data only.

### 7. 8 suturing clips extend the gesture vocab with two ad-hoc codes (`'00'`, `'01'`)

Eight `single_interrupted_stitch` clips carry the **literal strings**
`'00'` or `'01'` in `gesture.PSM{1,2}` instead of verbalized text.
These are not canonical gestures — the suturing `gesture_vocab` in
`meta/tasks.jsonl` only defines ids `1``18`. The two codes were used
ad-hoc by the annotators of these specific clips to mark motion-state
events, drawing their meanings from the **suturing step vocab**, where
the same texts already exist:

- `"00"``"bilateral pause (both hand not moving > 20 frames)"`
- `"01"``"move camera"`

**Affected clips and counts** (always paired across PSM1 and PSM2 —
identical literal on both arms on the same frame):

| Partition | Clip | Frames in clip | `"00"` frames | `"01"` frames |
|---|---|---:|---:|---:|
| online_data  | 0   |   314 |   0 |  31 |
| online_data  | 1   |   157 |   0 |  35 |
| online_data  | 11  |   452 |   0 |  28 |
| online_data  | 35  | 1,129 |  36 |   0 |
| online_data  | 38  | 1,181 |  28 |   0 |
| online_data  | 42  |   712 |  66 |   0 |
| online_data  | 43  | 1,041 |  70 |   0 |
| offline_data | 47  |   990 |   0 |  38 |
| **Total** | | **5,976** | **200** | **132** |

That's **332 frames out of 168,132 (≈ 0.197 %)** across the entire
release, or **0.369 %** within the suturing partition (90,068 frames).
Each affected clip uses **either** `"00"` **or** `"01"`, never both —
i.e. an annotator chose one motion-state code consistently for the
clip and used it alongside the canonical 18-gesture vocab on the
remaining frames.

**Why this is contained, not systematic.** An empirical scan of all
92 suturing clips shows:

- Only **8 / 92 clips** carry `"00"` or `"01"`.
- **Zero** clips have the other suturing step ids (`"11"``"15"`)
  leaking into the gesture column — which rules out a copy-paste-step-
  into-gesture-field bug. Only the two motion-state codes leak.
- All 8 affected clips also carry the **canonical verbalized gestures**
  on the majority of frames, so the literals coexist with valid data.

**Recommended consumer recipe.** Either filter the rows, or post-map
the two literals at load time:

```python
GESTURE_AD_HOC = {
    "00": "bilateral pause (both hand not moving > 20 frames)",
    "01": "move camera",
}
g = df["gesture.PSM1"].map(lambda v: GESTURE_AD_HOC.get(v, v))
```

**Status.** Deferred to v1.1: promote `"00"` / `"01"` into the canonical
suturing `gesture_vocab` (and decide whether they are suturing-only or
task-agnostic motion-state codes), so the packer's verbalizer can
resolve them at pack time rather than relying on a downstream patch.
The v1.0 data on disk is otherwise correct.

### 8. `duration_s` is `float32`

`episodes.parquet:duration_s` is the real first-to-last
`master_timestamp_ns` delta in seconds, stored as `float32`. Values
exhibit sub-millisecond noise (e.g. `162.599999904`, `112.699997`,
`90.000000`) — not an off-by-one error. For exact frame timing use
`index.parquet:master_timestamp_ns` (int64 ns). Don't compute
`int(duration_s * 10) == length_frames`.

### 9. CUDA non-determinism in preprocessing-derived streams (future)

When preprocessing IS run (not in v1.0), depth and optical-flow
outputs depend on GPU/driver. Two builds against the same raw clip
pixel-match within encoder tolerance but are not byte-exact across
machines. Irrelevant to v1.0; relevant to any v1.1+ re-pack that
includes the derived modalities.

### 10. Image bytes ≠ raw image bytes after unpack (pixel bit-exact, not byte)

The pack→unpack round-trip is **pixel** bit-exact (decoded ndarrays
match byte-for-byte). PNG file bytes differ because cv2's encoder
picks different compression filters than whatever produced the
original. The toolkit ships `scripts/verify_unpack_vs_raw.py` (pixel
comparison) for round-trip checks.

### 11. `meta/manifest.json` excludes a small known set

The SHA-256 manifest covers 3,912 of the 4,123 files on disk. The 211
untracked files are intentional: 205 × `.surgsync_complete.json`
per-episode sentinels, the manifest itself, `README.md` /
`CHANGELOG.md` (stamped *after* the manifest), and 1 × `.logs/*.jsonl`
operational log.

### 12. `stats.parquet` uses reservoir-sampled percentiles

`meta/stats.parquet:q01` and `:q99` come from a 10,000-sample reservoir
per column. Expect ±0.5% error — fine for ImageNet-style normalization
presets, **not** for tight outlier detection. Re-running
`build_stats()` produces slightly different `q01`/`q99` because of RNG.

---

## Citation

```bibtex
@inproceedings{zhou2026surgsync,
  author    = {Zhou, Haoying and Liu, Chang and Wu, Yimeng and Wu, Junlin
               and Wu, Zijian and Lee, Yu Chung and Martuscelli, Sara
               and Salcudean, Septimiu E. and Fischer, Gregory S.
               and Kazanzides, Peter},
  title     = {{SurgSync}: Time-Synchronized Multi-modal Data Collection
               Framework and Dataset for Surgical Robotics},
  booktitle = {IEEE International Conference on Robotics and Automation (ICRA)},
  year      = {2026},
}
```

If you accessed SurgSync (or a subset of it) through NVIDIA's
**PhysicalAI-Robotics-Open-H-Embodiment** collection at
[`Surgical/jhu/lcsr/smarts`](https://huggingface.co/datasets/nvidia/PhysicalAI-Robotics-Open-H-Embodiment/tree/main/Surgical/jhu/lcsr/smarts),
the citation is the same — use the `zhou2026surgsync` BibTeX above.
That ICRA 2026 paper is the canonical reference for the underlying
dVRK recordings; the Open-H-Embodiment collection redistributes a
curated subset of the v1.0 packed release described here.

External backbones used by the (future) preprocessing pipeline — cite
separately if you rely on derived streams:

```bibtex
@inproceedings{wen2025foundationstereo,
  title     = {FoundationStereo: Zero-Shot Stereo Matching},
  author    = {Wen, Bowen and Trepte, Matthew and Aribido, Joseph and Kautz, Jan and Gallo, Orazio and Birchfield, Stan},
  booktitle = {CVPR},
  year      = {2025}
}
@inproceedings{teed2020raft,
  title     = {{RAFT}: Recurrent All-Pairs Field Transforms for Optical Flow},
  author    = {Teed, Zachary and Deng, Jia},
  booktitle = {ECCV},
  year      = {2020}
}
```

---

## Maintainer / contact

**Haoying (Jack) Zhou**`hzhou62@jh.edu` / `hzhou6@wpi.edu` ·
[github.com/jackzhy96](https://github.com/jackzhy96) ·
project page **https://surgsync.github.io/**.

For questions about the data format, the loader API, or this specific
release, open an issue on the
[toolkit repository](https://github.com/jackzhy96/dvrk_multimodal_data_collection).

---

## License

Released under **Creative Commons Attribution-NonCommercial 4.0
International (CC-BY-NC-4.0)**. The dVRK recordings follow the same
licensing terms as the raw source data; contact the maintainer for
clarifications on specific clinical sub-partitions.

The accompanying **SurgSync toolkit** (reader, packer, unpacker,
processing pipelines) is released under its own license — see
`LICENSE` in the
[toolkit repository](https://github.com/jackzhy96/dvrk_multimodal_data_collection).