Gaze Estimation using Transformer (2021)

Balin
3 min readSep 28, 2021

--

Introduction

  • 因為目前來說 ViT 還算新,還有很多領域並沒有做相關的實驗,因此此篇就是來做 ViT 的實驗,主要就是想探討「If transformers are suitable for gaze estimation tasks?」。
  • 論文是 NeurIPS 的格式,提出透過 two transformers 和 hybrid transformers 的方式做 gaze estimation,hybrid 在所有 gaze dataset 上的表現都比 two transformers 和 CNN 好且使用比較少的參數量。
  • ViT 的架構是用 google 提出的純 ViT,CNN backbone 為 ResNet-18。

Method

Pure Transformers in Gaze Estimation

Hybrid Transformers in Gaze Estimation

Gaze estimation is a regression task and it is hard to predict the human gaze with a local patch such as a half of eye images.

  • 這邊的做法和上面類似,只是不透過 linear model 做 projection 而是透過 ResNet-18 將 input face 輸出 (h, w, c) 的 feature,之後 reshape 成 (l, c),直接把 l(h * w) 當成 patch 數量取代上面的 z_img,之後一樣 concate token 和加上 position encoding 丟進 transformer 和 MLP

Experiment

Common setting:

  • Input: Face image(224, 224, 3), Output: 2D vector(yaw, pitch)
  • Loss: L1 loss, P = 14, Resolution of each patch = (16, 16)
  • MLP dropout probability = 0.1
  • Pre-train on ETH-XGaze

Pure Transformers:

  • Dimension of linear projection: 768
  • Number of transformer layer: 12
  • Number of heads in multi-head self-attention: 64
  • Hidden size of two-layer MLP: 4096

Hybrid Transformers:

將 ResNet 的 output 再丟進一個 (1, 1) convolution 降維。

  • Output of ResNet-18: (7, 7, 512)
  • Output of (1, 1) convolution: (7, 7, 32)
  • Number of transformer layer: 6
  • Number of heads in multi-head self-attention: 8
  • Hidden size of two-layer MLP: 512

下面是比較的表格,可以看到 Hybrid 的效果比較好。

參考 AFF-NET 加了 eye 和 face corner position 的資訊到最後一個 MLP,且沒有 pre-train 在 ETH-XGaze 上,比較兩者的 point-of-gaze (POG)。

Hyper-parameters in Hybrid Transformer

  • 這邊分別對 transformer 的 Layers, Heads 數量和 Input dimensions 做 Ablation study,這邊的 Input dimension 是指 ResNet-18 後面接的 (1, 1) convolution output 的維度,也就是 input 給 transformer 的維度。
  • 針對不同 layer 數量的 transformer 驗證 self-attention 和 deep convolution 的重要性,不管 layer 數量是多少這兩個 component 都很重要。
  • 和純 CNN model 的比較,Hybrid 的 performance 比較好,GazeTR-Conv 是指將 GazeTR-Hybrid 的 transformer 換成兩個 256 層 hidden layer 的 MLP。
  • 跟其他領域一樣,只要架構有 transformer 這種較少 Inductive bias 的 model 通常都會需要比較大的訓練資料才能達到比較好的效果,也因此 pretrain 對其影響也比較大,但好處就是有較高的 upper bound。

Reference

[arxiv]

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response