← All work

schillyCL: image restoration model

2026ML engineerPython · PyTorch · Real-ESRGAN · OpenCV

schillyCL restores scanned magazine pages: it removes paper grain, yellowing and halftone artifacts while keeping the black ink lines intact. It is a fine-tune of the Real-ESRGAN RRDBNet architecture, trained on scan-to-digital pairs aligned by feature matching.

It's in production use for restoration work.

Output

Scanned page before restoration: paper grain, yellowing, halftone dots
Input, raw scan
The same page after restoration: clean paper, solid ink lines
Output, restored by the model
A second scanned page before restoration
Input, raw scan
The same second page after restoration
Output, restored by the model

What I built

The loss function is a weighted L1 that penalises an incorrect dark pixel three times harder than a light one. Standard L1 treats every pixel the same. Most of a scanned page is flat paper, so a model trained on plain L1 lowers its error fastest by smoothing everything, and the ink lines soften with it. Weighting the dark end stops that.

Full-resolution pages run through tiled inference with Gaussian blending, so tiles overlap and merge without visible seams. A residual-diff diagnostic renders exactly what the model removed from an image, which is how I check it's subtracting damage rather than redrawing content.

The operation underneath

Restoration is built out of convolution. A small kernel steps across the image. At each position the nine pixel values under it are multiplied by the kernel's weights and summed into one number, which becomes one pixel of a feature map. A trained network stacks hundreds of these, and that is how it learns to tell ink from paper grain.

Code

github.com/schilly-stack