Downloads · 30 days
0
Lewislou/cell-seg-sribd
cell-seg-sribd is a image segmentation model from Lewislou. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This repository provides the solution of team Sribd-med for NeurIPS-CellSeg Challenge. The details of our method are described in our paper [Multi-stream Cell Segmentation with Low-level Cues for Multi-modality Images…
Downloads · 30 days
0
Access
Public
Updated Mar 17, 2023
Repo size
4.6 GB
Likes
3
Public
Click a slice to open those files.
.pt2.3 GB · 50%
From the Hugging Face model README
This repository provides the solution of team Sribd-med for NeurIPS-CellSeg Challenge. The details of our method are described in our paper [Multi-stream Cell Segmentation with Low-level Cues for Multi-modality Images]. Some parts of the codes are from the baseline codes of the NeurIPS-CellSeg-Baseline repository,
You can reproduce our method as follows step by step:
Install requirements by python -m pip install -r requirements.txt
The competition training and tuning data can be downloaded from https://neurips22-cellseg.grand-challenge.org/dataset/ Besides, you can download three publiced data from the following link: Cellpose: https://www.cellpose.org/dataset Omnipose: http://www.cellpose.org/dataset_omnipose Sartorius: https://www.kaggle.com/competitions/sartorius-cell-instance-segmentation/overview
Install requirements by
python -m pip install -r requirements.txt
The competition training and tuning data can be downloaded from https://neurips22-cellseg.grand-challenge.org/dataset/ Besides, you can download three publiced data from the following link: Cellpose: https://www.cellpose.org/dataset Omnipose: http://www.cellpose.org/dataset_omnipose Sartorius: https://www.kaggle.com/competitions/sartorius-cell-instance-segmentation/overview
You can classify the cells into four classes in this step. Put all the images (competition + Cellpose + Omnipose + Sartorius) in one folder (data/allimages). Run classification code:
python classification/unsup_classification.py
The results can be stored in data/classification_results/
Using the classified images in data/classification_results/. A resnet18 is trained:
python classification/train_classification.py
Pre-training convnext-stardist using all the images (data/allimages).
python train_convnext_stardist.py
For class 0,2,3 finetune on the classified data (Take class1 as a example):
python finetune_convnext_stardist.py model_dir=(The pretrained convnext-stardist model) data_dir='data/classification_results/class1'
For class 1 train the convnext-hover from scratch using classified class 3 data.
python train_convnext_hover.py data_dir='data/classification_results/class3'
Finally, four segmentation models will be trained.
The models are in models/.
The inference process includes classification and segmentation.
python predict.py -i input_path -o output_path --model_path './models'
Calculate the F-score for evaluation:
python compute_metric.py --gt_path path_to_labels --seg_path output_path
The tuning set F1 score of our method is 0.8795. The rank running time of our method on all the 101 cases in the tuning set is zero in our local workstation.