【论文阅读+代码复现】Attentional PointNet

Brief

 前段时间开始以为想到了一些不错的idea,实际上的实验效果也很一般了。陷入了没有想法的阶段,那就读一读比较新的papar获得一下别人的想法吧。也所谓“问渠那得清如许?唯有源头活水来”。

Abstruct

  • attention机制结合pointent到3D数据检测模型

Introduction

We aim to design an efficient but simple architecture providing real-time performance on lower compute capability hardware

  • 作者在点云上使用视觉注意力机制来有顺序的检测包含兴趣区域的小区域。
  • 多物体检测
  • 可以做到实时检测

Related work

  • Converting point clouds into 2D images
  • Converting point clouds into volumetric forms
  • Another approach is inferring 3D bounding boxes directly from 2D images

We chose PointNet as the backbone for our model.

3 Attentional PointNet

  • 首先讲了一大段的视觉注意力的现实描述,比如男生喜欢看漂亮的女孩子。如果有了注意力,那么就会减少计算的带宽。

Focusing onto smaller relevant parts of the scene saves “computational bandwidth” as only fewer pixels need
to be processed.

  • RNN :每一次的迭代都会跑输入的某一个的分辨率输入。不能使用BG来训练—>STN。

3.1 Proposed Architecture

在这里插入图片描述
主要是以下几个部分:

  • Context Network
  • Recurrent Localization Network
  • 3D Transformer
  • Resampler
  • Classifier
  • 3D Box Estimation

3.2. Context Network

输入是两部分

  • raw data : 12 m × 12 m 12m\times12m 12m×12m
  • height map:上面输入数据的垂直投影, 120 × 120 120\times120 120×120cells

最后一步的合并的对其是很重要的:

Alignment of two embedding spaces was crucial after thorough experimentation we found addition gives equally good results as concatenation while keeping the network capacity low

3.3. Recurrent Localization Network

The Recurrent Localization Network is the heart of our Attentional PointNet architecture

the recurrent localization network sequentially attends to the location of the new object at every iteration (i).

每一次迭代都会去定位一些新的物体。该结构分成两个主要的部分:

  • The recurrent part consist of a GRU layer。输入是两部分,其一是context的输入 ( B , 1024 ) (B,1024) (B,1024),另外一部分是上一次GRU的输出 h i − 1 ( B , 512 ) h_{i-1}(B,512) hi1(B,512)

  • 3层的FC结构,每次的输入都是GRU输出的 h i h_i hi,用于回归5个参数 ( cos ⁡ θ i , sin ⁡ θ i , T x i , T y i , T z i ) ∈ Θ i \left(\cos \theta_{i}, \sin \theta_{i}, T x_{i}, T y_{i}, T z_{i}\right) \in \Theta_{i} (cosθi,sinθi,Txi,Tyi,Tzi)Θi,这是一个3D变换矩阵,对应了attention操作(选择了attended glimpse)。
    为了简单,作者仅仅考虑 y a w yaw yaw的旋转,因此我们可以把变换矩阵写成:

    T ( Θ i ) = [ cos ⁡ θ i − sin ⁡ θ i 0 T x i sin ⁡ θ i cos ⁡ θ i 0 T y i 0 0 1 T z i 0 0 0 1 ] T\left(\Theta_{i}\right)=\left[\begin{array}{cccc}{\cos \theta_{i}} & {-\sin \theta_{i}} & {0} & {T x_{i}} \\ {\sin \theta_{i}} & {\cos \theta_{i}} & {0} & {T y_{i}} \\ {0} & {0} & {1} & {T z_{i}} \\ {0} & {0} & {0} & {1}\end{array}\right] T(Θi)=cosθisinθi00sinθicosθi000010TxiTyiTzi1

这里先挖一个坑,后续想明白了和想起来再来填:这个矩阵具体怎么用?

3.4. 3D Transformer and Resampler

上面得到了一个变换矩阵,那么下面就要用了。如下使用,没想到这么快就填坑了。
[ x i t y i t z i t 1 ] = T ( Θ i ) [ x i s y i s z i s 1 ] \left[\begin{array}{l}{x_{i}^{t}} \\ {y_{i}^{t}} \\ {z_{i}^{t}} \\ {1}\end{array}\right]=T\left(\Theta_{i}\right)\left[\begin{array}{c}{x_{i}^{s}} \\ {y_{i}^{s}} \\ {z_{i}^{s}} \\ {1}\end{array}\right] xityitzit1=T(Θi)xisyiszis1
也就是对于原始的点云输入乘以这个矩阵就好了。这个操作也就是把坐标中心和对应的bbox大小改变以适合interest objects。
在这里插入图片描述

3.5. Localization and recognition

既然上面得到了感兴趣区域点(包含512个point),那么这一部分就要处理这些点了嘛。
作者的回归方式采用的是一个lighe-weight的pointenet(T-net),作者修改后的T-Net回归5个参数。也就是:
( cos ⁡ δ i , sin ⁡ δ i , t x i , t y i , t z i ) ∈ Δ i \left(\cos \delta_{i}, \sin \delta_{i}, t x_{i}, t y_{i}, t z_{i}\right) \in \Delta_{i} (cosδi,sinδi,txi,tyi,tzi)Δi
这个代表了真正的中心点和旋转角度。当然也要回归 ( W , H , L ) (W,H,L) (W,H,L)
也就是说在回归中心点位置和旋转方向上,进行了两次位置旋转,综合起来就是:
T ( Ψ i ) = T ( Θ i ) ∗ T ( Δ i ) T\left(\Psi_{i}\right)=T\left(\Theta_{i}\right) * T\left(\Delta_{i}\right) T(Ψi)=T(Θi)T(Δi)
物体类别的判断采用的是两层FC结构,其输入是从GRU得到的 h i h_i hi,输出一个分数

4. Training & Experiments

KITTI数据集:测试集是没有label的,因此我们把训练集合7:3的分成训练集和测试集。

4.1. Data Augmentation

数据划分如下图;采用具有 o v e r l a p = 1 m overlap=1m overlap=1m的方式进行划分。

在这里插入图片描述

  • 裁剪成小区域
  • 每个区域取样点 4096 4096 4096
  • 每个分割后的区域都编码其高度信息生成120×120 pixels的灰度图。如下图所示:中间的。

在这里插入图片描述
在height map的投影过程中需要注意以下几点:

  • 每个像素格子大致占据的高度为 r = 10 c m m r=10cmm r=10cmm
  • z轴选择的高度为 [ − 2 m , 3 m ] [-2m,3m] [2m,3m],目的是差不多刚好覆盖高度为3m的地标物体。
  • 投影规则:

P i → j = { P i = [ x , y , z ] T ∣ S j = f P S ( P i , r ) } H ( S j ) = max ⁡ ( P i → j ⋅ [ 0 , 0 , 1 ] T ) \begin{array}{c}{\mathrm{P}_{i \rightarrow j}=\left\{\mathrm{P}_{i}=[x, y, z]^{T} | S_{j}=f_{\mathrm{PS}}\left(\mathrm{P}_{i}, r\right)\right\}} \\ {H\left(S_{j}\right)=\max \left(\mathrm{P}_{i \rightarrow j} \cdot[0,0,1]^{T}\right)}\end{array} Pij={Pi=[x,y,z]TSj=fPS(Pi,r)}H(Sj)=max(Pij[0,0,1]T)

  • 数据增广操作,和second中是一样的,首先建立一个gt_data_base,然后随机向场景里边丢gt_box。

4.2. Loss Function

所有模型都采用下面这个统一的损失函数:
L s e q − i = α ∗ L c l s + β ( L T 1 − r e g + L T 2 − r e g ) + γ ∗ L s i z e − r e g + λ ∗ L r e g L f i n a l = 1 3 ∑ i = 1 n = 3 L s e q − i L r e g = ∥ I − T ( Ψ ) T ( Ψ ) T ∥ 2 \begin{array}{c}{L_{s e q-i}=\alpha * L_{c l s}+\beta\left(L_{T 1-r e g}+L_{T 2-r e g}\right)} \\ {+\gamma * L_{s i z e-r e g}+\lambda * L_{r e g}} \\ {\qquad L_{f i n a l}=\frac{1}{3} \sum_{i=1}^{n=3} L_{s e q-i}} \\ {L_{r e g}=\left\|I-T(\Psi) T(\Psi)^{T}\right\|^{2}}\end{array} Lseqi=αLcls+β(LT1reg+LT2reg)+γLsizereg+λLregLfinal=31i=1n=3LseqiLreg=IT(Ψ)T(Ψ)T2

  • BCE作为判别损失,smooth-L1作为回归损失。

5 代码工作

这里是 code

5.1 运行源代码

运行环境:

Python 2.7
CUDA 9.1
PyTorch 1.0
scipy
shapely

另外需要ROS,这里是为了显示用的

ROS
PCL

由于我没有能装ROS的权限,因此显示这一步先不错。
由于第一步数据分割就要ROS包,因此放弃了。

  • 2
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值