NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AFN: Adaptive Fusion Normalization via an Encoder-Decoder Framework

Zikai Zhou, Shuo Zhang, Ziruo Wang, Huanran ChenarXiv 2023

TL;DR

Adaptive Fusion Normalisation (AFN) is a novel normalization layer that combines the stability of Batch Normalisation (BN) with the adaptive power of an encoder-decoder framework. By utilizing residual learning to blend learned statistics with raw batch data, AFN achieves state-of-the-art performance in both standard image classification and challenging domain generalization tasks, effectively solving the gradient instability issues found in previous adaptive methods.

What Problem Does This Paper Address?

Normalization layers (like BN, LN, or IN) are the unsung heroes of deep learning, ensuring gradients flow smoothly and training converges. However, most existing methods are "one-trick ponies": Batch Normalisation (BN) excels at image classification but struggles with domain shifts; Instance Normalisation (IN) is great for style transfer but lags in classification.

Recent attempts to unify these, such as ASRNorm, have shown promise in domain generalization (adapting to new, unseen environments). However, the authors identify two critical flaws in ASRNorm:

  1. Instability: It frequently suffers from gradient explosion or vanishing, leading to training failure.
  2. Specialization: It performs poorly on standard image classification tasks because it struggles to capture inter-instance relationships within a batch.

AFN aims to bridge this gap, creating a robust, "all-terrain" normalization layer.

Methods

The core of AFN is a two-step process: Standardisation and Rescaling, both powered by an encoder-decoder architecture.

1. Standardisation with Residual Learning

Unlike standard BN, which simply subtracts the batch mean and divides by the standard deviation, AFN uses a small neural network (an encoder and two decoders) to learn "better" statistics ($\mu_{stan}$ and $\sigma_{stan}$) for the current mini-batch.

To ensure stability, the authors introduce a residual learning framework. They linearly combine the raw batch statistics with the learned ones: $$\hat{\mu}_{stan} = \lambda_\mu * \mu_{stan} + (1 - \lambda_\mu) * \mu$$ Early in training, the learnable parameter $\lambda$ is initialized to be very small. This forces the layer to behave like standard BN initially, providing a stable foundation before gradually adapting to the specific data distribution.

2. Rescaling

After standardisation, the features are rescaled using learned weights ($\hat{\gamma}$) and biases ($\hat{\beta}$). Again, these are generated by an encoder-decoder that takes the batch standard deviation and mean as input, allowing the scaling factors to adapt dynamically to the input data.

Fig. 2. Overview of our method, which is divided into two steps: standardisation and rescaling. We use an encoder-decoder framework to learn both the standardisation and rescaling statistics from the mini-batch statistics of the input. For the standard- isation stage, we use a residual learning framework to render our training process stable.

Datasets

The authors evaluated AFN across a wide variety of benchmarks:

  • Image Classification: CIFAR-10, CIFAR-100, SVHN, and MNIST-M.
  • Domain Generalisation:
    • Digits: A combination of MNIST, SVHN, USPS, and MNIST-M.
  • CIFAR-10-C: CIFAR-10 corrupted with 19 different types of noise/blur at 5 intensity levels.
  • PACS: A challenging dataset featuring four domains: Art painting, Cartoon, Photo, and Sketch.
Fig. 4. Illustration of domain generalisation with the PACS benchmark. Single-domain generalisation aims at training a model on one source domain data, while generalising well to other domains with very different visual presentations. For multi-domain generalisation, one source domain data is used for training, and the others are used for testing.

Key Insights and Ideas

  • Stability is Key: The most significant "aha moment" is the use of residual learning for normalization statistics. By starting as BN and evolving into a more complex adaptive layer, AFN avoids the "NaN" errors and gradient explosions that plague ASRNorm (as seen in the authors' VGG16 experiments).
  • Batch vs. Instance: The authors argue that using mini-batch statistics (like BN) rather than per-instance statistics (like IN or ASRNorm) is crucial for capturing the relationships between different images in a batch, which is why AFN succeeds in classification where others fail.
  • Robustness to Corruption: AFN shows its greatest strength as domain discrepancy increases. As shown in Figure 1, while all methods lose accuracy as corruption gets worse, AFN maintains a significantly higher performance ceiling than BN or ASRNorm.
Fig. 1. Accuracy of three different normalisation methods for single domain generalisation on CIFAR-10-C, compared at five different levels of domain discrepancy brought by cor- ruptions.

Key Results

  • Domain Generalisation: AFN outperformed ASRNorm by an average of 0.6% to 1.6% across Digits, CIFAR-10-C, and PACS. On the most difficult level of CIFAR-10-C corruption, AFN beat ASRNorm by 4.1%.
  • Image Classification: AFN consistently outperformed BN across various backbones (ResNet, WRN, VGG). Notably, while ASRNorm often failed to converge (producing "NaN" values), AFN remained stable and improved accuracy by roughly 0.5% to 1% over standard BN.

Limitations and Future Work

The authors acknowledge that while the current encoder-decoder structure (single fully connected layers) is efficient, there is room to explore more complex architectures for these sub-modules to potentially yield even better results. Additionally, they plan to extend AFN beyond computer vision into fields like speech recognition to test its versatility.

Summary updated

BibTeX
@misc{zhou2023afn,
  author = {Zikai Zhou and Shuo Zhang and Ziruo Wang and Huanran Chen},
  title = {{AFN: Adaptive Fusion Normalization via an Encoder-Decoder Framework}},
  year = {2023},
  eprint = {2308.03321},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.03321},
}
Figure