What it does
A U-Net has a contracting path that convolves and downsamples, and an expanding path that upsamples back to the input size. At each resolution the encoder’s feature map is concatenated onto the decoder’s, so fine details lost in downsampling (edges, hair, thin structures) are available when the decoder draws the output. The final 1 × 1 convolution gives one value per pixel, typically passed through a sigmoid to make a mask. U²-Net nests a small U-Net inside each stage.
Formula
eℓ = Conv(Pool(eℓ−1))dℓ = Conv(Concat(Up(dℓ+1), eℓ))mask = σ(Conv1×1(d1))Shapes and parameters
- Shapes
- Image [N, 3, H, W] → bottleneck [N, 128, H/4, W/4] → mask [N, 1, H, W], same size as the input.
- Parameters
- Dominated by the deepest convolutions. The small example totals 231,617; full U-Nets reach tens of millions.
- Used for
- U²-Net-p saliency, MODNet portrait matting, PP-HumanSeg, medical and document segmentation.
In WeightSpace
Catalog encoder–decoder models are edited at the bias of the final output convolution: the fused saliency logit, the foreground alpha logit, or the person/background logits. A positive delta grows the mask everywhere, a negative one shrinks it.