论文笔记:Image Captioning with Semantic Attention
来源:互联网 发布:海龟交易源码 编辑:程序博客网 时间:2024/05/22 00:17
论文链接:Image Captioning with Semantic Attention
框架
与普通的image Caption框架相比,论文从图片中提取了visual attribute(实际上就是一些单词),并把这些attribute结合进了input跟output attention model里面。
整个框架的公式如下:
对于这个attributes, 文章提出了三种方法来提取,分别是:
1. 在数据库查找相近的图片并选择其标签
2. 使用多标签的分类器
3. 使用全卷积网络(FCN)
而文章重点并不在这里,就不详细介绍了
文章把自己的做法和Show Attend and Tell的做法进行了对比,得出了几点主要的区别:
- [2]的attention model由于是从CNN中提取的feature,需要固定的分辨率,而本文的concepts则没有分辨率的限制(attributes 的三种提取方法都不需要固定分辨率),这个concepts甚至也不需要在图片中有直接的展现。
- 本文有一个结合了top-down information (the global visual feature,CNN信息) 和bottom-up concepts(attributes)的feedback过程(个人疑问1:这个feed back体现在哪里?),而[2]并没有这个过程。
- [2]在图片特定的位置使用了pretrained CNN提取出的feature,而本文使用了word feature,因此可以使用外部的图像数据来训练visual concepts,使用文本数据来学习semantics between words。
input attention model
input attention model主要就是计算权重
- exp是指以softmax函数的方式将所有
{Ai} 进行归一化 αit : attributeAi 与前一个预测单词Yt−1 的相关性yt−1, yi :Yt−1 和Ai 的one-hot representationU~∈R|y|×|y| : 词典大小的矩阵。我认为可以这样理解,这个矩阵存放着每个单词和其他单词之间的相关性,Yt−1 和Ai 这样的one-hot向量对U~ 相乘就是进行一个查表的操作。这个矩阵因为只跟单词有关,因此同一个单词即使在句子中的不同位置出现,它下一个单词的αit 都是一样的。对αit 的可视化也验证了这一观点:
图中第二行是αit 的变化,可以看到,以单词”a”为例,对于出现在句子中不同位置的单词”a”,对应的attribute权重α 都是一样的
- 由于
U~ 的维度太大,这里加入了word embedding 矩阵E 来进行降维。E 是以Word2Vec或者Glove来单独训练的,不参与最后的训练
wx,A 对visual attributes在word space的每个维度的相对重要性进行了建模。个人理解因为E 是单独训练的,存在一个不对应的问题,所以要加入wx,A xt 作为模型的输入,这里把直接把attention部分和前一个单词的部分直接相加了,感觉应该用concatenate的方式会好一点?
output attention model
output attention model基本跟前面input attention model类似。
原文对
a different set of attention scores are calculated since visual concepts may be attended in different orders during the analysis and synthesis processes of a single sentence.
- 由于加入了随时间变化的
hTt ,所以βit 跟αit 不一样。在不同位置的同一单词对下一个单词的βit 是会变化的 V∈Rn×d :可以理解为V建立了隐状态ht 与单词的embedding之间的相关性- 因为
ht 输出的时候经历了一个非线性变换,因此这里也要加入激活函数σ 来对Eyi 进行同样的变换
- 最后单词概率分布的输出,基本跟前面一样
loss
- 损失函数前面部分和以往的做法一样
ΘA={U,V,W∗,∗,w∗,∗} ΘR : RNN中所有参数g(α), g(β) :{αit} 和{βit} 的正则化
- p > 1 对在整个句子中对一的
Ai 的过度attention进行惩罚 - 0 < q < 1 对任意时刻的分散attention进行惩罚
实验
文章是当时state-of-the-art的结果。
作者测试了单独使用input或者output attention的效果,发现只使用一个的话只对模型只有少量的提升,但同时使用则有较大提升,说明两个具有比较强的协同作用。
而对于attributes的提取,作者发现使用FCN的效果是最好的。
对于attributes的使用,除了前面介绍的attention方法ATT,作者还测试了MAX和CON(concatenate),效果都没有ATT好。
总结
文章提出了新的attention模型,结合了top-down和bottom-up的机制,在利用image的overview的同时也利用了丰富的visual semantic aspects。模型的真正威力在于对这些aspects的关注,以及把全局和局部信息利用起来生成更好的captioin。
参考:
https://lisabug.github.io/2016/03/17/image-captioning-with-semantic-attention/
- 论文笔记:Image Captioning with Semantic Attention
- 论文笔记:Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering
- 论文阅读-《Semantic Segmentation with Reverse Attention》
- Attention to Scale: Scale-Aware Semantic Image Segmentation论文阅读笔记
- [深度学习论文笔记][Attention]Show, Attend, and Tell: Neural Image Caption Generation with Visual Attention
- 论文笔记:Self-critical Sequence Training for Image Captioning
- 论文笔记:Aligning where to see and what to tell: image caption with region-based attention ...
- Video Captioning with Multi-Faceted Attention
- 论文阅读:Neural Image Caption Generation with Visual Attention
- Video Captioning with Transferred Semantic Attributes
- 17-11-22 Deep Reinforcement Learning-based Image Captioning with Embedding Reward论文随笔
- 论文笔记:Residual Attention Network for Image Classification
- 【论文笔记】Deep Visual-Semantic Alignments for Generating Image Description
- 【论文笔记】Show and Tell: Lesson learned from the 2015 MSCOCO Image Captioning Challenge
- 【论文笔记】Neural Relation Extraction with Multi-lingual Attention
- 论文笔记《Feedforward semantic segmentation with zoom-out features》
- [深度学习论文笔记][Image to Sentence Generation] Deep Visual-Semantic Alignments for Generating Image Descri
- 深度学习论文(九)---DeepLabV2-Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution,
- txt文件解析简易框架
- spring整合Hibernate使用set方式注入sessionFactory问题
- 2017.10.17 測試總結并今日總結
- Spring Boot(一)——入门环境搭建
- Linux网络编程知识点
- 论文笔记:Image Captioning with Semantic Attention
- Android 左右侧滑菜单的实现
- 信息论:熵与互信息
- centos 安装 matplotlib
- 性能测试——系统业务指标
- mybatis的日期格式
- mobilenet
- 无限极
- 编程之reverseWords