CoolFace
Modelpublic

minhnguyent546/Vintern-Embedding-1B-mirror

sourceHugging Faceupdated 11mo agoView on Hugging Face
0likes20downloads
Model Card

image/jpeg

Model Details

Vintern-Embedding-1B is the next-generation embedding model built on top of the base Vintern-1B-v3\_5. It was trained on over 1.5 million high-quality question–document pairs, including both Visual Question Answering (VQA) and pure text QA tasks. Leveraging this large and diverse dataset, the model is capable of handling a wide range of cross-modal retrieval tasks, including:

  • —Text → Visual
  • —Text → Text

Compared to ColVintern-1B-v1, which was more experimental, this version is significantly optimized and achieves much higher retrieval quality. Despite having only \~0.9B parameters, it performs competitively with larger 2B–7B multimodal embedding models, making it both lightweight and highly effective.


Benchmark Highlights

  • —GreenNode/Markdown Table Retrieval (Vietnamese)
  • —Achieved MAP\@5 = 57.01 and Mean = 59.71, clearly multi-vector embedding outperforming all existing multilingual and Vietnamese-specific embedding baselines.
  • —GreenNode/Zalo Legal Text Retrieval (Vietnamese)
  • —Scored Mean = 73.14, on par with or surpassing Vietnamese-specialized models, showing strong performance on legal retrieval tasks.
  • —ViDoRe Benchmark (Global Multimodal Standard)
  • —Reached Average Score = 82.85, improving over ColVintern-1B v1 (78.8) and approaching the performance of several 2B–3B multimodal embedding models.
  • —Particularly strong in domains such as Artificial Intelligence (97.52), Healthcare (97.09), and Government (93.97).

Summary

👉 Vintern-Embedding-1B (v2) delivers robust cross-modal retrieval, excels on both Vietnamese-specific and global multimodal benchmarks, and remains highly efficient at \~1B parameters. It is a strong choice for RAG pipelines, multimodal search engines, and information retrieval applications in both English and Vietnamese.

Benchmark Details

Dataset: GreenNode/GreenNode-Table-Markdown-Retrieval

Model NameMAP@5 ↑MRR@5 ↑NDCG@5 ↑Recall@5 ↑Mean ↑
Multilingual Embedding models
me5_small33.7533.7535.6841.4936.17
me5_large38.1638.1640.2746.6240.80
M3-Embedding36.5236.5238.6044.8439.12
OpenAI-embedding-v330.6130.6132.5738.4633.06
Vietnamese Embedding models (Prior Work)
halong-embedding32.1532.1534.1340.0934.63
sup-SimCSE-VietNamese-phobert_base10.9010.9012.0315.4112.31
vietnamese-bi-encoder13.6113.6114.6317.6814.89
GreenNode-Embedding
M3-GN-VN41.8541.8544.1557.0546.23
M3-GN-VN-Mixed42.0842.0844.3351.0644.89
Ours – Multi-vector embedding
Vintern-Embedding-1B57.0157.0159.1765.6559.71

Dataset: GreenNode/zalo-ai-legal-text-retrieval-vn

Model NameMAP@5 ↑MRR@5 ↑NDCG@5 ↑Recall@5 ↑Mean ↑
Multilingual Embedding models
me5_small54.6854.3758.3269.1659.13
me5_large60.1459.6264.1776.0264.99
M3-Embedding69.3468.9673.7086.6874.67
OpenAI-embedding-v338.6838.8041.5349.9441.74
Vietnamese Embedding models (Prior Work)
halong-embedding52.5752.2856.6468.7257.55
sup-SimCSE-VietNamese-phobert_base25.1525.0727.8135.7928.46
vietnamese-bi-encoder54.8854.4759.1079.5161.99
GreenNode-Embedding
M3-GN-VN65.0364.8069.1981.6670.17
M3-GN-VN-Mixed69.7569.2874.0186.7474.95
Ours – Multi-vector embedding
Vintern-Embedding-1B68.9069.0672.3282.2973.14

Dataset: ViDoRe Benchmark

image/png

ModelModel_SizeAverage_ScoreArxivQADocVQAInfoVQAArtificial IntelligenceEnergyGovernmentHealthcare IndustryTAT-DQA
royokong/e5-v8.3B62.8848.334.769.278.978.182.282.329.3
TIGER-Lab/VLM2Vec-Full4.2B51.1642.826.766.753.563.56470.721.4
nvidia/llama-nemoretriever-colembed-3b-v14.4B90.4288.466.294.999.696.697.899.380.6
nvidia/llama-nemoretriever-colembed-1b-v12.4B89.887.664.593.610096.696.799.679.8
jinaai/jina-embeddings-v43.8B89.3888.560.193.899.397.396.699.180.3
nomic-ai/colnomic-embed-multimodal-3b3B89.2588.161.392.896.397.496.698.383.2
nomic-ai/colnomic-embed-multimodal-7b7B89.0088.360.192.298.896.395.999.381.1
vidore/colqwen2.5-v0.23B89.5888.963.692.599.696.195.89882.1
vidore/colqwen2-v1.02.2B89.188861.592.59995.995.598.882.2
ibm-granite/granite-vision-3.3-2b-embedding3B85.9884.254.689.798.996.397.398.967.9
vidore/colpali-v1.33B85.4483.358.485.597.494.696.197.470.8
vidore/colpali-v1.23B83.1677.856.682.297.593.894.494.968.1
ColVintern-1B0.9B78.871.648.384.692.988.789.495.259.6
Vintern-Embedding-1B0.9B82.8575.3751.7986.297.5293.1993.9797.0967.72

Examples:

Query Input:

"Sử dụng ma tuý bị gì ?"

Relevant Document Output:

Ma túy, thuốc gây nghiện, thuốc hướng thần và tiền chất ma túy;
c) Vi phạm các quy định về nghiên cứu, giám định, kiểm định, kiểm nghiệm, sản xuất, bảo quản, tồn trữ chất ma túy, tiền chất ma túy;
d) Vi phạm các quy định về giao nhận, tàng trữ, vận chuyển chất ma túy, thuốc gây nghiện, thuốc hướng thần, tiền chất ma túy;
đ) Vi phạm các quy định về phân phối, mua bán, sử dụng, trao đổi chất ma túy, thuốc gây nghiện, thuốc hướng thần, tiền chất ma túy;
e) Vi phạm các quy định về quản lý, kiểm soát, lưu giữ chất ma túy, thuốc gây nghiện, thuốc hướng thần, tiền chất tại các khu vực cửa khẩu, biên giới, trên biển;
g) Thực hiện cai nghiện ma túy vượt quá phạm vi hoạt động được ghi trong giấy phép hoạt động cai nghiện ma túy tự nguyện.
6. Phạt tiền từ 40.000.000 đồng đến 50.000.000 đồng đối với hành vi cho mượn, cho thuê, chuyển nhượng hoặc sử dụng giấy phép hoạt động cai nghiện ma túy tự nguyện vào các mục đích khác.
7. Phạt tiền từ 50.000.000 đồng đến 75.000.000 đồng đối với hành vi tổ chức cai nghiện ma tú

Query Input:

"Đi xe bằng 1 bánh bị phạt bao nhiêu ?"

Relevant Image Output: <img src="https://cdn-uploads.huggingface.co/production/uploads/6336b5c831efcb5647f00170/X3oqsaFXmjIXP6EbZo74U.png" alt="Relevant output" style="width:400px; height:auto;">

Query Input:

"Kinh tế Campuchia tăng trưởng như nào năm 2021 ?"

Relevant Image Output: <img src="https://cdn-uploads.huggingface.co/production/uploads/6336b5c831efcb5647f00170/HjdqTV_lCsd3PsheukC49.png" alt="Relevant output" style="width:400px; height:auto;">

Query Input:

"Công nghiệp từ năm 2017 tăng trưởng ra sao ?"

Relevant Image Output: <img src="https://cdn-uploads.huggingface.co/production/uploads/6336b5c831efcb5647f00170/yaWo4EiQ8hhCDj9jzOaMu.png" alt="Relevant output" style="width:400px; height:auto;">

Quickstart:

Installation:

bash
pip install decord
pip install transformers==4.48.2
pip install flash_attn

Download samples:

bash
wget https://huggingface.co/5CD-AI/ColVintern-1B-v1/resolve/main/ex1.jpg
wget https://huggingface.co/5CD-AI/ColVintern-1B-v1/resolve/main/ex2.jpg

Inference:

python
import torch
from PIL import Image
from transformers import AutoModel, AutoProcessor
import matplotlib.pyplot as plt

# ==============================
# 1. Load Model and Processor
# ==============================
model_name = "5CD-AI/Vintern-Embedding-1B"

model = AutoModel.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,       
    low_cpu_mem_usage=True,
    trust_remote_code=True,
).eval().cuda()                        

processor = AutoProcessor.from_pretrained(
    model_name,
    trust_remote_code=True
)

# ==============================
# 2. Prepare Input Data
# ==============================
# !wget https://huggingface.co/5CD-AI/ColVintern-1B-v1/resolve/main/ex1.jpg
# !wget https://huggingface.co/5CD-AI/ColVintern-1B-v1/resolve/main/ex2.jpg
images = [Image.open("ex1.jpg"), Image.open("ex2.jpg")]
batch_images = processor.process_images(images)

queries = [
    "Cảng Hải Phòng ở đâu ?",
    "Phí giao hàng bao nhiêu ?",
]
batch_queries = processor.process_queries(queries)

text_documents = [
    "Cảng Hải Phòng là một cụm cảng biển tổng hợp cấp quốc gia, lớn thứ 2 ở Việt Nam sau cảng Sài Gòn, là cửa ngõ quốc tế của Việt Nam, nằm tại ba quận Hồng Bàng, Ngô Quyền và Hải An. Bên cạnh đó, cùng tên Cảng Hải Phòng (tiếng Anh: Port of Hai Phong hoặc Hai Phong Port) là một cụm cảng biển thuộc Công ty cổ phần cảng Hải Phòng tại thành phố Hải Phòng, Việt Nam. Đây là một trong hai cảng biển tổng hợp lớn và lâu đời nhất tại Việt Nam, cùng với Công ty Cảng Sài Gòn ở phía Nam.",
    "Sân bay Chu Lai (tỉnh Quảng Nam) cũng được hãng hàng không giá rẻ Vietjet đề xuất đầu tư nâng cấp 20.000 tỉ đồng theo 3 giai đoạn từ 2020-2025 để đến năm 2025 trở thành Cảng hàng không quốc tế và trở thành trung tâm trung chuyển, vận tải hàng hóa lớn của cả nước theo quy hoạch của Bộ GTVT năm 2015.",
]
batch_text_docs = processor.process_docs(text_documents)

raw_docs = images + text_documents

# ==============================
# 3. Move Tensors to GPU
# ==============================
batch_images["pixel_values"] = batch_images["pixel_values"].cuda().bfloat16()
batch_images["input_ids"] = batch_images["input_ids"].cuda()
batch_images["attention_mask"] = batch_images["attention_mask"].cuda().bfloat16()

batch_queries["input_ids"] = batch_queries["input_ids"].cuda()
batch_queries["attention_mask"] = batch_queries["attention_mask"].cuda().bfloat16()

batch_text_docs["input_ids"] = batch_text_docs["input_ids"].cuda()
batch_text_docs["attention_mask"] = batch_text_docs["attention_mask"].cuda().bfloat16()

# ==============================
# 4. Generate Embeddings
# ==============================
with torch.no_grad():
    image_embeddings = model(**batch_images)
    query_embeddings = model(**batch_queries)
    text_docs_embeddings = model(**batch_text_docs)

# ==============================
# 5. Compute Similarity Scores
# ==============================
scores = processor.score_multi_vector(
    query_embeddings,
    list(image_embeddings) + list(text_docs_embeddings)
)

max_scores, max_indices = torch.max(scores, dim=1)

# ==============================
# 6. Print Results
# ==============================
for i, query in enumerate(queries):
    print("=" * 100)
    print(f"Query: '{query}'")
    print(f"Score: {max_scores[i].item()}\n")
    
    doc = raw_docs[max_indices[i]]
    if isinstance(doc, str):
        print(f"Matched Text Document:\n{doc}\n")
    else:
        plt.figure(figsize=(5, 5))
        plt.imshow(doc)
        plt.axis("off")
        plt.show()

Quickstart Google Colab: https://colab.research.google.com/drive/1jkP7fJja5RmSrP5Ad0_Csu7zPtIz-AwV?usp=sharing