paper-with-me

Papers

PTQ4SAM: Post-Training Quantization for Segment Anything

2024-05-06 · CVPR 2024 1 · Chengtao Lv, Hong Chen, Jinyang Guo, Yifu Ding, Xianglong Liu

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 distributions. Therefore, we introduce an Adaptive Granularity Quantization for Softmax through searching the optimal power-of-two base, which is hardware-friendly. Extensive experimental results across various vision tasks (instance segmentation, semantic segmentation and object detection), datasets and model variants show the superiority of PTQ4SAM. For example, when quantizing SAM-L to 6-bit, we achieve lossless accuracy for instance segmentation, about 0.5\% drop with theoretical 3.9$\times$ acceleration. The code is available at \url{https://github.com/chengtao-lv/PTQ4SAM}.

📄 PDF Abstract BibTeX arXiv:2405.03144

Code (1)

chengtao-lv/ptq4sam 공식 구현 pytorch

Tasks

Instance Segmentationobject-detectionObject DetectionQuantizationSegmentationSemantic Segmentation

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
SAM 설명 없음

Similar Papers 제목 키워드 기반

AHCPTQ: Accurate and Hardware-Compatible Post-Training Quantization for Segment Anything Model

2025-03-05 · Wenlun Zhang, Shimpei Ando, Kentaro Yoshioka

The Segment Anything Model (SAM) has demonstrated strong versatility across various visual tasks. However, its large storage requirements and high computational cost pose challenges for practical deployment. Post-trainin…

Instance SegmentationQuantizationSemantic Segmentation

Q-SAM2: Accurate Quantization for Segment Anything Model 2

2025-06-11 · Nicola Farronato, Florian Scheidegger, Mattia Rigotti, Cristiano Malossi 외

The Segment Anything Model 2 (SAM2) has gained significant attention as a foundational approach for promptable image and video segmentation. However, its expensive computational and memory consumption poses a severe chal…

QuantizationVideo SegmentationVideo Semantic Segmentation

CAR-SAM: Cross-Attention Reconstruction for Post-Training Quantization of the Segment Anything Model

2026-05-16 · Houji Wen, Jiangyong Yu, Jun Li, Dawei Yang arxiv

Segment Anything Models (SAMs) are extensively used in computer vision for universal image segmentation, but deploying them on resource-constrained devices is challenging due to their high computational and memory demand…

Image SegmentationModel Compression

TinySAM: Pushing the Envelope for Efficient Segment Anything Model

2023-12-21 · Han Shu, Wenshuo Li, Yehui Tang, Yiman Zhang 외

Recently segment anything model (SAM) has shown powerful segmentation capability and has drawn great attention in computer vision fields. Massive following works have developed various applications based on the pre-train…

Knowledge DistillationQuantization

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

2025-05-08 · Navin Ranjan, Andreas Savakis

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…

Computational EfficiencyInstance Segmentationobject-detectionObject Detection+2