skip to content
gigarouter gigarouter
models / image segmentation · coming soon

BiRefNet

ZhengPeng7/BiRefNet

published Jul 2024 · updated Feb 2026

BiRefNet is a segmentation model for high-resolution dichotomous image segmentation (DIS).

est. price
~$0.094
/ 1k images · estimated, set at launch
API providers
0
downloads / mo
733.7K
license
mit

specs

TaskDichotomous Image Segmentation (DIS)
ArchitectureBilateral Reference Framework (Localization Module + Reconstruction Module with bilateral reference)
LicenseMIT
Training DataDIS-TR dataset

about this model

BiRefNet is a dichotomous image segmentation model designed for high-resolution input, introduced in the paper "Bilateral Reference for High-Resolution Dichotomous Image Segmentation" (CAAI AIR 2024, DOI 10.26599/AIR.2024.9150038). It achieves state-of-the-art performance on dichotomous image segmentation (DIS), high-resolution salient object detection (HRSOD), and camouflaged object detection (COD).

Architecture and Capabilities

BiRefNet employs a bilateral reference framework comprising a localization module (LM) for object localization using global semantic information and a reconstruction module (RM) that leverages bilateral references: hierarchical image patches as source reference and gradient maps as target reference. Auxiliary gradient supervision is applied to improve fine-detail regions. The model was trained on the DIS-TR dataset and validated on DIS-TEs and DIS-VD.

Notable Performance and Optimizations

  • As of June 2025, the refine_foreground operation was accelerated by approximately 8× to ~80 ms on an NVIDIA 5090 GPU using a GPU implementation of fast-fg-est.
  • The Swin Transformer attention module was upgraded to PyTorch’s official SDPA (September 2025), reducing memory cost and offering potential speedups during training and inference.
  • The model has been updated to version v7 (arXiv 2401.03407, July 2025) with a corrected figure layout.

Visual Examples

DIS Sample 1 DIS Sample 2
Animation showing dichotomous segmentation result on sample 1 Animation showing dichotomous segmentation result on sample 2

The image below shows the online inference GUI demo on Hugging Face, which supports adjustable resolutions.

Screenshot of BiRefNet online inference GUI with adjustable resolution slider

Additional Resources

Source code, weights, and a model zoo are available on the GitHub repository. The full paper provides further details on the bilateral reference design and experimental benchmarks.

best for

FAQ

What is BiRefNet used for?

BiRefNet performs high-resolution dichotomous image segmentation to separate precise objects from backgrounds, with strong performance on fine details.

What input resolution does it support?

The default inference resolution is 1024x1024, though it can be adapted to other sizes.

What license is it under?

BiRefNet is released under the MIT license.

How do I call this model via the gigarouter API?

Use the OpenAI-compatible endpoint with your gigarouter API key; refer to the gigarouter documentation for endpoint details.

How does BiRefNet compare to other segmentation models?

BiRefNet achieves state-of-the-art results on dichotomous image segmentation (DIS) benchmarks and also performs well on high-resolution saliency object detection (HRSOD) and camouflaged object detection (COD).

not yet live

We're benchmarking and onboarding BiRefNet as a hosted, OpenAI-compatible API. Sign in for free credit and be ready when it lands, or tell us you want it and we'll prioritize it.

related image segmentation models

compare all →