arXiv:2505.04861cs.CV2025-05CVPR被引 7

为SAM模型设计混合精度量化方案,提升部署效率与精度

Mix-QSAM: Mixed-Precision Quantization of the Segment Anything Model

  • 基于KL散度和因果互信息,评估层重要性与层间关联
  • 6比特和4比特下平均精度最高提升20%,优于现有方法
  • 适合边缘设备部署,尤其关注模型压缩与推理加速的开发者

Segment Anything Model(SAM)作为流行的视觉基础模型,其高计算与内存需求使其在资源受限设备上的部署面临挑战。尽管训练后量化(PTQ)是降低计算开销的实用方法,但现有方法依赖固定位宽量化,导致精度与效率不理想。为此,我们提出Mix-QSAM,一种面向SAM的混合精度PTQ框架。首先,引入基于KL散度的逐层重要性评分,量化各层对输出的贡献;其次,提出跨层协同度,一种基于因果互信息的新指标,捕捉相邻层间的依赖关系,确保高度相关的层采用相似位宽,避免精度突变影响特征传播与数值稳定性。基于上述指标,构建整数二次规划(IQP)问题,在模型大小与位操作约束下优化位宽分配,对关键层赋予更高精度,对低影响层最小化位宽。实验表明,Mix-QSAM在实例分割与目标检测任务中持续优于现有PTQ方法,在6比特与4比特混合精度设置下,平均精度最高提升20%,同时保持高效计算。

原文摘要 · Abstract (English)

The Segment Anything Model (SAM) is a popular vision foundation model; however, its high computational and memory demands make deployment on resource-constrained devices challenging. While Post-Training Quantization (PTQ) is a practical approach for reducing computational overhead, existing PTQ methods rely on fixed bit-width quantization, leading to suboptimal accuracy and efficiency. To address this limitation, we propose Mix-QSAM, a mixed-precision PTQ framework for SAM. First, we introduce a layer-wise importance score, derived using Kullback-Leibler (KL) divergence, to quantify each layer's contribution to the model's output. Second, we introduce cross-layer synergy, a novel metric based on causal mutual information, to capture dependencies between adjacent layers. This ensures that highly interdependent layers maintain similar bit-widths, preventing abrupt precision mismatches that degrade feature propagation and numerical stability. Using these metrics, we formulate an Integer Quadratic Programming (IQP) problem to determine optimal bit-width allocation under model size and bit-operation constraints, assigning higher precision to critical layers while minimizing bit-width in less influential layers. Experimental results demonstrate that Mix-QSAM consistently outperforms existing PTQ methods on instance segmentation and object detection tasks, achieving up to 20% higher average precision under 6-bit and 4-bit mixed-precision settings, while maintaining computational efficiency.

量化SAM混合精度边缘部署

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