PTQ4SAM: Post-Training Quantization for Segment Anything
Chengtao Lv, Hong Chen, Jinyang Guo, Yifu Ding, Xianglong Liu

TL;DR
PTQ4SAM introduces a post-training quantization framework for the Segment Anything Model, effectively reducing memory and computation costs while maintaining high accuracy across various vision tasks.
Contribution
The paper proposes novel bimodal distribution transformation and adaptive softmax quantization strategies tailored for SAM, enabling efficient low-bit quantization without significant accuracy loss.
Findings
Achieves lossless accuracy at 6-bit quantization for SAM-L in instance segmentation.
Realizes approximately 3.9× acceleration with minimal accuracy drop.
Demonstrates superior performance across multiple vision tasks and datasets.
Abstract
Segment Anything Model (SAM) has achieved impressive performance in many computer vision tasks. However, as a large-scale model, the immense memory and computation costs hinder its practical deployment. In this paper, we propose a post-training quantization (PTQ) framework for Segment Anything Model, namely PTQ4SAM. First, we investigate the inherent bottleneck of SAM quantization attributed to the bimodal distribution in post-Key-Linear activations. We analyze its characteristics from both per-tensor and per-channel perspectives, and propose a Bimodal Integration strategy, which utilizes a mathematically equivalent sign operation to transform the bimodal distribution into a relatively easy-quantized normal distribution offline. Second, SAM encompasses diverse attention mechanisms (i.e., self-attention and two-way cross-attention), resulting in substantial variations in the post-Softmax…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsInfrared Target Detection Methodologies
MethodsSoftmax · Segment Anything Model
