Neural Methods
The operations that are learned rather than written. What they do well, what they invent, and where a hand-written kernel is still the better answer.
A convolutional network is a stack of the same operation from Module 03, with the kernel weights found by optimisation instead of by design. That continuity matters. Neural methods did not replace the classical toolkit, they extended the part of it that was already dominant.
Classical Filters against Deep Learning
The dividing line is whether the task has a correct answer that can be written down. Rotating an image by twelve degrees has one. Deciding which pixels belong to a cat does not.
| Property | Classical operator | Learned model |
|---|---|---|
| Determinism | Identical output every run | Identical only with fixed weights and seed. |
| Explainability | The kernel is the explanation | Behaviour inferred from evaluation. |
| Cost | Microseconds to milliseconds | Milliseconds to seconds, often on a GPU. |
| Failure mode | Predictable artefacts | Plausible but incorrect content. |
| Best at | Well-specified transforms | Tasks defined by examples. |
Super-Resolution
Classical upscaling interpolates between known samples and is therefore limited to what a smooth function can express. Learned upscalers hallucinate texture that matches the statistics of real images at the target scale, which is why they look sharp where bicubic looks soft.
ESRGAN and successors
An adversarial loss pushes output toward realistic texture. Very sharp results, occasional invented detail that was never in the source.
SwinIR and relatives
Attention over shifted windows captures longer-range structure. More faithful than GAN approaches, and heavier to run.
Latent upscalers
Highest perceptual quality on difficult inputs, at the cost of many sampling steps and weak guarantees of fidelity.
Lanczos and friends
Still the right answer when the output must be an interpolation of the input and nothing else. Instant, and honest about what it does not know.
Image prompt
Two versions of the same upscaled image for a before and after slider. Subject: a close crop of a weathered wooden shutter with peeling paint and a small ceramic tile, originally low resolution. Version A: interpolated upscale, soft edges, smeared paint texture, no fine grain. Version B: identical framing from a learned upscale, crisp paint flake edges, invented but plausible wood grain, slightly waxy surface texture. Photographic, identical composition and colour between the two, no text, 16:9.
Segmentation and Background Removal
Segmentation assigns a class or an instance to every pixel. U-Net established the encoder and decoder shape with skip connections that carry spatial detail past the bottleneck, and most architectures since are variations on it.
Promptable models such as Segment Anything changed the interface rather than the output. A click, a box, or a coarse mask becomes the query, and the model returns a boundary. For background removal that turns a per-image training problem into a per-image interaction.

Image prompt
Minimal symmetric network diagram on a transparent background shaped like a U. Left descending arm: four rectangles decreasing in height, connected by downward arrows. Bottom: one small rectangle. Right ascending arm: four rectangles increasing in height, connected by upward arrows. Four horizontal dashed cyan arrows connect each left rectangle to its counterpart on the right. All shapes drawn as thin 1.5px grey outlines with no fill, no text, flat vector, generous negative space, 16:8.
Inpainting
Inpainting fills a masked region with content consistent with its surroundings. Classical methods propagate structure inward from the boundary and work well on small scratches and dust. They fail as soon as the hole is large enough to require an object rather than a texture.
Diffusion based inpainting generates the region conditioned on the rest of the image, which handles object removal convincingly. The mask edge is where quality is decided: feather it, and dilate slightly beyond the object to include its shadow and reflection.
Deployment notes
| Runtime | Where it runs | Trade-off |
|---|---|---|
| ONNX Runtime Web | Browser, Wasm or WebGL backend | Wide model support, large bundle. |
| TensorFlow.js | Browser, WebGL or WebGPU | Mature tooling, uneven operator coverage. |
| Transformers.js | Browser, Wasm and WebGPU | Simple API for common vision models. |
| Server inference | Remote GPU | No client cost, but latency and privacy questions. |
Whichever runtime is chosen, the pre and post processing stages remain classical image processing. Resizing to the model input size, normalising channels, converting colour spaces, and cleaning the output mask are all operations from the earlier modules. The network is one stage in a pipeline, not a replacement for it.