Source-linked AI summary

Semantic Style Transfer and Turning Two-Bit Doodles into Fine Artworks

Alex J. Champandard

arXiv:1603.01768v1cs.CV

TL;DR

Neural style-transfer systems can produce unpredictable, semantically incoherent results and offer limited user control. This paper augments generative CNNs with semantic annotations, improving control and reducing such artifacts in style transfer and image synthesis.

  • Problem

    Existing style-transfer approaches lack semantic understanding, making precise content replication, faithful stylization, and reliable user control difficult.

  • Method

    The paper augments generative CNNs with semantic maps from manual labels or pixel-labeling networks to guide image synthesis and style transfer.

  • Results

    Semantic annotations improve user control, reduce incoherent pattern and color artifacts, and support more faithful transfer across image regions.

  • Takeaways & Limitations

    Content-aware semantic guidance makes neural generative algorithms more useful as controllable tools for creative image synthesis.

  • Takeaways & Limitations

    The semantic architecture requires additional memory and computation, with resource demands growing quickly when pixels use individual class labels.

Abstract

from arXiv · show

Convolutional neural networks (CNNs) have proven highly effective at image synthesis and style transfer. For most users, however, using them as tools can be a challenging task due to their unpredictable behavior that goes against common intuitions. This paper introduces a novel concept to augment such generative architectures with semantic annotations, either by manually authoring pixel labels or using existing solutions for semantic segmentation. The result is a content-aware generative algorithm that offers meaningful control over the outcome. Thus, we increase the quality of images generated by avoiding common glitches, make the results look significantly more plausible, and extend the functional range of these algorithms---whether for portraits or landscapes, etc. Applications include semantic style transfer and turning doodles with few colors into masterful paintings!

Introduction

CNNs enable powerful image synthesis and style transfer, but conventional generative algorithms often produce semantically incoherent glitches. The paper introduces semantic annotations that connect generative architectures with pixel-labeling networks, enabling more plausible and controllable synthesis.

  • Motivation: CNN feature spaces support image generation and produce astonishing style-transfer results, but users must carefully choose composition and style images to avoid unpredictable patterns.Deep convolution layers provide a more expressive feature space than raw pixels, supporting both classification and generation.
  • Motivation: Semantic expectations are often violated when hair, skin, vegetation, or other visual elements transfer across inappropriate regions.Users expect style components to match semantic labels, such as hair style with hair and skin tones with skin, regardless of color.
  • Problem: The paper attributes synthesis glitches to architectures not designed for correct synthesis and inadequate exploitation of higher-level semantic information by lower-level generative layers.In conventional architectures, top-to-bottom connections arise only indirectly through error backpropagation.
  • Contribution: The proposed architecture augments image-synthesis networks with semantic information and bridges them with pixel-labeling neural networks during generation.The paper also explains how existing algorithms can be adapted to incorporate semantic annotations.
  • Applications: The approach is applied to style transfer and image synthesis by analogy, including layouts that use semantic annotations to generate paintings.Figure 1 illustrates synthesizing paintings through analogy from an original painting, annotations, a desired layout, and generated output.

Related Work

Related work spans annotation-driven image analogy methods and neural style-transfer approaches based on global statistics or local patches. Although semantic segmentation enables effective specialized transfer, existing neural synthesis methods provide unreliable controls and do not yet use semantic context.

  • Annotation-driven transfer: Image analogy transfers artistic style through pixel features and local neighborhoods while allowing users to synthesize images from simple annotations.The paper contrasts this annotation capability with the higher stylistic quality of more recent deep-neural methods.
  • Neural style transfer: Neural style-transfer methods divide into specialized algorithms and general neural approaches, including gram-based and patch-based techniques.The paper frames recent style-transfer work around these two categories.
  • Neural style transfer: Gram-based transfer represents global image statistics with Gram matrices computed from inner products of convolution-layer activations, discarding local pixel information.For a layer with N channels, the operation produces an N × N matrix.
  • Neural style transfer: Patch-based transfer matches 3 × 3 neural patches between style and content features using nearest neighbors, improving precision through local pattern understanding.Operating locally reduces errors introduced by globally enforcing statistical distributions.
  • User control limitations: Gram- and patch-based methods expose mainly a style-content weighting factor, leaving precise content replication and faithful style transfer difficult while glitches remain unreliable to control.Changing the weight can produce an abstract mashup that ignores content or preserve content with washed-out texture.
  • Semantic methods: CNN segmentation architectures provide semantic pixel labels, but this context has not yet been used for synthesis despite benefits in non-neural methods and specialized portrait transfer.Specialized portrait methods extract facial features into masks, process segments independently, and transfer colors between corresponding parts.

Model

The model augments a patch-based style-transfer CNN with semantic channels, enabling user-controlled, content-aware synthesis while preserving compatibility with the original optimization framework. Semantic maps guide patch matching and loss computation without directly contributing pixel derivatives.

  • Model: The method builds on patch-based style transfer by minimizing weighted content reconstruction error Ec and style remapping error Es.The weights are α for Ec and β for Es.
  • Augmented CNN: The augmented CNN concatenates down-sampled semantic channels with activations at matching resolutions, producing N + M output channels.The semantic channels are weighted by γ before concatenation, providing an additional user control point.
  • Optimization: During L-BFGS optimization, the output combines current activations with the content semantic map, whose semantic component remains static.Semantic information affects matching and loss computation, while only activation differences drive pixel updates.
  • Semantic Maps: Semantic maps support arbitrary channel counts and representations, provided style and content maps share aspect ratio and consistent semantics.They may be manually authored, generated as label masks by CNNs, or represented as semantic embeddings.
  • Compatibility: The augmented architecture preserves existing patch-based implementations, and setting semantic information to zero recovers the original algorithm.The γ parameter also enables incremental introduction of semantic style transfer.

Experiments

Experiments show that semantic annotations improve style transfer by reducing patch- and gram-based artifacts and enabling meaningful control over style interpolation. Results across portraits and parameter settings demonstrate better semantic fidelity, while rendering remains practical on consumer hardware.

  • Experimental setup: Rendering uses VGG19 with augmented layer sem3 1, 3 × 3 patches, manually edited RGB semantic maps, random optimization seeds, and progressively increasing resolutions.On a GTX970 with 4Gb of GPU RAM, rendering takes from 3 to 8 minutes depending on quality and resolution.
  • Portraits: Portrait annotations use four main labels—background, clothing, skin and hair—with minor color variations for eyes, mouth, nose and ears.The semantic maps are displayed as greyscale but contain three channels.
  • Portraits: Semantic maps prevent repeating patches at high style weight and weak style blending at low weight by allowing style weight to vary relative to content.Skin tones and background colors are transferred more faithfully.
  • Parameter study: Lowering γ permits style reuse across semantic borders, whereas excessive γ degrades style quality and variety without noticeably improving annotation precision.Decreasing γ too far reverts toward the semantically unaware algorithm and indirectly increases style weight.
  • Parameter study: With the recommended default γ, adjusting style weight β enables meaningful interpolation without degenerating into abstract patchworks.The default γ is 50, chosen to equalize semantic-channel and convolution-activation value ranges.

Analysis

The analysis finds that semantic annotations improve controllability and consistency in style transfer, while introducing parameter tradeoffs, boundary artifacts, repetitive patterns, and computational overhead. User-created semantic embeddings may provide richer control than plain masks, but crisp maps and limited source patches remain challenging.

  • Semantic representations: Users implicitly create semantic embeddings that blend pixel classes, and these representations appear better suited to semantic style transfer than plain layer masks.Examples include stubble as a blend of hair and skin, and jewelry as similar but distinct from clothing.
  • Limitations: When source patches are scarce, restricting patches to the matching semantic segment creates repetitive patterns; lowering γ reduces precision while loosening the style constraint.The repetition is observed in parts of Figure 2.
  • Parameter behavior: Semantic constraints produce artifact-free blends across style-weight settings and help maintain consistent results over a wider parameter range.At high style weight, unconstrained images degenerate into patchworks, whereas semantic maps make the algorithm less fragile to style-weight adjustments.
  • Boundary behavior: The algorithm often paints segment borders with appropriate styles, but crisp semantic-map edges can still produce surprising results.Smoothing the semantic map can help in some cases.
  • Computational cost: RGB inputs require around 1% extra memory and approximately 5% extra computation, while individually class-labeled pixels increase resource demands quickly.The added memory and computation come from the model’s additional channels, and broader patch-based optimization could help.

Conclusion

The paper addresses limitations of existing style transfer methods by augmenting CNNs with semantic annotations from manual labels or pixel-labeling algorithms. This semantic guidance handles mismatched regional patterns and colors while improving user control and reducing unpredictability.

  • Semantic augmentation: The method augments CNN-based style transfer with semantic maps manually authored or produced by pixel-labeling algorithms.The authors present semantic annotation as a way to resolve limitations of existing techniques whose applicability decreases when colors or accuracy matter.
  • Style transfer: The technique handles corresponding image regions with completely opposite patterns or colors.
  • User control: Semantic guidance gives users better control over the output of neural style-transfer algorithms.
  • Practical utility: Reducing neural-network unpredictability makes these algorithms more useful for enhancing creativity and productivity.
Loading 1603.01768v1…