0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【論文解説】PatchFusion: An End-to-End Tile-Based Framework for High-Resolution Monocular Metric Depth Estimation

Posted at

当記事では深度推定(Depth Estimation)に用いる手法の1つであるPatchFusionの論文についてまとめました。

PatchFusionの概要

深度推定のタスク設定

PatchFusion1.png
PatchFusion論文 Figure.1

深度推定(Depth Estimation)は上図のように画像の奥行きを推定するタスクです。

PatchFusionのアルゴリズムの概要

高解像度の画像の深度推定を行う際に画像をそのまま入力すると計算量が大きくなるので、PatchFusionでは下図のようにPatchを抽出してそれぞれの範囲について深度の推定を行います。

PatchFusion2.png
PatchFusion論文 Figure.2 (a)

このようにPatch単位で深度推定を行うことで計算量の削減が可能な一方で、下図のようにPatchの境界が一貫性を持たないという問題が起こります。

PatchFusion3.png
PatchFusion論文 Figure.3

また、PatchFusionのアルゴリズムの主な要素は下記の3つであるとされています。

(1) A patch-wise fusion network
(2) A Global-to-Local module
(3) A Consistency-Aware Training(CAT) loss

次節では上記の3つについてそれぞれ詳しく確認します。

PatchFusionの詳細

A patch-wise fusion network

PatchFusionでは下図の(b)の左の図のように情報を混ぜるネットワークを構築します。このようなネットワークを構築することでそれぞれのPatch単位の推論にグローバルな情報も反映させることが可能になります。

PatchFusion4.png
PatchFusion論文 Figure.2

グローバルな情報の反映にあたって用いられるG2L(Global-to-Local)モジュールについては次項で詳しく確認します。

A Global-to-Local(G2L) module

G2L(Global-to-Local)処理は下記のような数式で表されます。

\begin{align}
f_{g}^{i} &= \mathrm{FB} \left( \tilde{f}_{g}^{i}, \mathrm{roi}(f_{c}^{i}), f_{f}^{i}, \mathrm{Upsample}(f_{g}^{i-1}) \right) \\
\tilde{f}_{g}^{i} &= \mathrm{FB} \left(\mathrm{roi}(f_{\mathrm{g2l}}^{i}), \hat{f}_{g}^{i} \right) \\
f_{\mathrm{g2l}}^{i} &= \mathrm{G2L}(f_{c}^{i}) = \mathrm{SW-SA}(\mathrm{W-SA}(f_{c}^{i}))
\end{align}

上記の式の解釈にあたっては1行目がFigure.2 (b)のC、2行目と3行目がFigure.2 (b)のBに対応していることに着目するとわかりやすいと思います。$i$はダウンサンプリングした際の特徴量のインデックス、roiはグローバルの出力からROI(Region of Interest)を抽出する処理、FBはFusion Blockにそれぞれ対応します。また、SW-SAやW-SAはSwin Transformerを参考にした処理であり、WindowをずらしてAttention処理を行うことでパッチの境界の情報を頑健にすることができます。

A Consistency-Aware Training(CAT) loss

Patchの境界における学習を頑健化させるにあたってPatchFusionでは下記のような数式で表されるConsistency-Aware lossが採用されています。

\begin{align}
\mathcal{L}_{c} &= || \mathcal{F}_{g}^{1} - \mathcal{F}_{g}^{2} ||_{2} + \mu_{1} || \mathbf{D}_{1} - \mathbf{D}_{2}||_{2}, \, x \in \Omega \\
\Omega &= I_{1} \cap I_{2} \\
I_{1}, I_{2} &= \mathrm{Crop}(I) \\
\mathcal{F}_{g}^{1}, \mathcal{F}_{g}^{2} &= f_{\mathrm{ExtractFeature}}(I_1), f_{\mathrm{ExtractFeature}}(I_2) \\
\mathbf{D}_{1}, \mathbf{D}_{2} &= f_{\mathrm{CalcDepth}}(I_1), f_{\mathrm{CalcDepth}}(I_2)
\end{align}

PatchFusion5.png
PatchFusion論文 Figure.4

また、PatchFusionの全体のlossの$\mathcal{L}$についてはDepth Map Prediction from a Single Image
using a Multi-Scale Deep Network
などで定義されるscale-invariant lossの$\mathcal{L}_{\mathrm{si}}$も用いることで下記のように定義されます。

\begin{align}
\mathcal{L} &= \mathcal{L}_{\mathrm{si}} + \mu_{2} \mathcal{L}_{c} \\
\mathcal{L}_{\mathrm{si}} &= ||\log{\mathbf{D}_{t}} - \log{\mathbf{D}_{p}} + \alpha(\mathbf{D}_{t}, \mathbf{D}_{p}) ||_{2}
\end{align}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?