# Neural style transfer

Neural style transfer (NST) is a deep learning technique that applies the visual style of one image to another image's content, using neural networks to generate new artwork. It was introduced in 2015 by Leon Gatys and colleagues.

Neural style transfer (NST) is a class of software algorithms that manipulate digital images or videos to adopt the appearance or visual style of another image. NST algorithms are characterized by their use of deep neural networks for image transformation. Common uses include creating artificial artwork from photographs, such as transferring the appearance of famous paintings to user-supplied photos. Notable mobile apps like DeepArt and Prisma employ NST techniques, and artists and designers worldwide use the method to develop new artwork based on existing styles.

NST is an example of image stylization, a problem studied for over two decades within non-photorealistic rendering. The first two example-based style transfer algorithms were image analogies and image quilting, both based on patch-based texture synthesis. Image analogies required a training pair of images (a photo and an artwork depicting it) to learn a transformation, while image quilting did not need that processing step but was demonstrated on only one style.

## History

The first NST method was published in the paper "A Neural Algorithm of Artistic Style" by Leon Gatys et al., originally released to ArXiv in 2015 and accepted at the CVPR conference in 2016. The original paper used a VGG-19 architecture pre-trained for object recognition on the ImageNet dataset. In 2017, Google AI introduced a method allowing a single deep convolutional style transfer network to learn multiple styles simultaneously, enabling real-time style interpolation even on video media.

## Mathematics

The idea of NST is to take two images: a content image \(\vec{p}\) and a style image \(\vec{a}\), and generate a third image \(\vec{x}\) that minimizes a weighted combination of two loss functions: a content loss \(\mathcal{L}_{\text{content}}(\vec{p}, \vec{x})\) and a style loss \(\mathcal{L}_{\text{style}}(\vec{a}, \vec{x})\). The total loss is a linear sum: \(\mathcal{L}_{\text{NST}}(\vec{p}, \vec{a}, \vec{x}) = \alpha \mathcal{L}_{\text{content}}(\vec{p}, \vec{x}) + \beta \mathcal{L}_{\text{style}}(\vec{a}, \vec{x})\). By jointly minimizing these losses, NST generates an image blending the content of the content image with the style of the style image.

Both losses measure similarity between images. Content similarity is the weighted sum of squared differences between neural activations of a single convolutional neural network (CNN) on two images. Style similarity is the weighted sum of Gram matrices within each layer. The original paper used a VGG-19 CNN, but the method works for any CNN.

### Symbols

Let \(\vec{x}\) be an image input to a CNN. Let \(F^l \in \mathbb{R}^{N_l \times M_l}\) be the matrix of filter responses in layer \(l\) to the image, where \(N_l\) is the number of filters in layer \(l\), and \(M_l\) is the height times width (number of pixels) of each filter response.

## Applications and Impact

NST has found widespread use in consumer applications, particularly mobile apps that allow users to apply artistic styles to their photos in real time. DeepArt and Prisma are among the most notable, popularizing the technique for a general audience. Beyond consumer apps, NST has been adopted by digital artists and designers for creating novel artwork, and it has influenced subsequent research in [generative-ai](https://www.wikiprompt.org/wiki/generative-ai) and image generation. The technique's ability to separate content from style in neural representations has also informed work in other areas of [deep-learning](https://www.wikiprompt.org/wiki/deep-learning), such as style-based generators and domain adaptation.

## Related Techniques and Evolution

NST is part of a broader family of image stylization methods that predate deep learning, including patch-based approaches like image analogies and image quilting. The introduction of deep neural networks marked a significant advance, enabling more flexible and higher-quality style transfer. Later developments, such as the 2017 Google AI method for multi-style learning, improved efficiency and real-time performance. NST also relates to other [neural-network](https://www.wikiprompt.org/wiki/neural-network) based image manipulation techniques, and its principles have been integrated into modern [generative-ai](https://www.wikiprompt.org/wiki/generative-ai) systems, though those often use different architectures like [transformer](https://www.wikiprompt.org/wiki/transformer) models rather than convolutional networks.

## Limitations and Considerations

Early NST methods were computationally intensive, requiring iterative optimization for each output image, though later approaches using feed-forward networks reduced this cost. The quality of results depends on the choice of layers and loss weights, and the method can sometimes produce artifacts or fail to preserve fine details. As with many [artificial-intelligence](https://www.wikiprompt.org/wiki/artificial-intelligence) techniques, NST raises questions about authorship and originality when used to create derivative artworks, though these are not unique to NST.

---
Source: https://www.wikiprompt.org/wiki/neural-style-transfer
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-07T21:30:35.473576+00:00
