当前位置:网站首页>【无标题】多模态模型 CLIP
【无标题】多模态模型 CLIP
2022-07-27 10:59:00 【想搞钱的小陈】
论文和代码链接
https://arxiv.org/pdf/2103.00020.pdf
https://github.com/openai/CLIP
介绍
CLIP是一个双模态的任务,例如输入一句句子,输出一个图像;之前有一些工作是通过图像预测文字描述,而CLIP是通过文字输出图像;
亮点
1、双模态,输入是文本和图像,文本和图像分别进入encoder编码;
2、采用对比学习 contrastive learning;
3、将分类模型转换为图文匹配问题;
Model
网络上有很多图文配对,作者是用了50w个query在网上搜索图片,每个query 2w个图片,总共4E张图片。

输入是N对图文,本文和图片分别通过对应的encoder,得到embeding,通过对比loss,计算2模态之间的cosine similarity,希望配对的loss最大(也就是图中斜对角的值最大),其余的值最小。是zero-shot的其中一种方式。
其中text encoder使用transformer,image encoder采用了2种模型,分别为:
- 5种ResNet:ResNet-50, ResNet-101, EfficientNet-style的ResNet,包括RN50x4, RN50x16, RN50x64;
- 3种ViT:ViT-B/32, ViT-B/16, ViT-L/14;
伪代码如下:

总结:
这比Imagenet单纯的分类好,因为如果只是分类的话,encoder只会考虑某个元素,以‘狗’为例,当对狗进行分类的时,只会聚集一些关于狗的特征;但如果是用图文匹配的方式的话,文字中除了狗的信息,还包括了其他多余的信息。例如,这是一只田园犬,可以对其细分等等。
边栏推荐
- A deep analysis of the soul of C language -- pointer
- Markdown editor syntax - setting of text color, size, font and background color (Reprint)
- (7) Process control
- Smart pointer (shared_ptr, unique_ptr, weak_ptr)
- LAN SDN technology hard core insider 13 from LAN to Internet
- 求组合数 AcWing 888. 求组合数 IV
- Local virtual machine initialization script
- Longest ascending subsequence model acwing 272. longest common ascending subsequence
- 剑指 Offer 笔记: T57 - I. 和为 s 的两个数字
- Why choose smart TV?
猜你喜欢

What is private traffic?

箱型图介绍

Error encountered in adding quick open option to right-click menu:

Gaussian elimination acwing 884. Gaussian elimination for solving XOR linear equations

JUC框架 从Runnable到Callable到FutureTask 使用浅析

Memory search acwing 901. Skiing

数字三角形模型 AcWing 1018. 最低通行费

状态压缩DP AcWing 91. 最短Hamilton路径

Digital triangle model acwing 1027. Grid retrieval

数字三角形模型 AcWing 1027. 方格取数
随机推荐
求组合数 AcWing 885. 求组合数 I
Moveit2 -- 2. Quick start of moveit in rviz
多家银行调整现金管理类理财产品申赎规则:申赎确认时效“T+0”变“T+1”
Luogu p1896 non aggression
Pat (Grade B) 2022 summer exam
Remember an experience of using canvas to make the banner streamer effect of Tencent cloud homepage
Find the combination number acwing 885. find the combination number I
[shader realizes shake random shaking effect _shader effect Chapter 10]
Win10 vscode code code format setting and remote breakpoint debugging
82.(cesium之家)cesium点在3d模型上运动
Several banks adjusted the redemption rules of cash management financial products: the confirmation time limit of redemption changed from "t+0" to "t+1"
局域网SDN硬核技术内幕 23 展望未来——RDMA(上)
"My" bug collection (Reprinted)
makefile模板
Digital triangle model acwing 1015. Picking flowers
第10章 枚举类与注解
Gaussian elimination acwing 884. Gaussian elimination for solving XOR linear equations
LAN SDN technology hard core insider 11 the key of cloud convergence CP -- hierarchical port binding
博弈论 AcWing 893. 集合-Nim游戏
(9) Shell I / O redirection