NeurIPS 2023 | 三维重建中的Neural SDF(Neural Implicit Surface)

2023-11-04 14:10 300 阅读 ID:1583
将门
将门

本文介绍一下我们组在NeurIPS 2023发表的工作: StEik: Stabilizing the Optimization of Neural Signed Distance Functions and Finer Shape Representation。这是一篇关于Neural SDF基础理论的paper,所以这篇文章中我先给大家梳理了一下Neural SDF(Neural Implicit Surface)近几年的发展历程,再介绍我们的贡献。

论文名称: 

StEik: Stabilizing the Optimization of Neural Signed Distance Functions and Finer Shape Representation

论文链接:

https://arxiv.org/abs/2305.18414
代码链接:

https://github.com/sunyx523/StEik

一、Introduction

近期基于体渲染的三维重建方法中,有项距离场Signed Distance Function(SDF)被广泛的用来表示三维表面,而SDF又被MLP隐式的定义。刚刚接触这个领域可能认为SDF近期才出现并应用到三维重建中,其实SDF的历史已经有几十年了,早在二十多年前SDF就被广泛的应用到图像分割和三维重建算法中(三维重建和图像分割其实可以看作同一个任务,三维重建其实是将空间分割为物体内和物体外两部分)。

这些算法都是基于calculus of variations来求解计算机视觉问题的,这是一种非常传统的算法,在二十年前是当时计算机视觉的主流算法,但国内的老师大多是深度学习火起来之后才开始进入cv领域的,对这种传统方法了解的不多。我老板Anthony Yezzi也算这个领域的小牛了,曾在01年拿过CVPR outstanding student paper,对SDF有很深的理解,毕竟做了几十年了,我也希望能将我所学到的分享给大家。之前SDF是被显式地储存在grid中,随着近几年深度学习的大火,人们开始用MLP隐式的表示SDF。Implicit Representation相比于Explicit Representation的优势很明显:

  • MLP是连续的,可以查询任意位置的SDF值
  • 可以通过PyTorch求得analytic gradient,避免numercial gradient引起的数值问题

二、Stereoscopic segmentation[1]

三、Neural Implicit Surface

在DeepSDF[2]中,作者首次尝试用MLP来隐式的表示SDF,通过缩小MLP的输出和ground truth SDF的差来让MLP拟合一个SDF:

对于不在表面上的点,DeepSDF也需要知道它们的符号(物体内部/外部)和距离表面的距离。然而在很多应用中,很难得到一个ground truth SDF。SAL[3]提出了不需要ground truth SDF的训练方法,并且提出了几何初始化,即将MLP的输出初始化为一个球体。这个初始化非常重要,在以后的工作中被广泛用到,之前单独写了一篇文章讲解这种初始化:

基于体渲染(NeRF)三维重建中的几何初始化
https://zhuanlan.zhihu.com/p/650679177

在此基础上SALD[4]在训练过程中引入了点云的normal监督,并大幅提高了重建的质量。

四、Eikonal Loss

在IGR[5]中,作者引入了基于Eikonal Equation的约束项,可以让学习到的函数接近一个SDF,这项约束可以在有无normal的情况下都可以使用。并且作者证明了仅仅利用这项约束加上约束表面点的SDF值为0,就可以学到理想的SDF,不需要使用SAL[6]中提出的复杂学习方法。这项约束后来成为著名的Eikonal Loss,是三维重建中必不可少的一项约束。

然而Eikonal Loss在基于variational method中并没有被广泛使用,取而代之的是reinitialization,即根据zero level set使用fast marching method重新生成一个SDF。其中一个原因如下图所示,因为SDF是用离散的grid表示的,求梯度时要用到finite difference scheme,在求拐点附近的梯度时,如果用简单的central difference scheme就会造成如下问题

                                                                Fast marching method, Sethian

需要使用复杂的upwind scheme才能避免奇点的不连续性。Eikonal Loss还有另一个问题就是optimization过程不稳定(这个不稳定性我将在后面讲到),之前也有很多文章[7]研究了Eikonal equation的这种不稳定性,这也就是为什么在variational method中人们几十年来都没有使用Eikonal Loss。

然而为什么最近的Neural SDF中又开始使用Eikonal Loss了呢,这是因为MLP相比于voxel grid存在一种implicit reguarization,也即FFN中提到的spectral bias,可以稳定Eikonal Loss的优化过程。然而当使用更强表达能力的结构时,这种implicit reguarization也会减弱,不稳定性又会出现。为了克服spectral bias重建出更多细节,人们开始探索表达能力更强的网络,随之而来的便是Eikonal Loss带来的不稳定性。

五、DiGS[8]

在这篇文章中作者尝试使用SIREN替换ReLU MLP来捕捉更多的几何细节。作者发现当SIREN网络在没有normal constrain(即输入ground truth normal,惩罚其和表面normal的差)的情况下重建效果很差,于是作者引入了二阶项约束,即梯度场的散度divergence,也是SDF的Laplacian:

作者发现使用二阶约束项后重建效果会变好。作者是根据观察SDF场,发现其二阶导数为零,才根据经验提出的这项约束。然而作者不知道这背后的理论原因,其实是因为normal constrain具有稳定Eikonal Loss的效果,所以当没有normal constrain的时候SIREN重建效果会变差,而二阶约束也具有稳定Eikonal的效果,所以加入二阶项也会让重建效果变好。

六、Stability analysis of Eikonal Loss

Visual demonstration of the eikonal instability in the INR. (a) shows a sudden change from top to bottom can occur when minimizing the eikonal loss. As the frequency components escalate, the evolution of the function becomes increasingly unstable for a negative κe, making it more susceptible to undesirable local minimizers. Right of the vertical line, (b) © and (d), we show two intermediate and the final results from the evolutions. If we add our new divergence term, it reduces the instability induced by the eikonal loss (see bottom). The evolution becomes more irregular without a divergence term (see top).

可以看到,在第一行Eikonal Loss的不稳定性导致的很糟糕的结果,第二行引入二阶约束后效果得到提升。

七、 New Shape Regularization

Illustration of the ability of our new regularization to capture fine-scale details of shape while still stabilizing the optimization. Without a penalty on the mean curvature, our directional divergence term restores the shape more quickly and captures fine details (bottom). On the other hand, the full divergence term (top) unnecessarily minimizes the mean curvature of the level sets, resulting in over-smoothness. Note the dark black lines represent the zero level set (lighter ones indicate other level sets). Ground truth is a snow-flake like shape (dotted gray). Note that both divergence terms prevent minimizing the eikonal loss too early, thereby avoiding sharp local minimizers.

八、New Shape Representation

MLP大多使用linear layer作为basic block,而一些文章中已经提到了ReLU based MLP中存在spectral bias,即更容易学习到低频信息。SIREN在这基础上提出了Sinosoidal activation,使网络能更快速地学习到高频信息。那能不能再进一步呢

九、Experiments

我们在Surface Reconstruction Benchmark,ShapeNet,Scene reconstuction数据集上测试了我们的实验结果,均达到了state of the art的结果。

通过visual result可以很清楚的看到我们的方法可以恢复一些复杂精细的几何结构。

模型大小与速度:

参考

[1] https://ieeexplore.ieee.org/document/937499

[2] https://arxiv.org/abs/1901.05103

[3] https://arxiv.org/abs/1911.10414

[4] https://arxiv.org/abs/2006.05400

[5] https://arxiv.org/abs/2002.10099

[6] https://math.berkeley.edu/~sethian/2006/Papers/sethian.siam_fast.pdf

[7] https://www.sciencedirect.com/science/article/abs/pii/016727899190197H

[8] https://arxiv.org/abs/2106.10811

[9] https://arxiv.org/abs/1808.00098

作者:孙雨欣

来源:知乎:https://zhuanlan.zhihu.com/p/649921965

Illustration by IconScout Store from IconScout

免责声明:作者保留权利,不代表本站立场。如想了解更多和作者有关的信息可以查看页面右侧作者信息卡片。
反馈
to-top--btn