arXiv:2611.04491cs.CVNov 2026

Manuscript Offprint

arXiv:2611.04491

SPA-Q: Structure-Preserving Adaptive Post-Training Quantization for Monocular Depth Estimation

Jaemin Choi, Jincheol Yang, Nahyun Lim, Yun-Seong Jeong, Matti Zinke, Hyunwoo Yu, Suk-Ju Kang

Abstract

Monocular depth estimation (MDE) has advanced rapidly with the emergence of foundation models such as Depth Anything. Their transformer-based architectures provide strong generalization across diverse scenes and domains, but also incur high computational and memory cost, making efficient deployment challenging. Post-Training Quantization (PTQ) provides an efficient and practical solution for model compression, yet low-bit PTQ remains challenging for MDE models. When applying PTQ to Depth Anything, we identify two key challenges: (i) independently minimizing the quantization error of the query and key projections fails to preserve the attention maps induced by their interaction, and (ii) quantization errors accumulate across layers, resulting in intermediate feature distribution shifts. To address these issues, we propose SPA-Q, a Structure-Preserving Adaptive PTQ framework for MDE, consisting of two main components. First, Attention-Preserving Calibration (APC) determines query and key quantization parameters by matching the full-precision attention distribution. Second, Channel-Wise Distribution Alignment (CWDA) learns channel-wise affine transformations to mitigate quantization-induced distribution shifts, and the learned parameters are absorbed into the weights after training. Experimental results show that SPA-Q consistently outperforms existing PTQ methods under 4-bit quantization, achieving an average 25.9% reduction in AbsRel and a 17.3% improvement in δ1\delta_1 across NYUv2 and KITTI datasets.

1 Introduction

Monocular depth estimation (MDE) is a fundamental task in computer vision, with applications in robotics [1, 2], autonomous driving [3, 4], and 3D scene understanding [5–7]. Recent advances in Vision Transformers (ViTs) [8–12] have significantly improved MDE, leading to strong foundation models such as MiDaS [13] and Depth Anything [14, 15]. Depth Anything achieves strong zero-shot generalization through large-scale training with labeled and pseudo-labeled data, while leveraging multi-scale intermediate features for dense depth prediction. However, its large model size and high computational cost hinder real-world deployment in resource-constrained environments.

Model quantization [16–21] is an effective approach for reducing the memory and computational cost of deep neural networks. Existing quantization methods can be broadly divided into quantization-aware training (QAT) [22–24] and post-training quantization (PTQ) [25–28]. QAT incorporates quantization effects during training and often achieves higher accuracy, but it requires additional training and access to training data. In contrast, PTQ applies quantization to a pre-trained model

*Equal contribution.

†Corresponding author.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

without full retraining, making it suitable for practical deployment. Although PTQ has been widely studied for recognition models, its application to MDE remains underexplored. Unlike recognition tasks, depth estimation requires preserving fine-grained geometric and structural information in intermediate features, making it more sensitive to quantization-induced distortions.

In our study, we identify two key limitations of low-bit PTQ for transformer-based MDE models. (i) Independent quantization error minimization for query and key projections is not well aligned with preserving the resulting attention distribution. Existing PTQ methods [25–28] typically calibrate each quantizer by minimizing the discrepancy between full-precision and quantized outputs of each projection. However, in self-attention, the attention map is determined by the query-key interaction passed through the softmax operation, rather than by the fidelity of each projection. Therefore, independently minimizing the quantization error of the query and key projections does not guarantee preservation of the resulting attention map. This issue is especially critical for MDE, as distorted attention maps can corrupt features aggregated by the decoder, thereby degrading scene geometry and object boundaries in depth predictions. (ii) Quantization errors accumulate across layers and induce distribution shifts in intermediate features. Since the DPT decoder fuses features from multiple encoder stages, even small shifts in feature distributions can propagate through the decoder and degrade depth prediction. In practice, low-bit quantization induces noticeable distribution shifts in intermediate features, making them increasingly mismatched with full-precision counterparts.

To address these limitations, we propose SPA-Q, a novel Structure-Preserving Adaptive PTQ framework for transformer-based MDE models. SPA-Q is designed for architectures whose decoders aggregate multi-stage encoder features to produce dense depth predictions. It consists of two complementary components. Attention-Preserving Calibration (APC) determines the quantization parameters of the query and key projections by directly preserving the full-precision attention distribution instead of minimizing projection errors independently. In particular, APC minimizes the KL divergence between the full-precision and quantized attention distributions, thereby better capturing their discrepancy after softmax. Channel-Wise Distribution Alignment (CWDA) addresses distribution shifts in intermediate features through learnable channel-wise affine transformations, which are optimized with feature-level and depth-level objectives in an end-to-end manner. The learned affine parameters are then fused into the weights, introducing no additional inference overhead. Our contributions are summarized as follows:

  • We identify two limitations of low-bit PTQ for transformer-based MDE models. First, independent quantization error minimization for query-key projections fails to preserve the resulting attention map. Second, accumulated quantization errors induce distribution shift in intermediate features.
  • We propose SPA-Q, a Structure-Preserving Adaptive PTQ method for MDE. SPA-Q introduces Attention-Preserving Calibration (APC), which calibrates query and key quantizers with an attention-level objective, and Channel-Wise Distribution Alignment (CWDA), a channel-wise alignment scheme for correcting intermediate feature distribution shifts.
  • Extensive experiments on relative depth estimation benchmarks show that SPA-Q outperforms existing PTQ methods under 4-bit quantization across all evaluated settings.

References (45)