- Instance segmentation task to detect and segment all the nuclei.
- Data:
- Nuclear segmentation dataset contains 24 training images with 14,598 nuclear and 6 test images with 2,360 nuclear.
- train: 20 images, 12188 nuclear
- val: 3 images, 2410 nuclear
- test: 6 images, 2360 nuclear
- Nuclear segmentation dataset contains 24 training images with 14,598 nuclear and 6 test images with 2,360 nuclear.
- Python 3.7
- Pytorch 1.6.0
- CUDA 10.2
To reproduce, do the following steps:
- Installation
- Data Preparation
- Select Config file
- Download Pretrained Model
- Training
- Testing
- Results
- Report
- Reference
-
install pytorch from https://pytorch.org/get-started/previous-versions/
-
install mmdetection
- Please refer to mmdetection for installation.
# quick install: # install pytorch correspond to your cuda version conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.2 -c pytorch pip install openmim mim install mmdet
-
install dependencies
- scikit-image
- tqdm
- apex (optional for swin transformer)
-
Recommend Way
- Download dataset which has been preprocessed. Google Drive. The data should be as follow.
data └── coco ├── annotations │ ├── train_coco.json │ ├── val_coco.json │ └── test_coco.json ├── train2017/train_pic │ ├── 1.png │ ├── 2.png │ └── ... ├── val2017/val_pic │ ├── 1.png │ ├── 2.png │ └── ... └── test2017/test ├── 1.png ├── 2.png └── ...
-
Or, Prepare Data From Scratch
-
Download the given dataset from Google Drive.
-
Split train data into "train" and "val" folder. (
python my_data_preprocess/data_process.py
) -
Run command
python my_data_preprocess/data_process.py
to create coco format input data.
- The result will be like:
- dataset/ ├── train_coco.json ├── val_coco.json ├── test_coco.json ├── train_pic ├── val_pic │ ├── 1.png │ └── ... └── test ├── 1.png └── ...
- Reorganize data as Data Preparation
-
- cascade mask rcnn:
config_cascade_mask_rcnn_50.py
- swin mask rcnn:
config_swinT.py
- detectoRS:
config_detectoRS.py
- train model with pretrained model
# cd mmdetection
python tools/train.py config_cascade_mask_rcnn_50.py
Edit "load_from" "data" in config_cascade_mask_rcnn_50.py
- Inference test data
python my_inference.py
- The result will be stored in "./answer.json".
- Format of "./answer.json" is same as COCO results.
- Results:
- val result:
- bbox_mAP: 0.061
- segm_mAP: 0.060
- Test mAP: 0.233557 (41)
- val result:
- Using mmdetection tips:
- Pick a config file in ./configs/...
- Run it anyway.
- Then you can get the complete config file.