arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.04861cs.CV
收藏

Mix-QSAM:Segment Anything Model 的混合精度量化

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

Rochester Institute of Technology(罗切斯特理工大学)

Navin Ranjan, Andreas Savakis

AI总结:

本文提出 Mix-QSAM 混合精度量化框架,通过 KL 散度重要性分数和跨层协同度量构建整数二次规划问题,为 SAM 各层分配最优位宽,在 6 位和 4 位设置下实现最高 20% 的平均精度提升。

摘要:

Segment Anything Model(SAM)是一种流行的视觉基础模型,但其高昂的计算和内存需求使得在资源受限设备上的部署具有挑战性。虽然训练后量化(PTQ)是降低计算开销的一种实用方法,但现有的 PTQ 方法依赖固定位宽量化,导致精度和效率欠佳。为了解决这一局限性,我们提出了 Mix-QSAM,一个针对 SAM 的混合精度 PTQ 框架。首先,我们引入了一种基于 Kullback-Leibler(KL)散度的逐层重要性分数,用于量化每一层对模型输出的贡献。其次,我们引入了跨层协同(cross-layer synergy),这是一种基于因果互信息的新度量,用于捕捉相邻层之间的依赖关系。这确保了高度相互依赖的层保持相似的位宽,防止因精度突然不匹配而降低特征传播和数值稳定性。利用这些度量,我们构建了一个整数二次规划(IQP)问题,在模型大小和位操作约束下确定最优位宽分配,为关键层分配更高精度,同时最小化影响较小层的位宽。实验结果表明,Mix-QSAM 在实例分割和目标检测任务上持续优于现有 PTQ 方法,在 6 位和 4 位混合精度设置下平均精度提升高达 20%,同时保持计算效率。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑