JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

When Pixels Meet Words: The Big Picture of Vision-Language

Discover why teaching machines to connect what they see with what we say unlocks captioning, search, and answering questions about any picture.

The Dream: Machines That Both See and Speak

Everything you met earlier in this computer-vision ladder shared a quiet limitation. A classifier hands you one label from a fixed list it was trained on: 'cat', 'dog', 'truck'. A detector draws boxes, but each box still gets a label from that same closed menu. A segmenter colours every pixel, again choosing from a pre-decided set of classes. They are powerful, but they can only ever answer the exact question their menu was built to answer. Ask a classifier 'is the person in this photo happy?' and it simply has no slot for that — the question lives outside its vocabulary.

Now imagine a different kind of model. You hand it a picture and simply talk to it. 'Describe this.' 'What colour is the umbrella?' 'Find me the photo with a red umbrella.' It reads your words, looks at the pixels, and answers in words of its own — fluent, open-ended sentences, not a number pointing into a fixed list. The input is natural language and the output is natural language, so the very same model can be asked almost anything. That single change — from a closed menu to open language — is the leap that opens up this whole track.

Think of how a toddler learns. She points at a furry thing and you say 'dog'; she points at the moon and you say 'moon'. Pointing is her vision; your words are the language wrapped around what she sees. Over thousands of these moments, seeing and saying fuse into one act of understanding. The models in this track try to recreate exactly that fusion. And the reason language is the right glue is that language is the universal interface: it is how humans have always specified what we mean and what we want. If a machine can take instructions and give answers in words, anyone can use it — no fixed menu, no special label set, just talking.

We call this family of models a vision-language model: one system that holds both worlds — pixels and words — and lets them speak to each other. For the rest of this guide we will map out what these models can do and why they all secretly rely on one shared idea. Then the four guides that follow will open the hood and show you, piece by piece, exactly how they work. Consider this the aerial photograph before we walk the streets.

The Four Tasks That Define the Field

Let's make this concrete with one picture we will keep returning to. Imagine a single photo: a person standing on a wet city street in the rain, holding a bright red umbrella. Hold that image in your mind. We are going to ask four very different-sounding things of it — and the punchline at the end is that they are not really four things at all.

First, image captioning: image in, a fluent sentence out. We feed the photo and the model writes 'A person holds a red umbrella while walking down a rainy street.' Notice it had to choose words and order them grammatically — it is generating language conditioned on what it sees, not picking from a list.

Second, visual question answering (VQA): image plus a question in, an answer out. We give the same photo and ask 'What colour is the umbrella?' and it replies 'Red.' We could just as easily ask 'Is it raining?' ('Yes') or 'How many people are there?' ('One'). The image stays fixed; the question is what changes, and the model must find the part of the picture each question is about.

Third, image-text retrieval: matching across a whole library, in either direction. Text-to-image: you type 'red umbrella' into a photo app holding ten thousand pictures, and it surfaces our photo near the top. Image-to-text: you hand the app the photo and it picks, from a list of captions, the one that fits best. Retrieval is ranking — sorting a pile by how well each item matches the query on the other side.

And a fourth, as a teaser for the next guide: zero-shot classification. Instead of training on a fixed label set, you just write the candidate labels as text — 'a photo of an umbrella', 'a photo of a bicycle' — and ask which one the image matches best. You can invent brand-new categories at test time, no retraining. The next guide (CLIP) is built precisely around this trick, so we will leave the details there.

One Shared Map for Two Worlds

This is the conceptual heart of the whole track, so let's go slowly. Start with one idea: an embedding. An embedding turns something messy — an image, a sentence — into a list of numbers, which you can read as coordinates in a high-dimensional space. Two coordinates place a point on a sheet of paper; three place it in a room. A vision-language model might use 512 or 768 numbers, placing each thing as a point in a 512-dimensional 'space' we cannot picture but can reason about. The promise of a good embedding is that meaning becomes geometry: things that mean similar things land close together, and things that mean different things land far apart.

Now the trick that makes vision-language models possible: put both images and text into the same space, with the same coordinate system. A photo of a dog and the words 'a photo of a dog' should land at nearly the same spot. Two analogies. (1) Think of two people speaking different languages — say Mandarin and French — who each translate their sentence into one shared 'meaning space'; once both are in that space, you can tell that 紅雨傘 and parapluie rouge mean the same thing even though the raw symbols share nothing. (2) Picture a treasure map where every photo and every caption is a pin, and the pins are placed by meaning, not by raw pixels or raw letters — so 'red umbrella' and the umbrella photo get stuck into the map right next to each other. That shared map is the foundation a vision-language model is built on.

Images and captions are each turned into points in one shared space; matching pairs are pulled together and mismatched pairs pushed apart.

A diagram showing an image encoder and a text encoder feeding into one shared embedding space, with arrows pulling a matching image-caption pair close and pushing non-matching pairs apart.

If meaning is now a position on a map, then 'do these two things mean the same?' becomes a geometry question: *how close are their two points?* We need a concrete number for closeness. We could measure the straight-line distance between the points, but there is a subtler, more useful measure that ignores how 'loud' a vector is and looks only at the direction it points. That measure is cosine similarity, and it is the quiet engine under almost every model in this track.

\operatorname{sim}(u, v) = \frac{u \cdot v}{\lVert u \rVert \, \lVert v \rVert}

Cosine similarity between an image embedding u and a text embedding v.

Let's read every piece of this. Here u is the image embedding — the list of coordinates for the photo — and v is the text embedding — the coordinates for the caption. The top, u · v, is the dot product: multiply the two vectors element by element and add up all those products. (If u = (3, 4) and v = (6, 8), then u · v = 3·6 + 4·8 = 18 + 32 = 50.) The dot product is large when the two vectors point the same way, but it also grows just because the vectors are long — and length here is mostly noise (a vivid vs. a faint description), not meaning. So we divide it away. ‖u‖ and ‖v‖ are the norms, the lengths of the arrows, each found by squaring the coordinates, summing, and taking the square root (‖u‖ = √(3² + 4²) = √25 = 5, and ‖v‖ = √(6² + 8²) = √100 = 10). Dividing the dot product by both lengths strips out all magnitude, leaving only the direction — geometrically, the cosine of the angle between the two arrows. The result always lands between −1 (pointing opposite ways, opposite meaning), through 0 (at right angles, unrelated), up to +1 (pointing the same way, same meaning). In our example, sim = 50 / (5·10) = 50/50 = 1: v is just u scaled up, so it points in the identical direction — perfect alignment. The whole intuition collapses to one slogan: closeness = a small angle.

import numpy as np

def cosine_similarity(u, v):
    # dot product: sum of element-wise products
    dot = np.dot(u, v)
    # norms: the lengths of each arrow
    norm_u = np.linalg.norm(u)
    norm_v = np.linalg.norm(v)
    # divide out magnitude -> only direction (the angle) remains
    return dot / (norm_u * norm_v)

image_emb = np.array([3.0, 4.0])      # 'photo of a red umbrella'
text_match = np.array([6.0, 8.0])     # 'a red umbrella'   (same direction)
text_other = np.array([-4.0, 3.0])    # 'a blue bicycle'   (right angle)

print(cosine_similarity(image_emb, text_match))   # 1.0  -> same meaning
print(cosine_similarity(image_emb, text_other))   # 0.0  -> unrelated
Cosine similarity in a few lines: matching meaning scores near 1, unrelated meaning near 0.

Two Ways to Wire Vision and Language Together

Now that you have the shared-map idea, here is the map of the journey itself — the spectrum of architectures the next four guides unpack. They differ in one question: how much do the vision side and the language side actually interact? We will keep this at the intuition level; the equations come in the later guides. Think of three points along a dial, from 'barely talk' to 'fully merged'.

At the 'barely talk' end sit dual encoders, also called two towers. One tower reads the image into a single vector; a separate tower reads the text into a single vector; then you simply compare the two with cosine similarity — nothing more. The two sides never look at each other's internals; they only meet at the very end as two finished points on the shared map. This is fast (you can pre-compute every image vector once and reuse it for any query) and it is exactly how CLIP works — your next guide.

Turn the dial up and you get fusion encoders. Here the two streams do not just meet at the end — they talk while thinking, through a mechanism called cross-attention, where the language side can look directly at specific regions of the image and vice versa. This lets the model handle questions a single comparison can't, like 'is the person to the left of the umbrella holding it?', which needs the words and the pixels to reason jointly. This is the territory of BLIP, your third guide, and the cross-attention machinery itself is the focus of the guide after that.

At the far 'fully merged' end sit LLM-centric models — a multimodal large language model. Here you take a powerful, already-trained language model and feed images into it as if they were extra words, so the LLM can read a picture and then reason, explain, and converse about it with all the fluency it already has. This is how systems like LLaVA and Flamingo work, and it is your fifth and final guide.

How We Know It Works (and When It Fails)

A model that can say anything can also say anything wrong, so we need honest ways to measure it — one per task. For image-text retrieval the standard yardstick is recall@K, and it is wonderfully plain: for each query, look at the top K results the model returns; did the genuinely correct item show up somewhere in that top K? Recall@1 asks 'was the very best guess right?'; recall@5 is more forgiving — 'was the right answer anywhere in the top five?'. Average that yes/no over many queries and you get a percentage. It mirrors real life: when you search a photo app, you happily scan the first handful of results, so 'is the right photo in the top 5?' is exactly what you care about.

def recall_at_k(ranked_results, correct_item, k):
    # ranked_results: items sorted best-first by cosine similarity
    # returns 1 if the correct item is in the top k, else 0
    return 1 if correct_item in ranked_results[:k] else 0

# average this over every query in your test set, then x100 for a percent
recall@K in plain pseudocode: a hit if the right item is anywhere in the top K.

For image captioning there is no single 'correct' sentence — many phrasings are fine — so we compare the model's caption against several human-written ones and score the overlap. BLEU roughly counts how many short word-sequences the machine shares with the humans; CIDEr is a captioning-specific score that weights the words humans tend to agree on. Treat both as rough thermometers, not truth: a caption can score well by parroting common phrases yet miss the actual scene, or score poorly while being a perfectly good different description. They guide development; they do not certify understanding.

For visual question answering the measure is the simplest of all: accuracy — what fraction of questions the model answers the way humans did. Because several human answers are collected per question, an answer usually counts as correct if enough people gave it too, which gently tolerates wording differences like 'red' vs 'bright red'.

Recall asks: of the items that should have been found, how many did we actually retrieve in our top results?

A diagram illustrating precision and recall, highlighting recall as the share of all relevant items that appear among the retrieved results.

Now the honest part, and please carry it into every later guide. These models hallucinate: a captioner may confidently describe a cat that simply is not in the photo, because it has seen 'a cat on a sofa' so often that the words flow whether or not the pixels support them. They inherit bias from the web data they learn on — they can lean on stereotypes (assuming a doctor is a man, a nurse a woman) and perform worse on people, places, and cultures underrepresented online. And they are heavily English-centric: trained mostly on English captions, they understand English prompts far better than other languages, which is a real limitation for a Mandarin or French speaker. None of this means the models are useless — it means you should read their fluent answers critically, knowing a confident sentence is not a guarantee of a correct one.

Web-trained vision-language models can perform unevenly across groups, reflecting biases baked into their training data.

A diagram about fairness in machine learning, showing a model performing unequally across different demographic groups.