🚀 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},
}