当前位置:网站首页>【无标题】多模态模型 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只会考虑某个元素,以‘狗’为例,当对狗进行分类的时,只会聚集一些关于狗的特征;但如果是用图文匹配的方式的话,文字中除了狗的信息,还包括了其他多余的信息。例如,这是一只田园犬,可以对其细分等等。
边栏推荐
- Find the combination number acwing 885. find the combination number I
- A deep analysis of the soul of C language -- pointer
- JUC框架 从Runnable到Callable到FutureTask 使用浅析
- Raw socket grabs packets, and packets on some ports cannot be caught
- 剑指 Offer 笔记: T53 - I. 在排序数组中查找数字
- EfficientNet
- C custom set
- Lazy loading of lists and pictures
- Codeforces round #664C
- LAN SDN technology hard core insider 12 cloud CP's daily love - hardware vxlan forwarding plane
猜你喜欢

第7章 异常处理

第8章 多线程

Game theory acwing 891. Nim game

Kepserver configuration

Game theory acwing 894. Split Nim game

【Unity入门计划】CreatorKitFPS:第一人称射击3D小游戏

Find the combination number acwing 885. find the combination number I

C# 自定义集合

Caused by:org.gradle.api.internal. plugins . PluginApplicationException: Failed to apply plugin

Find the combinatorial number acwing 889. 01 sequence satisfying the condition
随机推荐
State compression DP acwing 91. shortest Hamilton path
箱型图介绍
本地虚拟机初始化脚本
Maker Hongmeng application development training notes 02
剑指 Offer 笔记: T58 - II. 左旋转字符串
The C programming language (2nd) -- Notes -- 1.7
(10) File contains
Gaussian elimination acwing 883. solving linear equations with Gaussian elimination
Game theory acwing 891. Nim game
Redis simple to use
局域网SDN硬核技术内幕 24 展望未来——RDMA(中)
WGet warning: unable to verify
LAN SDN technology hard core insider 11 the key of cloud convergence CP -- hierarchical port binding
Codeforces round #664C
求组合数 AcWing 888. 求组合数 IV
Inclusion exclusion principle acwing 890. divisible numbers
局域网SDN技术硬核内幕 11 云网融合CP的关键——层次化端口绑定
第8章 多线程
The longest ascending subsequence model acwing 1016. The sum of the largest ascending subsequence
Knapsack model acwing 1024. Packing problem