--- license: mit base_model: PramaLLC/BEN3 base_model_relation: quantized library_name: mlx pipeline_tag: image-segmentation tags: - mlx - mlx-swift - apple-silicon - ios - macos - ben3 - background-removal - image-segmentation - dinov3 - 4-bit --- # BEN3-MLX (Apple Silicon / iOS & macOS) Native **MLX** / **MLX Swift** safetensors conversion and mobile 4-bit quantization of [PramaLLC/BEN3](https://huggingface.co/PramaLLC/BEN3) (DINOv3 ViT-B/16 encoder + DPT multi-hypothesis segmentation head). ## Files & Benchmarks | File | Quantization | Size | Mask MAE vs FP16 | IoU vs FP16 | | :--- | :--- | ---: | ---: | ---: | | `ben3-q4.safetensors` | 4-bit MLX affine (`group_size=64`) on 72 DINOv3 encoder linear layers; FP16 DPT decoder; FP32 BatchNorm | **105 MiB** | **0.00026** | **0.9989** | | `ben3-fp16.safetensors` | FP16 weights; FP32 BatchNorm running statistics | **222 MiB** | reference | reference | *Original PyTorch checkpoint `ben3.pth` is 464 MB FP32. `ben3-q4.safetensors` reduces on-disk and unified memory footprint by **4.4×** for iOS and macOS deployment while preserving full FP16 Conv2d/ConvTranspose2d precision in the DPT alpha-matting head.* ## Weight Layout Notes - Convolution weights are stored in standard PyTorch NCHW layout (`OIHW` for `Conv2d`, `IOHW` for `ConvTranspose2d`) and transposed to MLX NHWC at load time. - Training-only `num_batches_tracked` counters are stripped; BatchNorm `running_mean`, `running_var`, `weight`, and `bias` remain in FP32. - Quantized linear layers follow standard MLX `QuantizedLinear` (`weight` uint32, `scales` float16, `biases` float16, `mode="affine"`, `group_size=64`, `bits=4`). ## Attribution & License Derived from [PramaLLC/BEN3](https://huggingface.co/PramaLLC/BEN3) under the **MIT License**. ```bibtex @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} } ```