arXiv:2503.06515cs.CV2025-03AAAI被引 4

让SAM模型更轻量,4比特量化下分割精度提升11.7%。

SAQ-SAM: Semantically-Aligned Quantization for Segment Anything Model

论文配图:SAQ-SAM: Semantically-Aligned Quantization for Segment Anything Model
图 1 · 摘自论文原文
  • 通过感知一致性裁剪,有效抑制注意力异常值。
  • 引入提示感知重建,提升图像与提示的语义对齐。
  • 适合需要边缘部署的高精度分割应用。

Segment Anything Model (SAM) 具备出色的零样本分割能力;然而其高昂的计算成本使其难以在边缘设备上部署。尽管后训练量化(PTQ)是可行的压缩方案,但现有方法在应用于SAM时表现不佳,主要因其特殊组件和可提示工作流:(i) 掩码解码器的注意力存在极端激活异常值,我们发现即使100倍的激进裁剪,只要结合平滑或隔离处理,仍能抑制异常值并保持性能。然而,传统基于分布的指标(如均方误差)无法支持如此大规模的裁剪。(ii) 现有量化重建方法忽视了SAM的语义交互性,导致图像特征与提示意图错位。为此,本文提出SAQ-SAM,从语义对齐角度提升SAM的PTQ效果。具体而言,提出感知一致性裁剪,利用注意力焦点重叠实现激进裁剪的同时保留语义能力;同时提出提示感知重建,通过掩码解码器中的交叉注意力建模图像-提示交互,从而在分布和语义层面实现对齐。此外,为提升交互效率,设计了编码器中图像标记的层跳过策略。在多种SAM尺寸和任务上进行大量实验,包括实例分割、定向目标检测和语义分割,结果表明本方法持续领先。例如,将SAM-B量化至4比特时,实例分割任务中mAP比基线高出11.7%。

原文摘要 · Abstract (English)

Segment Anything Model (SAM) exhibits remarkable zero-shot segmentation capability; however, its prohibitive computational costs make edge deployment challenging. Although post-training quantization (PTQ) offers a promising compression solution, existing methods yield unsatisfactory results when applied to SAM, owing to its specialized model components and promptable workflow: (i) The mask decoder's attention exhibits extreme activation outliers, and we find that aggressive clipping (even 100x), without smoothing or isolation, is effective in suppressing outliers while maintaining performance. Unfortunately, traditional distribution-based metrics (e.g., MSE) fail to provide such large-scale clipping. (ii) Existing quantization reconstruction methods neglect semantic interactivity of SAM, leading to misalignment between image feature and prompt intention. To address the above issues, we propose SAQ-SAM in this paper, which boosts PTQ for SAM from the perspective of semantic alignment. Specifically, we propose Perceptual-Consistency Clipping, which exploits attention focus overlap to promote aggressive clipping while preserving semantic capabilities. Furthermore, we propose Prompt-Aware Reconstruction, which incorporates image-prompt interactions by leveraging cross-attention in mask decoder, thus facilitating alignment in both distribution and semantic. Moreover, to ensure the interaction efficiency, we design a layer-skipping strategy for image tokens in encoder. Extensive experiments are conducted on various SAM sizes and tasks, including instance segmentation, oriented object detection, and semantic segmentation, and the results show that our method consistently exhibits advantages. For example, when quantizing SAM-B to 4-bit, SAQ-SAM achieves 11.7% higher mAP than the baseline in instance segmentation task.

模型量化分割模型边缘部署SAM

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。