征战无人方程式大赛:PointPillars 在征程 6M 上的部署全记录
FSAC(Formula Student Autonomous China,中国大学生无人驾驶方程式大赛)2026 赛季落幕。同济大学无人驾驶方程式车队携无人驾驶赛车 Drd26 出战,车队的感知算法运行在地平线征程 6M 域控制器上,最终取得全国二等奖的成绩。本文记录赛队使用OpenExplorer,把 PointPillars 锥桶检测模型从浮点训练一路推进到 6M 板端部署与回灌验证的完整过程。
本季赛车在上一代电动方程式赛车 Dre25 的基础上完成无人化改造,感知、建图、规划与控制算法均由车队自主研发。今年的迁移中,赛队完成了 YOLO 和点云检测模型的 PTQ、QAT 验证;本文聚焦其中的点云检测,模型采用 PointPillars 特征编码与 Anchor-free CenterHead 检测头,经量化感知训练编译为征程6M 可执行的 hbm 模型文件,并通过基于 ROS 2 的数据回灌验证检测结果。
1. 面向锥桶检测的网络设计
激光雷达为赛道边界构建提供锥桶的空间位置与几何信息。锥桶在点云中占据的点数较少,远距离目标更加稀疏,因此网络需要从有限的局部特征中识别目标,并预测三维中心、尺寸和朝向。
本团队的模型检测 Cone、BigCone 两类目标,沿用 PointPillars 的特征编码方式:将点云划分为柱状体素,通过 PillarVFE 提取局部特征,再由 Scatter 映射为鸟瞰图(BEV)特征。检测部分采用二维 BEV Backbone 与 CenterHead,以中心热力图预测目标类别和位置,同时回归中心偏移、高度、尺寸与朝向,减少传统 Anchor-based 检测头中的先验框设计与匹配配置。因此,本文中的 PointPillars 模型指的是是 PointPillars 特征编码与 CenterHead 检测头的组合。
2. 前处理、检测网络与后处理的部署划分
板端由 CPU 完成点云范围过滤、体素化、PillarVFE 和 Scatter,生成固定尺寸的 BEV 特征;BPU 执行二维 BEV Backbone 与 CenterHead 预测分支;CPU 再对预测图进行候选筛选、三维框解码与旋转 NMS,输出检测结果。
将中间的二维网络交给 BPU,主要考虑其计算形式与硬件的匹配。这部分网络以卷积为主,同一组权重在规则特征网格上反复进行乘加运算,输出通道和空间位置之间具有较高的并行性。BPU 可以并行执行这些运算,并复用权重与特征数据,减少重复访存。
HBM 输出五路预测图,供 CPU 后处理使用:
3. 为什么选择 QAT
OE 支持 PTQ 与 QAT 两条量化路线。PTQ 依据校准样本统计激活范围,在不继续优化网络权重的情况下完成量化。但锥桶检测中的浅层高分辨率特征、中心热力图和回归分支对数值扰动较为敏感,取整、截断与饱和误差可能改变局部峰值响应,使阈值附近的分类分数发生偏移,影响候选目标的保留与三维框预测。对于点数较少的远距离锥桶,这类变化尤其值得关注。
前期 PC 端开发中,团队在采用 NVIDIA GPU 与 TensorRT 工具链的环境下,对分层 PTQ 与 Full-INT8 QAT 做过对比。在相同 BEV 输入和解码参数下测试 1238 帧数据,QAT 的总框匹配率由 PTQ 的 94.50% 提高到 98.30%,提高了 3.80 个百分点;BigCone 匹配率由 98.74% 提高到 99.66%;分类分数平均绝对偏差从 0.0632 降至 0.0237,降低约 62.5%。这组结果表明,通过 QAT 能够更好地恢复分类置信度及阈值附近的检测结果,成为团队选择量化微调路线的依据。
4. 借助 OE 完成量化适配与微调
赛队使用 OpenExplorer 3.9 的配套容器环境开展量化。整体流程从浮点模型出发,提取 BEV 校准输入,完成模型适配、校准和 QAT 微调,再导出 HBIR 并编译为 HBM。
4.1 数据与模型准备
点云数据沿用 KITTI 风格的组织方式,包含点云、三维标注及相应坐标转换信息。团队从浮点模型的 Scatter 输出端提取 BEV 特征,作为量化分区的校准输入。
原始检测模型基于 OpenPCDet,以 PyTorch 实现,并已完成浮点训练,因此团队选择地平线 Horizon Plugin for PyTorch ,在已有网络与检测损失的基础上开展 QAT。赛队参考 OE 官方 PyTorch 量化基础示例中的 Eager Mode 模型适配方法,使用 fuse_known_modules 支持的规则融合卷积、反卷积、BatchNorm 与激活模块的相应组合,通过 QuantStub 设置量化入口,并用 FloatFunctional 显式表达多尺度特征拼接。
随后,通过 March 与 set_march 指定目标架构,调用 prepare 插入校准与伪量化模块。校准、QAT 和验证状态由插件的 FakeQuantState 管理,沿用官方 Eager Mode 流程;检测部分仍保留原 CenterHead 的训练方式。
4.2 使用真实标注进行量化微调
微调从已有浮点权重开始。VFE 与 Scatter 沿用原模型参数,不参与训练更新;它们生成的 BEV 特征进入带有伪量化模块的二维网络,训练只更新 BEV Backbone 与 CenterHead。
人工标注的锥桶类别和三维框作为训练依据。团队将标注中心转换为鸟瞰图上的目标热力图,让模型学习“哪里有锥桶、属于哪一类”;同时,将预测的中心位置、高度、尺寸和朝向与标注值比较,计算几何回归误差。训练损失按以下权重相加:
L = 1.0 × L_heatmap + 2.0 × L_regression
其中,L_heatmap 衡量预测热力图与标注热力图的差异,L_regression 衡量三维框各项属性的预测误差。团队采用 AdamW 优化器,以小批量和较低学习率更新网络参数,使其在模拟低精度计算的条件下继续学习准确检测锥桶。
5. 从 QAT 模型编译到 征程6M
微调后的模型通过量化插件的 HBDK4 导出接口生成 HBIR,将网络运算、权重和量化信息交给编译工具。随后,HBDK4 编译器(hbdk4.compiler)通过 convert 与 compile 完成目标转换和编译,生成 HBM。本项目使用征程 6M,编译目标为 nash-m,并通过 hb_model_info 检查产物的目标架构。
6. 板端推理与 ROS 2 回灌验证
板端应用采用 C++ ROS 2 节点,并参考 OE UCP 示例调用 HBM。地平线 DNN 接口负责加载模型、查询输入输出张量属性和创建推理任务,其中使用 hbDNNInitializeFromFiles 加载 HBM、hbDNNInferV2 创建任务。UCP 接口负责内存分配、缓存同步、任务提交与等待,对应使用 hbUCPMallocCached、hbUCPMemFlush、hbUCPSubmitTask 和 hbUCPWaitTaskDone。执行依赖板端匹配的 libdnn、libhbucp 与 HBRT 运行库。
输入端使用与训练模型配套的 VFE 权重生成 BEV,输出端按照 CenterHead 的方式恢复三维框。前端权重与 HBM 需要配套,否则送入 BPU 的特征可能与量化训练时不同。
团队使用试车时录制的点云进行回灌:PC 通过 ROS 2 发送点云,征程6M 完成检测后回传结果,由 RViz 叠加显示原始点云和检测框。节点采用标准消息发送以下结果,并保留输入点云的时间戳与坐标系:
录制数据的单帧点云约为 8.3 MB。测试采用逐帧读取、Reliable QoS 和直连有线网口,并调整通信缓冲区;每帧推理完成后再发送下一帧,避免大量预读和待处理帧堆积。RViz 中的检测框保持到下一帧结果到达,便于观察检测结果。
Yolo 模型可直接采用PTQ,这里不赘述针对Yolo模型的流程。
7. 迁移实践总结
以 BEV 特征和五路预测图明确 BPU 网络的输入输出后,训练端与板端就有了逐阶段比较的依据。结果不一致时,可以依次检查点云读取、BEV 特征、网络预测图以及框解码与 NMS,定位差异来自哪个阶段。
OE 包的 PyTorch 量化插件、编译工具和各种示例代码,帮助团队完成了从浮点点云检测模型到 征程6M 板端应用的迁移,为后续精度与性能评估建立了基础。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Conquering the Autonomous Formula Competition: A Complete Record of Deploying PointPillars on Journey 6M
The 2026 season of the FSAC (Formula Student Autonomous China, the Chinese Formula Student Autonomous Competition) has concluded. Tongji University's driverless formula racing team competed with their autonomous racing car Drd26. The team's perception algorithm ran on the Horizon Journey 6M domain controller, ultimately achieving the National Second Prize. This article documents the team's complete process of using OpenExplorer to advance the PointPillars cone detection model from floating-point training all the way to on-board deployment on the 6M and data replay verification.
This season's car was converted for autonomous operation based on the previous-generation electric formula car Dre25. The perception, mapping, planning, and control algorithms were all independently developed by the team. In this year's migration, the team completed PTQ and QAT verification for the YOLO and point cloud detection models. This article focuses on the point cloud detection model, which uses PointPillars feature encoding and an Anchor-free CenterHead detection head, and was compiled via quantization-aware training into an executable HBM model file for the Journey 6M, with detection results verified through ROS 2-based data replay.
1. Network Design for Cone Detection
The LiDAR provides spatial position and geometric information of cones for track boundary construction. Cones occupy a small number of points in the point cloud, and distant targets are even sparser. Therefore, the network must identify objects from limited local features and predict their 3D center, dimensions, and orientation.
The team's model detects two types of targets: Cone and BigCone. It adopts the PointPillars feature encoding scheme: the point cloud is divided into pillar voxels, local features are extracted through PillarVFE, and then mapped to bird's-eye-view (BEV) features via Scatter. The detection component uses a 2D BEV backbone and CenterHead, predicting target class and location through a center heatmap while regressing center offset, height, dimensions, and orientation, thereby reducing the need for prior box design and matching configuration found in traditional anchor-based detection heads. Thus, the PointPillars model referred to in this article is the combination of PointPillars feature encoding with the CenterHead detection head.
2. Deployment Division of Pre-processing, Detection Network, and Post-processing
On the board, the CPU handles point cloud range filtering, voxelization, PillarVFE, and Scatter, generating fixed-size BEV features. The BPU executes the 2D BEV backbone and CenterHead prediction branches. The CPU then performs candidate filtering, 3D box decoding, and rotated NMS on the prediction maps, outputting the final detection results.
Offloading the intermediate 2D network to the BPU is primarily based on the alignment between its computational pattern and the hardware. This portion of the network is dominated by convolutions, where the same set of weights is repeatedly applied in multiply-accumulate operations on regular feature grids, exhibiting high parallelism across output channels and spatial positions. The BPU can execute these operations in parallel and reuse weight and feature data, reducing redundant memory access.
The HBM outputs five prediction maps for CPU post-processing:
3. Why Choose QAT
OE supports two quantization paths: PTQ and QAT. PTQ quantizes based on activation ranges estimated from calibration samples without further optimizing network weights. However, in cone detection, the shallow high-resolution features, center heatmaps, and regression branches are sensitive to numerical perturbations. Rounding, truncation, and saturation errors may alter local peak responses, shifting classification scores near the threshold and affecting the retention of candidate targets and 3D box prediction. For distant cones with few points, such changes are particularly noteworthy.
During earlier PC-side development, the team compared hierarchical PTQ and Full-INT8 QAT in an environment using NVIDIA GPUs and the TensorRT toolchain. Testing 1238 frames of data with identical BEV inputs and decoding parameters, the total box matching rate improved from 94.50% with PTQ to 98.30% with QAT, a gain of 3.80 percentage points. The BigCone matching rate improved from 98.74% to 99.66%. The mean absolute deviation of classification scores decreased from 0.0632 to 0.0237, a reduction of approximately 62.5%. These results indicate that QAT better restores classification confidence and detection results near the threshold, providing the basis for the team's decision to adopt the quantization fine-tuning approach.
4. Completing Quantization Adaptation and Fine-tuning with OE
The team used the container environment accompanying OpenExplorer 3.9 to carry out quantization. The overall workflow starts from the floating-point model, extracts BEV calibration inputs, completes model adaptation, calibration, and QAT fine-tuning, then exports HBIR and compiles it into HBM.
4.1 Data and Model Preparation
The point cloud data follows the KITTI-style organization, including point clouds, 3D annotations, and corresponding coordinate transformation information. The team extracted BEV features from the Scatter output of the floating-point model as calibration inputs for quantization partitioning.
The original detection model is based on OpenPCDet, implemented in PyTorch, and has completed floating-point training. The team therefore selected the Horizon Plugin for PyTorch to carry out QAT on the existing network and detection loss. The team referenced the Eager Mode model adaptation method from the official OE PyTorch quantization basic examples, using rules supported by fuse_known_modules to fuse combinations of convolution, deconvolution, BatchNorm, and activation modules. QuantStub was used to set quantization entry points, and FloatFunctional was used to explicitly express multi-scale feature concatenation.
Subsequently, the target architecture was specified through March and set_march, and prepare was called to insert calibration and fake quantization modules. Calibration, QAT, and verification states are managed by the plugin's FakeQuantState, following the official Eager Mode workflow; the detection portion still retains the original CenterHead training approach.
4.2 Quantization fine-tuning with real annotations
Fine-tuning starts from existing floating-point weights. VFE and Scatter retain the original model parameters and do not participate in training updates; the BEV features they generate enter a 2D network with fake quantization modules, and training only updates the BEV Backbone and CenterHead.
Manually annotated cone categories and 3D boxes serve as the training basis. The team converts annotation centers into target heatmaps on the bird's-eye view, enabling the model to learn "where the cones are and which category they belong to." Simultaneously, the predicted center position, height, dimensions, and orientation are compared against annotated values to compute geometric regression error. The training loss is summed with the following weights:
L = 1.0 × L_heatmap + 2.0 × L_regression
where L_heatmap measures the difference between the predicted heatmap and the annotated heatmap, and L_regression measures the prediction error of each 3D box attribute. The team uses the AdamW optimizer with small batch sizes and a low learning rate to update network parameters, allowing the model to continue learning accurate cone detection under simulated low-precision computation conditions.
5. From QAT model to compilation on Journey 6M
The fine-tuned model generates HBIR through the quantization plugin's HBDK4 export interface, passing network operations, weights, and quantization information to the compilation tool. Subsequently, the HBDK4 compiler (hbdk4.compiler) completes target conversion and compilation through convert and compile, producing HBM. This project uses Journey 6M, with the compilation target set to nash-m, and hb_model_info is used to verify the target architecture of the output artifact.
6. On-board inference and ROS 2 replay verification
The on-board application uses a C++ ROS 2 node and references the OE UCP example to call HBM. The Horizon DNN interface handles loading the model, querying input/output tensor properties, and creating inference tasks, where hbDNNInitializeFromFiles loads the HBM and hbDNNInferV2 creates the task. The UCP interface manages memory allocation, cache synchronization, task submission, and waiting, corresponding to the use of hbUCPMallocCached, hbUCPMemFlush, hbUCPSubmitTask, and hbUCPWaitTaskDone. Execution depends on matching on-board libdnn, libhbucp, and HBRT runtime libraries.
The input side uses VFE weights paired with the training model to generate BEV, and the output side restores 3D boxes according to the CenterHead approach. Front-end weights and HBM must be paired; otherwise, the features fed to the BPU may differ from those during quantization training.
The team uses recorded point clouds from test drives for replay: the PC sends point clouds via ROS 2, Journey 6M completes detection and returns results, and RViz overlays the original point cloud and detection boxes for display. The node uses standard messages to send the following results, preserving the timestamp and coordinate system of the input point cloud:
A single frame of recorded point cloud data is approximately 8.3 MB. Testing uses frame-by-frame reading, Reliable QoS, and a direct wired network connection, with adjusted communication buffers; the next frame is sent only after the current frame's inference completes, avoiding large pre-reads and accumulation of pending frames. Detection boxes in RViz persist until the next frame's results arrive, facilitating observation of detection results.
The Yolo model can directly use PTQ; the workflow specific to the Yolo model is not elaborated here.
7. Summary of migration practice
After defining the BPU network inputs and outputs using BEV features and five prediction maps, the training side and on-board side have a basis for stage-by-stage comparison. When results are inconsistent, the team can sequentially check point cloud reading, BEV features, network prediction maps, and box decoding with NMS to identify which stage the discrepancy originates from.
The PyTorch quantization plugin, compilation tools, and various sample code in the OE package helped the team complete the migration from a floating-point point cloud detection model to a Journey 6M on-board application, establishing a foundation for subsequent accuracy and performance evaluation.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.