What it does
Instance normalization computes the mean and variance of every channel of every image separately, over its height and width, and normalizes with them. This strips out global contrast and color casts of a particular image, which is why fast style transfer networks use it: the output style no longer depends on the lighting of the content photo. Group normalization pools channels into groups before computing statistics; it sits between instance norm (one channel per group) and layer norm (one group for all channels) and does not depend on batch size.
Formula
μnc = (1/HW) Σy,x xncyx, σnc2 = (1/HW) Σy,x (xncyx − μnc)2yncyx = γc · (xncyx − μnc) / √(σnc2 + ε) + βcShapes and parameters
- Shapes
- Input [N, C, H, W]; γ and β are [C]; output [N, C, H, W].
- Parameters
- 2 × C. A 128-channel layer has 256.
- Used for
- Fast neural style transfer, image generators, diffusion and segmentation networks trained with small batches.
In WeightSpace
Read-only in WeightSpace today. The mosaic style model is edited at the bias of its final convolution, after its instance-normalized layers.