Style Transfer with Target Feature Palette and Attention Coloring

Suhyeon Ha, Guisik Kim, Junseok Kwon

TL;DR

This paper introduces a novel style transfer framework that distills artistic styles into a "target feature palette" using K-means clustering. By combining this palette with an attention-based coloring mechanism, the model achieves state-of-the-art results in transferring complex artistic patterns while remarkably preserving the fine structural details of the original content image.

What Problem Does This Paper Address?

Neural Style Transfer (NST) has come a long way since its inception, but it still faces a fundamental "content-style trade-off." Conventional approaches often fall into two traps:

  1. Loss of Detail: Methods that rely on simple global statistics (like mean and variance) often blur the fine structures of the content image.
  2. Artifacts: More complex patch-based or optimization-based methods frequently produce "spotty" artifacts or unnatural, duplicated textures that obscure the original subject.

The authors aim to bridge this gap, creating a method that can handle diverse, rich artistic styles without sacrificing the recognizability and structural integrity of the content.

Methods

The proposed framework uses a standard VGG-19 encoder-decoder architecture but introduces two innovative modules:

  • Feature Palette Composition (FPC): Instead of treating the style image as a single entity, the FPC module breaks the style features into small patches and applies K-means clustering. This identifies $k$ representative "centroids" that capture the core artistic attributes (colors and textures) of the style. This collection of centroids becomes the Target Feature Palette.
  • Attention Coloring (AC): This module acts as the "painter." It calculates spatial attention maps between the content features and the stylized features derived from the palette. By using attention, the model can intelligently decide which part of the style palette belongs to which part of the content image.
Fig. 2: Overall procedure of the proposed framework.

The final loss function balances a content loss (measuring the Euclidean distance between feature maps) and a style loss (matching the mean and standard deviation of features across multiple VGG layers).

Datasets

The model was trained using two massive, standard datasets:

  • MS-COCO: Used for content images, providing 1.5 million object categories to ensure the model understands a wide variety of structures.
  • Painter by Numbers (PBN): Sourced from WikiArt, this dataset provides roughly 80,000 artistic images ranging from the 2nd to the 21st century.

For evaluation, the authors used a combination of 28 content images and 59 style images to create a large-scale test set of 1,652 pairs.

Key Insights and Ideas

  • Clustering as Distillation: The "aha moment" here is that an artistic style can be effectively summarized by a few key feature clusters. Using a palette of centroids (FPC) provides more "fruitful" information than a single global statistic but is more stable than using raw patches.
  • Attention for Structural Integrity: The AC module (detailed in Figure 3) uses an "inner and outer" procedure. The inner part calculates spatial relationships to strengthen content structure, while the outer part accumulates style features. This dual mechanism is why the model excels at the content-style trade-off.
  • Depth Maps as a Metric: In a clever move for quantitative evaluation, the authors used depth map errors (MAE and RMSE) to measure content preservation. The logic is sound: if a style transfer method preserves the "layout" and distance of objects (the depth map), it has successfully preserved the content's structure.
Fig. 3: Attention Coloring Module. The attention map between content and style features is used to reassemble features of stylized image.

Key Results

The paper demonstrates both qualitative and quantitative superiority over prominent methods like AdaIN, WCT, and SANet.

  • Quantitative: As shown in the paper's evaluation, the proposed method achieved the lowest Mean Absolute Error (0.463) and Root Mean Square Error (0.571) on depth map comparisons. This confirms it preserves the 3D layout of the original scene better than existing state-of-the-art (SOTA) models.
  • Qualitative: Visual results show that while other methods might produce "halo" artifacts around objects or fail to represent the style's colors accurately, this method maintains sharp edges and reflects rich, diverse styles.
  • Versatility: The framework naturally supports style interpolation (blending multiple styles) and spatial control (applying different styles to different parts of an image using masks) without needing additional training.
Table 3: Features on style transfer methods.

Limitations and Future Work

While the method is robust, the authors acknowledge that it can sometimes struggle with complex style patterns, where the transition between different textures in the style image isn't perfectly captured in the stylized output. They suggest that improving the transition logic for highly intricate style patterns is a promising direction for future research. Additionally, the choice of the number of clusters ($k$) and patch size ($p$) are empirical; automating these hyperparameters based on the input images could further optimize the process.

Summary updated

Abstract

Style transfer has attracted a lot of attentions, as it can change a given image into one with splendid artistic styles while preserving the image structure. However, conventional approaches easily lose image details and tend to produce unpleasant artifacts during style transfer. In this paper, to solve these problems, a novel artistic stylization method with target feature palettes is proposed, which can transfer key features accurately. Specifically, our method contains two modules, namely feature palette composition (FPC) and attention coloring (AC) modules. The FPC module captures representative features based on K-means clustering and produces a feature target palette. The following AC module calculates attention maps between content and style images, and transfers colors and patterns based on the attention map and the target palette. These modules enable the proposed stylization to focus on key features and generate plausibly transferred images. Thus, the contributions of the proposed method are to propose a novel deep learning-based style transfer method and present target feature palette and attention coloring modules, and provide in-depth analysis and insight on the proposed method via exhaustive ablation study. Qualitative and quantitative results show that our stylized images exhibit state-of-the-art performance, with strength in preserving core structures and details of the content image.
BibTeX
@article{ha2022style,
  author = {Suhyeon Ha and Guisik Kim and Junseok Kwon},
  title = {{Style Transfer with Target Feature Palette and Attention Coloring}},
  journal = {Multimedia Tools and Applications},
  year = {2022},
  doi = {10.1007/s11042-022-13123-4},
}
Figure