🚀 ColNomic Embed Multimodal 3B:先进的视觉文档检索模型
colnomic-embed-multimodal-3b
是一款多向量的先进多模态嵌入模型,在视觉文档检索任务中表现出色。它能够解决传统文本检索系统在处理包含复杂视觉信息文档时的难题,为用户提供更全面、准确的文档检索服务。
🚀 快速开始
若要使用 colnomic-embed-multimodal-3b
,请从源代码安装 colpali
:
pip install git+https://github.com/illuin-tech/colpali.git
import torch
from PIL import Image
from transformers.utils.import_utils import is_flash_attn_2_available
from colpali_engine.models import ColQwen2_5, ColQwen2_5_Processor
model_name = "nomic-ai/colnomic-embed-multimodal-3b"
model = ColQwen2_5.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="cuda:0",
attn_implementation="flash_attention_2" if is_flash_attn_2_available() else None,
).eval()
processor = ColQwen2_5_Processor.from_pretrained(model_name)
images = [
Image.new("RGB", (128, 128), color="white"),
Image.new("RGB", (64, 32), color="black"),
]
queries = [
"我们研发部门的组织结构是怎样的?",
"能否提供去年财务业绩的明细?",
]
batch_images = processor.process_images(images).to(model.device)
batch_queries = processor.process_queries(queries).to(model.device)
with torch.no_grad():
image_embeddings = model(**batch_images)
query_embeddings = model(**batch_queries)
scores = processor.score_multi_vector(query_embeddings, image_embeddings)
✨ 主要特性
- 高性能:在 Vidore-v2 上达到 61.2 的 NDCG@5,除 ColNomic Embed Multimodal 7B 外,优于其他所有模型。
- 统一的文本 - 图像编码:无需复杂的预处理,可直接对交错的文本和图像进行编码。
- 先进的架构:拥有 30 亿参数的多模态嵌入模型。
- 开放权重:模型权重可供研究使用。
📊 性能表现
模型 |
平均 |
ESG 餐厅人工数据 |
经济宏观多模态数据 |
AXA 多模态数据 |
MIT 生物数据 |
ESG 餐厅合成数据 |
ESG 餐厅合成多模态数据 |
MIT 生物多模态数据 |
AXA 数据 |
经济宏观数据 |
ColNomic Embed Multimodal 7B |
62.7 |
73.9 |
54.7 |
61.3 |
66.1 |
57.3 |
56.7 |
64.2 |
68.3 |
61.6 |
ColNomic Embed Multimodal 3B |
61.2 |
65.8 |
55.4 |
61.0 |
63.5 |
56.6 |
57.2 |
62.5 |
68.8 |
60.2 |
T - Systems ColQwen2.5 - 3B |
59.9 |
72.1 |
51.2 |
60.0 |
65.3 |
51.7 |
53.3 |
61.7 |
69.3 |
54.8 |
Nomic Embed Multimodal 7B |
59.7 |
65.7 |
57.7 |
59.3 |
64.0 |
49.2 |
51.9 |
61.2 |
66.3 |
63.1 |
GME Qwen2 7B |
59.0 |
65.8 |
56.2 |
55.4 |
64.0 |
54.3 |
56.7 |
55.1 |
60.7 |
62.9 |
Nomic Embed Multimodal 3B |
58.8 |
59.8 |
57.5 |
58.8 |
62.5 |
49.4 |
49.4 |
58.6 |
69.6 |
63.5 |
Llama Index vdr - 2b - multi - v1 |
58.4 |
63.1 |
52.8 |
61.0 |
60.6 |
50.3 |
51.2 |
56.9 |
68.8 |
61.2 |
Voyage Multimodal 3 |
55.0 |
56.1 |
55.0 |
59.5 |
56.4 |
47.2 |
46.2 |
51.5 |
64.1 |
58.8 |
🔧 技术细节
模型架构
- 总参数:30 亿
- 训练方式:基于 Qwen2.5 - VL 3B Instruct 进行微调
- 架构类型:具有统一文本和图像输入处理能力的视觉 - 语言模型
- 关键创新点:
- 采用同来源采样,生成更具挑战性的批次内负样本。
- 提供多向量输出选项,以提升性能。
与 RAG 工作流的集成
Nomic Embed Multimodal 3B 可无缝集成到检索增强生成(RAG)工作流中:
- 直接文档嵌入:直接对文档页面图像进行嵌入,无需 OCR 和复杂处理。
- 更快的处理速度:消除预处理步骤,实现更快的索引。
- 更完整的信息:在单个嵌入中捕获文本和视觉线索。
- 简单的实现方式:文本和图像使用相同的 API。
训练细节
ColNomic Embed Multimodal 3B 通过以下关键创新进行开发:
- 同来源采样:强制从同一数据集来源进行采样,生成更具挑战性的批次内负样本,防止模型学习到数据集的人为特征。
- 多向量配置:提供多向量变体,其性能优于密集变体。
💡 推荐用例
该模型在处理挑战传统纯文本系统的现实文档检索场景中表现出色:
- 研究论文:捕获方程式、图表和表格。
- 技术文档:对代码块、流程图和截图进行编码。
- 产品目录:表示图像、规格和价格表。
- 财务报告:嵌入图表、图形和数值数据。
- 视觉丰富的内容:布局和视觉信息很重要的场景。
- 多语言文档:视觉上下文提供重要线索的场景。
⚠️ 局限性
- 处理具有非常规布局或不寻常视觉元素的文档时,性能可能会有所不同。
- 虽然支持多种语言,但在英语内容上的性能最强。
- 处理非常大或复杂的文档时,可能需要将其分割成较小的块。
- 处理包含手写体或高度风格化字体的文档时,性能可能会降低。
🤝 加入 Nomic 社区
📄 许可证
如果您在研究或应用中发现此模型有用,请考虑引用:
@misc{faysse2024colpaliefficientdocumentretrieval,
title={ColPali: Efficient Document Retrieval with Vision Language Models},
author={Manuel Faysse and Hugues Sibille and Tony Wu and Bilel Omrani and Gautier Viaud and Céline Hudelot and Pierre Colombo},
year={2024},
eprint={2407.01449},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2407.01449},
}
@misc{ma2024unifyingmultimodalretrievaldocument,
title={Unifying Multimodal Retrieval via Document Screenshot Embedding},
author={Xueguang Ma and Sheng-Chieh Lin and Minghan Li and Wenhu Chen and Jimmy Lin},
year={2024},
eprint={2406.11251},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2406.11251},
}
@misc{nomicembedmultimodal2025,
title={Nomic Embed Multimodal: Interleaved Text, Image, and Screenshots for Visual Document Retrieval},
author={Nomic Team},
year={2025},
publisher={Nomic AI},
url={https://nomic.ai/blog/posts/nomic-embed-multimodal},
}