|
| 1 | +# Kvasir-SEG Segmented Polyp Dataset from Aliyun (Kvasir SEG Aliyun) |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +This project supports **`Kvasir-SEG Segmented Polyp Dataset from Aliyun (Kvasir SEG Aliyun) `**, which can be downloaded from [here](https://tianchi.aliyun.com/dataset/84385). |
| 6 | + |
| 7 | +### Dataset Overview |
| 8 | + |
| 9 | +Colorectal cancer is the second most common cancer type among women and third most common among men. Polyps are precursors to colorectal cancer and therefore important to detect and remove at an early stage. Polyps are found in nearly half of the individuals at age 50 that undergo a colonoscopy screening, and their frequency increase with age.Polyps are abnormal tissue growth from the mucous membrane, which is lining the inside of the GI tract, and can sometimes be cancerous. Colonoscopy is the gold standard for detection and assessment of these polyps with subsequent biopsy and removal of the polyps. Early disease detection has a huge impact on survival from colorectal cancer. Increasing the detection of polyps has been shown to decrease risk of colorectal cancer. Thus, automatic detection of more polyps at an early stage can play a crucial role in prevention and survival from colorectal cancer. |
| 10 | + |
| 11 | +The Kvasir-SEG dataset is based on the previous Kvasir dataset, which is the first multi-class dataset for gastrointestinal (GI) tract disease detection and classification. It contains annotated polyp images and their corresponding masks. The pixels depicting polyp tissue, the ROI, are represented by the foreground (white mask), while the background (in black) does not contain positive pixels. These images were collected and verified by experienced gastroenterologists from Vestre Viken Health Trust in Norway. The classes include anatomical landmarks, pathological findings and endoscopic procedures. |
| 12 | + |
| 13 | +### Information Statistics |
| 14 | + |
| 15 | +| Dataset Name | Anatomical Region | Task Type | Modality | Num. Classes | Train/Val/Test Images | Train/Val/Test Labeled | Release Date | License | |
| 16 | +| ------------------------------------------------------ | ----------------- | ------------ | --------- | ------------ | --------------------- | ---------------------- | ------------ | --------------------------------------------------------- | |
| 17 | +| [kvasir-seg](https://tianchi.aliyun.com/dataset/84385) | abdomen | segmentation | endoscopy | 2 | 1000/-/- | yes/-/- | 2020 | [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) | |
| 18 | + |
| 19 | +| Class Name | Num. Train | Pct. Train | Num. Val | Pct. Val | Num. Test | Pct. Test | |
| 20 | +| :--------: | :--------: | :--------: | :------: | :------: | :-------: | :-------: | |
| 21 | +| background | 1000 | 84.72 | - | - | - | - | |
| 22 | +| polyp | 1000 | 15.28 | - | - | - | - | |
| 23 | + |
| 24 | +Note: |
| 25 | + |
| 26 | +- `Pct` means percentage of pixels in this category in all pixels. |
| 27 | + |
| 28 | +### Visualization |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +### Dataset Citation |
| 33 | + |
| 34 | +``` |
| 35 | +@inproceedings{jha2020kvasir, |
| 36 | + title={Kvasir-seg: A segmented polyp dataset}, |
| 37 | + author={Jha, Debesh and Smedsrud, Pia H and Riegler, Michael A and Halvorsen, P{\aa}l and Lange, Thomas de and Johansen, Dag and Johansen, H{\aa}vard D}, |
| 38 | + booktitle={International Conference on Multimedia Modeling}, |
| 39 | + pages={451--462}, |
| 40 | + year={2020}, |
| 41 | + organization={Springer} |
| 42 | + } |
| 43 | +``` |
| 44 | + |
| 45 | +### Prerequisites |
| 46 | + |
| 47 | +- Python v3.8 |
| 48 | +- PyTorch v1.10.0 |
| 49 | +- pillow(PIL) v9.3.0 |
| 50 | +- scikit-learn(sklearn) v1.2.0 |
| 51 | +- [MIM](https://github.com/open-mmlab/mim) v0.3.4 |
| 52 | +- [MMCV](https://github.com/open-mmlab/mmcv) v2.0.0rc4 |
| 53 | +- [MMEngine](https://github.com/open-mmlab/mmengine) v0.2.0 or higher |
| 54 | +- [MMSegmentation](https://github.com/open-mmlab/mmsegmentation) v1.0.0rc5 |
| 55 | + |
| 56 | +All the commands below rely on the correct configuration of `PYTHONPATH`, which should point to the project's directory so that Python can locate the module files. In `kvasir_seg_aliyun/` root directory, run the following line to add the current directory to `PYTHONPATH`: |
| 57 | + |
| 58 | +```shell |
| 59 | +export PYTHONPATH=`pwd`:$PYTHONPATH |
| 60 | +``` |
| 61 | + |
| 62 | +### Dataset Preparing |
| 63 | + |
| 64 | +- download dataset from [here](https://tianchi.aliyun.com/dataset/84385) and decompression data to path 'data/.'. |
| 65 | +- run script `"python tools/prepare_dataset.py"` to format data and change folder structure as below. |
| 66 | +- run script `"python ../../tools/split_seg_dataset.py"` to split dataset and generate `train.txt`, `val.txt` and `test.txt`. If the label of official validation set and test set cannot be obtained, we generate `train.txt` and `val.txt` from the training set randomly. |
| 67 | + |
| 68 | +```none |
| 69 | + mmsegmentation |
| 70 | + ├── mmseg |
| 71 | + ├── projects |
| 72 | + │ ├── medical |
| 73 | + │ │ ├── 2d_image |
| 74 | + │ │ │ ├── endoscopy |
| 75 | + │ │ │ │ ├── kvasir_seg_aliyun |
| 76 | + │ │ │ │ │ ├── configs |
| 77 | + │ │ │ │ │ ├── datasets |
| 78 | + │ │ │ │ │ ├── tools |
| 79 | + │ │ │ │ │ ├── data |
| 80 | + │ │ │ │ │ │ ├── train.txt |
| 81 | + │ │ │ │ │ │ ├── val.txt |
| 82 | + │ │ │ │ │ │ ├── images |
| 83 | + │ │ │ │ │ │ │ ├── train |
| 84 | + │ │ │ │ | │ │ │ ├── xxx.png |
| 85 | + │ │ │ │ | │ │ │ ├── ... |
| 86 | + │ │ │ │ | │ │ │ └── xxx.png |
| 87 | + │ │ │ │ │ │ ├── masks |
| 88 | + │ │ │ │ │ │ │ ├── train |
| 89 | + │ │ │ │ | │ │ │ ├── xxx.png |
| 90 | + │ │ │ │ | │ │ │ ├── ... |
| 91 | + │ │ │ │ | │ │ │ └── xxx.png |
| 92 | +``` |
| 93 | + |
| 94 | +### Divided Dataset Information |
| 95 | + |
| 96 | +***Note: The table information below is divided by ourselves.*** |
| 97 | + |
| 98 | +| Class Name | Num. Train | Pct. Train | Num. Val | Pct. Val | Num. Test | Pct. Test | |
| 99 | +| :--------: | :--------: | :--------: | :------: | :------: | :-------: | :-------: | |
| 100 | +| background | 800 | 84.66 | 200 | 84.94 | - | - | |
| 101 | +| polyp | 800 | 15.34 | 200 | 15.06 | - | - | |
| 102 | + |
| 103 | +### Training commands |
| 104 | + |
| 105 | +To train models on a single server with one GPU. (default) |
| 106 | + |
| 107 | +```shell |
| 108 | +mim train mmseg ./configs/${CONFIG_FILE} |
| 109 | +``` |
| 110 | + |
| 111 | +### Testing commands |
| 112 | + |
| 113 | +To test models on a single server with one GPU. (default) |
| 114 | + |
| 115 | +```shell |
| 116 | +mim test mmseg ./configs/${CONFIG_FILE} --checkpoint ${CHECKPOINT_PATH} |
| 117 | +``` |
| 118 | + |
| 119 | +<!-- List the results as usually done in other model's README. [Example](https://github.com/open-mmlab/mmsegmentation/tree/dev-1.x/configs/fcn#results-and-models) |
| 120 | +
|
| 121 | +You should claim whether this is based on the pre-trained weights, which are converted from the official release; or it's a reproduced result obtained from retraining the model in this project. --> |
| 122 | + |
| 123 | +## Checklist |
| 124 | + |
| 125 | +- [x] Milestone 1: PR-ready, and acceptable to be one of the `projects/`. |
| 126 | + |
| 127 | + - [x] Finish the code |
| 128 | + - [x] Basic docstrings & proper citation |
| 129 | + - [ ] Test-time correctness |
| 130 | + - [x] A full README |
| 131 | + |
| 132 | +- [ ] Milestone 2: Indicates a successful model implementation. |
| 133 | + |
| 134 | + - [ ] Training-time correctness |
| 135 | + |
| 136 | +- [ ] Milestone 3: Good to be a part of our core package! |
| 137 | + |
| 138 | + - [ ] Type hints and docstrings |
| 139 | + - [ ] Unit tests |
| 140 | + - [ ] Code polishing |
| 141 | + - [ ] Metafile.yml |
| 142 | + |
| 143 | +- [ ] Move your modules into the core package following the codebase's file hierarchy structure. |
| 144 | + |
| 145 | +- [ ] Refactor your modules into the core package following the codebase's file hierarchy structure. |
0 commit comments