A visual encoder converts an image into a learned numerical representation that another model component can use. In image captioning, it turns scene content—such as a tabby cat, laser mouse, and paw—into an embedding for a text decoder. section 2.4
The encoder is usually the first half of a larger system. A decoder consumes its representation to generate text or a segmentation mask, while other inputs may be encoded alongside the image. section 2.4 section 15.4
Its role changes with the downstream task:
- Captioning: produce descriptive image embeddings that a text decoder transforms into a coherent sentence. section 2.4
- Segmentation: extract image features for a mask decoder, which combines them with encoded points, boxes, or masks. section 15.4
- SAM uses a Vision Transformer that divides an image into patches and applies self-attention to capture local and global relationships. section 15.4
From image to output
For captioning, an image encoder creates a numerical description of a scene, and a text decoder turns it into a sentence. For SAM, the encoder supplies image features while prompt information guides the mask decoder toward regions of interest. section 2.4 section 15.4
Figure 2.9 Conceptual diagram of BLIP caption generation
Use the conceptual diagram to follow the image representation from the encoder into the text decoder and generated caption. section 2.4



