BEN3: Background Erase Network

arXiv GitHub Website API Hugging Face Space

BEN3 (Background Erase Network) is our next-generation image and video background removal model, developed by BackgroundErase / Prama LLC.

Built on multi-hypothesis segmentation and a DINOv3 visual encoder, BEN3 is designed for high-quality foreground segmentation, fine-detail preservation, and efficient image and video processing. It supports single-image inference, batched image processing, transparent video generation, and background replacement.

Image Background Removal Demo

BEN3 Image Background Removal Results

Try the full BEN3 model directly at backgrounderase.com.

Video Background Removal Demo

BEN3 supports transparent video output and background replacement.

BEN3 Video Background Removal Demo

*Click the image above to watch BEN3 in action.*

Model Access

BEN3 is available in two versions:

BEN3 β€” Open Model

This repository contains the BEN3 multi-hypothesis generator, including the model weights, inference code, and support for image and video background removal.

BEN3 β€” Full Commercial Model

Our full commercial model incorporates the proprietary multi-hypothesis fusion network, delivering enhanced segmentation quality, boundary refinement, and fine-detail preservation.

The full model is available through:

  • Web Demo: Try BEN3 directly at backgrounderase.com.
  • API: Integrate the full BEN3 model into your applications and production workflows. See the API documentation.
  • On-Device Licensing: Deploy the full model within your own infrastructure or applications.
  • Enterprise API Access: Custom pricing, high-volume processing, and enterprise-level integration.

For on-device licensing, self-hosted deployments, or enterprise API access, contact sales@backgrounderase.com.

The fusion network is not included in the public release.

Quick Start

From the GitHub Python package

pip install git+https://github.com/PramaLLC/BEN3.git

Then load the model directly from this Hugging Face repository:

from PIL import Image
from ben3 import BEN3

model = BEN3.from_pretrained(
    "PramaLLC/BEN3",
    device="cuda",
)

foreground, mask = model.inference(Image.open("input.jpg"))
foreground.save("foreground.png")
mask.save("mask.png")

Directly from this repository

Clone/download the model repository, install requirements.txt, then:

from PIL import Image
from ben3 import BEN3

model = BEN3("ben3.pth", device="cuda")
foreground, mask = model.inference(Image.open("input.jpg"))
foreground.save("foreground.png")

Batched Image Inference

images = [Image.open("a.jpg"), Image.open("b.jpg")]
foregrounds, masks = model.inference(images)

Video Inference

Transparent VP9 WebM

model.segment_video(
    "input.mp4",
    output_path="foreground.webm",
    batch=8,
    webm=True,
    add_audio=True,
)

Solid-background MP4

model.segment_video(
    "input.mp4",
    output_path="foreground.mp4",
    batch=8,
    rgb_value=(255, 255, 255),
)

ffmpeg and ffprobe must be installed for transparent WebM output and audio muxing.

Research Benchmarks β€” MHFNet

Our multi-hypothesis fusion architecture, MHFNet, achieves leading performance on the DIS5K benchmark for dichotomous image segmentation.

On the 2,000-image DIS-TE benchmark, our multi-hypothesis fusion framework improves weighted F-measure from 0.8915 to 0.9054 and reduces mean absolute error from 0.0277 to 0.0255 compared to single-hypothesis selection from the same retrained generator.

These results correspond to the MHFNet research framework, not the standalone BEN3 generator released in this repository.

DIS-TE1–4 (2,000 Test Images)

Method Weighted F ↑ Max F ↑ MAE ↓ S-measure ↑ Mean E-measure ↑
IS-Net 0.725 0.799 0.070 0.819 0.858
InSPyReNet 0.838 0.891 0.039 0.900 0.922
BiRefNet 0.858 0.900 0.035 0.901 0.934
GenPercept 0.856 0.875 0.036 0.885 0.939
MVANet 0.861 0.908 0.035 0.904 0.938
DiffDIS 0.892 0.911 0.027 0.905 0.951
PDFNet-L 0.876 0.915 0.030 0.916 0.944
S3OD (Original) 0.890 0.919 0.029 0.912 0.949
S3OD (Retrained) 0.892 0.920 0.028 0.919 0.948
MHFNet (Ours) 0.905 0.922 0.026 0.923 0.952

See the MHFNet paper for the complete evaluation.

Architecture & Model Details

BEN3 is built on our research into multi-hypothesis segmentation, introduced in MHFNet: Multi-Hypothesis Fusion Network for Dichotomous Image Segmentation by Maxwell Meyer and Jack Spruyt β€” Prama LLC.

Unlike conventional segmentation models that produce a single foreground mask, BEN3 generates multiple candidate masks using a DINOv3 ViT-B/16 encoder and a DPT-style decoder. An auxiliary quality prediction head evaluates the candidate masks and selects the most promising prediction.

The full BEN3 pipeline introduces a second-stage fusion network that jointly processes the input image and multiple segmentation hypotheses to refine foreground boundaries and recover fine structures.

Open Model Specifications

  • Task: foreground/background segmentation and alpha-mask generation
  • Input: RGB image(s)
  • Output: foreground RGBA image(s) and 8-bit alpha mask(s)
  • Default inference size: 1024Γ—1024
  • Encoder: DINOv3 ViT-B/16 architecture
  • Decoder: DPT-style multi-scale feature fusion
  • Candidate masks: 3
  • Mask selection: learned auxiliary score head
  • Image inference: single or batched
  • Video inference: batched frame inference with transparent WebM or composited MP4 output

The full DINOv3 encoder state is expected inside ben3.pth. The included code instantiates the encoder architecture from configuration and does not separately download Meta's backbone weights.

Training Data

BEN3 was trained on our proprietary dataset of approximately 38,000 images for high-quality foreground segmentation and background removal.

The training dataset is proprietary to Prama LLC and is not included in this release.

Intended Use

BEN3 is designed for high-quality image and video background removal, foreground extraction, compositing, e-commerce imagery, creative applications, and related computer vision workflows.

Acknowledgements

BEN3 builds upon the multi-hypothesis segmentation architecture introduced in S3OD: Towards Generalizable Salient Object Detection with Synthetic Data.

We thank Orest Kupyn, Hirokatsu Kataoka, and Christian Rupprecht for their contributions to salient object detection and for making their research and implementation publicly available.

We also acknowledge the Meta AI research team for their work on DINOv3, which serves as the visual encoder architecture for BEN3.

Citation

If you find BEN3 or our multi-hypothesis fusion framework useful in your research or applications, please consider citing our work:

@misc{meyer2026mhfnetmultihypothesisfusionnetwork,
    title={MHFNet: Multi-Hypothesis Fusion Network for Dichotomous Image Segmentation},
    author={Maxwell Meyer and Jack Spruyt},
    year={2026},
    eprint={2611.38399},
    archivePrefix={arXiv},
    primaryClass={cs.CV},
    url={https://arxiv.org/abs/2611.38399}
}

License

The BEN3 implementation and publicly released hypothesis generator are released under the MIT License, subject to applicable third-party licensing terms.

Contact

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for PramaLLC/BEN3

Quantizations
1 model

Papers for PramaLLC/BEN3