Understanding VLM Vision Encoding
Table of Contents: What Is VLM Vision Encoding? How Does Vision Encoding Work? Why Is Vision Encoding Important? Training Strategies Behind VLM Vision Encoding The Nitty-Gritty Details FA...
9jaOnCloudUnderstanding VLM Vision Encoding
Table of Contents:
- What Is VLM Vision Encoding?
- How Does Vision Encoding Work?
- Why Is Vision Encoding Important?
- Training Strategies Behind VLM Vision Encoding
- The Nitty-Gritty Details
- FAQ
What Is VLM Vision Encoding?
Imagine explaining a photograph to someone fluent only in numbers. To translate every detail - colors, shapes, objects - into a numerical representation, you will require a method. That is precisely what vision encoding achieves for VLMs.How Does Vision Encoding Work?
In VLMs, vision encoding starts with an image. The model divides the image into smaller sections, known as patches. Each patch is then translated into a vector, a list of numbers representing features like color, texture, next to shape[1][5]. Rather than examining each patch individually, as in traditional computer vision, modern VLMs employ a Vision Transformer (ViT). A ViT treats these patches as words in a sentence. Through self-attention mechanisms derived from transformer models (the same technology powering ChatGPT), it identifies the image's crucial elements and their relationships[1][5]. The model concentrates on relevant details regardless of their position in the picture. Having encoded all patches as vectors, they establish an embedding space. An image gets close to similar images mathematically within this mathematical space[5]. The embedding space proves very beneficial, enabling the model to compare images with text descriptions alternatively, generate new captions according to its visual input.Why Is Vision Encoding Important?
Traditional computer vision models possessed limitations. They could execute tasks for which they had training, such as differentiating between cats and dogs in photos[3]. If you desired them to perform new assignments, in addition to recognizing new objects, you required labeled data in great amounts, along with retraining the whole process. That was not only slow but also expensive. Equipped with VLM vision encoding, powered by transformers such as ViTs, flexibility has increased significantly. You feed an image into your VLM along with text instructions. ("What animal is this?"), you get relevant responses. "It’s a cat!" Or, you can generate detailed descriptions. "A fluffy orange cat sitting on a windowsill"[3]. This stems from VLMs' proficiency in learning the relationships between visual and linguistic features. By training on vast datasets of image-text pairings, such models gain expertise in processing these modalities together[2][5].Training Strategies Behind VLM Vision Encoding
VLM training involves data throwing in big amounts - you will find clever strategies.- Pre-training - First, train your ViT encoder on image collections so it learns common visual patterns.
- Alignment - Following next, align visual with language embeddings to ensure similar concepts.
- Fine-tuning - Specific datasets facilitate everything's fine-tuning, answering questions, or generating captions[2].
The Nitty-Gritty Details
Vision encoding signifies transmitting raw pixel values from an image input, across layers, until those pixels transform into meaningful numerical representations.- Patch Extraction:
- Start by dividing your RGB grid into fixed-size squares, calling them "patches."
- A 224x224 pixel photo gets split into blocks of 16x16 pixels, with a total of 196 patches depending upon settings.
- Linear Projection & Positional Embeddings:
- Each patch undergoes a linear projection - it transforms high dimensionality signals to lower dimensionality signals.
- Since order has less importance, positional information gets added - spatial awareness gets maintained.