Skip to content

STOmics/cs-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CellBinDB: A Large-Scale Multimodal Annotated Dataset for Cell Segmentation with Benchmarking of Universal Models

Introduction

This project is a benchmark for general cell segmentation models. We have deployed the following 11 cell segmentation methods: MEDIAR, Cellpose, Cellpose3, SAM, Stardist, Deepcell, Cellprofiler,cellpose4,cellSAM,Hovernet(only HE),cellbin, along with code to evaluate the model segmentation performance. Through the command line or notebook, you can run 7 segmentation models or evaluate the performance of 7 models with one click.
Here is an evaluation example of DAPI staining in the DEMO: Bar Chart

Installation

git clone https://github.com/STOmics/cs-benchmark.git   
cd cs-benchmark 
  • Create an environment for Cellpose, SAM, StarDist, and DeepCell.
  • NOTE:The command does not include installing PyTorch. If you need to use GPU, please install the corresponding version of PyTorch.
# python3.8 in conda env
conda create --name=cs-benchmark python=3.8
conda activate cs-benchmark
pip install -r requirements.txt
pip install git+https://github.com/facebookresearch/segment-anything.git
  • Use the following command to install the environment for mediar and cellprofiler, and add the conda path in the _py_ section of cell_seg.py or cellsegmentation_benchmark.ipynb
conda env create -f src/methods/MEDIAR/environment.yaml
conda env create -f src/methods/cellprofiler/environment.yaml
conda env create -f src/methods/hover_net/environment.yaml

Tutorials

Data

zenodo download link
CNSA download link
figure1

Use via command line

Cell segmentation

  • Modify the parameters in the following command and input it into the command line:
python cell_seg.py -i your_inputpath -o your_outputpath -m  cellpose3 sam -t ss -g True  
  • Where:

  • -i is the input image path
    -o is the output mask path
    -m is the algorithm(s) to be used (can specify multiple)
    -t is the image type (ss/he/dapi/mif)
    -g is the GPU index (True/False or num)

Segmentation evaluation

  • Ensure that the images in the gt folder have filenames with "-mask" and the images in the algorithm output mask folder have filenames with "-img", with only this difference in their names.

  • Modify the parameters in the following command and input it into the command line:

python src/eval/cell_eval_multi.py -g gt_path -d dt_path -o result_path
  • Where:

  • -g is the path to the ground truth (GT) folder
    -d is the path to the algorithm output mask folder
    -o is the output path for the results

Use via Notebook

cellsegmentation_benchmark.ipynb

Citation

if you use CellBinDB in your work, please cite it

Can Shi, Jinghong Fan, Zhonghan Deng, Huanlin Liu, Qiang Kang, Yumei Li, Jing Guo, Jingwen Wang, Jinjiang Gong, Sha Liao, Ao Chen, Ying Zhang, Mei Li, CellBinDB: a large-scale multimodal annotated dataset for cell segmentation with benchmarking of universal models, GigaScience, Volume 14, 2025, giaf069,
doi: https://doi.org/10.1101/2024.11.20.619750

Reference

cellpose
cellpose3
cellpose4
deepcell
sam
mediar
stardist
cellprofiler
Hovernet
cellSAM

About

This repository is for cell segmentation benchmark

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published