Learning Conditioned Graph Structures for Interpretable Visual Question Answeringhtml
2019-05-29 00:29:43node
Code:https://github.com/aimbrain/vqa-project github
1. Background and Motivation: 算法
最近的計算機視覺工做開始探索圖像的高層表達(higher level representation of images),特別是利用 object detector 以及 graph-based structures 以進行更好的語義和空間圖像理解。將圖像表達爲 graphs,能夠顯示的進行模型交互,經過 graph iterms(objects in the image) 無縫進行信息的遷移。這種基於 graph 的技術已經在最近的 VQA 任務上應用上。這種方法的一個缺點是:the input graph structures are heavily engineered, image specific rather than question specific, and not easily transferable from abstract scenes to real images. 此外,very few approaches provide means to interpret the model's behavior, an essential aspect that is often lacking in deep learning models. 網絡
本文貢獻:現有的 VQA 方法並無嘗試建模不一樣物體之間的 semantic connections, 因此,本文嘗試經過引入一個先驗,來解決該問題。app
2. The Proposed Method : dom
本文所提出的方法如圖 2 所示。咱們開發了一種 DNN 能夠將 spatial,image and textual features 以一種新穎的方式進行組合,進行問題的回答。咱們的模型首先利用 Word embedding 和 RNN 模型來計算獲得問題的表達,以及一系列的物體描述(object descriptor),包括:bounding box corrdinates, image features vectors。咱們的 graph learning module 而後基於給定的問題,去學習一個 adjacency matrix。這個鄰接矩陣確保下一層 -the spatial graph convolutions- 可使其不但聚焦於 the objects,並且能夠聚焦在於問題相關的物體關係上。咱們卷積圖特徵,隨後通過 max-pooling,與 question embedding 組合在一塊兒,利用一個簡單的元素級相乘,從而能夠預測一個答案。ide
2.1 Computing model inputs : 函數
第一個階段是:計算輸入圖像和問題的 embedding。咱們將給定的圖像,用物體檢測算法轉換爲 K 個 visual features。物體檢測模型是咱們方法的必要步驟,由於每個 bounding box 都將在 question specific graph representations 上做爲一個節點。對於每個提出的 bounding box 都將會有一個 embedding,即:對應區域的卷積特徵。利用這種 object features 在其餘工做中已經被證實能夠提高 VQA 的效果,由於這使得模型能夠聚焦於 object-level feature,而不只僅是 CNN feature。對於每個 question,咱們利用一個 pre-trained Word embeddings 將問題轉換爲向量。而後用動態 GRU 模型,來進一步將句子編碼爲向量 q。
2.2 Graph Learner :
本小結是全文最重要的貢獻部分了:圖學習模塊(the graph learner module)。該模塊產生了一個基於 question 的圖像的 graphical representation。該模塊是比較 general 的,而且容易實現,學習到的複雜 feature 之間的關係,是可解釋的且問題相關的。學習到的 graph structure 經過定義的 node neighborhoods 來驅動空間圖卷積,容許 unary 和 pairwise attention 能夠被很天然的的學習到,由於 adjacency matrix 包含 self loops。
咱們想構建一個無向圖 g = {V, E, A},E 是邊的集合,A 是對應的鄰接矩陣。每個頂點 v 對應的是檢測到的物體(包圍盒的座標 以及 特徵向量)。咱們想學習一個鄰接矩陣 A,使得每個 edge $(i, j, A_{ij})$ 是基於問題特徵 q 。直觀的來說,咱們須要建模 feature vectors 之間的類似性,及其餘們與 given question 之間的相關性。因此,咱們將 question embedding q 與每個 visual features $v_n$ 進行組合,獲得 $[v_n][q]$。咱們而後計算該聯合映射:
其中,F 是非線性函數。經過將該 joint embedding $e_n$ 進行組合,獲得矩陣 E,這樣就能夠定義一個鄰接矩陣,帶有 self loops,$A = EE^T$,其中,$A_{i,j} = e^T_i e_j$。
這種定義不會在圖的稀疏性上有額外的約束,因此,能夠產生一個全鏈接的鄰接矩陣。這種學習到的 graph structure 將會被當作是接下來 圖卷積層的 backbone,目標是:learn a representation of object features that is conditioned on the most relevant, question-specific neighbours。這須要該 sparse graph structure 聚焦於圖像中最相關的部分。爲了學習一個每個節點的稀疏鄰接系統,咱們採用 ranking 的方法:
其中,topm 返回的是:輸入向量中前 m 個最大值的索引,$a_i$ 表示的是鄰接矩陣的第 i 行。換句話說,給定節點的鄰接系統將會對應與該節點有最強連接的 nodes。
2.3 Spatial Graph Convolutions:
給定一個特定問題的 graph structure,咱們探索一種圖卷積的方法去學習一種新的目標表達(that are informed by a neighborhood system tailored to answer the given question)。圖的頂點 V (BBox 的位置及其 feature)能夠經過他們的在圖像中的位置進行刻畫,能夠在空間上對他們的聯繫進行建模。此外,許多 VQA 問題須要該模型有關於:the model has an awareness of the orientation and relative position of features in an image, 可是許多以前的方法都忽略了這一點。
咱們使用一種 graph CNN 方法,直接在 graph domain 上依賴於空間關係直接進行操做。關鍵的是,他們的方法經過 pairwise pseudo-coordinate function u(i, j) 來捕獲 spatial information,對於每個 vertex i,以 i 爲座標系統,u(i, j) 是那個系統中的 vertex j 的座標。咱們的 pseudo-coordinate function u(i, j) 返回了一個極座標向量 $\ro, \theta$,表述了頂點 i 和 j 的 BBox 的空間相對位置。咱們將 Cartesian 和 Polar 座標做爲 Gaussian kernels 的輸入,而且觀察看:polar coordinates 效果更好。咱們認爲這是由於極座標分爲:方向和距離,提供了兩個角度來表示空間關係。
一個特別的步驟和挑戰是:the definition of a patch operator describing the influence of each neighbouring node that is robust to irregular neighbourhood structures. Monti et al. 提出使用 K個 可學習均值和協方差的 Gaussian kernels,均值能夠理解爲 pseudo coordinate 的方向和距離。對每個 k,咱們獲得一個 kernel weight $w_k(u)$,the patch operator is defined at kernel k for node i as:
其中,$f_n(i)$ 和 $N(i)$ 表明如公式 2 所示的頂點 i 的近鄰,咱們將每個 patch operator 的輸出看作是:近鄰特徵的加權求和(a weighted sum of the neighbouring features), 高斯核的集合描述了每個近鄰在卷積操做輸出時的影響。
咱們調整 patch operator 使其包含一個額外的基於產生的 graph edges 的加權因子:
$\alpha_{ij} = s(a_i)_j$,$s(.)_j$ 是一個 scaling function 的第 j 個元素 (此處定義爲 a softmax of the selected adjacency matrix elements)。這種更加 general 的形式意味着不一樣頂點之間的信息傳遞的強度能夠經過除了空間位置以外的信息進行加權。在本文的模型中,能夠理解爲:根據回答問題的狀況,咱們應該對兩個 nodes 之間的關係關注多少。因此,該網絡學習基於問題以 pairwise 的方式去關注 visual features。
最終,咱們定義在頂點 i 的卷積操做的輸出爲,K 個 kernels 的組合:
其中,每個 $G_k$ 是一個可學習權重矩陣(即:卷積核)。這能夠輸出一個卷積後的圖表示 H。
2.4 Prediction Layers :
經過上述步驟,咱們能夠獲得考慮結構化建模的特徵輸出,而後就能夠進行答案的預測了。本文的作法是經過 max-pooling layer 獲得 graph $h_{max}$ 的 global vector representation。做者將問題特徵 q 和 image $h_{max}$ 經過一個元素級相乘進行融合。而後用兩層 MLP 來計算分類得分。
2.5 Loss Function:
損失函數通常是採用交叉熵損失函數進行。做者採用和 [Tips and tricks for visual question answering: Learnings from the 2017 challenge] 相似的方法來處理。
3. Experiments:
==