多模态大模型的grounding能力

数据集

a)QW-VL:Visual Genome, RefCOCO, RefCOCO+, RefCOCOg,
b)CogVLM:Visual7W,Flickr30K-Entities
c)Kosmos2:GRIT

OFA

Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework
将多模态任务统一为seq2seq,最大模型900M

文本,图片,物体离散到统一的词表中:
将文本用BPE转化为subwords,将图片简单切分成多个patch并使用image quantization转化为image code,抽取图片中的物体的标签和bounding box并将bounding box离散化为location tokens。统一词表是文本的subwords,图片的image code和物体的location tokens三者的并集。
box表示方式:将坐标映射到1-1000,对应词表中总共1000个location token,一个box即<x1><y1><x2><y2>

KOSMOS-2

KOSMOS-2: Grounding Multimodal Large Language Models to the World

kosmos-2的一个重要贡献是解锁了MLLM的grounding能力

为了解锁grounding能力,作者做了一个大规模grounded image-text pair数据集GRIT(caption-box pair)

模型大小follow kosmos-1
训练数据分为四类

  • grounded image-text pairs(新增)
  • text corpora
  • image-caption pairs
  • interleaved image-text data.

box表示:将图像分为32 * 32个bin(箱子,块),总共32 * 32个special token :\(<loc_n>\),每个图像用左上,右下两个bin的token表示
image

Qwen-VL

Qwen-VL: A Versatile Vision-Language Model for
Understanding, Localization, Text Reading, and Beyond

Qwen-7B + OpenClip ViT-bigG
训练:

  1. Pretrain:在 text-image pair 数据上预训练(LAION,CC3M,CC12M) 22%的中文 分辨率224 × 224.
  2. Multi-task Pre-training:Pure text,Caption,Grounding,VQA,OCR, 分辨率448 × 448
    • 用同类型的数据构造 interleaved image-text data
    • Qwen-VL
  3. Supervised Fine-tuning:multi-modal instruction tuning data
    • 数据来自text-image pair和 LLM self-instruction dialogue data
    • Qwen-VL-Chat

image

user: "框出图中的格子衬衫"
assistant: "<ref>格子衬衫</ref><box>(588,499),(725,789)</box>"

box 的坐标没有special token,只是将数值Norm到[0-1000)

CogVLM

模型结构:
ViT encoder:EVA2-CLIP-E 除去最后一层
MLP adapter:two-layer MLP
LLM: CogVLM-17B 用的 Vicuna-7B v1.5
Visual expert module:每一层copy一份QKV的W和FFN,(相当于现在有两份vicuna),在输入的时候,image的token用image的QKV和FFN算,text的用text的QKV,FFN算,在算attention的时候image和text token有交互,为的是实现深度融合
image

自行构造grounding的数据集方法:

  • 基于image caption数据
  • spaCy 抽名词
  • GLIPv2 定位 bounding boxes

box 的坐标没有special token,只是将数值Norm到[0-1000)

posted @ 2023-10-26 11:00  shiiiilong  阅读(1539)  评论(0编辑  收藏  举报