一文帶你了解視覺問答VQA

A Brief Introduction for Visual Question Answer

Visual Question Answer (VQA) 是對視覺圖像的自然語言問答,作為視覺理解 (Visual Understanding) 的一個研究方向,連接著視覺和語言,模型需要在理解圖像的基礎(chǔ)上,根據(jù)具體的問題然后做出回答。本文將簡短的對VQA做一個調(diào)研,涉及一小部分論文,作為入門。


VQA example

一切從一篇17年發(fā)表在期刊Computer Vision and Image Understanding上的survey說起。

Visual question answering: A survey of methods and datasets, Qi Wu et.al

Visual Question Answering (VQA) is a challenging task that has received increasing attention from both the computer vision and the natural language processing communities. Given an image and a question in natural language, it requires reasoning over visual elements of the image and general knowledge to infer the correct answer. In the first part of this survey, we examine the state of the art by comparing modern approaches to the problem. We classify methods by their mechanism to connect the visual and textual modalities. In particular, we examine the common approach of combining convolutional and recurrent neural networks to map images and questions to a common feature space. We also discuss memory-augmented and modular architectures that interface with structured knowledge bases. In the second part of this survey, we review the datasets available for training and evaluating VQA systems. The various datatsets contain questions at different levels of complexity, which require different capabilities and types of reasoning. We examine in depth the question/answer pairs from the Visual Genome project, and evaluate the relevance of the structured annotations of images with scene graphs for VQA. Finally, we discuss promising future directions for the field, in particular the connection to structured knowledge bases and the use of natural language processing models.

這篇論文介紹了一些方法,數(shù)據(jù)集以及未來的研究方向。其中方法大部分是16年前的,調(diào)研將會涉及幾篇17年后的論文。

Method

VQA的模型一般是先分別對圖像和問題提取特征,然后聯(lián)合這兩個做一些多模態(tài)融合(如element-wise product, MCB,MFB),attention,知識補充等處理,最終經(jīng)過分類器輸出answer。關(guān)于特征提取,對于圖像image:使用VGG,Resnet,... pretrained on object recognition/detection;對于問題question:使用LSTM, GRU, ... GloVe word embedding。
論文將目前的方法歸為四類(四種 tips/tricks 用于VQA):

1. 聯(lián)合嵌入方法(joint embedding approaches)

學(xué)習(xí)視覺與自然語言的兩個不同模態(tài)特征在一個共同的特征空間的嵌入表達(dá)(embedding)。


joint embedding
  • 簡單方式:
    簡單的多模態(tài)的特征融合方法有element-wise product (multiply) / element-wise sum, concatenation,增加額外層的 concatenation + FCL/CNN/LSTM 等等。

    concatenation + LSTM方式,來自Ask Your Neurons: A Neural-based Approach to Answering Questions about Images, ICCV 2015, Fig 1.

    除了這些,一些論文提出了其他解決方案,這里只列舉幾個:

  • MRN, Multimodal Residual Learning for Visual QA, 16
    這篇論文使用Q經(jīng)過一層Neural得到權(quán)重,乘以V經(jīng)過兩層映射得到的特征,并經(jīng)過多級殘差連接。

    MRN

  • MCB, Multimodal Compact Bilinear Pooling for Visual Question Answering and Visual Grounding
    Bilinear源于Bilinear CNN,通過對兩個CNN得到的兩個特征,然后進(jìn)行外積。論文將其用在多模態(tài)融合之中。
    兩個向量x,q,進(jìn)行outer product 外積后線性變換W,得到隱含表達(dá)z。


    然而,當(dāng)x,q,z維度很大時,W的參數(shù)將十分巨大。為了解決這個問題,論文提出MCB的方法:

    視覺特征x和文本特征q經(jīng)過一個算法(具體可以看原論文),得到一個表達(dá),然后經(jīng)過卷積/FFT得到融合后的結(jié)果。
    總體框架如圖:

    MCB作為一個模塊被用于結(jié)合圖像特征和文本特征。

  • MFB, Multi-modal Factorized Bilinear Pooling with Co-Attention Learning for Visual Question Answering, ICCV 2017
    同MCB類似,MFB也是用于融合圖像和文本特征。論文使用矩陣分解及sum pooling方法,

矩陣分解(Factorized): z_i=x^T W_i y, W_i \ \in R^{m \times n}, 將W_i分解為U_iV_i^T, 最后得到 z_i=1^T(U_i^Tx \circ V_i^Ty) (關(guān)于更多細(xì)節(jié)可參考原文)

MFB

總的框架比MCB多了question attention:


MFB
  • ...

2. 注意力機制(attention mechanisms)

注意力機制已經(jīng)廣泛應(yīng)用到NLP,image caption,VQA等中,在VQA中,attention能夠根據(jù)具體的問題Q,把重點集中在想要的圖像特征中(權(quán)重),最后給出答案。


Attention

如上圖所示,通過問題Q的特征和圖像特征組合,經(jīng)過網(wǎng)絡(luò),公式或者其他方法得到每個圖像特征V = (v_1, ..., v_k)的權(quán)重,將權(quán)重乘上V,再聯(lián)合輸入到分類器or生成器中產(chǎn)生answer。
除了圖像上的attention外,MFB的論文還對問題Q本身也做一個attetion,并把兩個attention稱為co-attention。

3. 組合模型(compositional models)

把模型分解為模塊的組合的方法,模塊化有利于任務(wù)分解,重用等。survey論文主要介紹了兩篇論文:
(1)The Neural Module Networks (NMN)
這篇論文的大致思路是將問題進(jìn)行語義分析,得到語法樹,然后使用特定的模塊來代替樹的每個節(jié)點,最后構(gòu)成一個總的模型,如下圖所示的一個例子“Is there a red shape above a circle?”。


The Neural Module Networks (NMN)

(2)Dynamic Memory Networks
動態(tài)記憶就是將輸入重復(fù)經(jīng)過一個記憶模塊,更新記憶,最后得到一個最終記憶,然后得到answer。這種方法把模型分為四個模塊(跟一篇閱讀理解/QA的論文ask me anything的結(jié)構(gòu)類似):問題模塊,圖像模塊,記憶模塊,輸出模塊。


Dynamic Memory Networks

4. 知識增強方法(knowledge base-enhanced approaches)

結(jié)合圖片以外的額外的知識,如關(guān)于某個詞的描述。
下面將給出一篇相關(guān)的論文:

(1) Attributes
屬性是一個高層的概念的表達(dá)(從人的角度看)。一般我們提取到的特征是高層的,隱含語義,不可解釋的,而這篇論文使用了高層的屬性來表達(dá)特征向量V_{attr},每個值表示對應(yīng)屬性的概率。下圖是image caption的框架:


屬性是從圖片的captions中提取詞,然后去常見詞得到的一個集合。Predict是多屬性Multi-label預(yù)測,然后訓(xùn)練得到輸出為V_{attr}的網(wǎng)絡(luò)。第二部分利用得到的屬性向量V_{attr},使用LSTM來生成caption。
這種高層的語義屬性用來生成caption的方法,我覺得是不妥的,因為雖然它得到很多屬性的概率值,但是丟失了屬性之間的關(guān)系,比如位置信息等等。

(2) External Knowledge
額外知識的獲取是從DBpedia中獲取前5個屬性的相關(guān)描述,然后轉(zhuǎn)換為向量表達(dá)。最后聯(lián)合文檔向量,屬性向量,captions向量,問題來生成問題答案。


這種額外的知識是比較簡單的,就是一段關(guān)于屬性的語言描述,更復(fù)雜包括知識圖譜運用或者隱含知識表達(dá)等等知識的利用將有利于問答。有監(jiān)督學(xué)習(xí)學(xué)習(xí)到的是數(shù)據(jù)中包含的知識,但是我們的訓(xùn)練數(shù)據(jù)并不能覆蓋整個世界的所有知識,這是一個弊端。如何利用好知識與推理正是目前深度學(xué)習(xí)的一個挑戰(zhàn)。

Datasets

論文給出了13個數(shù)據(jù)集,除了下表的,還有Diagrams(一個圖表的數(shù)據(jù)集),Shapes(一個形狀,顏色的物體的合成數(shù)據(jù)集)。根據(jù)答案的類型可以分為兩種:open-ended(開放式的)和multiple choice(多選項的)。


其中VQA,Visual Genome是比較常用的數(shù)據(jù)集。

  1. VQA
    這個從16年開始就有challenge比賽,基于COCO的圖,是最常用的數(shù)據(jù)集,目前是2.0版本,相比于1.0平衡了問題類型的數(shù)量和一個問題會對應(yīng)幾張圖。
    例子:
  2. Visual Genome
    斯坦福的一個數(shù)據(jù)集,它不僅包含圖片,問題和答案,還包含了Region Descriptions,Object Instances,Attributes,Relationships。

    有一些論文用這個數(shù)據(jù)集的屬性信息和問答做數(shù)據(jù)增強,然后用于VQA數(shù)據(jù)集。這里可見在有監(jiān)督學(xué)習(xí)下數(shù)據(jù)的重要性。

Perfomance

準(zhǔn)確率acc:


下表列出的不是survey論文中的,而是論文Bottom-Up and Top-Down Attention for Image Captioning
and Visual Question Answering
中的, 這論文是CVPR 2018 full oral, winner of the 2017 Visual Question Answering challenge。這篇論文算是較前沿的,在表示圖像特征集合V時,不是劃分區(qū)域的方式,而是在object層面表達(dá)特征,然后用于attention選取。論文使用了Faster RCNN來識別object和attributes,稱之為bottom-up attention,這也是目前被廣泛使用的方式了(從VQA challenge 2018中的方法描述得知)。

其中HDU杭電的方法使用的是前面介紹的MFB,也是他們提出的方法,性能也算不錯了。目前的leaderboard(已截止)是:

可以看出目前的方法有了一點點提升,然而還是有許多不足的,比如Number計數(shù)類問題的準(zhǔn)確率就很低,可見目前的模型對知識,圖像理解還差得多()。
從VQA challenge的方法描述中得知bottom-up attention是很多方法采用的。

Facebook FAIR-A的描述:Our long-term goal is to create a VQA library where novel models can be easily composed from existing (or new) modules – visual encoders, question encoders, question-based attention mechanisms, and answer predictors. For our entry, we used Bottom-Up Town-Down attention over bounding-box proposes from the faster-RCNN object detector, attention to the question encoding, used Hadamard product instead of concatenation to combine question and image features. Moreover, we adopted a warm-up based learning schedule, fine-tuned the image features, and augmented our training data using Visual Genome and Visual Dialog datasets as well as image mirroring. Finally, we averaged the predictions from a diverse ensemble of models. These models used image features from Faster R-CNN models with feature pyramid networks with different parameter settings and/or initial seeds.

Discuss

作為需要視覺理解與推理能力的,介于Vision與NLP間的視覺問答VQA,是一個有趣而又充滿挑戰(zhàn)的問題。它的進(jìn)步不僅依賴于計算機視覺的發(fā)展和自然語言處理的能力,還需要對圖像的理解——視覺基礎(chǔ)能力,如識別,檢測等,同時學(xué)習(xí)到知識與推理的能力。然而,這條路還有很長的距離要走,或許目前大部分方法只不過是對訓(xùn)練數(shù)據(jù)的擬合分類,并沒有理解,也可能包含著語言先驗(見CVPR2018論文Don’t Just Assume; Look and Answer: Overcoming Priors for Visual Question Answering)。因此,一個真正理解圖像,能夠?qū)W習(xí)到知識和推理能力的模型才是最終目標(biāo)。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 前幾天把車停在賓館門前去超市買東西,等出來時,一輛轎車檔住我車了,貼得很緊! 我看車上有挪車電話,就打了過去,...
    RainyCai閱讀 200評論 0 1
  • 中原區(qū)塊鏈,見證你的成長,與你同行。60秒?yún)^(qū)塊鏈,要聞速遞。 韓國政府對當(dāng)?shù)乇忍貛判袠I(yè)的發(fā)展仍保持高度樂觀,并最近...
    蒙面加菲貓閱讀 322評論 0 0

友情鏈接更多精彩內(nèi)容