1
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?

論文まとめ:VGGT: Visual Geometry Grounded Transformer

1
Last updated at Posted at 2025-07-14

はじめに

先月開催された CVPR2025 でBest Paper Awards となった論文のざっくりまとめ。

もろもろ書きかけ

paper

project page

github

概要

  • 従来のBAなどの最適化を不要とし、画像から直接3D情報(カメラパラメータ、深度マップ、点群、トラッキング)を推定する
  • これにより高精度ながら推論速度が非常に速い
  • ニューラル・ネットワークのアーキテクチャとしてはGlobal AttentionとFrame Attentionを交互に実施する

スクリーンショット 2025-07-14 3.44.54.png

背景

これまでの SfM (Structure from Motion)

  • 従来のSfM(Structure from Motion)はbundle adjustmentなど最適化のフェーズが必要だった。
\begin{equation}
\min_{\{X_j, R_i, t_i, K_i\}} \sum_{i=1}^{N} \sum_{j=1}^{M} v_{ij} \cdot \left\| \mathbf{x}_{ij} - \pi\left(K_i, R_i, t_i, X_j \right) \right\|^2
\end{equation}

各記号は
$X_j \in \mathbb{R}^3$: 3D空間上の点($j$番目)
$R_i \in SO(3)$, $t_i \in \mathbb{R}^3$: カメラ$i$の回転行列と並進ベクトル(外部パラメータ)
$K_i$: カメラ$i$の内部パラメータ(焦点距離、主点などを含む行列)
$\mathbf{x}_{ij} \in \mathbb{R}^2$: カメラ$i$の画像上で観測された点$X_j$の位置
$\pi(\cdot)$: カメラモデルによる透視投影関数(3D点を2D画像平面に投影)
$v_{ij} \in {0,1}$: 点$X_j$がカメラ$i$に見えているかどうかの可視性マスク

VGGTではこのような最適化フェーズは必要なく、シーン(対象事物を撮影した画像複数枚)を入力すると諸々の情報がNNから出力される。

Fast3Rとの比較

Fast3RもCVPR2025の論文。
https://arxiv.org/abs/2501.13928

VGGTとFast3Rとの主な共通点

項目 Fast3R VGGT
目的 多視点からの3D再構成を1回のforwardで行う 同上
モデル構成 トランスフォーマベース トランスフォーマベース
入力 数百~千枚のRGB画像(最大2,000) 最大200枚のRGB画像
推論時最適化 なし(feed-forward) 同上
カメラパラメータ 自己推定(Fast3Rはrelative poses) 自己推定(rotation, translation, FOV)

主な違い

項目 Fast3R VGGT
3D表現 トライアングルメッシュ(via TSDF) 点群 or depth map(カメラごと)
出力形式 TSDF表現を推定 → Marching Cubesでメッシュ化 カメラごとのdepth / 3D点 / trackなどを出力
解像度 高品質なメッシュ生成が可能 点群・depthベースの簡潔な幾何再構成
カメラトークン なし(relative poseをattentionで学習) あり(camera tokenから姿勢・FOVを直接予測)
カメラ出力 相対回転/平行移動行列 回転(クォータニオン)、位置、視野角
入力トークン構造 Patch Embedding + Position Embedding + Pose Attention DINOトークン + Camera Token + Register Token
Transformer方式 Pose-aware Spatio-Temporal Attention Alternating Attention(画像軸とカメラ軸の交互処理)
学習データ BlendedMVS, ScanNetなど ScanNet, MegaDepth, BlendedMVS など
モデルサイズ 2.1B(Base)または smaller variants 約1.2B
学習時間 1000時間以上(最大モデル) 64GPU × 9日程度

Fast3R以外のこれまでの MVS (Multi-View Stereo)

  • これまでのMVSも最適化のフェーズがある。

Tracking-Any-Point

  • 複数frameある中で、あるframeにおけるある点に対し、他のframeでどこにあるかを当てるtask
  • いずれも Tracking-Any-Point に限ったモデル

ニューラルネットワークのアーキテクチャ

スクリーンショット 2025-07-14 4.26.37.png

画像の特徴量化

DINOを用いる

add camera tokens

各画像にcamera token(カメラ推定用)とregister tokensを追加し、Transformer出力から予測に使う。

AA(Alternating-Attention)

AA(Alternating-Attention)モジュールでは、標準Transformerを少し変えて、層ごとに

  1. global self-attention:全フレーム(全画像)をまとめてattention
  2. frame-wise self-attention:各フレーム(各画像)内だけでattention

を交互に行います。これで「画像間の統合」と「画像ごとの活性の整え(正規化的な効果)」のバランスを取る。なおcross-attentionは使わない。

AAを用いるモデルと、毎回全フレームでattentionするモデルとを比較した場合、AAを使っても2層に1層は全フレームを用いたattentionを実施するので、演算量は半分強にしか削減されない。

それ以上にフレームごとのattentionによってフレームごとの正規化的な効果が現れるため、これがよいと著者らは言っている。

(AA), making the transformer focus within each frame and globally in an alternate fashion.

...maximizing cross-frame information fusion although significantly increasing the runtime...

実際、以下の3つ

  • Global self-attention only
  • Cross-attention(Fast3R)
  • AA(Alternating-Attention
    で精度を比較したところ、AAが最良だった。

head

head部分は

  • カメラヘッド
  • DPT(depth, point, track)ヘッド
    からなる。

カメラヘッド

モデルから出力された camera tokenからカメラの内部行列・外部行列を回帰する。

DPTヘッド

モデルから出力された DPT tokenに対して追加のattention, 線形層でupsampleし、depth map, point map, 追跡用特徴を生成

学習

loss 全体

\begin{equation}
\mathcal{L} = \mathcal{L}_{\text{depth}} + 
              \mathcal{L}_{\text{point}} +
              \mathcal{L}_{\text{camera}} +
              \lambda_{\text{track}} \cdot \mathcal{L}_{\text{track}}
\end{equation}

$\mathcal{L}_{\text{depth}}$:深度マップに対するL1損失(または相対誤差)
$\mathcal{L}_{\text{point}}$:点群(3D座標)に対する Chamfer Distance
$\mathcal{L}_{\text{camera}}$:カメラ姿勢・視野角に対する損失(回転はクォータニオン距離、位置はL2誤差)
$\mathcal{L}_{\text{track}}$:3D点トラッキングに対する損失(特徴間距離など)

カメラ内部・外部パラメータのloss

カメラの内部パラメータ・外部パラメータに関しては、予測値 $\hat{g}^i$ とtarget $g^i$ との Huber loss $| \cdot |_{\epsilon}$を計算する。

\begin{equation}
\mathcal{L}_{\text{camera}} = \sum_{i=1}^N \| \hat{g}^i - g^i \|_{\epsilon}
\end{equation}

ちなみに Huber lossは以下で

\mathcal{L}_{\bf Huber} = \begin{cases}
    \frac{1}{2}a^2 & \text{for } |a| \leq \delta, \\
    \delta(|a| - \frac{1}{2}\delta)      & \text{otherwise.}
  \end{cases}

aが小さい時は二次関数的に増加し、大きい時は線形に増加する。

深度マップのloss

深度マップのlossは以下のようにdepth mapの差、及びその勾配を差を用いる。ただし、aleatoric uncertainty map というものをかけ、不確実性が高いピクセルはlossの寄与を低くする。

L_{\text{depth}} =
\sum_{i=1}^N
\left(
\left\| \Sigma^D_i \odot (\hat{D}_i - D_i) \right\|
+ \left\| \Sigma^D_i \odot (\nabla \hat{D}_i - \nabla D_i) \right\|
- \alpha \log \Sigma^D_i
\right)

ここで

  • $\hat{D}_i$: $i$ フレームの予測したdepth map
  • $D_i$: $i$ フレームのtargetのdepth map
  • $\Sigma^D_i$: 予測した aleatoric uncertainty map
  • $\odot$: channel-broadcast element-wise product
  • $\alpha$: 対数項への掛け率

点群のloss

点群のlossもdepthと同様に、点群mapの差と、その勾配の差を用いる。またdepthと同様にaleatoric uncertainty mapを用いて不確実なピクセルのlossの寄与を小さくしている。

L_{\text{point}} =
\sum_{i=1}^N
\left(
\left\| \Sigma^P_i \odot (\hat{P}_i - P_i) \right\|
+ \left\| \Sigma^P_i \odot (\nabla \hat{P}_i - \nabla P_i) \right\|
- \alpha \log \Sigma^P_i
\right)

ここで

  • $\hat{P}_i$: $i$ フレームにおける予測した点群map
  • $P_i$: $i$ フレームにおけるtargetの点群map
  • $\Sigma^P_i$: 予測したaleatoric uncertainty map
  • $\odot$: channel-broadcast element-wise product
  • $\alpha$: weighting coefficient for the log term

実験と結果

dataset

以下のdatasetで学習した。

  • Co3Dv2
  • BlendMVS
  • DL3DV
  • MegaDepth
  • Kubric
  • WildRGB
  • ScanNet
  • HyperSim
  • Mapillary
  • Habitat
  • Replica
  • MVS-Synth
  • PointOdyssey
  • Viertual KITTI
  • Aria Synthetic Environments
  • Aria Digital Twin
  • Objaverseのような合成データ

屋内、屋外、リアルデータ、合成データと様々なdatasetを使っている。

カメラパラメータの比較

  • 推定した遷移行列の各値、回転行列の各角度と正解値とのAUC@30を算出し、既存モデルと比較。

スクリーンショット 2025-07-14 16.30.51.png

Multi-view estimationの比較

Multi-view estimationのメトリクス

chamfer距離を使用する。これは以下のようにpredictした点の3D座標 $x$ に対してtargetの任意の点の座標 $y$とのsquareed error のうち最小のものを見つけ、それを全てのpredictした点に関して平均したもの。これをtargetに対しても行い、足し合わせる。

\begin{equation}
\mathcal{L}_{\text{point}} = \frac{1}{|\hat{P}|} \sum_{x \in \hat{P}} \min_{y \in P} \| x - y \|_2^2 +
                             \frac{1}{|P|} \sum_{y \in P} \min_{x \in \hat{P}} \| y - x \|_2^2
\end{equation}

そうすると、以下の左図でtarget:赤に対して predict:青のようにわりと似た形状を推定していれば、chamfer距離も小さくなる。一方で右図のようにpredict:緑のように形状がかなりずれていれば、黄色の点線部分のように近い点がないため、これが2乗で加算され、lossが大きくなる。

スクリーンショット 2025-08-11 22.36.43.png

Multi-view estimation の比較結果

  • DTU datasetを用いて depthの精度を他モデルと比較した

スクリーンショット 2025-07-14 17.40.01.png

Point Map Estimation

Image Matching

ablation study

Alternating-Attentionモジュールの性能を評価した。
以下の表で上段がCross-attentionのみ、中段がGlobal Self-Attentionのみ、下段が両方いれたもの(本手法)。

スクリーンショット 2025-08-13 3.20.01.png

どちらかというと Global Self-Attention が効いている。

感想

  • Fast3Rのように高速でSfM等を行う似た仕組みがあるが、それと比べても精度がかなりよい。そうすると、AAによってフレームごとの正規化が効いている点が大きいか?
  • ただ、それ以上に大量のデータを使っている点は精度にかなり寄与していると考えられる
  • WORLD MODELになりえるか、という観点でいうと
    • このモデルだとカメラ行列やdepth mapなどが整ったデータセットを用意する必要があり、 Youtubeなどの世の中に大量にあるデータで自己教師あり学習のような形のスケールは難しそう
1
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
1
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?