BiRefNet
Choose the right BiRefNet checkpoint for your cutout: distinguish segmentation, matting and foreground-color refinement, then inspect the exported asset on its intended backgrounds.
At a glance
- Input
- A still image processed according to the selected checkpoint's documented preprocessing path.
- Output
- A predicted foreground mask, or a task-specific matting output when the separate matting checkpoint is deliberately selected.
- Access
- Official code and reviewed standard or matting assets declare MIT. Pin the exact checkpoint and review derivatives and hosted services separately.
- Who it fits
- Editors and developers who can define the required cutout, keep preprocessing fixed and inspect the delivered composite on its destination backgrounds.
- When to choose something else
- Avoid assuming one segmentation mask is a finished alpha asset, or using a checkpoint whose task and preprocessing do not match the brief.
- Cost and access conditions
- Compute is only one part of a cutout's cost. Track mask inference, optional color refinement and manual edge cleanup on representative images; no runtime or hardware minimum was tested here.
Key Highlights
Segmentation and matting serve different tasks
BiRefNet's standard dichotomous segmentation output is not automatically an alpha-matting or foreground-color result. Match the checkpoint and post-processing path to the actual deliverable.
Inspect the mask and composite separately
The standard example resizes the input for inference, applies a sigmoid to the prediction and resizes the mask back. Check the mask itself, then test the exported cutout on every required background.
Foreground-color refinement is another operation
The official repository includes a separate foreground-color refinement path. Record whether it was used rather than attributing every edge or color improvement to the segmentation checkpoint.
About
On this page
BiRefNet is an image-segmentation research project used to separate a foreground subject from its background. It can be a useful starting point for a cutout workflow, but the checkpoint matters: a standard foreground-segmentation model and a matting model do not make the same prediction. Choose the task first, then evaluate the resulting mask and composite at the size and on the background where the image will actually be used.
This is a source-based evaluation, checked on September 10, 2026. We did not run BiRefNet on a GPU or produce the example cutouts described below. The chair-image scenario and acceptance worksheet are proposed editorial tools for evaluating your own images, not measured results.
Reviewed source revisions: code ebcc0bc8, standard model card e2bf8e44, matting model card eccde0a8.
Ask whether you need a selection or transparency
A product cutout can fail in several different ways. The main subject may be selected incorrectly, a narrow opening may be filled in, fine fibers may disappear, or the edge may retain color from the original background. Calling all of these “background removal accuracy” hides the actual editing problem.
The original BiRefNet work addresses high-resolution dichotomous image segmentation through localization and reconstruction components. That establishes the research task, not a promise that every released checkpoint handles translucent material identically. BiRefNet paper.
The official standard model card identifies its weights with the segmentation task. The project also provides a separately identified general-matting checkpoint. For a hard-edged object, a foreground selection may be sufficient. For soft transitions or partially transparent material, your evaluation should explicitly examine alpha behavior and the suitability of the selected checkpoint. Standard model, matting model.
Imagine an upholstered chair photographed for a furniture catalogue. The editor needs the narrow legs and the open space beneath the seat preserved, with a small fabric fringe along one edge. The desired deliverable is a reusable cutout that works on both a pale product page and a dark promotional layout. A mask that looks convincing against the original studio background has not yet met that brief.
Inspect the mask and the composite separately
The standard model-card example preprocesses an image, predicts a mask, resizes that mask back to the image dimensions and applies it as an alpha channel. Those steps make an image with transparency, but applying a predicted segmentation mask as alpha does not by itself establish physically correct transparency for glass, smoke or fabric. Official inference example.
Keep the original photograph, predicted mask and final composite as separate artifacts. The mask helps you see whether the subject selection is correct. The composite reveals how that selection interacts with edge colors and the replacement background. Looking at only one can conceal a defect that appears immediately in the other.
For the chair, inspect the spaces between legs in the mask before judging the fringe on the dark layout. If those spaces are wrong, foreground-color refinement will not restore the missing geometry. If the selection is correct but a pale rim remains, changing the entire subject mask may damage good edges while leaving the color problem unresolved.
Also verify the delivered file after export and reimport. Transparency must survive the actual asset pipeline, not only the editing preview. Check the file format, image dimensions and how the destination application composites it. A flattened image or incorrectly interpreted alpha channel is a delivery failure even when the model's output was usable.
Pin the checkpoint and preprocessing together
BiRefNet is a project with multiple published variants, including standard, matting and higher-resolution options. Do not attach one training resolution, memory figure or benchmark result to every file carrying the name. Record the exact model repository, revision and preprocessing used for your test. Project model zoo.
The official loading example includes a remote-code option. Treat downloaded model code as executable software: review its source, pin a revision, use an isolated environment and avoid giving an experiment unrelated credentials. A familiar model name does not make an arbitrary mirror or community wrapper equivalent to the author's distribution.
Record the input resize and the mask resize separately. A large source photograph may still be reduced substantially before inference. Restoring the output mask to the original dimensions restores its canvas size, not evidence that every tiny source detail was preserved. Judge detail on the actual result rather than using the source image's megapixel count as a quality claim.
If you compare a standard and a matting checkpoint, retain each one's documented preprocessing. Changing the checkpoint and several unrelated postprocessing settings at once makes the result hard to explain. First establish a complete baseline for each candidate, then adjust the particular stage associated with an observed defect.
Understand what the MIT licence does and does not cover
The project repository uses MIT, and the official standard and matting model cards identify those weights with MIT as well. The licence allows broad use of covered material subject to its notice conditions and includes a warranty disclaimer. Keep the applicable licence and attribution information with any redistribution. Repository licence.
Do not transfer that conclusion to every derivative model trained on the same architecture. A different checkpoint or hosted service can have different terms. Check the exact weights and service you intend to use rather than inferring permission from “based on BiRefNet.” Likewise, an open licence does not make hosted inference, storage or GPU time costless.
The source photograph remains a separate rights question. Confirm that you may edit and publish it, including any recognizable people, artwork or branding it contains. Removing a background does not create ownership of the remaining subject. This article reports the source licences; it is not legal advice or a guarantee that a particular commercial image is cleared.
For a team workflow, make the licence decision part of the run record rather than a note held by one developer. If a new model revision replaces the checkpoint later, the record should make it obvious that both technical behavior and applicable terms need another check.
Prepare a cutout trial around the delivery brief
For the hypothetical chair catalogue, select a small group of photographs that represents the actual editing work. Include a clear silhouette, a low-contrast edge, an open gap between structural parts and fine fabric detail. These categories expose different acceptance questions without pretending to be a comprehensive segmentation benchmark.
Before running anything, mark which features must remain and which surrounding elements should disappear. Decide whether the contact shadow belongs in the deliverable, should be edited separately or must be removed. A disagreement about the intended shadow is an art-direction issue, not necessarily a model error.
Save the untouched input and create a reference crop for each important edge. Record the final placement size, destination backgrounds and permissible manual-edit time. A cutout for a small catalogue thumbnail and one for a large campaign layout may need different treatment even when they originate from the same photograph.
Run one candidate configuration, retain its mask and composite it onto the planned light and dark backgrounds. Compare those results at delivery size and inspect the critical crops more closely when diagnosing a defect. Do not reject a useful thumbnail solely for an invisible magnified imperfection, or accept a large-format asset because its reduced preview looks clean.
Use a multi-background acceptance worksheet
The following worksheet is an original proposal for the chair example. It has no filled-in success rate because no image test was performed for this review.
| Region or delivery check | What to inspect | Decision to record |
|---|---|---|
| Outer silhouette | Seat corners and narrow legs against both planned backgrounds | Accept, manually correct, or reject with the exact affected region. |
| Interior openings | Gaps beneath the seat and between structural elements | Confirm that background is removed without erasing part of the chair. |
| Fabric fringe | Whether useful fine detail survives without a distracting halo | Judge at intended placement size and record any permitted edge cleanup. |
| Contact shadow | Whether the result matches the agreed art direction | Keep, separate or remove deliberately; do not let the model define the brief. |
| Exported asset | Alpha, dimensions and appearance after destination import | Confirm that the delivered file matches the approved composite. |
| Editing effort | Time spent correcting each accepted and rejected image | Compare total accepted-deliverable time, including unsuccessful attempts. |
Keep an example of a borderline result and its written decision. This helps two editors apply the same standard to later images. Otherwise “good edge” can mean different things depending on the background or reviewer, and an apparent improvement may only reflect a changed acceptance threshold.
Use the worksheet to identify where automation helps. A model may save substantial selection work while leaving a predictable manual cleanup step. That can be a useful workflow if the cleanup is visible and budgeted. It should not be described as unattended production simply because most of the foreground appears on the first attempt.
Treat foreground-color refinement as another operation
The repository includes a foreground-refinement function with separate CPU and GPU paths. It estimates foreground colors using the image and mask; it is not the same operation as predicting the mask itself. Its presence is useful evidence for structuring a trial, not proof that refinement improves every photograph. Foreground refinement code.
If the chair's silhouette is acceptable but its edge carries the old background color, compare a copy with and without refinement. Preserve the original mask so you can see whether the change affects color rather than selection. Inspect the pale and dark composites again, since an edge adjustment that helps one background can still be unsuitable for the other.
Avoid applying several cleanup operations without keeping intermediate results. Aggressive smoothing can make an edge look tidy while discarding the fabric detail the brief required. Record what changed and whether the change solved the named defect. If it did not, revert that experimental branch rather than stacking more adjustments on an unexplained result.
Diagnose the defect before buying more compute
These are proposed investigations, not measured failure frequencies. Start with the stage where the problem becomes visible.
| Observed defect | First investigation | Controlled next step |
|---|---|---|
| A narrow leg disappears | Whether it survives preprocessing and appears in the predicted mask | Compare the relevant crop and a justified resolution change. |
| An interior gap stays filled | Whether the selected checkpoint and mask identify the intended opening | Review the mask directly and compare a second appropriate checkpoint or manual correction. |
| A halo appears only on dark backgrounds | Foreground color versus mask boundary | Compare refinement on a duplicate while holding the selection fixed. |
| Fine fibers look opaque or cut off | Whether the task needs matting rather than a binary selection | Evaluate the separate matting checkpoint against the same delivery brief. |
| The editor preview is correct but the website is not | Export format, alpha interpretation and image transformation | Reimport the delivered file and inspect the destination pipeline. |
Measure initialization, inference, refinement and export separately when evaluating speed. Include manual correction in the end-to-end result. A maintainer's GPU timing is not a promised processing time for your machine, checkpoint, image dimensions or batch size, and this review supplies no minimum-hardware guarantee.
Know when a different editing method is simpler
For a few hard-edged products, a manual path may be more predictable than configuring an automated pipeline. For important translucent material, specialist matting or retouching may be necessary. If the photograph does not distinguish the subject from its background clearly enough for the delivery brief, a controlled reshoot can be more productive than repeated model trials.
Choose among those approaches using the same acceptance worksheet and editing budget. Do not compare a model's raw mask against a manually polished final asset without acknowledging the difference in work performed. The meaningful comparison is the time and effort needed to produce an accepted deliverable under the same brief.
BiRefNet is therefore best approached as a selectable component in an image workflow, not a universal promise of perfect transparency. Keep the checkpoint, preprocessing, mask, composite and correction record together. For other image-related model categories, visit the model directory; assess any named alternative independently before treating it as a replacement.
Use Cases
Product cutout acceptance
For an object with narrow legs, open gaps or fabric fringe, compare the mask and composite at delivery size on light, dark and coloured backgrounds before accepting the asset.
Checkpoint selection for a defined edit
Compare only checkpoints intended for the same segmentation or matting job, using the same preprocessing and acceptance sheet. A model name alone does not make their outputs interchangeable.
Pros & Cons
Pros
- Official standard segmentation and separate matting checkpoints make the intended task distinguishable.
- The documented inference path exposes the mask-processing steps needed for a reproducible trial.
- The repository includes a separate foreground-color refinement operation when the delivery requires it.
Cons
- A segmentation mask alone does not prove clean transparency or correct foreground color at difficult edges.
- Checkpoint variants have different tasks and preprocessing assumptions, so results cannot be generalized across the BiRefNet name.
- The delivered cutout may need foreground-color refinement and manual edge cleanup after mask prediction.
Technical Details
Architecture
Bilateral reference with localization and reconstruction modules
License
MIT
MIT repository code and MIT-labelled official standard/matting weights. Retain required notices. Derivative checkpoints, hosting and source-photo rights must be checked separately. License source
Available Platforms
Frequently Asked Questions
Related Models
BRIA RMBG
BRIA RMBG is a state-of-the-art background removal model developed by BRIA AI, an Israeli startup specializing in responsible and commercially licensed generative AI. The model delivers exceptional accuracy in separating foreground subjects from backgrounds, handling complex scenarios including fine hair details, transparent objects, intricate edges, smoke, and glass with remarkable precision. BRIA RMBG is built on a proprietary architecture trained on exclusively licensed and ethically sourced data, ensuring full commercial safety and IP compliance that distinguishes it from models trained on scraped internet data. It produces high-quality alpha mattes preserving fine edge details and natural transparency gradients for clean cutouts suitable for professional workflows. Available in versions including RMBG 1.4 and RMBG 2.0, the model consistently ranks among top performers on background removal benchmarks including DIS5K and HRS10K datasets. BRIA RMBG is accessible through Hugging Face with a permissive license for research and commercial use, and through BRIA's commercial API for scalable cloud processing. Integration options include Python SDK, REST API, and popular image processing pipeline compatibility. Applications span e-commerce product photography, graphic design compositing, video conferencing virtual backgrounds, automotive and real estate photography, social media content creation, and document digitization. The model processes images in milliseconds on modern GPUs, suitable for real-time and high-volume batch processing. BRIA RMBG has established itself as one of the most commercially trusted and technically advanced background removal solutions available.
MODNet
MODNet (Matting Objective Decomposition Network) is an open-source portrait matting model developed by ZHKKKe, designed for real-time human portrait background removal without requiring a pre-defined trimap or additional user input. Unlike traditional matting approaches needing manually drawn trimaps, MODNet achieves fully automatic portrait matting by decomposing the complex matting objective into three sub-tasks: semantic estimation for identifying the person region, detail prediction for refining edge quality around hair and clothing boundaries, and semantic-detail fusion for combining both signals into a high-quality alpha matte. This decomposition enables efficient single-pass inference at real-time speeds, making it practical for video conferencing, live streaming, and mobile photography where latency is critical. The model produces smooth and accurate alpha mattes with particular strength in handling hair strands, fabric edges, and other fine boundary details challenging for segmentation-based approaches. MODNet supports both image and video input with temporal consistency optimizations for stable video matting without flickering. The model is lightweight enough for mobile devices and edge hardware, with ONNX export supporting deployment across iOS, Android, and web browsers through WebAssembly. Common applications include video call background replacement, portrait mode photography, social media content creation, virtual try-on systems, and film post-production green screen alternatives. Released under Apache 2.0, MODNet provides a free and efficient solution widely adopted in both research and production portrait matting applications.
RemBG
RemBG is a popular open-source tool developed by Daniel Gatis for automatic background removal from images, providing a simple and efficient solution for isolating foreground subjects without manual selection or professional editing skills. The tool leverages multiple pre-trained segmentation models including U2-Net, IS-Net, SAM, and specialized variants optimized for different use cases such as general objects, human subjects, anime characters, and clothing items. RemBG processes images through semantic segmentation to identify foreground elements and generates precise alpha matte masks that cleanly separate subjects from backgrounds, producing transparent PNG outputs ready for immediate use. The tool excels at handling complex edge cases including wispy hair, translucent fabrics, intricate jewelry, and objects with irregular boundaries. RemBG is available as a Python library via pip, a command-line interface for batch processing, and through API integrations for production deployment. It processes images locally without sending data to external servers, making it suitable for privacy-sensitive applications. Common use cases include e-commerce product photography, social media content creation, passport photo processing, graphic design compositing, real estate photography, and marketing materials. The tool supports JPEG, PNG, and WebP formats and handles both single images and batch directory operations. RemBG has become one of the most starred background removal repositories on GitHub with millions of downloads, and its models are integrated into numerous other AI tools. Released under the MIT license, it provides a free and commercially viable alternative to paid background removal services.
Segment Anything (SAM)
Segment Anything Model (SAM) is Meta AI's foundation model for promptable image segmentation, designed to segment any object in any image based on input prompts including points, bounding boxes, masks, or text descriptions. Released in April 2023 alongside the SA-1B dataset containing over 1 billion masks from 11 million images, SAM creates a general-purpose segmentation model that handles diverse tasks without task-specific fine-tuning. The architecture consists of three components: a Vision Transformer image encoder that processes input images into embeddings, a flexible prompt encoder handling different prompt types, and a lightweight mask decoder producing segmentation masks in real-time. SAM's zero-shot transfer capability means it can segment objects never seen during training, making it applicable across visual domains from medical imaging to satellite photography to creative content editing. The model supports automatic mask generation for segmenting everything in an image, interactive point-based segmentation for precise object selection, and box-prompted segmentation for region targeting. SAM has spawned derivative works including SAM 2 with video support, EfficientSAM for edge deployment, and FastSAM for faster inference. Practical applications span background removal, medical image annotation, autonomous driving perception, agricultural monitoring, GIS mapping, and interactive editing tools. SAM is fully open source under Apache 2.0 with PyTorch implementations, and models and dataset are freely available through Meta's repositories. It has become one of the most influential computer vision models, fundamentally changing how segmentation tasks are approached across industries.
Quick Info
Bilateral reference with localization and reconstruction modules