
MobileSAM2: Lightweight Segment Anything for 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:- Temporal HyperKD: This module extracts temporal knowledge by constructing patch-wise and instance-wise hypergraphs. For a video embedding , nodes are established via pooling based on mask predictions. Hyperedges are formed using an -ball distance threshold, where a hyperedge connects all vertices within a distance of a central vertex . By minimizing the difference between the incidence matrices and of the teacher and student models—formulated as —the student learns to replicate the temporal consistency of the teacher.
- Granularity HyperKD: This module captures orthogonal multi-granularity knowledge (e.g., objects vs. subparts). Nodes 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: .
The total objective function is defined as: