Reg-PTQ: Regression-specialized Post-training Quantization for Fully Quantized Object Detector

Yifu Ding, Weilun Feng, Chuyan Chen, Jinyang Guo, Xianglong Liu

Introduction

Object detection is a cornerstone of modern computer vision, powering applications from autonomous vehicles to industrial robotics. However, deploying these complex models on edge devices remains a significant challenge due to their high computational and memory requirements. Post-training quantization (PTQ) has emerged as a popular technique to mitigate these costs by converting 32-bit floating-point weights and activations into lower-precision formats (e.g., 4-bit or 8-bit integers) without requiring expensive retraining.

Despite its success in classification, standard PTQ often fails when applied to the "head" of object detectors—the component responsible for bounding box regression. Reg-PTQ introduces the first universal framework designed to fully quantize object detectors, achieving substantial reductions in computation and storage while maintaining high accuracy.

The Bottleneck: Why Quantize the Head?

Most existing PTQ methods focus on quantizing the backbone and neck of the model, leaving the detection head in high precision. This selective approach misses a significant optimization opportunity. As shown in Figure 1, the detection head can account for nearly half of a model's memory footprint in architectures like Faster R-CNN and RetinaNet.

Analysis of model components showing that the detection head is a significant contributor to memory footprint and FLOPs.

Leaving the head unquantized limits the efficiency gains possible on resource-constrained hardware. Reg-PTQ addresses this by enabling full quantization of the entire detector pipeline.

The Regression Challenge

The primary reason regression heads are typically excluded from quantization is their extreme sensitivity to rounding noise. Unlike classification, which maps inputs to discrete categories, regression operates in a continuous numerical space where small errors directly translate to geometric shifts in bounding boxes.

Comparison of quantization error and performance for a classifier vs. a regressor.

The authors' analysis reveals that while classifiers can often tolerate the noise introduced by uniform quantization, regressors suffer significant performance degradation. This is because regression weights often follow non-uniform distributions (e.g., Laplace or Gaussian), making standard uniform quantizers suboptimal.

Methodology: Reg-PTQ

To overcome these challenges, Reg-PTQ introduces two core innovations:

1. Filtered Global Loss Integration Calibration (FGIC)

Traditional PTQ methods typically minimize "local" reconstruction error layer-by-layer. Reg-PTQ argues that for regression, global feedback is essential. FGIC integrates a global loss that considers the final output of the detector. To ensure this global signal is helpful rather than noisy, it employs a two-step filtering mechanism:

  • Confidence Filtering: Predictions with low confidence scores are ignored.
  • IoU Filtering: Only predicted boxes with high overlap (Intersection-over-Union) relative to the original floating-point model's predictions are used for calibration.

2. Learnable Logarithmic-Affine Quantizer (LLAQ)

Recognizing the non-uniform nature of regression weights, the authors developed LLAQ. This quantizer applies a logarithmic-affine transformation to the weights before quantization. This effectively "stretches" the dense clusters of weights near zero into a more uniform distribution, allowing the subsequent quantization step to preserve more fine-grained detail.

Key Results and Impact

Reg-PTQ was evaluated on the MS COCO benchmark across several popular architectures, including Faster R-CNN, YOLO, and RetinaNet. The results demonstrate its superiority over previous state-of-the-art PTQ methods:

  • Efficiency: Under 4-bit (W4A4) quantization, Reg-PTQ achieved up to a 7.6× reduction in FLOPs and a 5.4× reduction in storage compared to full-precision models.
  • Accuracy: On RetinaNet (ResNet-50), the framework achieved 23.9% mAP under ultra-low W2A4 settings, outperforming previous methods by approximately 4%.
  • Near-Lossless Performance: At W4A8 precision, the performance drop compared to the full-precision model was negligible (e.g., only a 0.3% drop on RetinaNet ResNet-101).

Conclusion

Reg-PTQ represents a significant step forward in making fully quantized object detectors viable for edge deployment. By addressing the specific sensitivities of regression tasks through global loss calibration and specialized non-uniform quantization, it unlocks the full potential of PTQ for complex detection models. Future work may extend these techniques to Transformer-based architectures and explore even lower bit-widths for extreme efficiency.

Summary updated

BibTeX
@inproceedings{ding2024reg,
  author = {Yifu Ding and Weilun Feng and Chuyan Chen and Jinyang Guo and Xianglong Liu},
  title = {{Reg-PTQ: Regression-specialized Post-training Quantization for Fully Quantized Object Detector}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.01531},
}
Figure