PointPillars: Fast Encoders for Object Detection from Point Clouds
论文链接: https://arxiv.org/abs/1812.05784
一、Problem Statement
作者认为目前对于point cloud 的两种encoding 方式,精度与速度不能很好的兼备,因此提出一种新的encoding 方式,名为PointPillars。
- voxel:
point cloud is organized in voxels and the set of voxels in each vertical column is encoded into a fixed-length, hand-crafted, feature encoding to form a pseudo-image which can be processed by a standard image detection architecture.
这类方法典型的有:MV3D, AVOD, PIXOR, Complex YOLO - pointcloud
PointNets are applied to voxels which are then processed by a set of 3D convolutional layers followed by a 2D backbone and a detection head.
这类方法典型的有: voxelnet, second
二、 Direction
提出一个新的encoder,使其利用PointNet去学习点云表征,这些点云是通过vertical columns(pillars) 进行encoding的。这个检测方法是 end-to-end learnining with only 2D convolutional layers。
三、 Method
1. 网络结构
PointPillars 输入 point clouds 然后输出 oriented 3D boxes。主要包括三个阶段:
1. A feature encoder network: 把点云转换为稀疏的pseudo-image
2. 2D convolutional backbone: 处理pseudo-image
3. A detection head: 识别和回归3D boxes
(1) A feature encoder network
第一阶段先将point cloud 转为pseudo-image:
将一个点表示为:
x
,
y
,
z
,
r
x,y,z,r
x,y,z,r
-
离散化 point cloud
在x-y平面上將point cloud 离散化为 spaced grid, 并创建pillars集合 ∣ P ∣ = B |P|=B ∣P∣=B。不需要超参数来控制z轴上的binning。 -
每一个pillar上的点,就会被增强 x c , y c , z c , x p , y p x_c,y_c,z_c,x_p,y_p xc,yc,zc,xp,yp, 下标c代表到pillar中所有点算术平均的距离,下标p代表离pillar中心 x , y x,y x,y的补偿。所以目前一个点的维度为D=9: ( x , y , z , r , x c , y c , z c , x p , y p ) (x,y,z,r,x_c,y_c,z_c,x_p,y_p) (x,y,z,r,xc,yc,zc,xp,yp)。
-
考虑到每个pillar包含的点数不一致,有可能是很稀疏的,有可能是密集的。因此如果点多,就randomly sampled,如果点少,就zero padding,最终使得点云变为tensor格式,维度为 ( D , P , N ) (D,P,N) (D,P,N)。
D 代表是 channel number
P 代表non-empty pillar number
N 代表一个pillar内有points的数目 -
然后使用PointNet、linear layer、BN、ReLU 生成 ( C , P , N ) (C,P,N) (C,P,N)维度的tensor,然后再通过max operation生成 ( C , P ) (C,P) (C,P)维度的tensor。
-
最后这个features 回到其pillars原始的位置,形成一个pseudo-image,维度为 ( C , H , W ) (C,H,W) (C,H,W), H是高,W是宽。
(2) 2D convolutional backbone
与voxelnet 相似的backbone,其含有两个子网络:
- top-down
这个网络产生越来越小的特征 - upsample and concatenation
这个网络对特征进行upsample和concatenation。
(3) Detection head
使用SSD来进行3D 目标检测。与SSD类似,作者使用先验框与真值进行2D IoU匹配。Bounding box的高度不进行匹配,而是额外的回归参数目标。
2.目标函数
与second中的loss function 一样。ground truth boxes和anchors定义为: ( x , y , z , w , l , h , θ ) (x,y,z,w,l,h,\theta) (x,y,z,w,l,h,θ)
L t o t a l = 1 N p o s ( β l o c L l o c + β c l s L c l s + β d i r L d i r ) L_{total}=\frac{1}{N_{pos}}(\beta_{loc} L_{loc} + \beta_{cls} L_{cls} + \beta_{dir} L_{dir}) Ltotal=Npos1(βlocLloc+βclsLcls+βdirLdir)
其中, N p o s N_{pos} Npos表示positive anchors的数量。
(1) localization loss
△ x = x g t − x a d a , △ y = y g t − y a d a , △ z = z g t − z a d a △ w = l o g w g t w a , △ l = l o g l g t l a , △ h = l o g h g t h a △ θ = s i n ( θ g t − θ a ) \begin{matrix} \triangle x = \frac{x^{gt}-x^a}{d^a}, \triangle y = \frac{y^{gt}-y^a}{d^a}, \triangle z = \frac{z^{gt}-z^a}{d^a} \\ \\ \triangle w = log \frac{w^{gt}}{w^a}, \triangle l = log \frac{l^{gt}}{l^a}, \triangle h = log \frac{h^{gt}}{h^a} \\ \\ \triangle \theta = sin(\theta^{gt}-\theta^a) \end{matrix} △x=daxgt−xa,△y=daygt−ya,△z=dazgt−za△w=logwawgt,△l=loglalgt,△h=loghahgt△θ=sin(θgt−θa)
x g t , x a x^{gt}, x^a xgt,xa分别代表ground truth 与 anchor boxes。 d a = ( w a ) 2 + ( l a ) 2 d^a=\sqrt{(w^a)^2+(l^a)^2} da=(wa)2+(la)2
所以localization los为:
L
l
o
c
=
∑
b
∈
(
x
,
y
,
z
,
w
,
l
,
h
,
θ
)
S
m
o
o
t
h
L
1
(
△
b
)
L_{loc}=\sum_{b \in (x,y,z,w,l,h,\theta)} SmoothL1(\triangle b)
Lloc=b∈(x,y,z,w,l,h,θ)∑SmoothL1(△b)
(2) angle localization loss
使用softmax classification loss L d i r L_{dir} Ldir
(3)classification loss
使用focal loss
L
c
l
s
=
−
α
a
(
1
−
p
a
)
γ
l
o
g
p
a
L_{cls}=-\alpha_a(1-p^a)^\gamma logp^a
Lcls=−αa(1−pa)γlogpa
p a p^a pa是anchor的类别概率。
四、Conclusion
PointPillars的几个优点:
- PointPillars 可以利用所有的点云信息
- 因为操作在pillars上,而不是voxel上,所以不需要手动调整垂直方向的binning
- pillars很高效,因为所有关键的操作都是2D卷积。
- PointPillars适用不同的点云,如多个lidar scans,甚至是radar pointclouds
速度快,但是使用3D到2D,再用2D CNN, 会出现信息损失。
Reference
- https://zhuanlan.zhihu.com/p/102994173