hkust-aaron commited on
Commit
de05a3e
·
verified ·
1 Parent(s): 07f5340

Update dataset card: annotated sample pack and SAM 3.1 dense tracks

Browse files
Files changed (1) hide show
  1. README.md +52 -68
README.md CHANGED
@@ -1,8 +1,10 @@
1
  ---
2
  license: apache-2.0
3
- pretty_name: Laparoscopic Surgical Video Dataset for Robotic Vision — Sample
4
  task_categories:
5
  - robotics
 
 
6
  size_categories:
7
  - n<1K
8
  tags:
@@ -12,98 +14,80 @@ tags:
12
  - surgical-robotics
13
  - robotic-vision
14
  - computer-vision
15
- - self-supervised-learning
16
- - unannotated
 
 
17
  ---
18
 
19
- # Laparoscopic Surgical Video Dataset for Robotic Vision
20
 
21
- **An open surgical video sample for robot perception, visual representation learning, and surgical scene understanding.**
22
 
23
- This dataset contains one unannotated laparoscopic video: **11 minutes 57 seconds at 720 × 576 resolution and 25 fps**. It provides visual source material for developing surgical robotics perception pipelines, from self-supervised learning to instrument detection, tracking, and activity recognition after annotation. The sample is released under **Apache License 2.0**.
24
 
25
- **Workflow:** download → sample frames or clips → annotate → train → evaluate.
26
 
27
- ## Dataset overview
28
 
29
- | Attribute | Specification |
30
- |---|---|
31
- | Content | One laparoscopic surgical video |
32
- | Primary file | [`videos/laparoscopic_sample_001.mp4`](videos/laparoscopic_sample_001.mp4) |
33
- | Duration | 717.16 seconds |
34
- | Resolution / frame rate | 720 × 576 / 25 fps |
35
- | Encoding | H.264 in MP4; video only |
36
- | File size | 525,231,261 bytes |
37
- | Annotation status | Unannotated |
38
- | Integrity metadata | [`manifest.json`](manifest.json), including SHA-256 |
39
- | License | [Apache-2.0](LICENSE) |
40
-
41
- The primary file preserves the original recording without re-encoding. The root-level `2023-04-20_2059_VID0001ab.mp4` is an identical copy of the same recording; use the primary path above for a consistent pipeline.
42
-
43
- ## Applications in surgical robotics
44
-
45
- | Application | Learning approach | Data preparation |
46
  |---|---|---|
47
- | **Visual representation learning** | Adapt a pretrained image or video encoder using masked reconstruction or contrastive objectives. | Quality-controlled frames or short clips. |
48
- | **Surgical instrument detection and segmentation** | Fine-tune a detector or segmentation model to localize visible instruments. | Reviewed bounding boxes or pixel masks, instrument classes, and visibility labels. |
49
- | **Instrument tracking** | Associate instrument instances and estimate image-plane motion over time. | Consecutive frames, persistent IDs, and optional tip or shaft keypoints. |
50
- | **Surgical activity recognition** | Train temporal models on observable actions and transitions. | Timestamped segments with a consistent action vocabulary. |
51
- | **Vision-language learning** | Learn scene descriptions, retrieval, or question answering from image-text or video-text pairs. | Expert-reviewed captions and questions grounded in visible content. |
52
-
53
- The release supplies the raw visual observations. The task-specific labels in this table describe the next preparation step for supervised training.
 
 
 
 
54
 
55
- ## Quick start
56
 
57
- Install the Hugging Face CLI and FFmpeg, then download the primary video and supporting files:
58
 
59
- ```bash
60
- hf download hkust-aaron/laparoscopic-robotic-vision-sample \
61
- videos/laparoscopic_sample_001.mp4 manifest.json LICENSE README.md \
62
- --repo-type dataset --local-dir surgical-video
63
 
64
- mkdir -p surgical-video/frames
65
- ffmpeg -i surgical-video/videos/laparoscopic_sample_001.mp4 \
66
- -vf fps=2 -q:v 2 surgical-video/frames/frame_%06d.jpg
67
- ```
68
 
69
- This example samples at **2 fps**, producing approximately 1,434 images for initial review and annotation. Use native-rate consecutive frames for tracking or faster motion. Maintain a manifest mapping each extracted image to its source frame index and presentation timestamp.
70
 
71
- ## From video to training data
72
-
73
- **Prepare and annotate.** Check decoding, timestamps, blur, occlusion, and exposure. Define instrument classes and rules for partially visible objects before labeling. For detection, store bounding boxes; for segmentation, masks; for tracking, persistent instance IDs. An annotation record can include:
74
-
75
- ```text
76
- video_id, frame_index, timestamp_seconds, image_path,
77
- class_id, bbox_or_mask, instrument_id, keypoints, visibility
78
- ```
79
-
80
- For temporal labels, use `start_seconds`, `end_seconds`, and `action_label`. For vision-language tasks, pair reviewed captions with explicit frame or clip references. Surgical interpretation benefits from expert review.
81
-
82
- **Train a baseline.** Start with a pretrained visual encoder and a task-specific head. Compare a frozen-encoder baseline against partial or full fine-tuning. Preserve aspect ratio with resizing and padding; keep geometric augmentation synchronized with boxes, masks, and keypoints. For temporal experiments, sample clips of 16 or 32 frames and record their sampling rate and stride. Save the model version, preprocessing configuration, label schema, split definition, and random seed for reproducibility.
83
 
84
- **Evaluate and expand.** Separate training and validation into contiguous temporal blocks, leaving a gap to reduce leakage between neighboring frames. Use detection mAP, segmentation Dice/IoU, tracking HOTA/IDF1, or activity-recognition macro-F1 and segment-level F1 as appropriate. Within-video evaluation tests pipeline behavior; additional independent recordings across procedures, patients, devices, and institutions enable cross-case generalization studies. Review errors by visibility, motion blur, and illumination to guide further data collection.
 
 
85
 
86
- ## Toward action-conditioned robot learning
87
 
88
- The video can support development of the **visual observation encoder** in a larger robot-learning system. Extending that system to policy learning requires synchronized demonstrations pairing images with robot state and executed actions:
 
 
 
 
89
 
90
- ```text
91
- observation_t = {image_t, joint_state_t, end_effector_pose_t, ...}
92
- action_t = {commanded_motion_t, gripper_command_t, ...}
93
- ```
94
 
95
- Collect camera calibration, coordinate-frame definitions, timestamp synchronization, action units, and control frequency, together with force or contact signals where relevant. These paired demonstrations support behavior cloning and other imitation-learning experiments, followed by simulation and task-specific validation.
 
96
 
97
- ## Release notes and provenance
98
 
99
- The contributor supplied the recording and confirmed permission for public distribution, commercial AI training, and release under Apache License 2.0. Acquisition and procedure metadata can be added as they are verified. Expanded collections should document provenance, consent, and privacy review alongside technical metadata.
100
 
101
- The original MP4 decoded in an initial check, with an FFmpeg `wrong sample count` container warning. Verify decoded frames and timestamps in the chosen preprocessing pipeline and retain the result in processing logs.
102
 
103
  ## Broader surgical video resources
104
 
105
- This repository provides one public sample from a broader initiative. The team reports access to approximately **50,000 hours of surgical video resources** and welcomes discussions about data requirements for medical AI and surgical robotics research. Availability, scope, delivery, and licensing terms for those resources are agreed separately; the Apache-2.0 license applies to the sample published in this repository.
106
 
107
  ## Contact
108
 
109
- For dataset inquiries, broader video resources, and collaboration, contact [aaron@aaronxu.com](mailto:aaron@aaronxu.com).
 
1
  ---
2
  license: apache-2.0
3
+ pretty_name: Laparoscopic Surgical Video Dataset for Robotic Vision — Annotated Sample
4
  task_categories:
5
  - robotics
6
+ - image-segmentation
7
+ - video-classification
8
  size_categories:
9
  - n<1K
10
  tags:
 
14
  - surgical-robotics
15
  - robotic-vision
16
  - computer-vision
17
+ - instance-segmentation
18
+ - video-object-segmentation
19
+ - video-text
20
+ - sam3
21
  ---
22
 
23
+ # Laparoscopic Surgical Video Dataset for Robotic Vision — Annotated Sample
24
 
25
+ **One laparoscopic recording, delivered as a worked example of how the wider collection can be prepared for robot perception and video–language training.**
26
 
27
+ The recording (720 × 576, 25 fps, 11 min 57 s) is published here in its original form and as an intracorporeal-only cut, together with four layers of labels: frame-level quality metrics, a scene timeline, 70 clip captions, and instance masks — keyframe masks on 81 frames and SAM 3.1 tracks propagated through the whole video.
28
 
29
+ > **Status: pipeline demonstration, not a benchmark.** One case only. All labels are AI-drafted or model-generated and **have not been reviewed by a surgeon or trained annotator.**
30
 
31
+ ## Contents
32
 
33
+ | Path | Content | Coverage |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  |---|---|---|
35
+ | `videos/laparoscopic_sample_001.mp4` | Original recording, not re-encoded (717.16 s). Its last ~22 s show the camera leaving the body and the operating room. | Whole recording |
36
+ | `2023-04-20_2059_VID0001ab.mp4` | Byte-identical copy of the file above under its original name | Whole recording |
37
+ | `annotated/video/laparoscopic_sample_001_intracorporeal.mp4` | Stream copy of source frames 0–17369 (694.80 s); out-of-body footage and container metadata removed. All labels below refer to this file's frame indices. | Whole case |
38
+ | `annotated/layer1_quality/` | Per-frame sharpness, brightness, colour, glare and motion; per-second usability timeline | 17,929 frames |
39
+ | `annotated/layer2_timeline/` | 12 scene segments and 6 point events, with overview contact sheets | Whole case |
40
+ | `annotated/layer3_clip_captions/` | 70 consecutive 10 s clips, each with an English caption, instrument list, scene flags, motion level and quality columns (JSONL + CSV) | Whole case |
41
+ | `annotated/gold_subset/` | 81 keyframes (one per clip + 12 hand-picked) with instance masks, tip points and appearance classes; v1 (AI draft) and v2 (SAM 3.1) in COCO format | 81 frames, 200 instances |
42
+ | `annotated/dense_tracks/` | SAM 3.1 instance masks for every frame, tracked within each 10 s clip | 17,370 frames, 222 tracks |
43
+ | `annotated/scripts/` | Scripts that produced every layer | — |
44
+ | `annotated/DATACARD.md` | Full data card: methods, label definitions, limitations | — |
45
+ | `annotated/SHA256SUMS.txt` | Checksums of every file under `annotated/` | — |
46
 
47
+ ## Label layers
48
 
49
+ **Quality (layer 1).** Of 694 intracorporeal seconds, 683 are flagged usable; 11 s blur, 8 s glare, 21 s low-red (haze or near-lens object). Thresholds are simple heuristics, documented in `scripts/03_quality_timeline.py`.
50
 
51
+ **Scene timeline (layer 2).** 12 segments describing only what is visible (e.g. gauze placement, sustained work at one site, haze episodes). They are *not* surgical phases; a surgeon must map them onto a procedure-specific ontology. Boundaries ±4 s, except the end of the case, which is frame-accurate.
 
 
 
52
 
53
+ **Clip captions (layer 3).** 70 captions of 13–40 words written for video–text training, from one frame every 2 s. Flags: gauze visible (46 clips), near-lens instrument (18), pooled blood (13), haze (6), mostly instrument-free (3).
 
 
 
54
 
55
+ **Instance masks.** Appearance classes, not device identification:
56
 
57
+ | Class | Meaning |
58
+ |---|---|
59
+ | `white_insulated_jawed` | jawed instrument with cream/white insulation |
60
+ | `dark_rod` | dark cylindrical rod without visible jaws |
61
+ | `fenestrated_grasper` | jawed instrument with an open-window jaw |
62
+ | `gauze` | woven gauze-like material |
 
 
 
 
 
 
63
 
64
+ - *Keyframes, v1*: polygons drafted by an AI model on a coordinate grid, snapped to edges with GrabCut.
65
+ - *Keyframes, v2*: re-segmented with **Meta SAM 3.1** from three clicks per instance. The SAM 3.1 mask is kept where it agrees with the draft (IoU ≥ 0.5): 175 of 200 instances. The other 25 keep the draft and carry `needs_review: true`.
66
+ - *Dense tracks*: each 10 s clip is one SAM 3.1 session — text prompt `"metal tool"` on the first frame plus the keyframe clicks, propagated forwards and backwards. Click tracks carry the keyframe class; text tracks are labelled `instrument_text_detected`. All 70 clips completed: 222 tracks (167 from keyframe clicks, 55 from the text prompt), 43,281 frame masks; 96.6 % of frames contain at least one mask. One PNG per frame (pixel value = track id) plus per-clip JSON with class, source, and per-frame area, bbox and score; overlay previews in `annotated/dense_tracks/previews/`.
67
 
68
+ ## Known limitations
69
 
70
+ 1. No expert review and no inter-annotator agreement.
71
+ 2. One case: no cross-case, cross-site or cross-device claim can be made.
72
+ 3. Standard definition; procedure, anatomy, institution and device metadata are not provided.
73
+ 4. Video only — no kinematics, force, depth or audio. Suitable for perception and video pre-training, not for learning control policies directly.
74
+ 5. Track ids are local to a 10 s clip; tracks are not linked across clips. Objects that are neither on the clip's keyframe nor found by the text prompt on its first frame are not tracked, so recall is incomplete.
75
 
76
+ ## Tools and licences
 
 
 
77
 
78
+ - Instance masks were produced with SAM 3.1 (`facebookresearch/sam3`, checkpoint `sam3.1_multiplex.pt`, SHA-256 `0567debe…541cb6`), which Meta releases under the SAM License. The model weights are not included here.
79
+ - The video and all labels in this repository are released under Apache-2.0.
80
 
81
+ ## Provenance and privacy
82
 
83
+ The contributor supplied the recording and confirmed permission for public distribution, commercial AI training and release under Apache-2.0. The underlying written authorisation is not included here. Expanded collections should document provenance, consent and privacy review alongside technical metadata.
84
 
85
+ The intracorporeal cut removes the operating-room footage. The original file in `videos/` still contains it, and the intracorporeal frames were not individually screened for incidental identifiers.
86
 
87
  ## Broader surgical video resources
88
 
89
+ This repository is one sample from a broader initiative with access to approximately **50,000 hours of surgical video**. Availability, scope, delivery and licensing for those resources are agreed separately; the Apache-2.0 licence applies only to this repository.
90
 
91
  ## Contact
92
 
93
+ For dataset inquiries, annotated pilots and collaboration: [aaron@aaronxu.com](mailto:aaron@aaronxu.com).