Text + visual reasoning machine, new progress in cross-modality pre-training

Author | Lee, Duan Nan, Zhou Ming

Source | Microsoft Research AI headlines (ID: MSRAsia)

REVIEW machine reasoning requires the use of existing knowledge and inference techniques to judge the input information is not seen, is very important in the field of natural language processing. This article Advances in Microsoft Research Asia in the field of cross-modality pre-training will be presented.

In recent years, natural language processing (NLP) and computer vision (CV) and the integration of the two areas continue to collide, derived from a lot of cross-modal research topics (such as image retrieval and picture quiz). However, due to the base model both areas mostly pure NLP or CV for mission design and training (for example in NLP language model designed for BERT and CV in the picture classification designed ResNet) alone, these models are not well describe the language and the association between visual content. Such learning is associated downstream from the annotation data corresponding to the task is one solution, but due to the size of the largest expenses, the program is still obvious shortcomings.

In response to these problems, we propose cross-modality pre-training model Unicoder-VL. By means of cross-modality pre-trained general areas, the model can be learned associations between the inner and visual language, and combined for generating a visual representation of the vector and language. Experimental results show that takes into account the joint cross-modal vector representation of information can well migrate downstream to the task, and achieved good results. Next, the model introduced briefly Unicoder-VL, and by their use in image retrieval and image inference Q, illustrating the action of the cross-modal model reasoning task.

Cross-modal model pre-trained Unicoder-VL

Unicoder-VL Transformer multi-layer structure as the base model, based representation from synergies between attentional mechanisms of learning the language and language information. We designed four cross-modality pre-training tasks, including: 1) the text language model based on the mask; 2) based on the mask image region prediction category; 3) matching the image text; 4) an image feature generation. Figure 1 shows a schematic view of the model.

Figure 1: Unicoder-VL schematic model

1)基于文本的掩码语言模型。该任务将预训练数据中的 token 以15%概率随机遮挡(mask)。为保证预训练与微调的一致性(微调时不做遮挡),每次选中的遮挡词以80%概率真正遮挡(替换成特殊符号 [MASK]),以10%概率随机替换为其他词,以10%概率保持不变。

2)基于图像区域的掩码类别预测。该任务首先使用 Faster R-CNN 提取图片中每个区域的特征,包括视觉特征(池化后的 ROI 特征)和空间特征(表示其空间位置信息的坐标值)。然后,将视觉特征和空间特征分别输入到全连接层并映射到和语言 token 维度相同的向量空间中,并与该区域对应的文本类别标签向量相加,得到每个图像区域对应的输入向量表示。和文本掩码类似,该任务对图像区域做遮挡操作,以15%概率选中遮挡区域,并在每次遮挡时以80%概率将特征随机替换为全0向量,以10%概率随机替换成其他区域对应的特征向量,以10%概率保持不变。 

3)图像文本匹配。该任务基于图片-文本对随机采样负样例图片或文本,并让模型判别两者是否匹配。Unicoder-VL 保留了 BERT 中的特殊符号 [CLS]。该符号在最后一层的输出向量经过 MLP 层映射后,直接用于预测输入图文之间的匹配关系。这一任务用于学习图片与文本之间的全局信息对应关系。

4)图像特征生成。该任务为每个遮挡的图片区域生成一个特征向量。通过拟合该向量和图片区域对应的原始图像特征向量,使得模型能够更好地根据图文上下文信息进行图像信息补全。

Unicoder-VL 在图片检索和图片推理问答中的应用

Unicoder-VL 在经过预训练后,可以直接在下游任务上进行微调(fine-tune)。本文主要在图片检索和图片推理问答这两个任务上进行验证。

1)图像文本检索。我们选取 MSCOCO 数据集和 Flickr30k 数据集,并分别从图片检索文本和文本检索图片这两个角度评估 Unicoder-VL 在图片检索上的能力。由于预训练数据与这两个图文检索数据集之间的差异,需要在这两个数据集上进行一定程度的微调。所用到的数据构造则与预训练任务3)保持一致:即随机采样负例图片(或文本),让模型判别两者是否匹配。

实验结果如图2所示:zero-shot 表示 Unicoder-VL 在经过预训练但未经过微调的情况下,在测试集的性能表现;w/o pre-training 表示 Unicoder-VL 在未经预训练的情况下,直接用于下游任务训练的表现。前者证明经过预训练的 Unicoder-VL 具有很好的泛化迁移能力,后者证明 Transformer 结构即使没有经过预训练,同样在跨模态任务上有很强的建模能力。与 state-of-the-art 结果的比较说明跨模态预训练可以极大提高图片检索的能力。

图2: Unicoder-VL 在 MSCOCO 和 Flickr30k 测试集的图片检索结果 (截止到2019.12.10) 

2)图片推理问答(GQA)。图片推理问答任务 GQA 是由斯坦福大学提出的跨模态推理问答数据集。该任务在训练数据集中不但提供图片、自然语言问题和问题对应的答案,还提供图片对应的场景图(scene graph)以及每个自然语言问题对应的基于场景图的语义表示。由于该数据集中很大比例的问题都是复杂问题(即涉及到多跳转或多约束条件的自然语言理解),因此需要模型具备很强的推理能力,才能在该任务上个取得排名靠前的结果。

针对该任务,我们设计了一个基于 Unicoder-VL 的视觉问答推理模型(DREAM+Unicoder-VL)。该模型首先使用 Unicoder-VL 将输入自然语言问题和图片转化为对应的向量表示。然后,基于语义分析技术,将自然语言问题转化为对应的树结构语义表示,基于物体识别技术,从图片中抽取物体候选,并使用常识知识库对每个物体候选进行常识知识三元组扩展。接下来,对问题对应的语义表示和常识知识三元组集合进行向量编码,并结合 Unicoder-VL 输出的向量表示进行跨模态注意力计算。最后,基于融合后的跨模态混合信息进行答案排序。图3 给出该方法在 GQA 任务排行榜上的结果(截止到2020-01-10)。

图3: Unicoder-VL 在图片推理问答 GQA 任务上的结果

除了为推理任务而专门设计的问题理解和图片理解外,实验证明使用 Unicoder-VL 比使用 BERT + ResNet 能够获得显著的性能提升。这充分说明跨模态预训练模型对跨模态任务的重要性和有效性。

结语

本文介绍了微软亚洲研究院在跨模态预训练上的一个工作:Unicoder-VL,验证了跨模态预训练在图片检索和视觉推理问答任务上均能取得很好的效果。当然,这依然是机器推理研究中最初始的一步。在未来,我们将基于目前已有的预训练模型、知识图谱、规则以及海量开放领域数据,针对推理任务,尤其是小样本任务,进行更多的探索和尝试。

了解更多技术细节,请点击阅读原文查看论文:

Unicoder-VL: A Universal Encoder for Vision and Language by Cross-modal Pre-training

链接:https://arxiv.org/pdf/1908.06066.pdf

(*本文为AI科技大本营转载文章,转载请联系原作者

精彩推荐

2020年,由 CSDN 主办的「Python开发者日」活动(Python Day)正式启动。我们将与 PyCon 官方授权的 PyCon中国社区合作,联手顶尖企业、行业与技术专家,通过精彩的技术干货内容、有趣多元化的活动等诸多体验,共同为中国 IT 技术开发者搭建专业、开放的技术交流与成长的家园。未来,我们和中国万千开发者一起分享技术、践行技术,铸就中国原创技术力量。

【Python Day——北京站】现已正式启动,「新春早鸟票」火热开抢!2020年,我们还将在全国多个城市举办巡回活动,敬请期待!

活动咨询,可扫描下方二维码加入官方交流群~

CSDN「Python Day」咨询群 ????

来~一起聊聊Python

如果群满100人,无法自动进入,可添加会议小助手微信:婷婷,151 0101 4297(电话同微信)


推荐阅读

发布了1301 篇原创文章 · 获赞 1万+ · 访问量 542万+

Guess you like

Origin blog.csdn.net/dQCFKyQDXYm3F8rB0/article/details/104057995