HomeLearnCoursesHackathonsAccount
Image Segmentation
How Models Produce Pixel-Level Output · 1/2

Compress to understand, then expand to paint

3x3 filter scans the imageedge found

Conceptually, a common approach to segmentation splits the job into two halves. First, an encoder progressively compresses the image down through a series of layers, shrinking its spatial size while building up an understanding of what's present, this part looks a lot like the convolutional layers used in image classification and detection, where each layer applies filters that detect increasingly abstract patterns. By the bottom of the encoder, the model has a compact, information-dense summary of what's in the image, but it has lost precise pixel positions along the way.

Then a decoder takes over and does the reverse, progressively expanding that compressed understanding back up to the original image resolution. At each step of expansion, the decoder paints in a class label for every pixel, essentially rebuilding a full-resolution image where the 'color' at each position is now a class prediction rather than the original pixel value. This compress-then-expand shape is often drawn as a 'U', narrow at the bottom and wide at the top and bottom edges, so it's commonly called a U-shaped or encoder-decoder architecture.