Group normalization (GroupNorm) is a normalization layer that divides the channels of each training example into fixed-size groups and standardizes the activations inside every group using that group’s own mean and variance. In neural networks, and especially in convolutional models used across artificial intelligence, it serves the same purpose as batch normalization, namely stabilizing and accelerating training, but it computes its statistics independently of the batch dimension.
Because the statistics never mix examples, the layer behaves identically during training and inference and keeps its accuracy when only one or two images fit on a GPU. That property made group normalization a standard choice in object detection, segmentation, diffusion models and other memory-heavy vision workloads.
How group normalization computes its statistics
Group normalization works on a feature tensor with shape N x C x H x W, where N is the batch size, C the number of channels and H x W the spatial size. The layer splits the C channels into G groups of C/G channels each, then computes one mean and one variance over all channels and spatial positions within a single group of a single sample.
Each activation is then normalized as x minus the group mean, divided by the square root of the group variance plus a small epsilon, typically 1e-5. Finally, a learnable per-channel scale (gamma) and shift (beta) restore the representational capacity that normalization alone would remove. Group normalization therefore adds only 2C trainable parameters to the layer.
The following table lists the main elements of the computation and their role.
| Element | Typical value | Role |
|---|---|---|
| Number of groups G | 32 (common default) | Sets how many channels share statistics |
| Channels per group | C / G, often 8 to 64 | Defines the size of each normalization set |
| Epsilon | 1e-5 or 1e-6 | Prevents division by zero |
| Gamma and beta | One pair per channel | Restore scale and offset after normalization |
| Reduction axes | Group channels, H, W | Exclude the batch dimension entirely |
Group normalization among related normalization layers
Group normalization sits on a continuum between layer normalization and instance normalization. With G = 1, all channels form a single group and the operation equals layer normalization over C, H and W. With G = C, every channel is its own group and the operation equals instance normalization. Intermediate values let the model share statistics among related feature channels without forcing all channels into one distribution.
The comparison below shows over which axes each common method computes its statistics.
| Method | Statistics computed over | Depends on batch size | Typical domain |
|---|---|---|---|
| Batch normalization | N, H, W per channel | Yes | CNNs with large batches |
| Layer normalization | C, H, W per sample | No | Transformers, RNNs |
| Instance normalization | H, W per channel and sample | No | Style transfer |
| Group normalization | Channel group, H, W per sample | No | Detection, segmentation, diffusion |
| RMSNorm | Features per token, no mean | No | Large language models |
Unlike batch normalization, group normalization keeps no running averages. The statistics are recomputed for every input, so there is no train-test discrepancy caused by stale or unrepresentative moving estimates.
Why batch independence matters
Batch normalization estimates statistics from the mini-batch, and that estimate becomes noisy and biased when the batch is small. In the original ResNet-50 experiments on ImageNet, batch normalization lost substantial accuracy as the per-GPU batch fell from 32 to 2 images, while group normalization kept its error nearly constant across batch sizes. At large batches, batch normalization usually remains slightly ahead.
Batch independence also simplifies engineering. There is no need for synchronized batch normalization across devices, no special handling of evaluation mode and no sensitivity to how examples are grouped. This matters in high-resolution segmentation, video models, 3D medical imaging and the U-Net backbones of diffusion models, where memory limits often allow only one to four samples per device.
Choosing the number of groups and placement
The number of groups is the main hyperparameter. A value of 32 works well for most convolutional backbones, and results are usually robust between 8 and 64 groups. The channel count must be divisible by G; some implementations instead fix the channels per group, for example 16, which adapts better to narrow layers.
The decision table below summarizes common situations and sensible configurations.
| Situation | Recommended choice | Reason |
|---|---|---|
| Batch of 1 to 8 per device | GroupNorm with G = 32 | Statistics stay reliable without the batch |
| Large batch image classification | Batch normalization | Slightly higher accuracy and fused inference |
| Diffusion U-Net blocks | GroupNorm, often 32 groups | Small batches and stable denoising |
| Narrow layers below 64 channels | Fewer groups or fixed group size | Avoids groups with too few channels |
| Weight-standardized convolutions | GroupNorm plus weight standardization | Closes the gap to batch normalization |
Placement follows the usual pattern: convolution, then group normalization, then the activation function such as ReLU or SiLU. In residual connections, initializing the last gamma of each block to zero can help very deep networks start close to an identity mapping.
Limitations and common mistakes
Group normalization is not free. Computing per-sample group statistics at inference time costs extra memory traffic and latency, whereas batch normalization can be folded into the preceding convolution after training. On edge devices this difference can be noticeable.
| Symptom | Likely cause | Fix |
|---|---|---|
| Shape error at construction | Channels not divisible by G | Change G or pad channel counts |
| Poor accuracy in thin layers | Groups contain only one or two channels | Reduce the number of groups |
| Training diverges in mixed precision | Variance computed in half precision | Compute statistics in float32 |
| Gap versus batch normalization | Large batches available | Consider batch normalization or weight standardization |
- Group normalization is not a regularizer in the way batch normalization partly is, because it adds no batch noise.
- Pretrained weights trained with batch normalization cannot be swapped to GroupNorm without fine-tuning.
- For transformers operating on token sequences, layer normalization or RMSNorm remains the conventional choice.
In everyday language
A neural network passes numbers from layer to layer. If those numbers grow too large or too small, learning becomes slow or unstable. Normalization keeps the numbers in a steady range.
Group normalization does this inside each single picture. It sorts the picture’s features into small teams, such as 32 teams. Each team is then adjusted to a common average and spread. Other pictures in the batch play no role. That is why it still works when the computer can hold only one picture at a time.
Seen in the real world
A medical imaging team trains a 3D segmentation network to outline tumors in CT volumes of 512 x 512 x 128 voxels. Each volume is so large that a single GPU holds only two samples. With batch normalization, validation scores fluctuate strongly between epochs, and results at inference differ from those seen during training.
The team replaces every batch normalization layer with group normalization using 16 groups, because several layers have only 32 or 64 channels. Training becomes smooth and reproducible, the gap between training and evaluation behavior disappears, and the Dice score on the validation set rises by several points. The same configuration is then deployed for inference one scan at a time without any change to the normalization layers.