[CLIP] Learning Transferable Visual Models From Natural Language Supervision

本文主要是介绍[CLIP] Learning Transferable Visual Models From Natural Language Supervision,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

        通过在4亿图像/文本对上训练文字和图片的匹配关系来预训练网络,可以学习到SOTA的图像特征。预训练模型可以用于下游任务的零样本学习

                ​​​​​​​        ​​​​​​​        

1、网络结构

        1)simplified version of ConVIRT

        2)linear projection to map from each encoder's representation to the multi-modal embedding space

        3)image encoder

                -> ResNet

                         antialiased rect-2 blur pooling

                        用attention pooling (single layer of "transformer-style" multi-head QKV attention, where the query is conditioned on the global average-pooled representation of the image)来代替global average pooling

                -> Vision Transformer (ViT)

                        add an additional layer normalization to the combined patch

                        position embeddings before the transformer

                        slightly different initialization scheme

        4)text encoder

                -> Transformer

                        architecture modifications

                        63M-parameter 12 layer 512-wide model with 8 attention heads

                        lower-cased byte pair encoding (BPE) representation of the text with a 49152 vocab size

                        the max sequence length was capped at 76

                        the text sequence is bracketed with [SOS] and [EOS] tokens

                        the activations of the highest layer of the transformer at the [EOS] token are treated as the feature representation of the text which is layer normalized and then linearly projected into the multi-modal embedding space

        5)scale

                -> image encoder

                        equally increase the width, depth, and resolution of the model

                -> text encoder

                        only scale the width of the model to be proportional to the calculated increase in width of the ResNet, do not scale the depth at all

                        * text encoder对CLIP的表现影响较小

2、数据

        1)400 million (image, text) pairs from Internet

        2)many of the (image, text) pairs are only a single sentence

3、训练

        1)Contrastive Language-Image Pre-training (CLIP)

        2)text as a whole, not the exact words of that text

        3)Given a batch of N (image, text) pairs, predict N x N possible (image, text) pairings。N取32768

        4)jointly train an image encoder and text encoder

        5)maximize the cosine similarity of the N real pairs; minimizing the cosine similarity of the N^{2} - N incorrect pairs

        6)train from scratch

        7)数据增强

                random square crop from resized images

        8)learnable temperature parameter \tau (control the range of the logits in the softmax)

4、优势

        无需softmax分类器来预测结果,因此可以更灵活的用于zero-shot任务

这篇关于[CLIP] Learning Transferable Visual Models From Natural Language Supervision的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



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

相关文章

Visual Studio中,MSBUild版本问题

假如项目规定了MSBUild版本,那么在安装完Visual Studio后,假如带的MSBUild版本与项目要求的版本不符合要求,那么可以把需要的MSBUild添加到系统中,然后即可使用。步骤如下:            假如项目需要使用V12的MSBUild,而安装的Visual Studio带的MSBUild版本为V14。 ①到MSDN下载V12 MSBUild包,把V12包解压到目录(

Deep Learning复习笔记0

Key Concept: Embedding: learned dense, continuous, low-dimensional representations of object 【将难以表示的对象(如图片,文本等)用连续的低维度的方式表示】 RNN: Recurrent Neural Network -> for processing sequential data (time se

shader language学习(1)——shader language简介背景

shader language,称为着色语言,shade在英语是阴影、颜色深浅的意思。shader language基于物体本身属性和光照条件,计算美格橡塑的颜色值。 实际上这种解释具有明显的时代局限性,在GPU编程发展的早期,shader language的提出目标是加强对图形处理算法的控制,所以对该语言的定义也针对于此。但随着技术的进步,目前的shader language早已经用于通用计算

Retrieval-Augmented Generation for Large Language Models A Survey

Retrieval-Augmented Generation for Large Language Models: A Survey 文献综述 文章目录 Retrieval-Augmented Generation for Large Language Models: A Survey 文献综述 Abstract背景介绍 RAG概述原始RAG先进RAG预检索过程后检索过程 模块化RAGMo

使用AGG里面的clip_box函数裁剪画布, 绘制裁剪后的图形

// 矩形裁剪图片, 透明void agg_testImageClipbox_rgba32(unsigned char* buffer, unsigned int width, unsigned int height){// ========= 创建渲染缓冲区 =========agg::rendering_buffer rbuf;// BMP是上下倒置的,为了和GDI习惯相同,最后一个参数是

Visual Studio开发环境搭建

原文:https://blog.c12th.cn/archives/25.html Visual Studio开发环境搭建 测试:笔记本原装操作系统:Windows 10 家庭中文版 资源分享链接:提取码:qbt2 注意事项:注意查看本地硬盘是否够用,建议预留4G左右空间。 教程 安装Visual studio 2010 找到并解压 “VS2010中文旗舰版”

AI 大模型企业应用实战(10)-LLMs和Chat Models

1 模型 来看两种不同类型的模型--LLM 和聊天模型。然后,它将介绍如何使用提示模板来格式化这些模型的输入,以及如何使用输出解析器来处理输出。 LangChain 中的语言模型有两种类型: 1.1 Chat Models 聊天模型通常由 LLM 支持,但专门针对会话进行了调整。提供者 API 使用与纯文本补全模型不同的接口。它们的输入不是单个字符串,而是聊天信息列表,输出则是一条人工智能

GIM: Learning Generalizable Image Matcher From Internet Videos

【引用格式】:Shen X, Yin W, Müller M, et al. GIM: Learning Generalizable Image Matcher From Internet Videos[C]//The Twelfth International Conference on Learning Representations. 2023. 【网址】:https://arxiv.or

python库安装出现Microsoft Visual C++ 14.0 required问题解决

出现上述错误,最简单的方法就是安装c++2015即可,然而网上乱七八糟的软件下载,下面提供百度云盘链接,直接下载安装即可用。 点击下载 安装到电脑即可。

在Mac OS上使用Visual Studio Code创建C++ Qt的Hello World应用

引言 Qt是一个跨平台的应用程序和用户界面框架,而Visual Studio Code是一个功能强大的编辑器,两者结合可以极大地提升开发效率。本文将指导你在Mac OS上使用Visual Studio Code创建一个简单的Qt 'Hello World'窗口应用。 环境准备 确保你的MacBook OS运行最新的操作系统。安装Homebrew,Mac OS的包管理器。通过Homebrew安装