Due to highly constrained computing power and memory, deploying 3D lidar-based detectors on edge devices equipped in autonomous vehicles and robots poses a crucial challenge. Being a convenient and straightforward model compression approach, Post-Training Quantization (PTQ) has been widely adopted in 2D vision tasks. However, applying it directly to 3D lidar-based tasks inevitably leads to performance degradation. As a remedy, we propose an effective PTQ method called LiDAR-PTQ, which is particularly curated for 3D lidar detection (both SPConv-based and SPConv-free). Our LiDAR-PTQ features three main components, \textbf{(1)} a sparsity-based calibration method to determine the initialization of quantization parameters, \textbf{(2)} a Task-guided Global Positive Loss (TGPL) to reduce the disparity between the final predictions before and after quantization, \textbf{(3)} an adaptive rounding-to-nearest operation to minimize the layerwise reconstruction error. Extensive experiments demonstrate that our LiDAR-PTQ can achieve state-of-the-art quantization performance when applied to CenterPoint (both Pillar-based and Voxel-based). To our knowledge, for the very first time in lidar-based 3D detection tasks, the PTQ INT8 model's accuracy is almost the same as the FP32 model while enjoying $3\times$ inference speedup. Moreover, our LiDAR-PTQ is cost-effective being $30\times$ faster than the quantization-aware training method. Code will be released at \url{https://github.com/StiphyJay/LiDAR-PTQ}.
翻译:由于计算能力和内存高度受限,在自动驾驶汽车和机器人搭载的边缘设备上部署基于3D激光雷达的检测器是一项关键挑战。作为一种便捷直接的模型压缩方法,训练后量化(PTQ)已在2D视觉任务中得到广泛应用。然而,将其直接应用于基于3D激光雷达的任务会导致性能下降。为此,我们提出了一种有效的PTQ方法——LiDAR-PTQ,该方法专为3D激光雷达检测(包括基于SPConv和无需SPConv的模型)设计。LiDAR-PTQ包含三个主要组件:(1)基于稀疏性的校准方法,用于确定量化参数的初始化;(2)任务引导的全局正损失(TGPL),用于减少量化前后最终预测之间的差异;(3)自适应四舍五入操作,以最小化逐层重构误差。大量实验表明,我们的LiDAR-PTQ在应用于CenterPoint(包括基于Pillar和基于Voxel的模型)时能实现最先进的量化性能。据我们所知,在基于激光雷达的3D检测任务中,首次实现了PTQ INT8模型的精度几乎与FP32模型持平,同时享有3倍推理加速。此外,我们的LiDAR-PTQ成本效益显著,比量化感知训练方法快30倍。代码将在https://github.com/StiphyJay/LiDAR-PTQ 开源。