Hierarchical Question-Image Co-Attention for Visual Question Answering
Hierarchical Question-Image Co-Attention for Visual Question Answering
NIPS 2016
Paper: https://arxiv.org/pdf/1606.00061.pdf
Code: https://github.com/jiasenlu/HieCoAttenVQA
Related Blog: 【AI前沿】机器阅读理解与问答·Dynamic Co-Attention Networks
Introduction:
本文提出了一种新的联合图像和文本特征的协同显著性的概念,使得两个不同模态的特征可以相互引导。
此外,作者也对输入的文本信息,从多个角度进行加权处理,构建多个不同层次的 image-question co-attention maps,即:word-level,phrase-level and question-level。
最后,在 phrase level,我们提出一种新颖的 卷积-池化策略(convolution-pooling strategy)来自适应的选择 the phase size。
Methods:
1. Notation:
问题 Q = {q1, ... , qT},其中 qt 是第 t 个单词的特征向量。我们用 qtw, qtp, qts 分别表示 在位置 t 处的 Word embedding,phrase embedding 以及 question embedding。
图像特征表示为 V = {v1, ... ,vN},其中,vn 是空间位置 n 处的特征向量。
图像和问题的 co-attention features 在每一个层次,都可以表示为:v^, q^。
不同模块和层的权重可以表示为 W。
2. Question Hierarchy:
给定 the 1-hot encoding of the question words Q, 我们首先将单词映射到单词空间,以得到:Qw. 为了计算词汇的特征,我们采用在单词映射向量上采用 1-D 卷积。具体来说,在每一个单词位置,我们计算 the Word vectors with filters of three window sizes 的内积:unigram, bigram and trigram. 对于第 t 个单词,在窗口大小为 s 时的卷积输出为:
其中,Wcs 是权重参数。单词级别的向量 Qw 是 approximately 0-padding before feeding into bigram and trigram convolutions to maintain the length of the sequence after convolution. 给定卷积的结果,我们然后 在每一个单词位置,跨越不同的 n-grams 采用 max-pooling 以得到 phrase-level features:
我们的 pooling method 不同于前人的方法,可以自适应的选择 different gram features at each time step, 并且可以保持原始序列的长度和序列。我们利用 LSTM 来编码 max-pooling 之后的 sequence 。对应的 question-level feature 是第 t 个时间步骤的 LSTM hidden vector。
3. Co-Attention:
我们提出两种协同显著的机制(two co-attention mechanism),第一种是 parallel co-attention,同时产生 image 和 question attention。第二种是 alternating co-attention,顺序的产生 image 和 question attentions。如图2所示,这些 co-attention mechanisms 可以在所有问题等级上执行。
【Parallel Co-Attention】 这种 attention 机制尝试同时对 image 和 question 进行 attend。我们通过计算 图像 和 问题特征在所有的 image-locations and question-locations 进行相似度的计算。具体来说,给定一个图像特征图 V,以及 问题的表达 Q,放射矩阵 (the affinity matrix)C 可以计算如下:
其中,Wb 包括了权重。在计算得到 affinity matrix 之后,计算 image attention 的一种可能的方法是:simply maximize out the affinity over the locations of other modality, i.e.
并非选择 the max activation,我们发现如果我们将这个 affinity matrix 看做是一个 feature,然后学习去预测 image 和 question attention maps 可以提升最终的结果:
其中 Wv 和 Wq,whv,whq 是权重参数。av 和 aq 是每一个图像区域 vn 和 单词 qt 的 attention probability。放射矩阵 C 将 question attention space 转换为 image attention space. 基于上述 attention weights,图像 和 问题 attention vectors 可以看做是 image feature 和 question feature 的加权求和:
【Alternating Co-Attention】分步的协同 attention ,简单来讲,包括三个步骤:
1)summarize the question into a single vecror q;
2)attend to the image based on the question summary q ;
3)attend to the question based on the attended image feature.
我们定义 attention operation x^ = A(X; g),将图像特征 X 以及 从问题得到的 attention guidance g 作为输入,然后输出 the attended image vector。这些操作可以表达为:
其中,空心符号1 是元素全为 1 的向量。
4. Encoding for Predicting Answers :
我们将 VQA 看做是一个 classification task,我们从所有的三个层次的 attended image and question features 来预测答案。我们用 MLP 来迭代的编码 the attention features:
Experiments:
Hierarchical Question-Image Co-Attention for Visual Question Answering的更多相关文章
- 论文阅读:Learning Visual Question Answering by Bootstrapping Hard Attention
Learning Visual Question Answering by Bootstrapping Hard Attention Google DeepMind ECCV-2018 2018 ...
- 论文:Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering-阅读总结
Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering-阅读总结 笔记不能简单的抄写文中 ...
- Visual Question Answering with Memory-Augmented Networks
Visual Question Answering with Memory-Augmented Networks 2018-05-15 20:15:03 Motivation: 虽然 VQA 已经取得 ...
- Learning Conditioned Graph Structures for Interpretable Visual Question Answering
Learning Conditioned Graph Structures for Interpretable Visual Question Answering 2019-05-29 00:29:4 ...
- 【自然语言处理】--视觉问答(Visual Question Answering,VQA)从初始到应用
一.前述 视觉问答(Visual Question Answering,VQA),是一种涉及计算机视觉和自然语言处理的学习任务.这一任务的定义如下: A VQA system takes as inp ...
- 论文笔记:Visual Question Answering as a Meta Learning Task
Visual Question Answering as a Meta Learning Task ECCV 2018 2018-09-13 19:58:08 Paper: http://openac ...
- A Regularized Competition Model for Question Diffi culty Estimation in Community Question Answering Services-20160520
1.Information publication:EMNLP 2014 author:Jing Liu(在前一篇sigir基础上,拓展模型的论文) 2.What 衡量CQA中问题的困难程度,提出从两 ...
- (zhuan) Recurrent Neural Network
Recurrent Neural Network 2016年07月01日 Deep learning Deep learning 字数:24235 this blog from: http:/ ...
- 香侬科技独家对话Facebook人工智能研究院首席科学家Devi Parikh
Facebook 人工智能研究院(FAIR)首席科学家 Devi Parikh 是 2017 年 IJCAI 计算机和思想奖获得者(IJCAI 两个最重要的奖项之一,被誉为国际人工智能领域的「菲尔兹奖 ...
随机推荐
- Marlin 擠出頭溫度控制PID值校正
Marlin 擠出頭溫度控制PID值校正 擠出頭加熱器.溫度感應器安裝好後,先別急著直接指定工作溫度並且加熱.因為控制板上的溫度控制PID參數尚未校正.如果加熱速度過快,有可能會加熱過度並且導致零件燒 ...
- MyBatis学习笔记(二)——使用MyBatis对表执行CRUD操作
转自孤傲苍狼的博客:http://www.cnblogs.com/xdp-gacl/p/4262895.html 上一篇博文MyBatis学习总结(一)——MyBatis快速入门中我们讲了如何使用My ...
- 关于SqlCommand对象的2个方法:ExecuteNonQuery 方法和ExecuteScalar方法
1.SqlCommand.ExecuteNonQuery 方法 对连接执行 Transact-SQL 语句并返回受影响的行数. 语法:public override int ExecuteNonQue ...
- numpy高级应用
reshape重塑数组 ravel 拉平数组 concatenate 最一般化的连接,沿一条轴连接一组数组 # print(np.concatenate([arr1,arr2],axis = 0)) ...
- 判断是移动端还是PC端
// 判断是移动端还是PC端 $http_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USE ...
- 使用tableau去将存入mysql都地区点击率进行了展示 感觉很好用
1.连接数据源很多选项:hive mysql Oracle 等所有数据库 2.写上hive2的那个客户端连接,下边会显示出让我装连接的驱动 ,所有jdbc都需要这样 点进去找到windows的下载一键 ...
- javaweb笔记—02
1.compatible:adj. 兼容的:能共处的:可并立的2.web所有的请求都是http请求,http请求默认的编码是ISO-8859-1,不支持utf-8,要统一设置前台和后台一样,才不会乱码 ...
- P2709 小B的询问(莫队)
P2709 小B的询问 莫队模板 资磁离线询问 维护两个跳来跳去的指针 先分块,蓝后询问按块排序. 蓝后每次指针左右横跳更新答案 #include<iostream> #include&l ...
- fjwc2019 D6T2 密文(trie+贪心)
#194. 「2019冬令营提高组」密文 设$s[i]$表示前$i$个密文的异或和 容易发现,只要知道$s[0]~s[n](s[0]=0)$就可以知道每一位的值. 转化一下,就变成了在完全图上求最小生 ...
- 从技术专家到管理者的思路转变(V1)
作为技术专家出身的管理者,是一种优势(你所做的很多决策可能比非技术出身的管理者更加具有可行性和性价比).也是一种劣势(你可能会过于自恋自己的技术优势).这取决于你在接下去的职业生涯中,如何取舍你的技术 ...