Skip to content
プロジェクト

概要

Optimize segmentation Dice/IoU without retraining. Plug-and-play decoding that replaces argmax or thresholding. Compatible with SAM, DeepLab, SegFormer, and more. Research published in NeurIPS & JMLR. 🧩

AI・機械学習

この数値の測り方

計測したスター増加

24時間
0
7日間
+1
15日間
+1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

🧩 RankSEG

Metric-Aware Dice/IoU Post-Processing Without Retraining

PyPI License Python PyTorch GitHub Stars Documentation Hugging Face Spaces Open In Colab 中文文档

JMLR NeurIPS

News | Quick Start | Benchmarks | Integrations | Docs | Citation


RankSEG replaces argmax or fixed thresholds with metric-aware post-processing designed to improve Dice or IoU—no retraining or fine-tuning. Use it with frozen PyTorch segmentation models for multiclass, binary, and multilabel tasks, from natural images to 3D medical scans.

RankSEG on 3D CT · Same model. No retraining.

Pancreas CT slice: ground truth, argmax (Dice 35.0), and RankSEG (Dice 49.3). White outlines mark ground truth.

20-volume mean Dice: 50.30 → 54.87 (+4.57 pp)
Frozen MONAI BTCV Swin UNETR · MSD Pancreas.

Illustrative slice above; white outline = ground truth. Research use only.
Evaluation protocol and example selection.

📰 News

  • August 2026 — RankSEG joins the official MONAI Tutorials! Try metric-aware post-processing for 3D medical segmentation. Tutorial · Colab

⚡ Quick Start

pip install -U rankseg

Optional Linux x86-64 GPU acceleration: pip install "rankseg[cuda]" (setup and activation).

For multiclass model logits shaped (batch, classes, *spatial), with at least two classes:

from rankseg import RankSEG

probs = model_logits.softmax(dim=1)
preds = RankSEG(metric="dice")(probs)  # replaces argmax; shape: (batch, *spatial)

For binary/multilabel examples, the functional API, and solver options, see the Getting Started guide.

RMA Dice offers optional memory-saving screening with safe_screening="auto". The default remains False, preserving the original computation path. Opting in may change masks near numerical ties. Details.

New in 0.0.9: spatial dependence with DEP. For Dice, solver="DEP" models label dependence between nearby pixels (NeurIPS 2026). Try it on 2D images with ambiguous regions, using the same probabilities:

preds_dep = RankSEG(metric="dice", solver="DEP", theta=300.0)(probs)

DEP supports CPU/CUDA and both output modes. It requires smooth=0 and does not accept safe_screening. theta is the spatial bandwidth in pixels; theta=0 removes dependence between distinct pixels but does not guarantee the same predictions as RMA. RMA remains the default. DEP usage and parameters.

Try it online: Colab · Interactive demo

📊 Benchmarks

Same probabilities. No retraining. Selected results compare argmax with RankSEG-RMA using the Dice objective. Scores are percentages; gains are percentage points (pp).

Selected RankSEG benchmark results comparing Dice and IoU with argmax on five datasets

Gains vary by dataset. Full results, metric definitions, runtime, and reproduction commands: rankseg-benchmark. For the algorithm and additional experiments, see our NeurIPS 2025 paper.

🔌 Integrations

Choose your workflow:

Ecosystem Get started Try online
PyTorch Docs · Example Colab
Hugging Face Docs · Notebook Colab
SAM family Docs · Notebook Colab
MONAI Docs · Official tutorial Colab
PaddleSeg (externally maintained) Docs · Community branch —

🔗 Citation

If you use RankSEG in your research, please cite our papers:

  • Dai, B., & Li, C. (2023). RankSEG: A Consistent Ranking-based Framework for Segmentation. Journal of Machine Learning Research, 24(224), 1-50. [link]
  • Wang, Z., & Dai, B. (2025). RankSEG-RMA: An Efficient Segmentation Algorithm via Reciprocal Moment Approximation. Advances in Neural Information Processing Systems (NeurIPS 2025). [link]
  • Wang, Z., & Dai, B. (2026). On the Relaxation of Conditional Independence Assumption for Image Segmentation. Advances in Neural Information Processing Systems (NeurIPS 2026).
@article{dai2023rankseg,
  title={RankSEG: A Consistent Ranking-based Framework for Segmentation},
  author={Dai, Ben and Li, Chunlin},
  journal={Journal of Machine Learning Research},
  volume={24},
  number={224},
  pages={1--50},
  url={https://www.jmlr.org/papers/v24/22-0712.html},
  year={2023}
}

@inproceedings{wang2025rankseg,
  title={RankSEG-RMA: An Efficient Segmentation Algorithm via Reciprocal Moment Approximation},
  author={Wang, Zixun and Dai, Ben},
  booktitle={Advances in Neural Information Processing Systems},
  url={https://arxiv.org/abs/2510.15362},
  year={2025}
}

@inproceedings{wang2026rankseg,
  title={On the Relaxation of Conditional Independence Assumption for Image Segmentation},
  author={Wang, Zixun and Dai, Ben},
  booktitle={Advances in Neural Information Processing Systems},
  year={2026}
}

Star us on GitHub if RankSEG helps your project! ⭐

関連プロジェクトを探す

読み込み中…