Introduction
Arbitrary Neural Style Transfer (AST) seeks to synthesize an image that combines the semantic content of one image with the stylistic characteristics of another. Traditional methods typically fall into two categories: global transformations like AdaIN, which often fail to capture local texture nuances, and local attention mechanisms like SANet, which can introduce visual artifacts by ignoring low-level feature distributions. This paper introduces Adaptive Attention Normalization (AdaAttN), a module designed to bridge this gap by performing local, distribution-aware normalization.
The AdaAttN Module
The core innovation of AdaAttN is the shift from global image statistics to per-point, attention-weighted local statistics. The process involves three critical steps:
- Multi-Level Attention: Unlike previous attention-based AST methods that rely solely on deep semantic features, AdaAttN incorporates both shallow and deep VGG features. This allows the model to account for both high-level structure and fine-grained textures (e.g., brushstrokes, edges).
- Weighted Local Statistics: For every spatial point in the content feature map, AdaAttN calculates a unique mean and standard deviation based on the style features, weighted by the attention map. This ensures that the applied style is locally relevant to the content.
- Adaptive Normalization: Content features are normalized to match these calculated local style statistics.
To further refine the output, the authors introduce a Local Feature Loss ($L_{lf}$), which provides a deterministic signal to ensure the network's output remains consistent with the AdaAttN transformation, effectively eliminating common local artifacts.
Video Style Transfer
AdaAttN is also optimized for video. To prevent the temporal flickering common in attention-based video stylization, the authors replace the standard Softmax with Cosine Similarity in the attention calculation. This creates a smoother distribution of attention weights across frames. Additionally, a Cross-Image Similarity Loss ($L_{is}$) is employed to maintain temporal consistency without the computational overhead of optical flow.
Results and Discussion
AdaAttN demonstrates superior performance in both qualitative and quantitative evaluations.
Key Findings:
- Visual Fidelity: The model produces cleaner textures and better preserves content structures compared to state-of-the-art methods like SANet or AdaIN.
- User Preference: In a study involving 100 participants, AdaAttN was consistently preferred for its balance of stylization and content preservation.
- Efficiency: The model achieves real-time performance, running at approximately 20 FPS on standard hardware.
- Temporal Stability: For video tasks, AdaAttN achieves lower optical flow error than competing methods, indicating smoother transitions between frames.
Conclusion
By revisiting the attention mechanism through the lens of local distribution normalization, AdaAttN sets a new standard for arbitrary style transfer. The inclusion of shallow features and the transition to per-point statistics address long-standing issues of "washed-out" textures and "dirty" artifacts. Future work may explore the application of this attentive normalization to broader image-to-image translation tasks or the integration of more flexible encoders.
Summary updated