论文阅读:端到端自动驾驶UniAD详解(一)

UniAD概览

BEV特征提取

采用BEVFomer模型结构,对环视图像提取BEV特征,如下图所示

数据流过程:

  1. <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t时刻的 <math xmlns="http://www.w3.org/1998/Math/MathML"> N N </math>N张环视图像,经过图像Backbone(例:ResNet-101)得到 <math xmlns="http://www.w3.org/1998/Math/MathML"> N N </math>N张图像对应的特征: <math xmlns="http://www.w3.org/1998/Math/MathML"> F t = { F t i } i = 1 N F_t=\{F_t^i\}^{N}_{i=1} </math>Ft={Fti}i=1N,其中 <math xmlns="http://www.w3.org/1998/Math/MathML"> F t i F^i_t </math>Fti表示 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t时刻的第 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i个视角的图像的特征;

  2. <math xmlns="http://www.w3.org/1998/Math/MathML"> t − 1 t-1 </math>t−1时刻的BEV特征 <math xmlns="http://www.w3.org/1998/Math/MathML"> B t − 1 B_{t-1} </math>Bt−1和BEV queries <math xmlns="http://www.w3.org/1998/Math/MathML"> Q b e v Q_{bev} </math>Qbev (预先定义的维度与BEV特征一致的可学习参数),经过时序自注意力机制(TSA, temporal self-attention)模块,得到经过TSA后的BEV queries <math xmlns="http://www.w3.org/1998/Math/MathML"> Q b e v Q_{bev} </math>Qbev

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> Q b e v = D e f o r m A t t e n ( Q b e v , B t − 1 , B t − 1 ) Q_{bev}=\mathrm{DeformAtten}(Q_{bev},B_{t-1},B_{t-1}) </math>Qbev=DeformAtten(Qbev,Bt−1,Bt−1)

  1. TSA后的BEV queries <math xmlns="http://www.w3.org/1998/Math/MathML"> Q b e v Q_{bev} </math>Qbev 和 <math xmlns="http://www.w3.org/1998/Math/MathML"> F t { F t i } i = 1 N F_t\{F_t^i\}{i=1}^{N} </math>Ft{Fti}i=1N,经过空间交叉注意力机制(SCA, Spatial Cross-Attention)模块,得到经过SCA后的BEV queries <math xmlns="http://www.w3.org/1998/Math/MathML"> Q b e v Q{bev} </math>Qbev

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> Q b e v = D e f o r m A t t e n ( Q b e v , F t , F t ) Q_{bev}=\mathrm{DeformAtten}(Q_{bev},F_{t},F_{t}) </math>Qbev=DeformAtten(Qbev,Ft,Ft)

  1. 经过6个(TSA+Norm+SCA+Norm+FF+Norm)的组合模块之后,输出 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t时刻的BEV特征 <math xmlns="http://www.w3.org/1998/Math/MathML"> B t B_t </math>Bt.

其中 <math xmlns="http://www.w3.org/1998/Math/MathML"> D e f o r m A t t e n ( Q , K , V ) \mathrm{DeformAtten}(Q,K,V) </math>DeformAtten(Q,K,V)表示,以 <math xmlns="http://www.w3.org/1998/Math/MathML"> Q Q </math>Q为查询向量信息源, <math xmlns="http://www.w3.org/1998/Math/MathML"> K K </math>K为键的信息源, <math xmlns="http://www.w3.org/1998/Math/MathML"> V V </math>V为值的信息源的Deformable Attention机制算子。

TrackFormer

TrackFormer基于MOTR模型的整体结构,将原模型中每帧的2D图像输入,改为BEV特征作为输入,如下图所示

TrackFormer将上图中的Video Stream的每一帧图像和Enc模块,替换为上一步由BEV特征提取模块得到的 <math xmlns="http://www.w3.org/1998/Math/MathML"> B B </math>B,即每帧的BEV特征。

从时序的BEV特征输入,经过MOTR模型推理,到输出目标轨迹,需要经过以下步骤:

  1. <math xmlns="http://www.w3.org/1998/Math/MathML"> T 1 T_1 </math>T1时刻的BEV特征 <math xmlns="http://www.w3.org/1998/Math/MathML"> B t 1 B_{t_1} </math>Bt1,与Detect Query <math xmlns="http://www.w3.org/1998/Math/MathML"> q d q_d </math>qd一起作为输入,经过Transformer Decoder解码器,得到Hidden States(隐状态),同时输出 <math xmlns="http://www.w3.org/1998/Math/MathML"> T 1 T_1 </math>T1帧的目标和轨迹;

  2. Hidden States再经过QIM(查询交互模块)得到 <math xmlns="http://www.w3.org/1998/Math/MathML"> T 2 T_2 </math>T2帧的Tracked Query <math xmlns="http://www.w3.org/1998/Math/MathML"> q t r q_{tr} </math>qtr;

  3. Detect Query <math xmlns="http://www.w3.org/1998/Math/MathML"> q d q_d </math>qd与 <math xmlns="http://www.w3.org/1998/Math/MathML"> T 2 T_2 </math>T2帧的Tracked Query <math xmlns="http://www.w3.org/1998/Math/MathML"> q t r q_{tr} </math>qtr进行拼接,与 <math xmlns="http://www.w3.org/1998/Math/MathML"> T 2 T_2 </math>T2帧的图像特征,一起输入到Transformer Decoder解码器,得到 <math xmlns="http://www.w3.org/1998/Math/MathML"> T 2 T_2 </math>T2帧的Hidden States,同时输出 <math xmlns="http://www.w3.org/1998/Math/MathML"> T 2 T_2 </math>T2帧的目标和轨迹;

  4. 循环执行上述步骤,根据 <math xmlns="http://www.w3.org/1998/Math/MathML"> T i T_i </math>Ti帧的状态信息,进行 <math xmlns="http://www.w3.org/1998/Math/MathML"> T i + 1 T_{i+1} </math>Ti+1帧的轨迹预测, <math xmlns="http://www.w3.org/1998/Math/MathML"> i = 2 , 3 , 4 , ... i=2,3,4,\dots </math>i=2,3,4,...

Detect Query和Track Query

Detect Query是一个可学习的查询向量,维度为 <math xmlns="http://www.w3.org/1998/Math/MathML"> N d e t ∗ d N_{det}*d </math>Ndet∗d, <math xmlns="http://www.w3.org/1998/Math/MathML"> N d e t N_{det} </math>Ndet为最大检测目标个数,长度固定, <math xmlns="http://www.w3.org/1998/Math/MathML"> d d </math>d为负责每个目标的查询向量长度。它负责检测第一次出现的目标。

Track Query是一个可学习的查询向量,维度为 <math xmlns="http://www.w3.org/1998/Math/MathML"> N t r ∗ d N_{tr}*d </math>Ntr∗d, <math xmlns="http://www.w3.org/1998/Math/MathML"> N t r N_{tr} </math>Ntr为当前存在目标轨迹个数,长度随着目标轨迹的产生和消失而变动, <math xmlns="http://www.w3.org/1998/Math/MathML"> d d </math>d为负责每个目标轨迹的查询向量长度。它负责维护目标的轨迹信息。

Detect Query和Track Query拼接起来,一起作为查询向量,结合由BEV特征 <math xmlns="http://www.w3.org/1998/Math/MathML"> B B </math>B产生的键和值,参与到Transformer Decoder模块,负责检测新出现的目标和维护已有目标的轨迹。

QIM(查询交互模块)

此模块负责目标轨迹的产生和消失,维护轨迹的生命周期。

训练阶段,通过匈牙利匹配算法,Detect Query与Ground Truth中第一次出现的目标,根据两者的IoU大小进行Bipartite matching配对,确定每个位置负责检测的目标框;Track Query与Ground Truth中对应轨迹ID的目标,根据两者IoU大小进行进行Bipartite matching配对。

推理阶段,Detect Query根据检测框的阈值大小来确定要保留的检测,而Track Query中,需某个目标轨迹的阈值持续低于某个值一段时间后,才进行删除。

MapFormer

采用Panoptic SegFormer模型结构的transformer encoer模块、location decoder模块和mask decoder模块,对环视图像的BEV特征进行全景分割,得到map信息: lanes,、boundaries、pedestrian crossings和 drivable area.

数据流过程:

  • 环视图像的BEV特征,经过Flatten之后,作为Featue Token,输入到Transformer Encoder模块,得到Encoder的输出 <math xmlns="http://www.w3.org/1998/Math/MathML"> F F </math>F;
  • <math xmlns="http://www.w3.org/1998/Math/MathML"> F F </math>F与 <math xmlns="http://www.w3.org/1998/Math/MathML"> N t h N_{th} </math>Nth个 Things Queries,输入Location Decoder模块,得到 <math xmlns="http://www.w3.org/1998/Math/MathML"> N t h N_{th} </math>Nth个 location-aware Things Queries;
  • <math xmlns="http://www.w3.org/1998/Math/MathML"> N t h N_{th} </math>Nth个 location-aware Things Queries和 <math xmlns="http://www.w3.org/1998/Math/MathML"> N s t N_{st} </math>Nst个 Stuff Queries,输入Mask Decoder模块,得到每类的分割mask和对应的分类;

MotionFormer、OccFormer和Planner

除了上述模块之外,UniAD还包括MotionFormer模块、OccFormer模块和planner模块,我将在此系列文章的第二篇中进行详细讲解:

  • MotionFormer捕获B+物体+地图之间的交互信息(作为k和v),并预测每个物体的未来轨迹,由于场景中每个物体的行动可能会对其他物体产生重大影响,该模块为所有考虑的物体做出联合预测。
  • 同时,我们设计了一个自车查询,以明确地对自车进行建模,并与其他物体交互。
  • OccFormer使用BEV特征B作为查询,物体motion信息作为k和v,并且预测物体未来occupancy的情况
  • 最后,Planner使用来自MotionFormer的表达性自车查询来预测规划结果,并通过避开OccFormer预测的占用区域来避免碰撞。
  • Planner 利用来自MotionFormer的自车查询来预测规划结果,并将其自身远离OccFormer预测的占用区域,以避免碰撞。
相关推荐
君义_noip13 分钟前
信息学奥赛一本通 1524:旅游航道
c++·算法·图论·信息学奥赛
烁34721 分钟前
每日一题(小白)动态规划篇5
算法·动态规划
独好紫罗兰22 分钟前
洛谷题单2-P5717 【深基3.习8】三角形分类-python-流程图重构
开发语言·python·算法
滴答滴答嗒嗒滴29 分钟前
Python小练习系列 Vol.8:组合总和(回溯 + 剪枝 + 去重)
python·算法·剪枝
lidashent1 小时前
数据结构和算法——汉诺塔问题
数据结构·算法
小王努力学编程1 小时前
动态规划学习——背包问题
开发语言·c++·学习·算法·动态规划
f狐0狸x3 小时前
【蓝桥杯每日一题】4.1
c语言·c++·算法·蓝桥杯
ん贤3 小时前
2023第十四届蓝桥杯大赛软件赛省赛C/C++ 大学 B 组(真题&题解)(C++/Java题解)
java·c语言·数据结构·c++·算法·蓝桥杯
梭七y3 小时前
【力扣hot100题】(022)反转链表
算法·leetcode·链表
威视锐科技6 小时前
软件定义无线电36
网络·网络协议·算法·fpga开发·架构·信息与通信