Measuring Style Similarity in Diffusion Models

Gowthami Somepalli, Anubhav Gupta, Kamal Gupta, Shramay Palta, Micah Goldblum, Jonas Geiping, Abhinav Shrivastava, Tom GoldsteinarXiv 2024 · DOI

Introduction

As text-to-image models like Stable Diffusion and Midjourney become ubiquitous, the creative community has raised urgent concerns regarding "style theft." While standard image retrieval tools excel at identifying semantic content (e.g., finding images of the same object), they often fail to capture the nuances of an artist's signature brushwork, color palette, or composition. This paper introduces Contrastive Style Descriptors (CSD), a framework designed to quantify and attribute artistic style, providing a mathematical tool to determine if a generated image borrows too heavily from specific training data.

Methodology

The core of the approach involves fine-tuning a Vision Transformer (ViT) to prioritize stylistic features over semantic content. This is achieved through a dual-objective training pipeline:

  1. Multi-label Contrastive Loss (MCL): The model learns to group images by artist or style tag, regardless of the subject matter.
  2. Style-Preserving Self-Supervised Learning (SSL): Unlike standard SSL, which uses color-altering augmentations to force models to ignore style, CSD utilizes only spatial augmentations (rotations, flips). This forces the model to treat color and texture as essential features rather than noise.

Data: The LAION-Styles Dataset

To train CSD, the authors curated LAION-Styles, a subset of the LAION-Aesthetics 6+ dataset. It contains approximately 512,000 images across 3,840 unique style tags, including specific artists, mediums, and movements. The dataset was built using the "CLIP Interrogator" to filter for high-confidence style keywords.

Analysis: Style Attribution and Model Behavior

The framework allows for a granular comparison of how different generative models handle artistic influence. One significant finding is the "unlearning" of specific artists; for instance, Stable Diffusion 2.1 shows a marked decrease in similarity to artists like Greg Rutkowski compared to its predecessor, SD 1.4, and Midjourney.

Comparison of generated images and similarity scores across different models, highlighting how CSD quantifies stylistic borrowing.

Furthermore, the authors discovered that prompt complexity often correlates with higher style replication. User-generated prompts, which are typically more descriptive and complex, tend to result in higher similarity scores than simple "in the style of" prompts.

Results: Benchmarking and Human Performance

CSD achieves state-of-the-art results on fine art benchmarks like WikiArt and DomainNet. On WikiArt, CSD ViT-L achieved a mAP@1 of 64.56, outperforming standard CLIP ViT-L (59.4).

Perhaps most notably, the model outperforms untrained humans in style retrieval tasks. While humans are frequently distracted by the subject matter of a painting, the CSD model remains focused on the stylistic "fingerprint," allowing it to match works by the same artist even when the content is entirely different.

Human study results demonstrating that CSD models consistently outperform untrained humans in identifying stylistic matches.

Conclusion

While "style" remains a subjective and social construct, CSD provides a robust computational proxy for artist attribution. By disentangling style from content, this framework offers a path toward more transparent and ethical generative AI. Future work will aim to expand these descriptors to include more abstract elements like mood and lighting, while addressing the inherent biases in large-scale web-scraped datasets.

Summary updated

BibTeX
@misc{somepalli2024measuring,
  author = {Gowthami Somepalli and Anubhav Gupta and Kamal Gupta and Shramay Palta and Micah Goldblum and Jonas Geiping and Abhinav Shrivastava and Tom Goldstein},
  title = {{Measuring Style Similarity in Diffusion Models}},
  year = {2024},
  eprint = {2404.01292},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.01292},
}
Figure