“圖像問答” (visual question answering) — 觀察分析一張圖像然後回答和圖像相關的問題 — 是結合了 “圖像辨識” (image recognition) 和 “自然語言理解” (natural language understanding) 的一個研究領域。先來看看三個圖像問答的例子:
VQA Dataset
在 VQA Dataset 中, 圖像問答系統或算法要根據圖像回答二元分類問題 (binary classification problem: Is the umbrella upside down?)、計數問題 (counting problem: How many children are in the bed?)、或是開放問題 (open-ended question: Who is wearing glasses? Where is the child setting?)。
CLEVR Dataset
在 CLEVR Dataset 中, 圖像問答系統或算法要能辨識圖像中的物品然後回答關於物品的形狀/顏色/材質/大小、還有空間關係/邏輯關係等問題。
FigureQA Dataset
在 FigureQA Dataset 中, 圖像問答系統或算法要回答 bar chart, pie chart, 或 line plot 中的相關問題。
"圖像問答" 和 "深度學習"
因為 “圖像問答” 是結合了 “圖像辨識” 和 “語言處理” 兩者的研究領域, 一個主要研究方向就是 “深度學習” (Deep Learning): 用 Convolutional Neural Network (CNN) 進行圖像辨識、用 Recurrent Neural Network (RNN) 做語言處理、再將兩者的結果結合起來做回答如圖 Fig 4.
Keras 官網提供了針對 CNN/RNN/VQA 的標準實現方式如圖 Fig 5.
- Line 1–4: 導入Keras library
- Line 6–21: 實現圖像辨識的 CNN模型
- Line 23–26: 實現語言處理的 RNN 模型
- Line 28–31: 結合 CNN/RNN 成為 VQA 模型
"視覺問答" (Visual Question Answering) 和 "關係網路" (Relation Network)
“圖像問答” 的多種多樣產生了一些有趣而重要的研究, 其中之一是 DeepMind 的 Relation Network [1,2]。Relation Network 主要的目的在於發掘一張圖像中不同物品彼此之間的空間關係或邏輯關係: 如 Fig 6. 問題中的 “… the same size as …” 和 Fig 7. 問題中的 “… is left of …”.
Fig 7. 中 Relation Network (RN) 的目的即在於發掘 “物品與物品” (object-to-object) 或 “特徵與特徵” (feature-to-feature) 彼此的空間關係或邏輯關係。Fig 8. 顯示在 Keras/Theano 下一個最簡單的 “特徵選取” (feature extraction) 和 “關係選取” (relation extraction) 實現方式。