From paintbrush to pixel: A review of deep neural networks in
  AI-generated art
This paper delves into the fascinating field of AI-generated art and explores
the various deep neural network architectures and models that have been
utilized to create it. From the classic convolutional networks to the
cutting-edge diffusion models, we examine the key players in the field. We
explain the general structures and working principles of these neural networks.
Then, we showcase examples of milestones, starting with the dreamy landscapes
of DeepDream and moving on to the most recent developments, including Stable
Diffusion and DALL-E 3, which produce mesmerizing images. We provide a detailed
comparison of these models, highlighting their strengths and limitations, and
examining the remarkable progress that deep neural networks have made so far in
a short period of time. With a unique blend of technical explanations and
insights into the current state of AI-generated art, this paper exemplifies how
art and computer science interact.
Anne-Sofie Maerten, Derya Soydaner
# From paintbrush to pixel: A review of deep neural networks in AI-generated art

###### Abstract

This paper delves into the fascinating field of AI-generated art and explores the various deep neural network architectures and models that have been utilized to create it. From the classic convolutional networks to the cutting-edge diffusion models, we examine the key players in the field. We explain the general structures and working principles of these neural networks. Then, we showcase examples of milestones, starting with the dreamy landscapes of DeepDream and moving on to the most recent developments, including Stable Diffusion and DALL-E 2, which produce mesmerizing images. A detailed comparison of these models is provided, highlighting their strengths and limitations. Thus, we examine the remarkable progress that deep neural networks have made so far in a short period of time. With a unique blend of technical explanations and insights into the current state of AI-generated art, this paper exemplifies how art and computer science interact.

Neural networks, Transformers, Diffusion models, Generative adversarial networks, Deep learning, Image processing

## 1 Introduction

_"AI-generated art is a new and emerging field, and it will likely take some time for it to fully mature and for its place in the art world to be fully understood,"_replied ChatGPT, the chatbot created by OpenAI, when we asked about the
current state of AI-generated art. It continued by stating _"As with any new field, it will take time for it to be fully understood and for its place in the art world to be established."_

Whether they are recognized as art or not, AI-generated images are widespread today. Regardless of discussions about how creative or artistic they are, their existence in our lives cannot be denied any longer. In 2018, the first AI-generated portrait _"Edmond de Belamy"_ (Figure 1) sold for $432,500 at Christie's art auction. It was created using a generative adversarial network (GAN) [26], and a part of _"La Famille de Belamy"_ series by Obvious Art. The fact that it is signed with the loss function used in GAN makes this case also quite amusing. In 2022, Jason M. Allen's AI-generated artwork, _"Theatre D'opera Spatial"_ (Figure 1), won the art prize in the digital category at the Colorado State Fair's annual art competition. This piece was created with the AI-based tool Midjourney which can generate images by taking text prompts as input.

All of this progress in AI-generated art is made possible by _deep learning_ which is a subfield of machine learning. This subfield includes _deep neural networks_ which have led to significant breakthroughs in various fields such as computer vision in the last decade. In this paper, we focus on deep neural networks used in image processing and recent developments that have been used to produce AI-generated images. In the literature, there are several studies that address AI-generated art from different perspectives. For example, Cetinic _et al._ (2022) [7] touches upon the creativity of AI technologies as well as authorship, copyright and ethical issues. Ragot _et al._ (2020) [54] conducted an experiment where they asked participants to rate the difference between paintings created by humans and AI in terms of liking, perceived beauty, novelty, and meaning. Other important issues today are credit allocation and responsibility for AI-generated art [20]. Recently, a review of generative AI models has been released which touches upon various applications such as texts, images, videos and audios [5].

Figure 1: _(Left)_ “Edmond de Belamy” - The first AI-generated portrait sold at Christie’s art auction in 2018. _(Right)_ “Theatre D’opera Spatial” - The winner of the digital art category at the Colorado State Fair’s annual art competition in 2022.
In this paper, we focus on the main neural networks which have been used to generate realistic images. We explain the building blocks of the related neural networks to provide readers with a better understanding of these models. We describe the general working principles of these neural networks, and introduce the recent trends in AI-generated art such as DALL-E 2 [56]. We examine the rapid development of deep neural networks in AI-generated art, and emphasize the milestones in this progress. This review addresses the topic from a technical perspective and provides comparisons of current state-of-the-art models. However, even for a non-technical audience (e.g., from more traditional areas in the fine arts, aesthetics, and cultural studies), this review could serve the purpose of providing an overview of the different techniques and tools that are currently available.

The rest of the paper is organized as follows. In Section 2, we describe the important neural networks used for the models in AI-generated art. We introduce the progress in generative modeling and recent trends in Section 3. We discuss the current models in Section 4 and we conclude in Section 5.

## 2 Preliminaries

During training, a neural network adjusts its parameters called _weights_. When the training is completed, the weights are optimized for the given task, i.e., the neural network _learns_. A typical neural network is a multilayer perceptron (MLP) which is useful for classification and regression tasks. However, there are many deep neural networks which are particularly effective in image processing. One of them is convolutional neural networks (CNNs). In this section, we start with CNNs which require data labels during training and learn in a supervised learning setting. Then, we explain the autoencoders which can learn without data labels, that is, learn by unsupervised learning. We continue with GANs and the Transformer neural network. Lastly, we explain the diffusion models, which are the latest advancements in deep learning.

### Convolutional neural networks

Convolutional neural networks [37; 38], usually referred to as CNNs, or ConvNets, are deep neural networks utilized mainly for image processing. In a deep CNN, increasingly more abstract features are extracted from the image through a series of hidden layers. As such, a CNN follows a similar hierarchy as the human visual cortex, in that earlier areas extract simple visual features and higher areas extract combinations of features and high level features. In this manner, the complex mapping of the input pixels is divided into a series of nested mappings, each of which is represented by a different layer [27].

There are various CNN architectures in the literature such as LeNet [37; 38], which is capable of recognizing handwritten digits. However, more complex tasks like object recognition require deeper CNNs such as AlexNet [36], VGG [63], ResNet [28], DenseNet [30], EfficientNet [68], Inception and GoogLeNet [66]. A typical CNN includes three kinds of layers: convolutional layers, pooling
layers, and fully-connected layers. The general structure of a typical CNN for classification is illustrated in Figure 2. The input image \(\mathcal{X}\) is presented at the input layer, which is followed by the first convolutional layer. In a convolutional layer, the weights are kept within _kernels_. During learning, a mathematical operation called _convolution_ is performed between the input and the kernel. Basically, convolution is performed by multiplying the elements of the input with each element of the kernel and summing the results of this multiplication. This input can be an input image or the output of another, preceding convolutional layer. The units in a convolutional layer are arranged into planes, each of which is referred to as a _feature map_, defined as 3D tensors. Each unit in a feature map takes input from a small area of the image, and all units detect the same pattern but at different locations in the input image. In a feature map, all units share the same weights, thus a convolution of the image pixel intensities with a _kernel_ is performed [3]. In general, there are multiple feature maps in a convolutional layer, each with its own weights, to detect multiple features [3]. Accordingly, a single convolutional layer includes lots of kernels, each operating at the same time. Moreover, as a deep neural network, a CNN typically includes many convolutional layers which implies millions of parameters.

Each output of convolution operation is usually run through a nonlinear activation function, such as the rectified linear unit (ReLU) [23]. Then, a convolutional layer or a stack of convolutional layers is followed by a _pooling layer_ which reduces the size of feature maps by calculating a summary statistic of the nearby outputs such as the maximum value or the average [27]. In the end, a series of convolutional and pooling layers is followed by _fully-connected (dense)_ layers. The activation function that the output layer applies depends on the task. In most cases, a sigmoid function is preferred for binary classification, softmax nonlinearity for multi-classification, and linear activation for regression tasks. Accordingly, a CNN minimizes the difference between the desired output values \(y\) and the predicted values \(\hat{y}\) in the cross-entropy loss functions given in Eq. 1 and Eq. 2 for binary and multi-class classification, respectively. In the case of a regression task, a CNN may minimize mean squared error given in Eq. 3. In the equations below, \(W\) represents the weights belonging to the hidden layers, and \(V\) represents the output layer weights. Although the

Figure 2: An example CNN structure with two convolutional, two pooling, and three fully-connected layers for classification.
aforementioned are the most frequently used activation and loss functions, in the literature, there are other alternatives available such as Leaky ReLU [41] as an activation function, or mean absolute error as a loss function.

\[L(W,v\mid\mathcal{X})=-\sum_{t}y^{t}log\hat{y}^{t}+(1-y^{t})log(1-\hat{y}^{t}) \tag{1}\]

\[L(W,V\mid\mathcal{X})=-\sum_{t}\sum_{i}y^{t}_{i}log\hat{y}^{t}_{i} \tag{2}\]

\[L(W,V\mid\mathcal{X})=\frac{1}{2}\sum_{t}\sum_{i}(y^{t}_{i}-\hat{y}^{t}_{i})^{2} \tag{3}\]

A fully-connected layer and a convolutional layer significantly differ in that fully-connected layers learn global patterns in their input feature space, whereas convolutional layers learn local patterns [10]. In a CNN, there are less weights than there would be if the network were fully-connected because of the local receptive fields [3]. CNNs are now essential neural networks in deep learning and have yielded major advances for a variety of image processing tasks.

### Autoencoders

The autoencoder, originally named the _autoassociator_ by Cottrell _et al._ (1987) [12], is a typical example of unsupervised learning. This neural network learns to reconstruct the input data as the output by extracting a (usually lower-dimensional) representation of the data. The autoencoder has been successfully implemented for unsupervised or semi-supervised tasks, or as a preprocessing stage for supervised tasks. The general structure of an autoencoder consists of an _encoder_ and a _decoder_ as shown in Figure 3. In the simplest case, both encoder and decoder are composed of a single fully-connected layer for each, or a series of fully-connected layers. During training, the encoder, in one or more layers, usually transforms the input to a lower-dimensional representation. Then, the decoder that follows, in one or more layers, takes this representation as input and reconstructs the original input back as its output [64]. The aim is to obtain a meaningful representation of data, which makes the autoencoder also an example of _representation learning_.

In the general framework, the encoder takes the input \(x^{t}\), and produces a compressed or _hidden/latent_ representation of input \(h^{t}\). Then, the decoder takes \(h^{t}\) as input and reconstructs the original input as the output \(\hat{x}^{t}\). When the \(h^{t}\) dimension is less than the \(x^{t}\) dimension, the autoencoder is called _undercomplete_. The undercomplete autoencoder can capture the most salient features of the data. On the other hand, when the \(h^{t}\) dimension is equal or greater than the \(x^{t}\) dimension, it is called _overcomplete_. The overcomplete autoencoder just copies the input to the output as it cannot learn anything meaningful about the data distribution. Regularized autoencoders, such as the _sparse autoencoders_, alleviate this issue by applying a regularization term in the loss function [27].
The tasks related to image processing may require both encoder and decoder be composed of convolutional layers instead of fully-connected layers. In this case, it is called a _convolutional autoencoder_. The first layers of the encoder are convolution/pooling layers and correspondingly the last layers of the decoder are deconvolution/unpooling layers. Whether the layers are fully-connected or convolutional, total reconstruction on a training set \(\mathcal{X}=\{x^{t}\}_{t}\) is used as the loss function. The encoder and decoder weights, \(\theta_{E}\) and \(\theta_{D}\) respectively, are learned together to minimize this error:

\[E(\theta_{E},\theta_{D}|\mathcal{X}) = \sum_{t}\|x^{t}-\hat{x}^{t}\|^{2} \tag{4}\] \[= \sum_{t}\|x^{t}-f_{D}(f_{E}(x^{t}|\theta_{E})|\theta_{D})\|^{2}\]

When an autoencoder in which the encoder and decoder are both perceptrons learns a lower-dimensional compressed representation of data, the autoencoder performs similar to principal component analysis (PCA): The encoder weights span the same space spanned by the \(k\) highest eigenvectors of the input covariance matrix [4]. When the encoder and decoder are multi-layer perceptrons, then the autoencoder learns to do nonlinear dimensionality reduction in the encoder [64].

In comparison to the different autoencoder types, we should highlight the _variational autoencoder (VAE)_[35; 57] which turns an autoencoder into a _generative_ model. Similar to the autoencoder architecture mentioned above, a VAE is composed of an encoder and decoder. However, the encoder does not produce a lower-dimensional latent space. Instead, the encoder produces parameters of a predefined distribution in the latent space for input, i.e., mean and variance. Thus, the input data is encoded as a probability distribution. Then, new samples can be generated by sampling from the latent space that the autoencoder learned during training.

Different from the Eq. 4, the loss function of VAE is composed of two main terms. The first one is the reconstruction loss which is the same loss in Eq. 4. The second term is the Kullback-Leibler divergence between the latent space

Figure 3: The general structure of the _(Left)_ Autoencoder, _(Right)_ Variational autoencoder. \(x^{t}\) refers to an input sample, \(h^{t}\) to the latent representation and \(\hat{x}^{t}\) to the reconstructed input. The parameters of encoder (\(\theta_{E}\)) and decoder (\(\theta_{D}\)) are updated during training.
distribution and standard Gaussian distribution. The loss function is the sum of these two terms. Once the VAE is trained, new samples can be generated by using the learned latent space. This property makes the VAE a generative model.

### Generative adversarial networks

When it comes to the generative models, the _generative adversarial network_ (GAN) [26] is a milestone in deep learning literature. The idea is based on game theory and a minimax game with two players. Instead of human players, in this case, the players are neural networks. One of these neural networks is called a _generator (G)_ while the other one is called a _discriminator (D)_. These two networks are trained end-to-end with backpropagation in an _adversarial_ setting, i.e., the generator and discriminator compete with each other. The generator captures the data distribution while the discriminator estimates the probability that its input comes from the real data or is a fake sample which is created by the generator. The competition between these two neural networks in the game makes them improve their results until the fake data generated by G is indistinguishable from the original data for D. As a result, G learns to model the data distribution during training and can generate _novel_ samples after training is completed.

In the original GAN framework, both the generator and discriminator are MLPs. The generator takes a random noise vector as input and generates samples. The discriminator takes the generated sample and a real sample from the data as inputs, and tries to decide which one is real. Then, based on the feedback coming from the discriminator, the generator updates its weights. As shown in the loss function in Eq. 5, G tries maximizing the probability of D making a mistake. The game ends at a saddle point where D is equal to 1/2 everywhere. The generative networks that use different loss functions, such as the Wasserstein GAN (WGAN) [1], can be used as alternatives to traditional

Figure 4: The general structure of an generative adversarial network (GAN). The generator upscales its input (a noise vector) through a series of layers into an image. The discriminator performs a binary classification task, i.e., deciding whether the input image it receives is real or a generated sample.
GAN training.

\[\min_{G}\max_{D}V(D,G)=\mathbb{E}_{x\sim p_{\text{data}}(x)}[\log D(x)]+\mathbb{ E}_{z\sim p_{z}(z)}[\log(1-D(G(z)))] \tag{5}\]

In addition to its huge impact on deep learning, potential directions have been discussed on how GANs could advance cognitive science [25]. In the literature, there are various different GAN architectures [13]. For example, when the G and D are composed of convolutional layers, this architecture is called a _deep convolutional GAN (DCGAN)_[51]. The most well-known DCGAN is _StyleGAN_[32] which can vary coarse-to-fine visual features separately. Whereas an ordinary GAN receives a noise vector as input, StyleGAN inputs the noise vector to a mapping network to create an intermediate latent space. The intermediate latents are then fed through the generator through adaptive instance normalization [32]. The mapping network ensures that features are disentangled in latent space, allowing StyleGAN to manipulate specific features in images (e.g., remove someone's glasses or make someone look older). Pix2pix is a GAN that takes an image as input (rather than noise) and translates it to a different modality (e.g., BW image to RGB image) [31]. Whereas the training of pix2pix requires image pairs (the same image in RGB and BW), CycleGAN [75] alleviates this need by 'cycling' between two GANs (see Section 3.2). An _adversarial autoencoder_ combines the adversarial setting of GANs with the autoencoder architecture [42]. Lastly, a _self-attention adversarial neural network (SAGAN)_[73] defines a GAN framework with an attention mechanism, which is explained in Section 2.4.

### Transformers

Convolution has become the central component for image processing applications as neural networks progressed throughout time. However, in addition to the computational burden that convolutional layers bring, the convolution operation has been criticized for being far from human vision. Because our human visual system has evolved to be sparse and efficient, we do not process our entire visual field with the same resources. Rather, our eyes perform a fixation point strategy by means of a _visual attention system_ which plays an essential role in human cognition [47; 48]. In this manner, we as humans pay selective attention to specific parts of our visual input.

Inspired by the attention system in human vision, _computational_ attention mechanisms have been developed and integrated into neural networks. The main goal is reducing the computational burden caused by the convolution operation, as well as improving the performance. These attention-based neural networks have been applied to a variety of applications such as image recognition or object tracking; see [65] for a review. In particular, a novel attention-based encoder-decoder neural network architecture was presented for neural machine translation (NMT) in 2015 [2]. The idea behind this approach is illustrated in Figure 5, which shows how the attention mechanisms in neural networks work. In this example, the encoder takes an input sentence in English,
and the decoder outputs its translation in Dutch. Both encoder and decoder include _recurrent neural networks (RNNs)_; see [24] for more information about RNNs. Basically, the encoder outputs hidden states, and the decoder takes all the hidden states as inputs. Before processing them, the decoder applies an attention mechanism that gives each hidden state a score. Then, it multiplies each hidden state by its score to which a softmax function is applied. The weighted scores are summed up, and the result leads to the context vector for the decoder. By obtaining weighted hidden states which are most associated with certain words, the decoder focuses on the relevant parts of the input during decoding.

After that study in 2015, attention mechanisms in neural networks have progressed rapidly, especially for NMT. One of them is the _self-attention_ which is the core building block of the _Transformer_[69]. The Transformer is composed of encoder-decoder stacks which are entirely based on self-attention without any convolutional or recurrent layers. There are six identical layers in each of the encoder-decoder stacks that form the Transformer. To illustrate the model, only one encoder-decoder stack is shown in Figure 6.

Figure 5: A neural machine translation example. The model takes an English sentence as input and translates it into Dutch. The figure shows encoder hidden states, and which words the model focuses more on (indicated by the color intensity) while translating.

Figure 6: The Transformer architecture in detail [65; 69]. _(Left)_ The Transformer with one encoder-decoder stack. _(Center)_ Multi-head attention. _(Right)_ Scaled dot-product attention.
The encoder-decoder stacks in the Transformer are composed of fully-connected layers and _multi-head attention_ which is a kind of self-attention mechanism applying _scaled dot-product attention_ within itself. As seen in Figure 6, these attention mechanisms use three vectors for each word, namely _query (Q)_, _key (K)_ and _value (V)_. These vectors are computed by multiplying the input with weight matrices \(W_{q}\), \(W_{k}\) and \(W_{v}\) which are learned during training. In general, each value is weighted by a function of the query with the corresponding key. The output is computed as a weighted sum of the values. In the _scaled dot-product attention_, the dot products of the query with all keys are computed. As given in Eq. 6, each result is divided by the square root of the dimension of the keys to have more stable gradients. They pass onto the softmax function, thus the weights for the values are obtained. Finally each softmax score is multiplied with the value [69]:

\[Attention(Q,K,V)=softmax(\frac{QK^{T}}{\sqrt{d_{k}}})V \tag{6}\]

_Multi-head attention_ extends this idea by applying linear activations to the inputs (keys, values and queries) \(h\) times based on different, learned linear representations (Figure 6). Each of the projected versions of queries, keys and values are called _heads_ where then the scaled dot-product attention is performed in parallel. Thus, the self-attention is calculated multiple times using different sets of query, key and value vectors. This leads to the ability for the model to jointly attend to information at different positions [69]. In the last step, the projections are concatenated. Additionally, the decoder applies _masked multi-head attention_ to ensure that only previous word embeddings (tokens) are used when predicting the next word in the sentence.

In the literature, there are different Transformer architectures for various tasks [34; 40]. After the Transformer has yielded major progress in natural

Figure 7: The Vision Transformer [18]. In order to classify an image, it takes the input as patches, projects linearly, adds position embeddings, and uses a Transformer encoder.
language processing (NLP), it has been adapted to image processing tasks. _Image Transformer_[50] is one of these adaptations in which the Transformer is applied to image processing. Image Transformer applies self-attention in local neighborhoods for each query pixel, and performs well on image generation and image super-resolution. However, the current state-of-the-art model is _Vision Transformer_[18] which splits an input image into patches. Then, the Transformer takes the linear embeddings of these patches in sequence as input (Figure 7). The Vision Transformer performs well on image classification tasks whilst using fewer parameters.

### Diffusion models

Today, text-to-image models such as DALL-E 2 [56] or Midjourney have turned AI into a popular tool to produce mesmerizing images. These are _diffusion models_ which have shown great success in generating high-quality images. They have already been proven to outperform GANs at image synthesis [15].

In comparison with GANs, the training of diffusion models does not require an adversarial setting. The original Denoising Diffusion method was proposed by [16] inspired by non-equilibrium thermodynamics that systematically destroys structure in a data distribution, then restores the data. Based on this method, _denoising diffusion probabilistic models_ or _diffusion models_ in short, have been applied to image generation by Ho _et al._ (2020) [29].

Diffusion models require two main steps in the training phase (Figure 8). At first, during _the forward (diffusion) process_, random noise is gradually added to the input image until the original input becomes all noise. This is performed by a _fixed_ Markov chain which adds Gaussian noise for \(T\) successive steps. Secondly, during the _reconstruction_ or _reverse process_, the model reconstructs the original data from the noise obtained in the forward process. The reverse process is defined as a Markov Chain with _learned_ Gaussian transitions. Accordingly, the prediction of probability density at time \(t\) depends only on the state attained at time _(t-1)_. Here, \(x_{1},...,x_{T}\) are latents of the same dimensionality as the data which make the diffusion models _latent variable models_[29].

Figure 8: The working principle of diffusion model in general [29]. Starting from an image, the forward process involves gradually adding noise (following a fixed Markov chain) until the image is all noise. In the reverse process, the original image is reconstructed step by step through a learned Markov Chain.
The general structure of a diffusion model is given in Figure 8. The reverse process requires training a neural network because the estimation of probability density at an earlier time step given the current state of the system is non trivial. To this end, all previous gradients are necessary for obtaining the required estimation. For each step in the Markov Chain, a neural network learns to denoise the image. Optionally, the denoising process can be guided by text (see Section 3.3.2). In this case, a Transformer encoder maps a text prompt to tokens which are then fed to the neural network (Figure 9). Once trained, a diffusion model can be used to generate data by simply passing random noise (and optionally a text prompt) through the learned denoising process.

The diffusion model may bring to mind VAEs which encode the input data as a probability distribution and then sample from the learned latent space (Section 2.2). However, the forward process makes the diffusion model different from the VAEs as training is not required in this fixed Markov chain. More detailed information about diffusion models and its applications can be found in [70].

## 3 AI-generated art

In this section, we provide an overview of the models that have shaped the field of AI-generated art. This overview includes GANs, Transformer-based models and Diffusion models. In each section, we touch on the models that had a large impact on the field. We elaborate on the model architectures and provide a comprehensive comparison. It should be noted that this review is focused on models which have been detailed in scientific papers and therefore does not include the well-known diffusion model Midjourney.

Figure 9: The illustration of one time step in the learned Markov Chain in the reverse process. A deep neural network (e.g., U-Net [60]) learns to transform a noisy input into a less noisy image with the help of a text prompt that describes the content of the image.
### Opening gambit

DeepDream.Once CNNs achieved impressive results in image processing, the researchers started developing visualization techniques to better understand how these neural networks see the world and perform classification. Examining each layer of a trained neural network led to the development of _DeepDream_[44; 45], which produces surprisingly artistic images.

DeepDream generates images based on the representations learned by the neural network. To this end, it takes an input image, runs a trained CNN in reverse, and tries to maximize the activation of entire layers by applying gradient _ascent_[10]. DeepDream can be applied to any layer of a trained CNN. However, applying it to high-level layers is usually preferred because it provides visual patterns such as shapes or textures that are easier to recognize.

An illustration of an original input image and its DeepDream output is shown in Figure 10. What is striking, is that the output image contains lots of animal faces and eyes. This is due to the fact that the original DeepDream is based on Inception [66], which was trained using the ImageNet database [14]. Since there are so many examples of different dog breeds and bird species in the ImageNet database, DeepDream is biased towards those. For some people, DeepDream images resemble dream-like psychedelic experiences. In any case, although it was not its initial purpose, DeepDream inspired people to employ AI as a tool for artistic image creation.

Neural Style Transfer.A deep learning-based technique to combine the content of an image with the style of another image is called _neural style transfer_[22]. This technique uses a pretrained CNN to transfer the style of one image to another image. A typical example is shown in Figure 10 where the style of one image (e.g., _Starry Night_ by Vincent Van Gogh) is applied to a content target image. Neural style transfer can be implemented by redefining

Figure 10: _(Left)_ A DeepDream example. Deepdream receives an input image and outputs a dreamy version in which faces and eyes emerge due to the maximization of the final layer’s activations. _(Right)_ An illustration of neural style transfer. The content target image and style image are provided as input to the model. As output, it retains the content of the target image and applies the style of the other image.
the loss function in a CNN. This loss function is altered to preserve the content of the target image through the high-level activations of the CNN. At the same time, the loss function should capture the style of the other image through the activations in multiple layers. To this end, similar correlations within activations for low-level and high-level layers contribute to the loss function [10]. The result is an image that combines the content of the input image with the style of the second input image.

### Generative adversarial networks

ArtGAN.Tan _et al._ (2017) [67] presented their model called _"ArtGAN"_, in which they show the result of a GAN trained on paintings. Although their output images looked nothing like an artwork of one of the great masters, the images seemed to capture the low-level features of artworks. This work sparked interest in the use of GANs to generate artistic images. Additionally, it challenged people to think of creativity as a concept that could be replicated by artificial intelligence.

Can.Shortly afterwards, Elgammal _et al._ (2017) [19] further pushed this idea in their paper on _creative adversarial neural networks (CAN)_. Their goal was to train a GAN to generate images that would be considered as art by the discriminator but did not fit any existing art styles. The resulting images looked mostly like abstract paintings that had a unique feel to them. Elgammal _et al._ (2017) then validated their work in a perceptual study where they asked human participants to rate the images on factors such as liking, novelty, ambiguity, surprisingness and complexity. In addition, they asked the participants whether they thought the image originated from a human-made painting or a computer-generated one. There were no differences in the scores on the above mentioned factors between CAN art and various abstract artworks or more traditional GAN art. However, participants more often thought that their CAN images were made by a human artist as opposed to GAN generated art.

pix2pix.In 2017, Isola _et al._ (2017) [31] had the innovative idea to create a conditional GAN [43] that receives an image as input and generates a transformed version of that image. This was achieved by training the GAN on corresponding image pairs. For example, say you have a dataset of RGB images. You can create a BW version of all these images to create image pairs (one is RGB, one is BW). What is not as trivial, is turning BW images into colored ones. One could manually color the images but this is time consuming. _pix2pix_ allows you to automate this process. The generator receives the BW version of the image pair and generates an RGB version. Next, the discriminator receives both the transformed image and the original RGB image, and has to determine which one is real and which one is fake. After the training is completed, the pix2pix GAN can transform any BW image into a colored version. The major advantage of pix2pix is that it can be applied to any dataset of image pairs without the need to adjust the training process or loss function. Thus, the same model can be used to transform sketches into paintings
or BW images into colored images, simply by changing the training dataset. Many artists as well as AI enthusiasts have been inspired by pix2pix to create artistic images using this model (Figure 11).

CycleGAN.Although pix2pix was a major breakthrough in generative AI, one shortcoming was that it requires corresponding image pairs for its training, which simply do not exist for all applications. For example, we do not have a corresponding photograph for every painting created by Monet. Therefore, pix2pix would not be able to turn your photograph into a Monet painting. In 2017, the same lab released _CycleGAN_, another major breakthrough in generative AI since this GAN is able to transform your photograph into a Monet painting [75]. CycleGAN extends pix2pix by combining two conditional GANs and 'cycling' between them. The first GAN's generator might receive an image of a Monet painting and is trained to transform it to a photograph. The output image is then fed to the second generator to be transformed into a Monet painting. This transformed Monet painting and the original Monet painting are then fed to the first discriminator, whereas the photograph version of the image is compared to an existing (unpaired) photograph by the second discriminator. The same process is repeated for an existing photo by turning it into a Monet painting and back to a photo. The transformed photo is then compared to the original photo whereas the transformed Monet painting is compared to an existing (unpaired) Monet painting. In the end, the model can transform images into the other modality without having seen pairs in the training set.

GauGAN.In 2019, Nvidia researchers released _"GauGAN"_, named after post-impressionist painter Paul Gaugain [49]. Similar to pix2pix, GauGAN

Figure 11: Examples of artistic applications of pix2pix. **A.** Artwork _“Memories of Passersby I”_ by Mario Kingemann. This work continuously generates a male and female looking portrait by manipulating previously generated portraits using a collection of GANs (including pix2pix). **B.** Screenshot from video _“Learning to See: Gloomy Sunday”_ by Memo Alten. The original video shows a side by side of the input and output of pix2pix trained to turn ordinary video (showing household items) into artistic landscapes and flower paintings.
takes an image as input and produces a transformation of that image as output. Their model uses spatially adaptive denormalization, also known as SPADE, which is a channel-wise normalization method (similar to Batch Normalization) convolved with a segmentation map. As a result, the output image can be steered with a semantic segmentation map. In addition, the input image is decoded using a VAE, which learns a latent distribution capturing the style of the image. As a result, one can generate new images of which the content is controlled by a segmentation map and the style by an existing image. Figure 12 shows some example images generated with GauGAN.

Since then Nvidia has released an updated version called _GauGAN2_[62]. As the name suggests, it is still a GAN framework. However, this updated version can additionally perform text-to-image generation, meaning it can generate an image based on a text description as input. Earlier that year, text-to-image models became extremely popular due to the release of DALL-E [55], a Transformer-based model which will be discussed in the next section.

Lafite.Zhou _et al._ (2021) [74] proposed a GAN-based framework to perform language-free text-to-image generation, meaning they train their model solely on images. However, it is still able to generate images based on text descriptions after training is completed. They use CLIP's [52] joint semantic embedding space of text and images to generate pseudo text and image pairs. CLIP is another model that is trained to link text descriptions to the

Figure 12: Example images generated with GauGAN. One can provide a segmentation map and optionally a style reference as input. GauGAN then generates a photo-realistic version of the segmentation map in the style of the reference image. When we add a palm tree in the segmentation map, GauGAN adds a palm tree to its output in two different styles.
correct image and vice versa. Then, they adapt StyleGAN 2 [33] to a conditional version where the text embedding is concatenated with StyleSpace, the intermediate and well-disentangled feature space of StyleGAN [32].

### Text-to-image models

#### 3.3.1 The Transformer

**DALL-E.** Early in 2021, OpenAI released their groundbreaking model _"DALL-E"_ (named after Pixar's Wall-e and Surrealist painter Salvador Dali) on their blog. Shortly after, they detailed the workings of their model in their paper titled _"Zero-shot Text-to-Image generation"_[55]. DALL-E combines a discrete variational autoencoder (dVAE) [58], which learns to map images to lower dimensional tokens, and a Transformer, which autoregressively models text and image tokens (see Figure 15). In this manner, DALL-E is optimized to jointly model text, accompanying images and their token representations. As a result, given a text description as input, DALL-E can predict the image tokens and decode them into an image during inference. Here, zero-shot refers to the ability to generate images based on text descriptions that are not seen during training. This means that DALL-E can combine concepts that it has learned separately but never seen together in a single generated image. For example, it has seen both robots and illustrations of dragons in the training data but it has not seen a robot in the shape of a dragon. However, when prompted to generate "a robot dragon", the model can produce sensible images (see Figure 13). This remarkable capability of the model has resulted in a hype surrounding DALL-E. Although DALL-E can generate cartoons and art styles quite well, it lacks accuracy when generating photo-realistic images. As a result, OpenAI and other companies have devoted substantial resources to create an improved text-to-image model.

**CogView.** Concurrently with DALL-E, Ding _et al._ (2021) created _"CogView"_[17], a similar text-to-image model that supports Chinese rather than English. Besides the innovative idea to combine VAE and transformers, they include other features such as super-resolution to improve the resolution of the generated images. Despite their super-resolution module, their generated images lack photo-realistic quality.

**Make-A-Scene.** In 2022, Meta AI released their _"Make-A-Scene"_ model [21]. Their Transformer-based text-to-image model allows the user more control over the generated image by working with segmentation maps. During training, the model receives a text prompt, segmentation map and accompanying image as input (similarly as GauGAN2). The model then learns a latent mapping based on tokenized versions of the inputs. During inference, Make-A-Scene is able to generate an image and segmentation map based solely on text input (see Figure 15). Alternatively, one can provide a segmentation map as input to steer the desired output more. Moreover, one can alter the segmentation map that the model produces to steer the image generation.
Parti.Later that year, Google released their Transformer-based text-to-image model called _Parti_ which stands for _Pathways Autoregressive Text-to-Image model_[71]. This was the second text-to-image model Google released that year, a month after releasing Imagen [61] (see Section 3.3.2). Parti is based on a ViT-VQGAN [72], which combines the transformer encoder and decoder with an adversarial loss of a pretrained GAN to optimize image generation. Parti uses an additional transformer encoder to handle the text input, which is transformed into text tokens to serve as input to a transformer decoder alongside the image tokens from the ViT-VQGAN during training. At test time, the Transformer solely receives text as input and predicts the image tokens, which are then provided to the ViT-VQGAN to detokenize and turn them into an actual image (see Figure 15). Parti outperforms all other text-to-image models with a zero-shot FID score of 7.23 and a fine-tuned FID score of 3.22 on MS-COCO [39] (see Table 1). Figure 14 is a great example of Parti's remarkable capability to extract the essence of what the caption refers to (in this case, the _style_ of American Gothic). The generated image is not simply a copy of the original in which the rabbits seem photoshopped.

Muse.Earlier this year, Google released _Muse_, another Transformer-based text-to-image model [8]. Muse includes a VQGAN tokenizer to transfer images

Figure 13: Example images produced by DALL-E [55], retrieved from the original OpenAI blog [https://openai.com/blog/dall-e/](https://openai.com/blog/dall-e/).
into tokens and vice versa. The text input is turned into tokens using a pre-trained transformer encoder of the T5-XXL language model [53] (see Figure 15). The advantage of using such a pre-trained encoder is that this model component has been trained on a large corpus of text. A struggle in the training of text-to-image models is that it is time consuming to gather a large set of high quality image and caption pairs. The text and caption pairs likely span a limited part of concepts known in a language. Since NLP models are trained with solely text as input (which is easier to gather), they are trained on a more encompassing corpus of text. The authors find that the inclusion of the pretrained encoder results in higher quality, photo-realistic images and that the generation of text in the generated images is more accurate.

Due to its computational efficiency, Muse is the text-to-image model which requires the least time to generate an image when prompted. It achieves a state-of-the-art CLIP score of 0.32, which is a measure of how close the generated images are to the prompted caption. They verified this further in a behavioral study in which human raters indicated that the Muse-generated images are better aligned with the prompts compared to images generated with Stable Diffusion (see Section 3.3.2). In addition to image generation, Muse allows inpainting, outpainting and mask-free editing (which will be explained in more detail in Section 3.3.2).

#### Diffusion Models

Glide.In 2021, OpenAI came out with a paper that showed that diffusion models outperform GANs on image generation [15]. Less than a year after, OpenAI applied this insight to text-to-image generation, and they released _GLIDE_, a pipeline consisting of a diffusion model for image synthesis and a transformer encoder for text input [46] (see Figure 18). This new and improved

Figure 14: _(Left) American Gothic_ by Grant Wood. _(Right)_ An example image generated by Parti [71], retrieved from [https://parti.research.google/](https://parti.research.google/).
model is trained on the same dataset as DALL-E. The quality of their generated images strongly outperforms DALL-E. In a study where they asked human participants to judge the generated images from DALL-E and GLIDE, the raters preferred the GLIDE images over the DALL-E images 87% of the time for photorealism and 69% of the time for caption similarity. In addition, they preferred blurred GLIDE images over reranked or cherry picked DALL-E images.

Besides improving photorealism, GLIDE also offers the additional feature of image inpainting, meaning that you can edit a specific region in an existing or computer-generated image. For example, one can take an image of the Mona Lisa and add a necklace by providing the image and a text description (e.g., "a golden necklace") as input to GLIDE (see Figure 16).

**DALL-E 2.** Even though GLIDE was an impressive improvement upon DALL-E, it did not garner the same attention. When OpenAI released _DALL-E 2_[56], an advancement of GLIDE, this has changed. DALL-E 2 has a similar

Figure 16: An example of inpainting with GLIDE. It receives an image of the Mona Lisa as input as well as a mask and a text description “a golden necklace”. Then, it generates the output as Mona Lisa with a golden necklace. [46].

Figure 15: Comparison of the Transformer-based text-to-image models.
diffusion pipeline as GLIDE. What has been improved upon is the text input in the diffusion pipeline. Whereas GLIDE uses an untrained transformer encoder to format the text, DALL-E 2 uses the CLIP text encoder. Additionally, it uses a prior model to transform the text embedding into a CLIP image embedding before feeding it to the diffusion model (see Figure 18). This is achieved by transforming the text descriptions and images to text and image embeddings (or tokens) respectively using transformer encoders. The model is then trained to link the correct embeddings with one another. This relationship between text description and image is exploited in DALL-E 2 to provide the diffusion model with an embedding that reflects the text input but is more suited for image generation. In addition to improving image quality compared to GLIDE, DALL-E 2 allows the user to extend the background of an existing image or computer-generated one (referred to as outpainting, see Figure 17) and to generate variations of images.

Imagen.Shortly after, Google released their first text-to-image model called _Imagen_[61]. Their model is closer to GLIDE in architecture, since it does not rely on CLIP embeddings. Rather, it uses the pretrained encoder of the NLP model T5-XXL (similarly as Muse), whose embeddings are fed to the diffusion model (see Figure 18). As a result, the model is able to generate images that contain text more accurately (which is something OpenAI's models struggled with). In addition, Imagen feeds the generated image of the diffusion model to two super-resolution diffusion models to increase the resolution of the images.

Stable Diffusion.The biggest revolution in the field is perhaps the fully open source release of _Stable Diffusion_, by a company called StabilityAI [59] (we elaborate on the concerns regarding open source models in Section 4). Their main contribution is the computational efficiency of their model as opposed to the above mentioned text-to-image models. Rather than operating

Figure 17: Image outpainting examples by DALL-E 2 [56]. _(Left)_ Mona Lisa. _(Right)_ Girl with a Pearl Earring.
in pixel-space, Stable Diffusion operates in (lower-dimensional) latent space and maps the output of the diffusion process back to pixel space using a VAE (see Figure 18). Whereas previous text-to-image models require hundreds of GPU computing days, this latent diffusion model requires significantly smaller computational demands and is therefore more accessible to those with less resources. Besides image generation, Stable Diffusion additionally allows the user to modify existing images through image-to-image translation (e.g., turning a sketch into digital art) or inpainting (removing or adding something in an existing image).

InstructPix2Pix.Although several text-to-image models have this inpainting feature, in practice it is difficult to get the desired output based on a text description. The user either needs to describe the entire output image, or create a mask for the area in the image that should be modified and describe the desired modification. _InstructPix2Pix_ is a modification of Stable Diffusion and allows the user to modify images through intuitive text instructions [6]. Rather than having to describe the desired output image or providing a mask, the user can just write an intuitive instruction of how the input image should be adjusted (mask-free editing). For example, if you would like to turn the _Sunflowers_ by Vincent Van Gogh into a painting of roses, you can just write the instruction "Swap sunflowers with roses" (Figure 19).

Figure 19: InstructPix2Pix turns the _Sunflowers_ by Vincent Van Gogh into a painting of roses [6].

Figure 18: Comparison of the diffusion model-based text-to-image models.
## 4 Comparison of deep generative models

Due to the enormous efforts in the field of generative AI, it may be hard to decide which model might be most suited for one's purposes. Table 1 provides a comparison of the above mentioned models in terms of their computational efficiency (dataset size and trainable parameters), the quality of the generated images (FID score), the capabilities of the model and its accessibility (open source vs. not for public use). The state-of-the-art models that generate the highest photo-realistic images belong to Google (Parti, Muse and Imagen). However, none of these models are open source, meaning no one other than Google Research has access to them. Therefore, these results have not been reproduced by other researchers. Additionally, artists cannot use these models to create AI-generated art. On the other hand, OpenAI has released filtered versions of their models GLIDE and DALL-E 2. These versions have been trained on a filtered dataset that excluded images containing recognizable people (e.g., celebrities, political figures), nudity or violence (e.g., weapons, substance use). DALL-E 2 is accessible through a user-friendly interface where the user can type a text prompt and four generated images are shown. GLIDE is accessible through a Google Colab notebook that loads the model and its weights, but does not show the origin code to avoid misuse.

StabilityAI opted for the transparent approach, releasing both the code of their model as well as the weights. This allows anyone to use and adjust their model, that has been trained on images containing recognizable figures. Their dataset is filtered for explicit nudity and violence, however, it does contain artistic nudity such as nude paintings or sculptures. Figure 20 illustrates how Stable Diffusion allows the generation of semi-n

Figure 20: Example images generated by Stable Diffusion which allows the generation of (partial or fully) nude images. _(Left)_ Generated with the prompt “Darth Vader in his black swimshorts sunbathing on the beach.” _(Right)_ Generated with the prompt “Batman as a Greek God wearing a loincloth.”
figures. For illustration purposes, we opted for fictional characters and partially nude images. However, it is possible to create harmful deepfakes using Stable diffusion. As a result, many expressed their concerns about the release of Stable Diffusion, and its possible misuse. Emad Mostaque, the founder of StabilityAI, has stated in several interviews that the technology is not the issue, rather those who have malicious intentions. Other technologies, such as GANs, have resulted in harmful deep fakes in the past. Our role as society is to find proper rules of conduct to deal with these misuses, rather than denying access to new groundbreaking technology. That being said, StabilityAI has instilled multiple safety barriers to avoid misuse by stating ethical and legal rules in Stable Diffusion's permission license (e.g., stating you cannot spread nude or violent deepfakes) and including an AI-based safety classifier that filters the generated images.

\begin{table}
\begin{tabular}{l l l l l l} \hline \hline Model & FID on MS-COCO & Trainable parameters & Dataset size & Open source & Capabilities \\ \hline ArtGAN & - 1 & - & 80K & Yes & Image generation \\ CAN & - & - & 80K & Yes & Image generation \\ pix2pix & - & - & Various2 & Yes & Image manipulation \\ CycleGAN & - & - & Various & Yes & image manipulation \\  & & & & & Image generation, \\  & & & & & image manipulation, \\  & & & & & text-to-image \\ LAFITE & 26.94 & 75M & - & - & Text-to-image \\ DALL-E & 27.50 & 12B & 250M & No & Text-to-image \\ CogView & 27.10 & 4B & 30M & - & Text-to-image \\ Make-A-Scene & 11.84 & 4B & 35M & No & Text-to-image, \\  & & & & & image manipulation \\ Parti & 7.23 & 20B & - & No & Text-to-image \\  & & & & & Text-to-image, \\ Muse & 7.88 & 3B & 460M & No & inpainting, \\  & & & & & mask-free editing \\ GLIDE & 12.24 & 3.5B & 250M & Partially & Text-to-image, \\  & & & & & inpainting \\ DALL-E 2 & 10.39 & 4.5B & 650M & Partially & Text-to-image, inpainting, \\  & & & & & outpainting, \\ Imagen & 7.27 & 2B & 460M & No & Text-to-image \\ Stable Diffusion & 12.63 & \(<\) 1B & 5B & Yes & Text-to-image, inpainting, \\  & & & & & image manipulation \\ InstructPix2Pix & - & \(<\) 1B & 450K & Yes & Mask-free editing \\ \hline \hline \end{tabular} 1

\end{table}
Table 1: Summary of deep generative models
## 5 Conclusions

Deep learning and its image processing applications are now at a totally different stage than a few years ago. In the beginning of last decade, it was groundbreaking that deep neural networks could classify natural images. Today, these models are capable of generating highly realistic and complex images based on simple text prompts. This allows individuals without programming knowledge to employ these powerful models. It is important to remember that the use of these models should be guided by ethical and responsible considerations. These tools can assist artists to express their creativity and may shape the future of art. As ChatGPT stated, _"Some people believe that AI has the potential to revolutionize the way we create and think about art, while others are more skeptical and believe that true creativity and artistic expression can only come from human beings."_

_"Ultimately, the role of AI in the arts will depend on how it is used and the goals and values of the people who are using it"_ ChatGPT concluded.

Acknowledgments.We would like to thank ChatGPT for answering our questions patiently.
