Skip to content
All projects

Leyenda

computer vision with Deep Learning

A pipeline of trained models sorts the images of a digitized collection, repairs the noisy ones, then writes their caption. It runs end to end in an online demo.

Try the demo

  • 3

    models in a pipeline

    Sort, denoise, caption: each one decides what the next receives.

  • 30

    models compared

    Trained and ranked stage by stage before the final three were kept.

  • 100%

    of noisy images caught

    Before any denoising, by a detector tuned on 40 validation images.

Setting
Academic, CESI, Deep Learning module
Period
June 2026
Team
Five
Client
Fictional: a digitization company and its archive collections
ChapterProblemContents
  1. Problem
  2. Constraints
  3. Architecture
  4. Decisions
  5. Results
  6. Limitations and lessons learned

Problem

Image collections to describe

The client, a fictional one, digitizes archives for its customers. Its collections mix photographs, paintings, diagrams, drawings and scanned text pages, with no usable annotation. The brief: write a caption for every photograph, automatically.

Two traps come with it. Describing a diagram as if it were a photo gives an absurd caption. Describing a photo damaged by noise gives a damaged caption. Hence a pipeline of specialized stages rather than a single model.

Constraints

Repair only what needs repairing

  • Methods set by the brief. A convolutional autoencoder to denoise, a pretrained CNN followed by an LSTM to caption.
  • Few images to learn denoising from. 148 photos, with no noisy version: the noise is generated, with a fixed seed per subset.
  • Denoising a clean image damages it. The denoiser must therefore only touch the images that need it.
  • A stream where photos are the minority. They make up only a quarter of the images to sort.
  • Numeric targets set before any experiment, stage by stage.

Architecture

The path of an image

The models are chained: the output of one decides the input of the next. The live demo shows the pipeline at work, on real images.

  • Sort A CNN trained from scratch on five families decides whether the image is a photograph.
  • Spot the noise The variance of the Laplacian measures how much neighboring pixels vary, which noise drives up, and compares it with a threshold tuned on validation.
  • Denoise A convolutional autoencoder rebuilds a clean image, and only sees the images flagged by the detector.
  • Describe InceptionV3, frozen, splits the image into regions; an attention LSTM writes the caption word by word, looking at the relevant regions.

Try the demo

What holds the pipeline together

  • Tune The noise threshold is tuned on validation images, never on the test set.
  • Reproduce Seeds and determinism options set before TensorFlow loads; a containerized environment with GPU access.
  • Prepare Image features are computed once and cached, so the captioner can train on the whole of COCO 2017.
  • Show The demo replays the pipeline, then captions twelve freely licensed images, published without selection.

Decisions

The model kept is not the best one

Seven decisions and what settled them
DecisionOption ruled outWhat settled it
A convolutional autoencoder to denoiseU-Net; DnCNNOur autoencoder rather than a U-Net: 16 times lighter (113,000 parameters vs. 1.9 million), 6 times faster to train, 3 times faster in use, at the cost of 1.4 dB, about 5%. And a model we built end to end ourselves, rather than an off-the-shelf architecture. The DnCNN, the same size, does slightly better, but the brief required the autoencoder.
Denoise only the noisy imagesDenoising everythingThe denoiser degrades clean images. A detector decides before acting.
Laplacian variance as the detectorThe autoencoder's reconstruction errorIt sorts 100% of the clean and noisy test images correctly, the other only 78%, and it depends on no model.
Measure the measurement noise before comparingRanking models on a single training runThree seeds give a standard deviation of 0.04 dB: below that, two models cannot be told apart.
No sharpening filter after denoisingA sharpening post-processMeasured, it lowers the PSNR, down to 23.85 dB.
InceptionV3 to read the imageEncoders with a 49-region gridIts attention grid is the finest, with 64 regions.
Beam search to writeGreedy decodingCaptions closer to the ones people wrote (measurements below). Settings chosen on 200 validation images.

Results

Every stage, measured on unseen images

Each stage is measured on a set held out from training, compared with a baseline that learns nothing.

Five denoisers, on equal terms

Denoising PSNR: 24.43 dB. How closely the repaired image matches the original, in decibels. Higher is better. On a scale from 10 dB to 30 dB: noisy image, 12.01; median filter, 18.22; our autoencoder, 24.43; U-Net, 25.83.

  • Noisy image, the starting point: 12.01 dB.
  • Median filter, with no learning at all: 18.22 dB.
  • Dense autoencoder, 77,254,208 parameters: 13.42 dB.
  • Convolutional autoencoder, kept, 112,579 parameters: 24.43 dB.
  • DnCNN, 114,307 parameters: 24.72 dB.
  • U-Net, 1,883,267 parameters: 25.83 dB.

Convolution makes the difference: the dense autoencoder, almost seven hundred times larger than the convolutional one, stays below the median filter.

All other measurements

  • Sorting, images correctly classified: 77.66%, vs. 75.47% for a model that always answers “non-photo”.
  • Sorting, scanned text and drawings taken for photos: 0 % error.
  • Sorting, paintings taken for photos: 64.7% after targeted correction, compared with 79.6% before.
  • Denoising, time per image: 0.65 ms.
  • Detector, clean images let through without denoising: 95%, on validation.

Denoising SSIM: 0.677. How closely the structure of the repaired image matches the original, from 0 to 1. Higher is better. On a scale from 0 to 1: noisy image, 0.137; our autoencoder, 0.677; U-Net, 0.741.

Caption BLEU-4: 0.229. The share of one- to four-word groups that the model's caption shares with captions written by people, from 0 to 1. Higher is better. On a scale from 0 to 1: greedy decoding, 0.187; our captioner, beam search, 0.229; ceiling of this model family, about 0.24.

Caption CIDEr: 0.6. How close the caption comes to captions written by people, giving more weight to the words they judge important. Higher is better. On a scale from 0 to 1.2: greedy decoding, 0.546; our captioner, beam search, 0.6.

  • The sets. Sorting: 6,111 test images, opened once. Denoising: 23 test images, drawn from the same small collection. Captioning: 4,000 COCO val2017 images, never seen in training.
  • The noise. Gaussian, with a standard deviation of 0.3, generated once with a fixed seed per subset: every model sees the same pairs.
  • The baselines. A model that always answers “non-photo”, a median filter, and the BLEU-4 of 0.24 at which this architecture family tops out in the literature.
  • The settings. Always chosen on validation, never on the test set.

Limitations and lessons learned

Test outside the training images sooner

Beyond its training images, the captioner gets things wrong. On the five demo images whose subject is absent from COCO, 5 out of 5 images get a wrong caption, and the captions of 3 out of 5 images invent people. Five images illustrate a failure mode; they do not measure a rate. A small hand-built control set, from day one, would have shown it before the demo did.

The sorter stays below its accuracy target of 85%. The targeted correction on paintings raised the photos wrongly rejected from 4.6% to 12.5%, and a rejected photo is never described. I would start from a pretrained sorting encoder.

No figure measures the whole pipeline: what sorting and denoising add to the final caption is unknown, yet that is the question that justifies the pipeline. Denoising is measured on a very small set only, with no confidence interval.