Skip to content
Leyenda, the project page

Leyenda, the demo

the vision pipeline on ten real images

Pick an image: the pipeline sorts it, repairs it if it is noisy, then writes its caption. Further down, twelve freely licensed images show where the captioning model goes wrong.

See the project page

The model is trained on COCO, an English-language dataset: English is all it produces. Translating its output would distort the demonstration; you would be judging a translation, not the model.

The pipeline, image by image

Ten real images, run through the pipeline

A surfer on the crest of a wave. Clean: described without repair, "a man riding a wave on a surfboard".

Sort the imagesRepair if neededCaptionnot a photoa photoyesnoDescribe InceptionV3, LSTM
Sort the imagesRepair if neededyesnoCaptionDescribe InceptionV3, LSTM

DescribeInceptionV3, LSTM, Bahdanau attention

InceptionV3, frozen, splits the image into regions; an LSTM with attention writes the caption word by word, looking at the regions that matter.

Real demo image, real attention weights.

A surfer on the crest of a wave.
a man riding a wave on a surfboard

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.65

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    clean: nothing to repair

    variation 0.068, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    not applied: the image is clean

  4. Describe

    a man riding a wave on a surfboard

    0.8 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

A spinach pizza on a plate, on a wooden table.
a pizza sitting on top of a wooden table

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.75

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    clean: nothing to repair

    variation 0.048, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    not applied: the image is clean

  4. Describe

    a pizza sitting on top of a wooden table

    0.9 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

A man in a red jumper holds a skateboard above his head, on a stage.
a man in a red shirt is holding a skateboard

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.63

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    clean: nothing to repair

    variation 0.033, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    not applied: the image is clean

  4. Describe

    a man in a red shirt is holding a skateboard

    0.7 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

A cheese pizza on a white plate.
a pizza sitting on top of a white plate

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.68

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    clean: nothing to repair

    variation 0.058, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    not applied: the image is clean

  4. Describe

    a pizza sitting on top of a white plate

    1.4 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

A cross-country skier on a snowy track, in a forest.
a group of people riding skis on a snow covered slope

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.89

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    clean: nothing to repair

    variation 0.052, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    not applied: the image is clean

  4. Describe

    a group of people riding skis on a snow covered slope

    0.8 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

The skier photo, damaged by heavy noise.
a group of people skiing down a hill

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.81

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    noisy: denoise it

    variation 0.175, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    grain removed by the autoencoder

  4. Describe

    a group of people skiing down a hill

    0.5 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

The spinach pizza photo, damaged by heavy noise.
a plate with a plate of food on it

Hover over or tap a word: the reticle frames the area the model was looking at as it wrote it, and the thin line outlines the cells that carried at least half of its attention.

  1. Sort

    a photograph

    photo probability: 0.68

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    noisy: denoise it

    variation 0.207, threshold 0.105

    how much neighboring pixels vary, which noise drives up; threshold tuned on validation

  3. Denoise

    grain removed by the autoencoder

  4. Describe

    a plate with a plate of food on it

    1.5 s on an RTX 4080

    on CPU alone, more than 5 s: the demo is computed once, then served as is

A diagram of molecules drawn as red and blue balls.

The pipeline stops here.

  1. Sort

    set aside: not a photograph

    photo probability: 0.04

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    not reached

  3. Denoise

    not reached

  4. Describe

    not reached

A scanned page of text, a scene from a play.

The pipeline stops here.

  1. Sort

    set aside: not a photograph

    photo probability: 0.00

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    not reached

  3. Denoise

    not reached

  4. Describe

    not reached

A pencil portrait drawing.

The pipeline stops here.

  1. Sort

    set aside: not a photograph

    photo probability: 0.00

    from 0 to 1; above 0.5, it is a photograph

  2. Measure the noise

    not reached

  3. Denoise

    not reached

  4. Describe

    not reached

Where the caption holds, where it invents

These twelve freely licensed images went once through the captioning model alone, without sorting or denoising, and are published unfiltered.

Verdicts on the twelve images, by group
GroupImagesBreakdownCorrectPartialWrong
Subjects present in COCO7340
Subjects absent from COCO5005of which 3 invent people

The captioner learned from COCO alone: 118,287 photos, and a vocabulary of 10,296 words, those seen at least five times. A word it has never seen, it cannot write. On subjects COCO knows, the caption holds: three correct, four partial. Outside COCO, it describes the nearest COCO scene: five wrong out of five, three of which invent people.

Photograph: pizza on a table

Subject present in COCO

a pizza sitting on top of a wooden table

correct

Photograph: cat sitting

Subject present in COCO

a cat is laying on a bed

correct

Photograph: double-decker bus on a street

Subject present in COCO

a double decker bus parked in front of a building

correct

Photograph: golden retriever sitting on grass

Subject present in COCO

a black and white dog laying on top of a wooden bench

partialdog correct; color, posture and surface wrong

Photograph: bicycles parked on a street

Subject present in COCO

a person riding a bike down a street

partialobject and place correct; action invented, the bicycles are parked

Photograph: train at a platform

Subject present in COCO

a train that is parked on the tracks

partialthe place is right, these are tracks; but no train is visible

Photograph: romanesco broccoli close-up

Subject present in COCO

a close up of a plate of food on a table

partial"close up" and "food" correct; no plate, no table

Photograph: aurora borealis over a forest, at night

Subject absent from COCO

a group of people standing next to each other

wrongno people, no group: an aurora over a forest

Photograph: pollen grains under an electron microscope, colorized

Subject absent from COCO

a bunch of bananas sitting on top of a table

wrongno bananas, no table: pollen grains seen under a microscope

Photograph: oil painting, mountain landscape

Subject absent from COCO

a group of people standing on top of a body of water

wronghallucinates people

Photograph: refracting telescope on its mount

Subject absent from COCO

a fire hydrant sitting on top of a table

wrongno fire hydrant, no table: a refracting telescope

Photograph: sand dunes, empty desert

Subject absent from COCO

a group of people standing on a beach

wronghallucinates people; mistakes sand for a beach

1 of 12
  • The verdict. A visual comparison between the image and the generated caption.
  • The limitation. Five images illustrate a failure mode; they do not measure a rate.

What these captions are worth

Captioning, on the test set: 4,000 COCO val2017 images, never seen in training
MetricGreedyScale from 0 to 1BeamGain
BLEU-4four-word runs shared with five human-written captions0.1870.229×1.22
CIDErwords people judged important0.5460.600×1.10

All the measurements on the project page

Image credits

The twelve freely licensed images come from Wikimedia Commons, under licenses that allow redistribution.