논문

하루에도 수만개의 글자를 읽고 있습니다. 하루에도 수백장의 종이를 들춰 읽습니다.
이것은 그 읽기에 대한 일기입니다.

SAFENet: Self-Supervised Monocular Depth Estimation with Semantic-Aware Feature Extraction

Problem

Single image에서 depth를 추정하는 문제, 즉 monocular depth estimation 영역에서 최근 self-supervised learning을 이용한 방법이 대두되고 있다. 하지만 이러한 방법들에서는 픽셀 밝기가 변화해버리거나, texture가 별로 없는 영역, 반복되는 패턴이 있는 영역, 가려진 영역은 photometric loss distribution을 변화를 야기시켜 학습을 어렵게 만든다.

Essence

이 논문에서는 photometric loss의 이러한 단점을 극복하기 위해 geometric representation과 feature-level semantic information을 통합한 방법을 제안하였다.

Semantically-guided된 depth feature는 이미지 내의 spatial context에 대한 정보도 포함하고 있어 depth estimation 결과를 향상시킨다. 즉 어떤 한 instance는 비슷한 거리 범위 내에 있으며 이를 반영할 수 있게 된다.

이러한 semantic-aware depth feature를 학습하기 위해 supervised segmentation task를 self-supervised depth estimation task에 multi-mask learning (MTL)로 적용하였다. 하지만 MTL에서는 각 task가 서로 간섭하는 것이 문제가 되며 이를 해결하기 위한 방법 또한 제안하였다.

먼저 encoder만 공유하고 decoder는 task별로 분리하는 방법을 사용하여 decoder가 서로 간섭하는 것을 막으면서도 decoder 내애 공유하는 모듈이 존재하여 시너지를 내도록 하였다. 이를 반영하여 spatial, channel dimension 모두 semantic-awareness한 intermediate representation을 가지는 network 구조를 제안한다.

Detail

Semantic segmentation의 정보를 가지고 있는 semantic-ware depth feautre는, 만약 같은 semantic class인 인접한 픽셀들이 3D 공간으로 projection될 경우, 이러한 픽셀들은 3D 공간에서도 비슷한 위치에 있을 것이라는 prior를 제공할 수 있다. 또한 영역 내에서 픽셀 값이 서로 구분이 잘 안되더라도, semantic information을 이용하여 영역 내 픽셀들의 특징을 이해하는데 도움이 된다.

이를 위하여 단순히 segmentation mask를 입력으로 사용하는 방법을 사용하지 않고 feature-level에서 semantic을 fusion하기 위하여 두 task를 joint training하는 방법을 고안하였다.

Encoder

두 task간 간섭을 피하기 위하여 encoder에는 [29]에서 사용한 3가지 테크닉을 적용하였다.

먼저 squeeze and exciation (SE) block을 이용하였다. global average pooled feature를 fully connected layer에 넣어 sigmoid function 기반의 채널별 activated vector를 생성하였고, 이는 각 채널의 attention으로 작용하여 feature에 곱해진다. SE모듈은 task마다 다른 파라미터를 사용하도록 하여 각 모듈이 task별로 다른 특성을 가지도록 하였다.

두번째로는 Residual Adapters (RA) [35]를 residual layer에 추가하여 shared feature를 향상시킴과 동시에 task-specific attribute 또한 반영하도록 하였다. 수식으로 표현하면 아래와 같다.

L_T(x) = x + L(x) + RA_T(x)

여기서 x는 feature를, T \in { Depth, Seg}는 task를, L(\cdot)RA_T(\cdot)는 각각 residual layer와 task-specific RA를 나타낸다.

마지막으로 batch normalization을 task마다 별도로 수행하여 task-invariant feature를 얻음과 동시에 task-dependent한 성질을 BN으로부터 얻을 수 있도록 하였다.

Decoder

아래 그림에서처럼 각 task별로 별도의 decoder를 사용하였다. 이렇게 하면 각자의 task에 맞게 task-specific feature를 학습하지만 다른 task의 decoder 정보를 이용하기는 어렵게 된다. 이를 위해 두가지 방법을 사용하였다.

첫번째는 [31, 21] 연구에서 영감을 받았는데, 1x1 convolution H_1^{1 \times 1}(\cdot), B_1^{1 \times 1}(\cdot)를 이용하여 다른 task로부터 intermediate representation을 공유할 수 있도록 하였다. Upsampling layer가 적용되기 전에 H_1^{1 \times 1}(\cdot), B_1^{1 \times 1}(\cdot)를 추가하여 두 decoder간 intermediate feuater를 공유하도록 하고, proparation 과정에서 interruption에서의 negative effect [21]을 막기 위해 H_2^{1 \times 1}(\cdot), B_2^{1 \times 1}(\cdot) 을 추가하여 shortcut으로 활용하였다. 이 과정을 cross propagation unit (CPU)라고 하였다. Segmentation feature s_t와 depth feature d_t가 주어졌을 때 task-shared feature의 계산 과정을 수식으로 나타내면 다음과 같다.

d_{t+1} = d_t + H_1^{1 \times 1}(s_t) + H_2^{1 \times 1}(d_t), s_{t+1} = s_t + B_1^{1 \times 1}(d_t) + B_2^{1 \times 1}(s_t)

두번째로는 segmentation이 가지고 있는 semantic affinity information을 depth estimation으로 저달하도록 하였다. 앞에서 만들어진 sharing unit은 1x1 convolution으로 이루어져 있어 depth decoder는 다른 위치의 정보는 참고할 수 없지만, CNN의 구조 특성상 segmentation decoder의 high-level feature는 이미 affinity information을 가지고 있다고 볼 수 있다. 따라서 segmentation feature s_t를 이용하여 non-local affinity matrix를 만들고자 하였다. 1x1 convolution K^{1 \times 1}, F^{1 \times 1} \in \mathbb{R}^{C \times H \times W }을 추가하고, 이들을 \mathbb{R}^{C \times HW}로 reshape 한 뒤, 행렬 곱을 한다. 그리고 softmax를 적용하면 affinity matrix \mathbf{A} \in \mathbb{R}^{HW \times HW}를 계산할 수 있다. 계산된 affinity matrix를 G^{1 \times 1}(\cdot)를 통과한 depth feature에 곱하면 semantic correction이 이루어진 depth feature를 얻을 수 있다. 수식으로 나타내면 다음과 같다.

d_{t+1} = BN(\mathbf{P^{1 \times 1}(\mathbf{A} G^{1 \times 1}(d_t))}) + d_t

여기서 \mathbf{P}^{1 \times 1}는 1x1 convolution이다. 이를 affinity propagation unit (APU)라고 하였다.

Loss functions

Loss는 supervised와 self-supervised가 통합된 형태이다. Semantic segmentation loss L_{seg}는 cross entropy를 이용하였고, depth loss는 기존의 photometric loss L_{photo}를 이용하였다. 다른 연구에서처럼 edge-ware smoothness loss L_{smooth} 또한 사용하였다.

L_{tot} = L_{photo} + \lambda_{smooth} L_{smooth} + \lambda_{seg} L_{seg}

모든 학습은 end-to-end로 이루어지나 모듈 중 task-specific한 부분들은 각자의 task-specific한 loss에서만 학습이 되도록 설정하였다.

Pose network는 Monodepth2의 그것을 그대로 사용하였다.


Add a Comment Trackback