2. 輪読内容について
• Neural scene representation and rendering
– S. M. Ali Eslami, Danilo J. Rezende, et al.
• Rezendeは,VAEやnormalizing flowを提案した人
• Deep Mind (Last authorはDemis Hassabis)
• Scienceに採録
• Generative Query Network(GQN)を提案した論文
– 本発表では,GQNの説明のために深層生成モデルの基礎から順番に話します.
– 合わせて,関連研究(全部DeepMind発)や世界モデルとの関連についても説明します.
• 本論文についての私見
– 確率モデル的には新しいことを提案しているわけではなく,従来の研究の応用.
– 学習できるアーキテクチャを提案した&実際に学習できることを示したことに意味があると考えていま
す.
– 世界モデルの研究的には非常に重要な論文で,今後こういう研究はどんどん増えていくのは確実(既
にDeepMindが量産している)
→どの部分が重要なのかをおさえることが大事 2
3. どういう研究?
• ある複数の視点における画像を元に,別の視点の画像を生成するGenerative
Query Network(GQN)というモデルを提案した.
– 動画で見ると衝撃的(https://www.youtube.com/watch?v=RBJFngN33Qo)
• 2D画像から3Dモデルを作成した?と話題に
– ただし多少誤解がある気がするので,基礎となる深層生成モデルから順番に説明していきます.
3
Fig. 1. Schematic illustration of the Generative Query Network. (A) The agent observes
training scene ! from different viewpoints (in this example from &$
/
, &$
@
and &$
A
). (B) The inputs
to the representation network 2 are observations made from viewpoints &$
/
and &$
@
, and the
A B
r1 r2
r
h1 h2 hL
z
Generation network gRepresentation network f
···
v2 v3
v1
v2v1 v3
Neural scene
representation
Query
Latent
Rendering steps
Predicted
view
+
i
i i
i i i
Observation 1
Observation 3Observation 2
19. 本論文の問題設定
• データセット:
– {(𝑥𝑖
𝑘
, 𝑣𝑖
𝑘
)}(𝑖 ∈ 1, … , 𝑁 , 𝑘 ∈ {1, … , 𝐾})
• 𝑥𝑖
𝑘
はRGB画像
• 𝑣𝑖
𝑘
は視点(viewpoint)
– 𝑤(カメラの位置,3次元),𝑦(ヨー,1次元), 𝑝(ピッチ,1次元)
• 目的:
– M個の観測(文脈という)(𝑥𝑖
1,…,𝑀
, 𝑣𝑖
1,…,𝑀
)と任意の視点(クエリ)𝑣𝑖
𝑞
が与えられ
たもとで, 対応する𝑥𝑖
𝑞
を予測する.
– しかし,3次元空間を有限の2次元の観測で決定論的にカバーすることは困難
19
Fig. 1. Schematic illustration of the Ge
training scene ! from different viewpoin
to the representation network 2 are obse
output is the scene representation 4, whi
observations’ representations. The gener
representation to predict what the scene
generator can only succeed if 4 contains
A B
Repre
v2
v3
v1
v1
i
i i
i
Observation 1
Observation 3Observation 2
→条件付き確率モデル(深層生成モデル)を利用する
23. 表現ネットワーク
• M個の観測(𝑥1,…,𝑀
, 𝑣1,…,𝑀
)を表現ネットワーク𝑓によって,一つの表現(文脈)r =
𝑓(𝑥1,…,𝑀
, 𝑣1,…,𝑀
)に要約する.
– 表現ネットワークのアーキテクチャは次のとおり
• 𝜓(𝑥, 𝑣)はCNNなど
• 各視点の平均(上式では総和)を取ることで,視点の順番に依存しない表現にす
ることができる.
– 順列ではなく組み合わせに対応した表現.
– 学習時に平均する視点の数をランダムに変更することで,任意の視点の数での推論が可能.
→(個人的に)GQN系のアーキテクチャで最も重要な部分
23
Fig. 1. Schematic illustration of the Generative Query Network. (A) Th
training scene ! from different viewpoints (in this example from &$
/
, &$
@
and
to the representation network 2 are observations made from viewpoints &$
/
output is the scene representation 4, which is obtained by element-wise sum
observations’ representations. The generation network, a recurrent latent va
representation to predict what the scene would look like from a different vi
A B
r1
r2
r
h1
z
GeneRepresentation network f
v2
v3
v1
v2v1 v3
Neural scene
representation
Query
Latent
+
i
i i
i i i
Observation 1
Observation 3Observation 2
24. 表現ネットワークのアーキテクチャ
• 3種類のアーキテクチャを提案
24
64x64x(7+3)
v x
32x32x32 16x16x64 8x8x128 1x1x256
k=2x2
s=2x2
k=2x2
s=2x2
k=2x2
s=2x2
k=8x8
s=8x8
r
1x1x7
64x64x3
v
x
32x32x256 32x32x128 16x16x(256+7) 16x16x128
k=2x2
s=2x2
k=3x3
s=1x1
k=2x2
s=2x2
k=3x3
s=1x1
r
1x1x7
k=3x3
s=1x1
k=1x1
s=1x1
16x16x256 16x16x256
Concatenate
+
16x16x7
+
A
B
64x64x3
v
x
32x32x256 32x32x128 16x16x(256+7) 16x16x128
k=2x2
s=2x2
k=3x3
s=1x1
k=2x2
s=2x2
k=3x3
s=1x1
r
1x1x7
k=3x3
s=1x1
k=1x1
s=1x1
16x16x256 16x16x256
Concatenate
+
16x16x7
+
C
Pool
1x1x256
PyramidTowerPool
27. Prior + Generationのアーキテクチャ
27
cl
hl
rv
q
zl
ul
cl+1
hl+1
zl+1
ul+1
…
…
zL
… uL x~N(η(uL))
Cϴ Cϴ Cϴ
g g g
cl
hl
rv
q
ul
cl+1
hl+1
ul+1
concat concat
zl
concat
sigmoidtanhsigmoidsigmoid
tanhx
+x
x
+
Δ
k=4x4
s=4x4
k = 5x5
s = 1x1
5x5
1x1
5x5
1x1
5x5
1x1
k=1x1
s=1x1
ηϴ
g
g
g
g
g
g
g
g
g
ηϴ
π
k=5x5
s=1x1
A
B
FigureS2: Generation network architecture. Implementation detailsof onepossiblearchitec-
ture for the generation network, which given query viewpoint vq
and representation r defines
the distribution g✓(xq
|vq
, r) from which images can be sampled. Convolutional kernel and
stride sizesare indicated by k and s respectively. Convolutions of stride1 ⇥1 aresizepreserv-
ing, whilst all others are ‘valid’. (A) The architecture produces the parameters of the output
distribution through theapplication of asequence of computational cores Cg
✓ that takevq
and r
g
𝑔 𝑥 𝑣 𝑞, 𝑟 をモデル化している(PriorとGenerationが一体化)
・これらをまとめてGenerationと呼んでいる部分もあるので注意
Fig. 1. Schematic illustration of the Generative Query Network. (A) The agent observes
training scene ! from different viewpoints (in this example from &$
/
, &$
@
and &$
A
). (B) The inputs
to the representation network 2 are observations made from viewpoints &$
/
and &$
@
, and the
output is the scene representation 4, which is obtained by element-wise summing of the
observations’ representations. The generation network, a recurrent latent variable model, uses the
representation to predict what the scene would look like from a different viewpoint &$
A
. The
generator can only succeed if 4 contains accurate and complete information about the contents of
the scene (e.g., the identities, positions, colours and counts of the objects, as well as the room’s
colours). Training via back-propagation across many scenes, randomizing the number of
A B
r1
r2
r
h1 h2 hL
z
Generation network gRepresentation network f
···
v2 v3
v1
v2
v1
v3
Neural scene
representation
Query
Latent
Rendering steps
Predicted
view
+
i
i i
i i i
Observation 1
Observation 3Observation 2
ちなみに,この図ではPrior(𝑧の
推論)は含まれていない
33. 実験結果
• Scene algebra
– 物体についてだけでなく,それらの位置についても足し算・引き算が可能
33
H
obs
Previous ob
A B
- =+
Blue
sphere
Red
sphere
Red
triangle
Blue
triangle
- =+
Red
sphere
Blue
sphere
Blue
cylinder
Red
cylinder
- =+
East light
sphere
West light
sphere
West light
triangle
East light
triangle
Pred
Pred
Pred
dueto
obs2
34. 実験結果
• Bayesian Surprise
– 𝑦が与えられた下で,𝑥を観測したときのSurpriseを次式で計算(information gain).
𝐼𝐺 𝑥, 𝑦 = 𝐾𝐿[𝑞(𝑧|𝑥, 𝑦)|𝑝(𝑧|𝑦)]
– 文脈の視点数を変更したときのSurprise度合いを確認.
• 視点数が増えるごとに,Surpriseが減少していることがわかる.
34
Held out
observation
Previous observations
B
=
Red
triangle
Blue
triangle
=
Blue
cylinder
Red
cylinder
=
West light
triangle
East light
triangle
Pred
Pred
Pred
dueto
obs2
dueto
obs5
38. 実験結果
• Predicted uncertainty
– Predicted information gain(information gainの期待値)を利用.
𝑃𝐼𝐺 𝑥, 𝑦 = 𝐸 𝑝 𝑥 𝑧, 𝑦 𝑝(𝑧|𝑦)[𝐼𝐺(𝑥, 𝑦)]
– 視点が増えるにつれて,不確実性が下がっていることがわかる.
38
Fig. 6. Partial observability and uncertainty. (A) The agent (GQN) records several
observations of a previously unencountered test maze (indicated by grey triangles). It is then
B
Predicted
uncertaintyObservationsViewpoints
1 2 3 0 1 2 30
Predicted
mapview
sample1
Predicted
mapview
sample2
A
Prediction Truth Prediction TruthObservations Observations
Decreasing uncertainty Decreasing uncertainty
39. データ集合4:Jaco arm
• Jaco arm:
– タスク:仮想環境上のアームをターゲットに近づけて留める
– 本実験では,次のような流れで学習する
• まずGQNによって,環境を完全に学習する.
• 学習したGQNの表現を使って,A3Cで強化学習
• 実験結果
– 視点が動いても,GQNの表現を使うことで適切に学習が進む.
39
Fig. 5. GQN representation enables more robust and data-efficient control. (A) The goal is
to learn to control a robotic arm to reach a randomly positioned coloured object. The controlling
policy observes the scene from a fixed or moving camera (grey). We pretrain a GQN
A
Pretraining views
B
TruthPredictionObservation
Policy
view
C
GQN representation
Raw pixels
Oracle
42. GQN vs. CGQN
• 実験:ボックスの未知の側の数字を適切に予測できるか?
– CGQNでは,各視点について一貫性のある予測ができる(T1とT2で同じ).
– GQNでは,T1とT2で異なる数字が予測される -> 視点による一貫性がない
42
Figure 6: Test-set negativeELBO against number of training steps (lower isbetter).
Figure 7: A cube in a room, with MNIST digits engraved on each face (test-set scene). The blue
conesarewherethecontext frameswerecaptured from. Thered conesarewherethemodel isqueried.
The context frames seethreesides of thecube, but themodels aretasked to sample from thefourth,
unseen, side. GQN (right column) independently samples a0 and 7 for the unseen side, resulting in
an inconsistent scene. CGQN samples aconsistent digit (2 or 9) for the unseen cubeface.
44. Neural Processes
• Neural Processes [Garnelo+ 18, DeepMind]
– (ざっくりいうと)Gaussian ProcessのカーネルをDNNに置き換えたモデル
• Globalな潜在変数を導入していることが特徴.
• 詳しくはこちらのスライドを参照(DL輪読会資料):
https://www.slideshare.net/DeepLearningJP2016/dlconditional-neural-
processes?ref=https://deeplearning.jp/neural-processes/
– 複数の任意の点とその値(文脈)が与えられた下で,未知の点の値を予測する.
• あれ,GQNっぽい
44
Neural Processes
10 100 300 784
Number of context points
ContextSample1Sample2Sample3
15 30 90 1024
Number of context points
ContextSample1Sample2Sample3
Figure 4. Pixel-wise regression on MNIST and CelebA The diagram on the left visualises how pixel-wise image completion can
任意の文脈を与えたときの回帰予測
(文脈が増えると分散が小さくなる)
任意の文脈を与えたときの画像生成
(文脈が増えると画像のバリエーションが小さくなる)
45. Neural Process vs. CGQN
• CGQNとの違い:
– 確率モデル的にはCGQNと同じ
– zへの推論にRNNを使わず,PriorとInferenceで同じencoderを使いまわしている(アーキテクチャ的な
違い)
– 論文に描かれているグラフィカルモデル(左)とアーキテクチャ(右)
• 左のグラフィカルモデルではInferenceが描かれていないので注意
45
46. SLIM
• Encoding Spatial Relations from Natural Language [Ramalho+ 18, DeepMind]
– GQNをベースに,言語の言い換えに対して同じ画像を生成する(不変性のある表現を獲得する)モデルであ
るSLIMを提案
46
Figure 2: Diagram of our model. A representation network parses multiple descriptions of ascene
from different viewpoints by taking in cameracoordinates and atextual caption. Therepresentations
for each viewpoint are aggregated into a scene representation vector r which is then used by a
– 自然言語𝑑1,…,𝑀
と視点𝑣1,…,𝑀
で構成される文脈r = 𝑓(𝑑1,…,𝑀
, 𝑣1,…,𝑀
)が与えられたとき, 未知の視点𝑣
𝑞
から
対応する画像𝑥
𝑞
を生成するように学習
• 上の図では,𝑐が視点
49. GQNによるカメラ位置の推定
• Learning models for visual 3D localization with implicit mapping [Rosenbaum+ 18,
DeepMind]
– GQNを利用して,自己位置推定のタスクを解く
• Minecraftからシーンのデータを作成.
– 文脈とクエリ(目標)画像から,視点(位置)を推定する
• 普通のGQNと逆の設定.
• 右画像の緑が予測した視点.
49
Figure 1: The Minecraft random walk dataset for localization in 3D scenes. Wegenerate random
trajectories in the Minecraft environment, and collect images along the trajectory labelled by the
camera pose coordinates (x,y,z yaw and pitch). Bottom: Images from random scenes. Top: The
localization problem setting - for a new trajectory in a new scene, given a set of images along
thetrajectory and their corresponding cameraposes (the ‘context’), predict the camerapose of an
additional observed imagein thetrajectory (the‘target’, shown in green).
hasseen increased usefor localization and SLAM problemsin recent years[22, 6, 13], most methods
still rely on pre-specified map representations. Agentstrained with reinforcement learning havebeen
demonstrated to solvenavigation tasksthat implicitly require localization and mapping [11, 3, 1, 20],
suggesting that it ispossible to learn theseabilities without such pre-specification. Other methods
52. 実験結果
• Generative(真ん中)とDiscriminative(下)の出力
– 文脈は20視点
– 予測した確率の高いところに,正解の位置(緑)があることが確認できる.
52
ground
truth
samples
camera pose
probability
maps
Figure 5: Generated samples from the generativemodel (middle), and thewhole output distribution
for the discriminative model (bottom). Both were computed using the attention models, and each
imageand posemap isfrom adifferent sceneconditioned on 20 context images. Thesamplescapture
much of the structure of the scenes including the shape of mountains, the location of lakes, the
presence of largetrees etc. (seesupplementary video for moresamples). The distribution of camera