--- dataset_info: features: - name: image dtype: image - name: mask dtype: image - name: image_id dtype: string splits: - name: train num_examples: 245 - name: test num_examples: 62 task_categories: - image-segmentation task_ids: - semantic-segmentation tags: - medical-imaging - surgical - endoscopy - segmentation size_categories: - n<1K license: cc-by-nc-sa-4.0 --- # m2caiSeg - Surgical Scene Segmentation Dataset Multi-class semantic segmentation dataset for surgical instrument and anatomy segmentation from the m2cai16 challenge. ## Dataset Preview ## Dataset Details | Property | Value | |---|---| | **Source** | m2cai16 Challenge | | **Modality** | Endoscopy (RGB) | | **Task** | Multi-class Semantic Segmentation | | **Classes** | 19 (1 background + 17 foreground + 1 unknown) | | **Train** | 245 images | | **Test** | 62 images | | **Image Format** | JPEG | | **Mask Format** | PNG (single-channel, integer class labels 0-18) | ## Class Mapping (19 Classes) Masks are **single-channel grayscale PNGs** where each pixel value is a class ID: | Class ID | Class Name | |----------|-----------| | 0 | background | | 1 | grasper | | 2 | bipolar | | 3 | hook | | 4 | scissors | | 5 | clipper | | 6 | irrigator | | 7 | specimen-bag | | 8 | trocars | | 9 | clip | | 10 | liver | | 11 | gall-bladder | | 12 | fat | | 13 | upperwall | | 14 | artery | | 15 | intestine | | 16 | bile | | 17 | blood | | 18 | unknown | The full mapping is also available as [`class_mapping.json`](class_mapping.json). ## Usage ```python from datasets import load_dataset import numpy as np # Load from HuggingFace dataset = load_dataset("Angelou0516/m2caiSeg") # Access a sample sample = dataset["train"][0] image = sample["image"] # PIL Image (RGB) mask = sample["mask"] # PIL Image (grayscale, pixel values = class IDs) image_id = sample["image_id"] # e.g., "0" # Get class labels mask_array = np.array(mask.convert("L")) unique_classes = np.unique(mask_array) # subset of 0-18 ``` ## License & Attribution Released under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/). The segmentation annotations are from the m2caiSeg dataset; the underlying video frames are from the m2cai16 challenge (CAMMA, University of Strasbourg), released under CC BY-NC-SA 4.0. Cite both: - Maqbool, S., Riaz, A., Sajid, H., Hasan, O. "m2caiSeg: Semantic Segmentation of Laparoscopic Images using Convolutional Neural Networks." arXiv:2008.10134, 2020. - Twinanda, A. P., et al. "EndoNet: A Deep Architecture for Recognition Tasks on Laparoscopic Videos." IEEE Transactions on Medical Imaging, 36(1):86-97, 2017. (m2cai16 / Cholec source, CAMMA) **Changes made in this mirror:** the m2caiSeg images and class masks are repackaged into HuggingFace parquet with train/test splits; a `class_mapping.json` index was added. No pixel data or class labels were altered.