Dataset preparation
A custom landscape-image dataset is prepared as paired grayscale and color examples. Images are transformed into Lab color space so luminance can be separated from chrominance.
A deep-learning colorization pipeline that learns to predict chrominance from grayscale landscape images in Lab color space and reconstructs the result back to RGB.


Drag the divider to compare the grayscale input with the model’s predicted colorization.
A custom landscape-image dataset is prepared as paired grayscale and color examples. Images are transformed into Lab color space so luminance can be separated from chrominance.
The encoder downsamples the image to capture context while the decoder restores spatial resolution. Skip connections preserve fine details between matching encoder and decoder stages.
The network outputs a two-channel tensor for the a and b chrominance components. A tanh activation constrains the prediction before the channels are combined with luminance.
Training uses MSELoss, Adam, a 10% validation split and automatic mixed precision. The trained state is saved as colorization_unet.pth and can be reloaded for inference.
View full result image ↗