File size: 2,702 Bytes
c1552cd
 
c126fd1
 
 
 
 
 
 
 
 
 
bd17906
 
989e98d
91237d9
831ee1f
91237d9
58b70bc
7df916d
 
989e98d
09fc6ea
 
7df916d
 
 
 
58b70bc
 
831ee1f
 
 
09fc6ea
 
 
 
 
 
 
fbf8b94
09fc6ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fbf8b94
09fc6ea
09af100
58b70bc
09fc6ea
58b70bc
09fc6ea
 
 
 
 
 
 
 
58b70bc
f423e71
989e98d
09fc6ea
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
---
license: cc-by-nc-sa-4.0
task_categories:
- image-segmentation
language:
- en
tags:
- medical
- biology
pretty_name: CholecSeg8k
size_categories:
- 1K<n<10K
---

# Description:

[paper](https://arxiv.org/abs/2012.12453) | [kaggle](https://www.kaggle.com/datasets/newslab/cholecseg8k)

The CholecSeg8k dataset, an extension of the Cholec80 collection, includes 8,080 carefully annotated images from laparoscopic cholecystectomy surgeries, selected from 17 video clips in Cholec80. Each image in CholecSeg8K is pixel-level annotated for thirteen different surgical elements. The dataset is efficiently organized in a directory structure, featuring 101 folders, each containing 80 frames at a resolution of 854x480, along with three types of masks for each frame: a color mask for visualization, an annotation tool mask, and a watershed mask for simplified processing. This comprehensive dataset, freely available under the CC BY-NC-SA 4.0 license, is a critical resource for advancing the field of computer-assisted surgical procedures.


# Loading the data:

First install the `datasets` library, then run the following code,
```python
from datasets import load_dataset

dataset = load_dataset("minwoosun/CholecSeg8k", trust_remote_code=True)
```

# Simple demo:

This short demo shows how to load the data and directly visualize an image along with the corresponding masks.

```python
from datasets import load_dataset
import matplotlib.pyplot as plt

dataset = load_dataset("minwoosun/CholecSeg8k", trust_remote_code=True)

def display_image(dataset, image_index):
    '''Display the image and corresponding three masks.'''
    
    fig, axs = plt.subplots(2, 2, figsize=(10, 10))
    
    for ax in axs.flat:
        ax.axis('off')
    
    # Display each image in its respective subplot
    axs[0, 0].imshow(dataset['train'][image_index]['image'])
    axs[0, 1].imshow(dataset['train'][image_index]['color_mask'])
    axs[1, 0].imshow(dataset['train'][image_index]['watershed_mask'])
    axs[1, 1].imshow(dataset['train'][image_index]['annotation_mask'])
    
    # Adjust spacing between images
    plt.subplots_adjust(wspace=0.01, hspace=-0.6)
    
    plt.show()

display_image(dataset, 800) # video index from 0 to 8079
```
![example image](example.png)

# Citation (BibTex):
```
@misc{hong2020cholecseg8k,
      title={CholecSeg8k: A Semantic Segmentation Dataset for Laparoscopic Cholecystectomy Based on Cholec80}, 
      author={W. -Y. Hong and C. -L. Kao and Y. -H. Kuo and J. -R. Wang and W. -L. Chang and C. -S. Shih},
      year={2020},
      eprint={2012.12453},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
```

# Data card contact:
Min Woo Sun (minwoos@stanford.edu)