|
| 1 | +# Kvasir-Sessile Dataset (Kvasir SEG) |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +This project supports **`Kvasir-Sessile Dataset (Kvasir SEG) `**, which can be downloaded from [here](https://opendatalab.com/Kvasir-Sessile_dataset). |
| 6 | + |
| 7 | +## Dataset Overview |
| 8 | + |
| 9 | +The Kvasir-SEG dataset contains polyp images and their corresponding ground truth from the Kvasir Dataset v2. The resolution of the images contained in Kvasir-SEG varies from 332x487 to 1920x1072 pixels. |
| 10 | + |
| 11 | +<!-- For a typical model, this section should contain the commands for training and testing. You are also suggested to dump your environment specification to env.yml by `conda env export > env.yml`. --> |
| 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 | +| [Kvarsir-SEG](https://opendatalab.com/Kvasir-Sessile_dataset) | abdomen | segmentation | endoscopy | 2 | 196/-/- | 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 | 196 | 92.31 | - | - | - | - | |
| 22 | +| polyp | 196 | 7.69 | - | - | - | - | |
| 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/` 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://opendatalab.com/Kvasir-Sessile_dataset) and decompress 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 |
| 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 | 156 | 92.28 | 40 | 92.41 | - | - | |
| 101 | +| polyp | 156 | 7.72 | 40 | 7.59 | - | - | |
| 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 | +- [x] Milestone 2: Indicates a successful model implementation. |
| 133 | + |
| 134 | + - [x] 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