AIDeblurA PictureEditor.com tool

What a deblur model can reconstruct

The interesting question is not whether a network makes a blurred frame look better. It is which of the details it produces were in the file, which were in the training set, and how anybody looking at the output is meant to tell the two apart.

A smear is an average, and averages lose an argument

Hold a camera still and each point of the scene lands on one sensor cell. Move it while the shutter is open and that point is smeared across a short line of cells, and every cell along the line records the sum of everything that passed over it. The file you end up with is a set of sums.

Recovering the scene from the sums is an equation with more unknowns than equations, and it stays that way however much arithmetic is applied. There is not one scene that produces your file; there is a family of them. High-frequency detail is where the family members disagree most, which is exactly why detail is the first thing to go and the last thing to come back.

Two different strategies pick a member of that family. A measured pass picks the one most consistent with a smear it read off the frame, and stops. A trained network picks the one that looks most like the sharp frames it was shown during training. The second produces more convincing pictures and makes a stronger claim, and the strength of that claim is the whole subject of this page.

What a prior is, in the only sense that matters here

A network trained on pairs of sharp and smeared frames does not learn to invert anything. It learns what sharp things tend to look like. Brick edges are straight. Eyelashes are fine dark lines against a lighter field. A printed stroke has a clean boundary rather than a gradient. Given a smeared input it produces an output carrying those properties, because outputs carrying those properties are what scored well during training.

That is enormously useful and it is also the failure mode. When the input genuinely contains a smeared brick edge, the prior puts the edge back where the arithmetic can only manage a gradient. When the input contains something the network has no expectation about, the prior still applies — and what comes back is the network’s idea of a plausible sharp thing in that position, rendered with exactly the same confidence as the correct parts of the frame. Nothing in the output marks which is which.

The word this domain uses

Reconstruction, and not recovery. Recovery is a claim about information, and the information about what was between the samples was never written down. Restoration is the wrong word too and belongs to a different problem — a scratch or a tear is damage laid on top of a photograph, and removing it is a question of what to put back where something was lost. A smear is the photograph itself, recorded along a path.

Why the corpus decides the competence

The published export is trained on the GoPro set: sequences shot hand-held at high frame rate, where consecutive frames are averaged to synthesise a realistic motion blur and the middle frame is the sharp target. Every pair in it is therefore a natural scene, shot hand-held, blurred by movement of the camera rather than of the subject, over a short exposure.

That is a narrow and well-chosen slice of the world, and it is precisely why the model is good at the thing it is good at. It is also why the list below is not a list of bugs. Each item is a failure the corpus contains no example of.

  • Defocus. An out-of-focus lens spreads a point into a disc, not along a line, and it does so differently at different distances in the same frame. The corpus has essentially none of it, and a network asked to undo it applies the wrong shape confidently.
  • Subject movement. A car that moved while the camera stayed still produces a smear in one region of an otherwise sharp frame. A single global correction is the wrong instrument for that and makes the sharp regions worse.
  • Long exposures. Past roughly a tenth of the frame width, the sums no longer constrain the scene enough for any method to pick a member of the family that resembles it.
  • Compression artefacts. A frame that has been through a messaging app twice carries block edges that look like structure. Both a measured pass and a trained one will happily sharpen them.
  • Anything discarded in blocks. A mosaic or a pixelation is not a smear at all, and there is nothing spread out to gather back together.

Reading a result the way somebody sceptical would

Four habits, in the order they are worth applying:

Compare, alwaysHold the frame as it arrived under the result. Detail that appears in the reconstruction and has no corresponding smudge in the input is detail nothing measured — the prior wrote it.
Watch the edges of edgesRinging, a bright fringe running parallel to a strong boundary, is the arithmetic overshooting. It is a reliable sign that the estimated extent was too large for that region of the frame.
Distrust small text and facesThese are the two places where a plausible wrong answer is indistinguishable from a right one at a glance, and the two places where being wrong costs the most.
Check the measurement firstIf the rail reports a block grid, or reports that there is nothing much to undo, the honest next step is to stop rather than to run a pass and read meaning into the difference.

None of this makes a reconstruction untrustworthy. It makes it a particular kind of evidence: good for reading a street name, good for rescuing a frame that was the only one taken, and not good for anything where a confident wrong answer is worse than no answer at all.