Abstract
Arbitrary Style Transfer (AST) aims to apply the artistic style of any reference image to a content image in a single pass. While current state-of-the-art methods like AdaIN provide fast execution, they often rely on heavy VGG-based architectures to compensate for the simplicity of their normalization layers, making them unsuitable for mobile deployment. We present Dynamic Instance Normalization (DIN), a novel layer that replaces static affine transformations with learnable dynamic convolutions. By treating the style image as a source of convolutional parameters, DIN enables high-quality stylization on lightweight architectures like MobileNet. Our approach achieves a 20x reduction in computational cost compared to standard VGG-based methods while delivering superior visual details and sharper textures.
Introduction
Neural Style Transfer (NST) has transitioned from slow optimization-based techniques to efficient feed-forward networks. However, "Arbitrary Style Transfer" (AST) models—which can handle unseen styles in a single pass—face a significant efficiency bottleneck. Popular methods like Adaptive Instance Normalization (AdaIN) use simple global statistics (mean and variance) to align content and style features. Because these statistics are coarse, the model requires massive encoders (typically VGG-19) to extract sufficiently rich features for the transformation to work. This computational burden prevents high-quality artistic stylization from running smoothly on resource-constrained mobile devices.
The Dynamic Instance Normalization (DIN) Layer
The core innovation of this work is the Dynamic Instance Normalization (DIN) layer. Unlike AdaIN, which applies a fixed linear shift and scale, DIN uses a dynamic convolution whose weights and biases are generated on-the-fly from the style image.
Mechanism
- Style Parameter Generation: A style encoder processes the reference image. Two sub-networks, the Weight Net and Bias Net, transform these style features into the actual parameters (kernels and biases) for a convolutional layer.
- Adaptive Transformation: The content image is first normalized via Instance Normalization. It is then processed by the generated dynamic convolution. Because the convolution parameters are learned and adaptive to the specific style, they can encode complex spatial patterns and brushstroke characteristics that simple statistics miss.
- Hierarchical Integration: To preserve structural integrity while applying fine-grained details, DIN layers are integrated at multiple scales within the decoder.
Lightweight Architecture for Mobile
By offloading the complexity of the style transformation to the DIN layer, the requirement for a heavy content encoder is relaxed. The authors leverage MobileNetV1 as a backbone, utilizing depthwise separable convolutions to minimize GFLOPs. This asymmetric design—a sophisticated style parameter generator paired with a lean content path—is optimized for mobile environments where style parameters can be pre-computed or cached.
Experimental Results
The proposed DIN model was evaluated against several state-of-the-art AST methods using a diverse dataset of content (MS-COCO, Flickr) and styles (WikiArt, Google Arts & Culture).
Efficiency and Performance
The MobileNet-based DIN model requires only 7.34 total GFLOPs (3.62 for the encoder and 3.72 for the decoder). In contrast, standard VGG-based methods like Huang et al. require approximately 63.44 GFLOPs. This represents a 20x reduction in computational overhead, enabling real-time performance on mobile hardware.
Visual Quality
Qualitative comparisons demonstrate that DIN produces results with higher fidelity to the style's texture. While AdaIN-based methods often produce "washed out" or blurry results when the style is complex, DIN successfully captures intricate patterns, such as the specific geometric arrangements in Cubist works or the thick impasto of Impressionist paintings.
Conclusion
Dynamic Instance Normalization represents a shift in AST design, moving from rigid normalization to flexible, learned transformations. By making the normalization layer "smarter," the rest of the network can be made significantly lighter without sacrificing artistic quality. Future research will focus on extending DIN to video style transfer to ensure temporal consistency and exploring its utility in broader domain adaptation tasks.
Summary updated