Llm Jp Clip Vit Base Patch16
日語CLIP模型,基於OpenCLIP框架訓練,支持零樣本圖像分類任務
下載量 40
發布時間 : 12/17/2024
模型概述
這是一個日語視覺語言模型,能夠將圖像與日語文本進行關聯,特別適用於零樣本圖像分類任務。模型在14.5億日語圖文對數據集上訓練,總參數量為248M。
模型特點
日語專用
專門針對日語優化的CLIP模型,在日語文本理解方面表現優異
大規模訓練數據
使用14.5億日語圖文對數據集訓練,覆蓋廣泛視覺概念
零樣本能力
無需特定訓練即可執行新類別的圖像分類任務
模型能力
零樣本圖像分類
圖像-文本匹配
跨模態檢索
使用案例
圖像分類
日語標籤圖像分類
使用日語文本標籤對圖像進行分類
在ImageNet日語分類任務上達到54.2%準確率
跨模態檢索
圖像搜索
使用日語文本查詢檢索相關圖像
在XM3600數據集上圖到文檢索任務中達到73.6%準確率
🚀 llm-jp-clip-vit-base-patch16模型
本項目是基於OpenCLIP訓練的日語CLIP模型,利用大規模日語圖像文本對數據集進行訓練,可用於零樣本圖像分類等視覺語言任務,為日語視覺語言處理提供了有效的解決方案。
🚀 快速開始
安裝
$ pip install open_clip_torch
零樣本圖像分類示例
import open_clip
model, preprocess = open_clip.create_model_from_pretrained('hf-hub:llm-jp/llm-jp-clip-vit-base-patch16')
tokenizer = open_clip.get_tokenizer('hf-hub:llm-jp/llm-jp-clip-vit-base-patch16')
import torch
from PIL import Image
import requests
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
image = preprocess(image).unsqueeze(0)
text = tokenizer(["貓", "犬", "鳥"])
with torch.no_grad(), torch.cuda.amp.autocast():
image_features = model.encode_image(image)
text_features = model.encode_text(text)
image_features /= image_features.norm(dim=-1, keepdim=True)
text_features /= text_features.norm(dim=-1, keepdim=True)
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", text_probs)
# Label probs: tensor([[9.9425e-01, 5.2273e-03, 5.2600e-04]])
參考資料:
- 在Hugging Face上使用OpenCLIP,HuggingFace文檔
- OpenCLIP 倉庫
✨ 主要特性
- 基於OpenCLIP訓練的日語CLIP模型。
- 使用relaion2B-en-research-safe-japanese-translation數據集進行訓練。
- 模型總參數數量為2.48億。
📦 安裝指南
$ pip install open_clip_torch
💻 使用示例
基礎用法
import open_clip
model, preprocess = open_clip.create_model_from_pretrained('hf-hub:llm-jp/llm-jp-clip-vit-base-patch16')
tokenizer = open_clip.get_tokenizer('hf-hub:llm-jp/llm-jp-clip-vit-base-patch16')
import torch
from PIL import Image
import requests
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
image = preprocess(image).unsqueeze(0)
text = tokenizer(["貓", "犬", "鳥"])
with torch.no_grad(), torch.cuda.amp.autocast():
image_features = model.encode_image(image)
text_features = model.encode_text(text)
image_features /= image_features.norm(dim=-1, keepdim=True)
text_features /= text_features.norm(dim=-1, keepdim=True)
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", text_probs)
# Label probs: tensor([[9.9425e-01, 5.2273e-03, 5.2600e-04]])
📚 詳細文檔
模型詳情
該日語CLIP模型使用OpenCLIP在relaion2B-en-research-safe-japanese-translation數據集上進行訓練。該數據集是ReLAION - 5B英文子集(https://huggingface.co/datasets/laion/relaion2B-en-research-safe)的日語翻譯版本,由gemma - 2 - 9b - it翻譯。
該模型的總參數數量為2.48億。
訓練細節
模型架構
- 文本編碼器:使用llm - jp - tokenizer的RoBERTa base。
- 圖像編碼器:ViT - B/16。
訓練數據
該模型在relaion2B-en-research-safe-japanese-translation數據集上進行訓練。由於圖像下載成功率為70%,數據集大小為14.5億個樣本,共進行了9個輪次的訓練(總共處理了130億個樣本)。
評估
評估代碼:https://github.com/llm-jp/clip-eval
表格:各模型在零樣本圖像分類和圖像文本檢索任務中的性能表現。粗體表示第一名,_下劃線_表示第二名。
模型 | 參數數量 (M) | ImageNet | Recruit | CIFAR10 | CIFAR100 | Food101 | Caltech101 | XM3600 I → T | XM3600 T → I | 平均得分 |
---|---|---|---|---|---|---|---|---|---|---|
日語CLIP | ||||||||||
Rinna ViT - B/16 | 196 | 50.6 | 39.9 | 90.7 | 64.0 | 53.2 | 84.6 | 53.8 | 54.0 | 61.4 |
Rinna ViT - B/16 cloob | 196 | 54.6 | 41.6 | 88.2 | 60.3 | 57.2 | 80.2 | 53.4 | 53.4 | 61.1 |
LY ViT - B/16 | 196 | 52.0 | 83.8 | 96.3 | 76.7 | 73.9 | 88.4 | 76.9 | 78.0 | 78.3 |
llm - jp - ViT - B/16 | 248 | 54.2 | 59.4 | 91.8 | 69.2 | 82.2 | 85.6 | 73.6 | 72.7 | 73.6 |
StabilityAI ViT - L/16 | 414 | 62.4 | 70.5 | 97.6 | 84.1 | 74.0 | 86.7 | 67.3 | 66.0 | 76.1 |
llm - jp - ViT - L/14 | 467 | 59.5 | 62.9 | 96.4 | 77.0 | 88.2 | 87.8 | 74.1 | 74.1 | 77.5 |
多語言CLIP | ||||||||||
SigLIP B/16 - 256 multi | 370 | 51.9 | 71.2 | 92.4 | 65.8 | 78.6 | 85.6 | 45.9 | 43.0 | 66.8 |
jina - clip - v2 | 865 | 35.8 | 48.1 | 95.1 | 58.3 | 52.0 | 69.4 | 67.3 | 66.4 | 61.6 |
LAION ViT - H/14 multi | 1193 | 53.0 | 74.5 | 97.9 | 78.4 | 74.3 | 85.1 | 75.0 | 72.0 | 76.3 |
📄 許可證
請參考Gemma使用條款,因為訓練數據使用gemma - 2 - 9b - it進行翻譯。我們僅將Gemma用於翻譯目的。根據第1.1(e)節中“模型衍生作品”的定義,我們的模型不屬於“為使模型表現得與Gemma相似的模型”類別。因此,我們得出結論,無需繼承Gemma許可證。
引用
@inproceedings{sugiura-etal-2025-developing,
title = "Developing {J}apanese {CLIP} Models Leveraging an Open-weight {LLM} for Large-scale Dataset Translation",
author = "Sugiura, Issa and
Kurita, Shuhei and
Oda, Yusuke and
Kawahara, Daisuke and
Okazaki, Naoaki",
editor = "Ebrahimi, Abteen and
Haider, Samar and
Liu, Emmy and
Haider, Sammar and
Leonor Pacheco, Maria and
Wein, Shira",
booktitle = "Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 4: Student Research Workshop)",
month = apr,
year = "2025",
address = "Albuquerque, USA",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.naacl-srw.15/",
pages = "162--170",
ISBN = "979-8-89176-192-6",
abstract = "CLIP is a foundational model that bridges images and text, widely adopted as a key component in numerous vision-language models.However, the lack of large-scale open Japanese image-text pairs poses a significant barrier to the development of Japanese vision-language models.In this study, we constructed a Japanese image-text pair dataset with 1.5 billion examples using machine translation with open-weight LLMs and pre-trained Japanese CLIP models on the dataset.The performance of the pre-trained models was evaluated across seven benchmark datasets, achieving competitive average scores compared to models of similar size without the need for extensive data curation. However, the results also revealed relatively low performance on tasks specific to Japanese culture, highlighting the limitations of translation-based approaches in capturing cultural nuances. Our dataset, models, and code are publicly available."
}
Clip Vit Large Patch14 336
基於Vision Transformer架構的大規模視覺語言預訓練模型,支持圖像與文本的跨模態理解
文本生成圖像
Transformers

C
openai
5.9M
241
Fashion Clip
MIT
FashionCLIP是基於CLIP開發的視覺語言模型,專門針對時尚領域進行微調,能夠生成通用產品表徵。
文本生成圖像
Transformers 英語

F
patrickjohncyh
3.8M
222
Gemma 3 1b It
Gemma 3是Google推出的輕量級先進開放模型系列,基於與Gemini模型相同的研究和技術構建。該模型是多模態模型,能夠處理文本和圖像輸入並生成文本輸出。
文本生成圖像
Transformers

G
google
2.1M
347
Blip Vqa Base
Bsd-3-clause
BLIP是一個統一的視覺語言預訓練框架,擅長視覺問答任務,通過語言-圖像聯合訓練實現多模態理解與生成能力
文本生成圖像
Transformers

B
Salesforce
1.9M
154
CLIP ViT H 14 Laion2b S32b B79k
MIT
基於OpenCLIP框架在LAION-2B英文數據集上訓練的視覺-語言模型,支持零樣本圖像分類和跨模態檢索任務
文本生成圖像
Safetensors
C
laion
1.8M
368
CLIP ViT B 32 Laion2b S34b B79k
MIT
基於OpenCLIP框架在LAION-2B英語子集上訓練的視覺-語言模型,支持零樣本圖像分類和跨模態檢索
文本生成圖像
Safetensors
C
laion
1.1M
112
Pickscore V1
PickScore v1 是一個針對文本生成圖像的評分函數,可用於預測人類偏好、評估模型性能和圖像排序等任務。
文本生成圖像
Transformers

P
yuvalkirstain
1.1M
44
Owlv2 Base Patch16 Ensemble
Apache-2.0
OWLv2是一種零樣本文本條件目標檢測模型,可通過文本查詢在圖像中定位對象。
文本生成圖像
Transformers

O
google
932.80k
99
Llama 3.2 11B Vision Instruct
Llama 3.2 是 Meta 發佈的多語言多模態大型語言模型,支持圖像文本到文本的轉換任務,具備強大的跨模態理解能力。
文本生成圖像
Transformers 支持多種語言

L
meta-llama
784.19k
1,424
Owlvit Base Patch32
Apache-2.0
OWL-ViT是一個零樣本文本條件目標檢測模型,可以通過文本查詢搜索圖像中的對象,無需特定類別的訓練數據。
文本生成圖像
Transformers

O
google
764.95k
129
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98