Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks

2023-10-24 16:21

本文主要是介绍Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目录

  • Oscar Pre-training
  • Adapting to V+L Tasks
  • Experimental Results & Analysis
    • Performance Comparison with SoTA
    • Qualitative Studies
  • References

OSCAR: Object-SemantiCs Aligned pRe-training

在这里插入图片描述

Oscar Pre-training

Input

  • Oscar 将每个输入的 image-text pair 都表示为 Word-Tag-Image triple ( w , q , v ) (w, q, v) (w,q,v),其中 w w w 为文本的 word embedding 序列, q q q 为图像中检测出的 object tags (以文本的方式输入模型) 的 word embedding 序列, v v v 为图像的 region vectors
    在这里插入图片描述
  • The object tags are used as anchor points to align image regions with word embeddings of pre-trained language models: Oscar 引入 q q q 作为 anchor points 可以加强模型 image-text alignment 的能力,该结论是基于以下观察:在 image-text pair 中,图像里出现的重要物体往往也会出现在文本中,并使用与 object tags 相同或近义的词汇。由于 q q q w w w 都属于语言模态,因此模型更容易找到它们之间的对齐关系。某个文本的 word embedding 如果与某个 Object tag 比较相似,那么该 word embedding 也应该与 Object tag 对应的 image region 有较大的注意力权重 (dictionary look up)。同时,这个方法也有助于减少图像区域的 Ambiguity,也就是区分 vision space 中十分相似但 language space 中十分不同的物体。送入 V+L 模型的 image regions 通常是 over-sampled,这导致不同图像区域都有较大重合,但从图像上难以区分。如下图 c c c 所示,couch 和 dog 在 image region features 上十分相似,但在 word semantic space 中十分不同
    在这里插入图片描述
  • v v v q q q 的具体生成方法如下:给定一张带有 K K K 个 regions of objects 的图片 (normally over-sampled and noisy),使用 Faster R-CNN 抽取出每个 region 的特征 ( v ′ , z ) (v',z) (v,z),其中 v ′ ∈ R P v'\in \R^P vRP 是一个 P P P 维向量 ( P = 2048 P=2048 P=2048), z z z 是一个 R R R 维向量 ( R = 4 R=4 R=4 or 6 6 6, It includes coordinates of top-left & bottom-right corners, and/or height & width.). 接着将 v ′ v' v z z z 连接后送入全连接层,将其映射到与 word embedding 相同的维数得到 v v v。同时,使用同一个 Faster R-CNN 检测一系列的高精度 object tags, q q q 即为这些 object tags 对应的 word embeddings 的序列

Pre-Training Objective

  • Oscar 的输入 ( w , q , v ) (w,q,v) (w,q,v) 可以从两个角度来看:
    在这里插入图片描述其中 x x xmodality view,用于区分文本和图像表示; x ′ x' xdictionary view,用于区分两个不同的语义空间。这两种不同的视角可以让我们设计出一个全新的预训练目标
  • A Dictionary View: Masked Token Loss: 设 h = [ w , q ] h=[w,q] h=[w,q] 为 discrete token sequence。类似 BERT 中的 masked language model,设置 Masked Token Loss (MTL) 作为预训练任务。在每个迭代中,用 [MASK] 遮盖 h h h 中 15% 的 tokens,损失函数如下:
    在这里插入图片描述

关于 Dictionary 的解释:A semantic space can be viewed a vector space defined by a dictionary, which maps an input to a vector representation in the semantic space. For example, BERT can be viewed as a dictionary that defines a linguistic semantic space. BERT maps an input word or word sequence into a feature vector in the semantic space.

  • A Modality View: Contrastive Loss: 设 h ′ = [ q , v ] h'= [q, v] h=[q,v] 表示图像模态。有 50% 的几率随机从数据集 D \mathcal D D 中采样一个 tag sequence 来替代原来的 q q q,组成 “polluted” image representations。然后在 [CLS] 对应的输出后添加一个 FC 层 f ( . ) f(.) f(.) 用于二分类,判断当前 ( w , h ′ ) (w,h') (w,h) 包含的是否是原来的 image representation
    在这里插入图片描述
  • The full pre-training objective:
    在这里插入图片描述During the cross-modal pre-training, we utilize object tags as the proxy of images to adjust the word embedding space of BERT, where a text is similar to its paired image (or more specifically, the object tags detected from the image), and dissimilar to the polluted ones.

Pre-training Corpus

  • We have built the pre-training corpus based on the existing V+L datasets, including COCO, Conceptual Captions (CC), SBU captions, flicker30k, GQA etc… In total, the unique image set is 4.1 million, and the corpus consists of 6.5 million text-tag-image triples, which is less than 9.6 million pairs used for UNITER pre-training and 9.18 million pairs for LXMERT.

Implementation Details

  • 我们预训练了两个模型: OSCAR B \text{OSCAR}_\text{B} OSCARB OSCAR L \text{OSCAR}_\text{L} OSCARL,分别使用 BERT BASE \text{BERT}_\text{BASE} BERTBASE BERT LARGE \text{BERT}_\text{LARGE} BERTLARGE 的参数进行初始化 (The sequence length of discrete tokens h h h and region features v v v are 35 and 50, respectively.)

Adapting to V+L Tasks

Experimental Results & Analysis

Performance Comparison with SoTA

在这里插入图片描述

在这里插入图片描述

Qualitative Studies

  • 我们用 t t t-SNE 对 image region 和 word token 的 features 在 2D map 上进行了可视化。可以看出,在 object tags 的帮助下,不同模态的同一物体之间的距离被大幅缩小 (e.g. person, zebra),相近语义的物体间的距离也变得更小 (e.g. animal (person, zebra, sheep, bird))
    在这里插入图片描述这更加说明了 object tags 对于 alignment learning 的重要性: it plays the role of anchor points in linking and regularizing the cross-modal feature learning.

References

  • Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks
  • The code and pre-trained models are released: https://github.com/microsoft/Oscar

这篇关于Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/276392

相关文章

2014 Multi-University Training Contest 8小记

1002 计算几何 最大的速度才可能拥有无限的面积。 最大的速度的点 求凸包, 凸包上的点( 注意不是端点 ) 才拥有无限的面积 注意 :  凸包上如果有重点则不满足。 另外最大的速度为0也不行的。 int cmp(double x){if(fabs(x) < 1e-8) return 0 ;if(x > 0) return 1 ;return -1 ;}struct poin

2014 Multi-University Training Contest 7小记

1003   数学 , 先暴力再解方程。 在b进制下是个2 , 3 位数的 大概是10000进制以上 。这部分解方程 2-10000 直接暴力 typedef long long LL ;LL n ;int ok(int b){LL m = n ;int c ;while(m){c = m % b ;if(c == 3 || c == 4 || c == 5 ||

2014 Multi-University Training Contest 6小记

1003  贪心 对于111...10....000 这样的序列,  a 为1的个数,b为0的个数,易得当 x= a / (a + b) 时 f最小。 讲串分成若干段  1..10..0   ,  1..10..0 ,  要满足x非递减 。  对于 xi > xi+1  这样的合并 即可。 const int maxn = 100008 ;struct Node{int

论文翻译:arxiv-2024 Benchmark Data Contamination of Large Language Models: A Survey

Benchmark Data Contamination of Large Language Models: A Survey https://arxiv.org/abs/2406.04244 大规模语言模型的基准数据污染:一项综述 文章目录 大规模语言模型的基准数据污染:一项综述摘要1 引言 摘要 大规模语言模型(LLMs),如GPT-4、Claude-3和Gemini的快

论文翻译:ICLR-2024 PROVING TEST SET CONTAMINATION IN BLACK BOX LANGUAGE MODELS

PROVING TEST SET CONTAMINATION IN BLACK BOX LANGUAGE MODELS https://openreview.net/forum?id=KS8mIvetg2 验证测试集污染在黑盒语言模型中 文章目录 验证测试集污染在黑盒语言模型中摘要1 引言 摘要 大型语言模型是在大量互联网数据上训练的,这引发了人们的担忧和猜测,即它们可能已

【Python报错已解决】AttributeError: ‘list‘ object has no attribute ‘text‘

🎬 鸽芷咕:个人主页  🔥 个人专栏: 《C++干货基地》《粉丝福利》 ⛺️生活的理想,就是为了理想的生活! 文章目录 前言一、问题描述1.1 报错示例1.2 报错分析1.3 解决思路 二、解决方法2.1 方法一:检查属性名2.2 步骤二:访问列表元素的属性 三、其他解决方法四、总结 前言 在Python编程中,属性错误(At

UML- 统一建模语言(Unified Modeling Language)创建项目的序列图及类图

陈科肇 ============= 1.主要模型 在UML系统开发中有三个主要的模型: 功能模型:从用户的角度展示系统的功能,包括用例图。 对象模型:采用对象、属性、操作、关联等概念展示系统的结构和基础,包括类图、对象图、包图。 动态模型:展现系统的内部行为。 包括序列图、活动图、状态图。 因为要创建个人空间项目并不是一个很大的项目,我这里只须关注两种图的创建就可以了,而在开始创建UML图

速通GPT-3:Language Models are Few-Shot Learners全文解读

文章目录 论文实验总览1. 任务设置与测试策略2. 任务类别3. 关键实验结果4. 数据污染与实验局限性5. 总结与贡献 Abstract1. 概括2. 具体分析3. 摘要全文翻译4. 为什么不需要梯度更新或微调⭐ Introduction1. 概括2. 具体分析3. 进一步分析 Approach1. 概括2. 具体分析3. 进一步分析 Results1. 概括2. 具体分析2.1 语言模型

Post-Training有多重要?一文带你了解全部细节

1. 简介 随着LLM学界和工业界日新月异的发展,不仅预训练所用的算力和数据正在疯狂内卷,后训练(post-training)的对齐和微调方法也在不断更新。InstructGPT、WebGPT等较早发布的模型使用标准RLHF方法,其中的数据管理风格和规模似乎已经过时。近来,Meta、谷歌和英伟达等AI巨头纷纷发布开源模型,附带发布详尽的论文或报告,包括Llama 3.1、Nemotron 340

error while loading shared libraries: libnuma.so.1: cannot open shared object file:

腾讯云CentOS,安装Mysql时: 1.yum remove libnuma.so.1 2.yum install numactl.x86_64