论文:《Keep your Eyes on the Lane: Real-time Attention-guided Lane Detection》
地址:https://arxiv.org/abs/2010.12035v2
代码:https://github.com/lucastabelini/LaneATT
L a n e = { ( x i , y i ) } i = 0 N p t s − 1 , y i = i ⋅ H i m a g e N p t s − 1 Lane=\{(x_i,y_i)\}^{N_{pts}-1}_{i=0},\ \ \ \ y_i=i\cdot\frac{H_{image}}{N_{pts}-1} Lane={(xi,yi)}i=0Npts−1, yi=i⋅Npts−1Himage
s: 起始点 index
e: 终止点 index
起始点 s 被定义为 y o r i g y_{orig} yorig;
终止点 e 被定义为 e = s + ⌊ l ⌋ − 1 e=s+\lfloor l\rfloor -1 e=s+⌊l⌋−1;
Focal Loss 与 Smooth L1 Loss
一般的CNN都可以,原文中又用了一个 1 × 1 1\times 1 1×1 的 Conv 对骨干网输出的特征通道( F b a c k ∈ R C F ′ × H F × W F \pmb{F}_{back}\in \mathbb{R}^{C'_F\times H_F\times W_F} Fback∈RCF′×HF×WF)进行了缩减( F ∈ R C F × H F × W F \pmb{F}\in \mathbb{R}^{C_F\times H_F\times W_F} F∈RCF×HF×WF)。
将图像上的 Anchor ( x o r i g , y o r i g , θ ) (x_{orig},y_{orig},\theta) (xorig,yorig,θ) 投影到特征(得到 { ( x j , y j ) ∣ y j = 0 , 1 , 2 , . . . , H F − 1 } \{(x_j,y_j)\ |\ y_j=0,1,2,...,H_F-1\} {(xj,yj) ∣ yj=0,1,2,...,HF−1})上:
x j = ⌊ 1 tan θ ( y j − y o r i g s t r i d e b a c k b o n e ) + x o r i g s t r i d e b a c k b o n e ⌋ y j = 0 , 1 , 2 , . . . , H F − 1 \begin{aligned} x_j&=\lfloor\frac{1}{\tan\theta}(y_j-\frac{y_{orig}}{stride_{backbone}})+\frac{x_{orig}}{stride_{backbone}}\rfloor\\ y_j&=0,\ \ 1,\ \ 2,\ \ ...,\ \ H_F-1 \end{aligned} xjyj=⌊tanθ1(yj−stridebackboneyorig)+stridebackbonexorig⌋=0, 1, 2, ..., HF−1
利用局部 anchor 特征构建辅助 anchor 特征,以集成全局信息。
w i , j = { softmax ( L a t t ( a i l o c a l ) ) j , if j < i 0 , if j = i softmax ( L a t t ( a i l o c a l ) ) j − 1 , if j > i a i g l o b a l = Σ j w i , j a j l o c a l \begin{aligned} w_{i,j}&=\begin{cases} \text{softmax}(L_{att}(\pmb{a}^{local}_i))_j,&\text{if}\ ji\\ \end{cases}\\ \pmb{a}^{global}_{i}&=\Sigma_{j}w_{i,j}\pmb{a}^{local}_{j} \end{aligned} wi,jaiglobal=⎩ ⎨ ⎧softmax(Latt(ailocal))j,0,softmax(Latt(ailocal))j−1,if j<iif j=iif j>i=Σjwi,jajlocal
- 符号的含义可见上图;
- 实际使用的是矩阵形式;