参考代码:Structure-Guided-Ranking-Loss
1. 概述
导读:在这篇文章中提出了一种在监督深度估计方法中的损失函数。该方法是属于pair-wise ranking loss族的,文章通过利用目标的分割结果提出了一些新的采样策略,也就是低层次的边缘采样与目标实例级别的采样。从而极大增强了损失函数的约束能力,提升了最后深度图预测在边缘部分的锐化成都,以及目标内部的一致性内在属性。
文章将之前一些方法的损失函数进行比较,其结果在边缘与目标内部均得到了不错的提升,见下图所示:
理解下面的内容,需要的背景知识:
- 论文:Single- image depth perception in the wild
- 读书笔记:Single-Image Depth Perception in the Wild笔记
- 论文:Monocular relative depth per- ception with web stereo data supervision
2. 方法设计
2.1 original pair-wise ranking loss
文章中使用到的深度表达为inverse depth,RGB的图像经过网络之后得到估计出来的深度:
P = F ( I ) P=F(I) P=F(I)
在之前的论文中对于pair-wise的损失函数描述为:
ϕ ( p 0 − p 1 ) = { l o g ( 1 + e x p ( − l ( p 0 − p 1 ) ) ) , l ≠ 0 ( p 0 − p 1 ) 2 , l = 0 \phi(p_0-p_1) = \begin{cases} log(1+exp(-l(p_0-p_1))), & \text{$l\neq0$} \\[2ex] (p_0-p_1)^2, & \text{$l=0$} \end{cases} ϕ(p0−p1)=⎩⎨⎧log(1+exp(−l(p0−p1))),(p0−p1)2,l=0l=0
其中采样过程中正负样本的判别条件为:
l = { + 1 p 0 ∗ / p 1 ∗ ≥ 1 + τ − 1 , p 0 ∗ / p 1 ∗ ≤ 1 1 + τ 0 , otherwise l= \begin{cases} +1 & \text{$p_0^{*}/p_1^{*}\ge1+\tau$} \\[2ex] -1, & \text{$p_0^{*}/p_1^{*}\le\frac{1}{1+\tau}$} \\[3ex] 0, & \text{otherwise} \end{cases} l=⎩⎪⎪⎪⎪⎨⎪⎪