There isn’t a single “gold‐standard” image embedding model that focuses exclusively on the text content in an image, but there are several approaches and models that primarily leverage the textual information (often with layout or spatial cues) extracted from images. These generally fall into two categories:
1. Two‐Stage Approaches: OCR + Text Embedding
In this approach, an Optical Character Recognition (OCR) system is applied to the image to get a transcript (sometimes along with the position of words), and then a text encoder is used to create embeddings. Some common choices are:
This approach is prevalent in many document analysis pipelines. The idea is that if the image is “text-heavy,” you simply turn it into text and process it with proven language models.
2. End-to-End Models that Integrate Text and Visual Cues
Some newer architectures are designed to work directly on images while giving extra emphasis on the text content (often crucial in documents or scene images where text layout matters). These models typically combine visual features with the recognized text and its positions:
-
LayoutLM Series:
- LayoutLM, LayoutLMv2, LayoutLMv3:
These models were developed primarily for document understanding. They take as input not only the textual transcript (obtained via OCR) but also the spatial layout (position information) of the text. The transformer-based architectures are trained end-to-end for tasks like classification, question answering, and information extraction on documents.
- Key point: They are “image embeddings” models for documents that rely mainly on the text and its layout, rather than rich visual appearance.
-
Donut (Document Understanding Transformer):
- Developed by NAVER, Donut is designed to work directly on document images without requiring a separate OCR step. It learns to extract the semantic and layout information present in documents, effectively embedding the document by focusing on its textual and structural content.
- Key point: It’s an end-to-end transformer approach that “reads” the image similarly to how humans might process a document—by focusing on the textual information and its arrangement.
-
Other Specialized Models:
There are also methods in the scene text recognition area (like models for text spotting) or approaches that combine scene text extraction with language modeling. While these models might be optimized for reading text in natural scenes (e.g., street signs, storefronts), their embeddings also tend to focus on the text.
Summary
- Two-Stage Pipelines: Use OCR (e.g., Tesseract, Cloud Vision) to extract text, then apply language models (BERT, Sentence-BERT) to create embeddings.
- End-to-End Architectures:
- LayoutLM and successors are excellent for documents because they integrate textual content and layout directly into the embedding process.
- Donut is another model that emphasizes text and structure from documents without a separate OCR phase.
While models like CLIP work in a multimodal fashion (encoding both images and text into a joint space), they tend to focus on the overall image appearance rather than specifically homing in on text content. So if your main goal is to capture the meaning of the text inside images, the OCR-plus-text-embedding approach or dedicated document understanding models (like LayoutLM/Donut) are often the most effective choices.
I hope this helps clarify the landscape of image embedding approaches that center on text content!