MobileSAM2: Lightweight Segment Anything for Spatial Intelligence
Paper

MobileSAM2: Lightweight Segment Anything for Spatial Intelligence

Yufei Wang
2026.07.20
·Arxiv·by Homin.Lee
#Computer Vision#Knowledge Distillation#Lightweight Model#MobileSAM2#Spatial Intelligence

Key Points

  • 1MobileSAM2 is a new family of lightweight segmentation models that enables efficient, high-performance image and video segmentation on resource-constrained devices.
  • 2The authors introduce Hypergraphical Knowledge Distillation (HyperKD), which uses temporal and granularity hypergraphs to effectively transfer the comprehensive, multi-scale knowledge of the large SAM2 model into smaller student architectures.
  • 3Experimental results demonstrate that MobileSAM2 successfully balances efficiency and effectiveness, significantly outperforming existing distillation methods across multiple video segmentation benchmarks.

MobileSAM2 is a lightweight adaptation of the SAM2 video foundation model designed for resource-constrained edge devices. Addressing the challenges of deploying heavy segmentation models on mobile platforms, the authors introduce a novel distillation framework, Hypergraphical Knowledge Distill (HyperKD), and a family of efficient model architectures, MobileSAM2.

The methodology relies on the premise that SAM2’s performance stems from two primary latent knowledge structures: temporal correlations across video frames and multi-granularity hierarchies of visual concepts. Because these are implicitly encoded within the teacher model’s parameters, the authors propose HyperKD to explicitly model them using hypergraphs.

Hypergraphical Knowledge Distill (HyperKD)

HyperKD consists of two main components:
  1. Temporal HyperKD: This module extracts temporal knowledge by constructing patch-wise and instance-wise hypergraphs. For a video embedding zItzI_t, nodes are established via pooling based on mask predictions. Hyperedges are formed using an ϵ\epsilon-ball distance threshold, where a hyperedge connects all vertices uu within a distance ϵ\epsilon of a central vertex vv. By minimizing the difference between the incidence matrices HtH_t and HsH_s of the teacher and student models—formulated as LTHKD=∥HPat−HPas∥F+∥HtIns−HsIns∥FL_{THKD} = \|H^P a_t - H^P a_s\|_F + \|H^{Ins}_t - H^{Ins}_s\|_F—the student learns to replicate the temporal consistency of the teacher.
  2. Granularity HyperKD: This module captures orthogonal multi-granularity knowledge (e.g., objects vs. subparts). Nodes v∈VtGranv \in V^{Gran}_t are initialized by masked average pooling of frame embeddings. The resulting hypergraph is encapsulated into the student by minimizing the Frobenius norm of the difference between teacher and student incidence matrices: LGHKD=∥HtGran−HsGran∥FL_{GHKD} = \|H^{Gran}_t - H^{Gran}_s\|_F.

The total objective function is defined as:
Loss=∥zIt−zIs∥1+α⋅LTHKD+β⋅LGHKDLoss = \|zI_t - zI_s\|_1 + \alpha \cdot L_{THKD} + \beta \cdot L_{GHKD}

MobileSAM2 Architecture

To achieve efficiency, the authors employ a progressive model contraction strategy on the Hiera vision transformer backbone. By searching a parameter space of contraction factors—including embedding dimensions (ΓEmb\Gamma_{Emb}), block depth (ΓBlk\Gamma_{Blk}), window sizes (ΓWinSiz\Gamma_{WinSiz}), and attention head expansion ratios (ΓHExp\Gamma_{HExp})—they identified three distinct model configurations (5M, 10M, and 23M parameters). These models retain the memory module, prompt encoder, and mask decoder of the original SAM2, replacing only the heavy image encoder.

Experimental Impact

Extensive benchmarking on VOS datasets (MOSE, DAVIS 2017, LVOS, and SA-V) demonstrates that MobileSAM2 significantly outperforms traditional distillation baselines like FitNet, CIRKD, and FAKD. The approach succeeds in balancing high-fidelity temporal and multi-granularity understanding with the computational requirements of mobile hardware, facilitating real-time spatial intelligence on constrained devices.