\section{Introduction}

We may not be able to play soccer like Lionel Messi, but perhaps we can train deep networks to hallucinate imagery suggesting that we can.  Consider the images in Fig.~\ref{fig-intro}.  In this paper we describe research toward synthesizing realistic images or sequences that forecast the appearance of people performing desired actions.  The model can take a pose and a reference image of a person, and generate a novel view of the person in the given pose, while capturing fine appearance details.

Image or video generation has emerged as an important problem in many domains. Within robotics, work has explored predicting the consequences after interactions between an agent and its environment~\cite{finn2016unsupervisedPhysicalInteraction}. In natural language processing, approaches~\cite{mansimov2015generating,reed2016generative} have been proposed to tackle tasks such as text to image or image to text synthesis. Generative models of video sequences~\cite{walker2017poseKnow, Villegas2017LearningToGenerate} and fashion images~\cite{ZhaoWCLF17,MaDPIG17} are a core part of visual understanding and have received renewed attention from the vision community.

In this paper, we focus on generating realistic images of a particular person striking a desired pose. Human body pose is a natural intermediate representation for this generation, and hence utilized in many previous methods for synthesizing human motion and video~\cite{BrandH00,EfrosBMM03,walker2017poseKnow}. We follow in this paradigm, using body poses to generate person images and videos. Simple networks~\cite{walker2017poseKnow} may generate blurry and distorted images.  Stylistic methods~\cite{isola2016pix2pix} have shown great success in generating realistic images, but lack control over the appearance of the generated images. Our task requires the model to be able to generate images of a person with a specific appearance. Inspired by~\cite{chen2017stylebank}, we propose a novel appearance rendering network which encodes appearance into convolutional filters. These filters are operationalized using a fully convolutional network, and utilized in an image-to-image translation structure that transfers the desired appearance to the generated image.

To sum up, we contribute a new state of the art generative model that performs adaptive appearance rendering to create accurate depictions of human figures in these human poses. We demonstrate our model on two applications: fashion image synthesis and multi-person video synthesis involving complex human activities. Comprehensive quantitative results are provided to facilitate the analysis of each component of our model, and qualitative visualizations are shown in complementary to quantitative results.


\section{Related Work}

{\bf Image generation:} Image-to-image translation has achieved great success since the emergence of GANs~\cite{goodfellow2014GAN}. Recent work produces promising results using GAN-based models~\cite{isola2016pix2pix, CycleGAN2017}. Stylized images can be generated by using feed-forward networks~\cite{gatys2015neuralStyleTransfer} with the help of perceptual loss~\cite{johnson2016perceptualLoss}. The recent work of \cite{chen2017stylebank} proposes a structure to disentangle style and content for style transfer. Styles are encoded using a stylebank (set of convolution filters). Visual analogy making~\cite{NIPS2015_5845_analogy, sadeghi2015visalogy} generates or searches for an new image analagous to an input one, based on other previously given example pairs.

{\bf Generation from intermediate representations:} Generation directly in low-level pixel space is difficult and these types of approaches tend to generate blurry or distorted future frames. To tackle this problem, hierarchical models~\cite{walker2017poseKnow, Villegas2017LearningToGenerate, ZhuPrada17, KaracanAEE16, ma2017pose} adopt intermediate representations. This type of approach can alleviate image blur, however the quality of generation largely depends on the the image generation network. Simple generation networks can still produce blurry images as shown in~\cite{walker2017poseKnow}. It's worth noting that Ma et al. propose a two-stage approach to solve a problem similar to our work~\cite{ma2017pose}. However, the main contribution of this work is to propose a simple yet well-performing base model to the problem of generating images conditioned on pose and appearance.

{\bf Video generation:} Data-driven video generation has seen a renaissance in recent years. One major branch of methods uses RNN-based models such as encoder-decoder LSTMs for direct pixel-level video prediction~\cite{ranzato2014videoGenerationBaseline, srivastava2015unsupervisedVideoRepresentationLSTMs, oh2015actionConditionedVideoPrediction, mathieu2015deepBeyondMSE}. These methods successfully synthesized low-resolution videos with relatively simple semantics, such as moving MNIST digits or human action videos with very regular, smooth motion. Subsequent work has attempted to expand the quality of predicted video in terms of resolution and diversity in human activity.  Earlier efforts were focused on optical flow-timescale prediction, further work pushed past into more complex motions (e.g.~\cite{liu2017video}).

In summary, our approach builds on the substantial body of related work in pose analysis and style/analogy-based image generation. We contribute a novel, simple and effective method for adaptive appearance rendering model for image/video generation from human poses.


\begin{figure*}[!tph]
\center
\includegraphics[width=0.85\textwidth]{figures_for_main_paper/sys-flow.pdf}
\caption{Overview of the adaptive appearance rendering network. Given input posemap image and appearance reference image, the appearance is encoded into convolutional filters, then these filters are placed in the image-to-image translation network to transfer the appearance to images of each person striking the desired pose.}
\label{fig:overview}
\end{figure*}
\section{Adaptive Rendering Network}
\label{sec:adaptive_render}
Given pose estimations as intermediate representations, the goal of our model is to synthesize realistic image of person with desired appearance and pose, where the pose of every person is a \textit{posemap} image in which ``white" body joint points are drawn on a black background canvas. Great success has been shown in generating realistic images given a sketch as inputs~\cite{isola2016pix2pix}, which is similar to our task since the posemap image can be treated as a sketch. However, for our task we cannot generate random appearance and we need control over appearance of generated images to make sure that the generated person is wearing the desired clothing.

To accomplish this goal, we propose an adaptive rendering structure where the appearance filters are adaptively computed from an input reference image using a fully convolutional neural network (FCN) and supervised using style loss to enforce similar color distributions as the input reference image. By incorporating this FCN into an image-to-image translation network a realistic image of a target consistent with the desired action and appearance can be generated.

\subsection{Network Structure}
 
Fig.~\ref{fig:overview} shows our adaptive rendering network (Ada-R Network) architecture, which consists of two branches: an encoder-decoder branch, and an adaptive rendering branch. The network requires two input images: a posemap image, and a reference image which provides the appearance of the same person in a different pose. The goal of the network is to generate a realistic image of a person consistent with the posemap and having appearance consistent with the reference image.
 
\textbf{Encoder-Decoder}: Instead of training an encoder-decoder network which can reconstruct input images, our encoder-decoder branch shown in Fig.~\ref{fig:overview} is a sketch $\rightarrow$ image model. 

We use the same input size and encoder-decoder structure as in~\cite{isola2016pix2pix}: both generator and discriminator use modules of the form convolution-BatchNorm-Relu~\cite{ioffe2015batch}, the encoder consists of convolutional layers with stride 2 and symmetrically the decoder consists of convolutional layers with fractional stride $\frac{1}{2}$. 

\textbf{Adaptive Rendering}: The encoder-decoder network takes binary posemap images as inputs which do not contain any information about the appearance of the person.  Hence, we propose to use another network to learn appearance information. By combining these two networks together we are able to generate realistic images of a person wearing the desired clothing. Here we introduce our Ada-R network. 

To transfer the desired appearance to the encoder-decoder branch, we replace the last convolutional filter in the encoder-decoder branch with our adaptive appearance transfer filter. The adaptive appearance filter $\bm{K}_{ada \mhyphen app}$ encoding appearance information of a person is derived from an input appearance reference image $\bm{I}_{app}$ using a fully-convolutional network
\begin{equation}
    \bm{K}_{ada \mhyphen app} = FCN(\bm{I}_{app})
\end{equation}
For image generation, the inputs are appearance-posemap image pairs. For video generation, the rendering of one person's posemap sequence only requires one reference image, and the frames could be obtained by performing adaptive appearance rendering frame by frame. The filter is applied to the rendering procedure by
\begin{eqnarray}
    \bm{F} &=& \mathcal{E} (\bm{I}_{pose}) \\
    \bar{\bm{F}} &=& \bm{F} \ast \bm{K}_{ada \mhyphen app}
\end{eqnarray}
where $\mathcal{E}$ is the encoder network, $\bm{I}_{pose}$ is the posemap image and $\ast$ is a regular 2D convolution operator. $\bm{F}$ is the feature map of size $w\times h\times C_{in}$ generated by the encoder network. We set the size of $\bm{K}_{ada \mhyphen app}$ to $k\times k\times C_{in}\times C_{out}$ to be compatible with $\bm{F}$, where $k$, $C_{in}$ and $C_{out}$ denote the kernel size, input channel number and output channel number of this adaptive convolution operation. $\bar{\bm{F}}$ is the feature map after applying the adaptive appearance filter to the feature map $\bm{F}$. The person $\bm{I}_{gen}$ with desired appearance is finally produced with
\begin{equation}
     \bm{I}_{gen} = \mathcal{D} (\bar{\bm{F}})
\end{equation}
where $\mathcal{D}$ is the decoder network.

We release a reference implementation\footnote{\url{https://github.com/wisdomdeng/AdaptiveRendering}} to provide the full details on the model architecture and parameter settings.

\subsection{Loss Function}

Our network is trained in an adversarial setting, where the Ada-R network is the generator $G$, and a discriminator $D$ is introduced to discriminate between real and generated images. The overall architecture is a conditional generative adversarial network conditioned on the reference image. Let $\bm{I}_{goal}$ be the target image that we try to produce, and $\bm{I}_{gen}$ be the image that the Ada-R network generated. The loss of our Ada-R network is defined as
\begin{equation}
\mathcal{L_{CGAN}}(G, D) + \mathcal{L_{T}}
\end{equation}
where $\mathcal{L_{CGAN}}(G, D)$ is the standard adversarial loss. 
$\mathcal{L_{T}}$ is our appearance transfer loss, defined below.
\begin{equation}
\mathcal{L_{T}} = \alpha \mathcal{L}_{1}(\bm{I}_{gen}, \bm{I}_{goal}) + \beta \mathcal{L_{C}}(\bm{I}_{gen}, \bm{I}_{goal}) + \gamma \mathcal{L_{S}}(\bm{I}_{gen}, \bm{I}_{app}).
\end{equation}
$\mathcal{L}_{1}$ is an $L_1$ loss that encourages pixel-level agreement between the generated image and the target image, defined as:
\begin{equation}
\mathcal{L}_{1}(\bm{I}_{gen}, \bm{I}_{goal}) = ||\bm{I}_{gen}-\bm{I}_{goal}||.
\end{equation}
$\mathcal{L_{C}}$ and $\mathcal{L_{S}}$ are the content and style loss, defined the same as Gatys et al.~\cite{gatys2015neuralStyleTransfer}.  They 
aim to preserve image structure and colour distributions respectively:
\begin{eqnarray}
\mathcal{L_{C}}(\bm{I}_{gen}, \bm{I}_{goal}) = \sum_{l \in {l_{c}}}||F_{l}(\bm{I}_{gen})-F_{l}(\bm{I}_{goal})||^2 \\
\mathcal{L_{S}}(\bm{I}_{gen}, \bm{I}_{app}) = \sum_{l \in {l_{s}}}||G_{l}(\bm{I}_{gen})-G_{l}(\bm{I}_{app})||^2
\end{eqnarray}
where $F_{l}$ is the feature map from layer $l$ of a pretrained VGG-19 network~\cite{Simonyan15VGG}. $l_{c}$ are layers of VGG-19 used to compute the content loss. $G_{l}(\cdot)$ is the Gram matrix which learns the correlations of color distribution given two input images. $l_{s}$ are layers of VGG-19 used to compute the style loss.

The final objective is defined as
\begin{equation}
G^{\star} = \arg \underset{G}{\min}\ \underset{D}{\max}\ \mathcal{L_{CGAN}}(G, D) + \mathcal{L_{T}}
\end{equation}


\section{Experiments}
\label{sec:exp}
We demonstrate our model on the DeepFashion dataset~\cite{liuLQWTcvpr16DeepFashion} and Volleyball dataset ~\cite{Ibrahim_2016_CVPR_volleyball}. For the DeepFashion dataset, the goal is to render a given appearance to different poses of same person. Due to the completeness of poses, we perform comprehensive quantitative evaluations and an ablation study on the DeepFashion dataset. We also demonstrate a novel application of our model on the Volleyball dataset where the goal is to synthesize short videos (5 frames) containing groups of people given the people in the $1^{st}$ frame as appearance reference image. 

To train our Ada-R network, we compute content loss at layer \textit{relu4-2} and style loss at layer \textit{relu1-2}, \textit{relu2-2}, \textit{relu3-2}, \textit{relu4-2} and \textit{relu5-2} of the pre-trained VGG-19 network. We set the learning rate to \textit{1e-3}, loss weights are set to bring the $L1$, content and style losses to a similar scale. For fashion dataset $\alpha=100$, $\beta=1e-4$, $\sigma=1e-14$. For Volleyball dataset, $\alpha=100$, $\beta=0.1$, $\sigma=1e-12$. To make the training stable, for DeepFashion dataset, in each iteration the generator is updated three times and the discriminator is updated one time; and for Volleyball dataset, in each iteration the generator is updated twice and the discriminator is updated one time.

We adopt Mean Square Error (MSE), Peak Signal-to-noise Ratio (PSNR), and Structural Similarity (SSIM)~\cite{wang2004image} as evaluation metrics. MSE and PSNR are pixel-wise measurements for quality of reconstructed or generated images. SSIM measures the quality of a generated image by considering the image's structural information instead of only pixel-wise errors. For both datasets, the OpenPose detector~\cite{cao2017realtime} is used to obtain corresponding poses for each target in a given image.


\subsection{Experiments on DeepFashion}
\label{eval:fashion}
DeepFashion contains fashion images of different person IDs, and most IDs contain 4 views: front, side, back and full body. We filtered out IDs without upper body view or with less than 3 views, resulting in 3418 person IDs. To train our model, we use 2395 person IDs, resulting in 14370 pose-appearance pairs. To test our model, we use 1023 person IDs, resulting in 6138 pose-appearance pairs. Original images are resized to $128 \times 128$ for both training and testing.
 

To analyze the strength of our model as well as the importance of each component in both the network structure and loss, we compare our Ada-R approach with the following approaches:

{\bf Ada-R w/o style loss}: In this baseline, we remove the style loss from the loss function.

{\bf Ada-R w/o content loss}: In this baseline, we remove the content loss from the loss function.

{\bf Ada-R w/o $L_1$ loss}: In this baseline, we remove the $L_1$ loss from the loss function.

{\bf Pose-GAN$^\star$ (PG$^\star$)}: We adopt the generation structure used by Walker et al.~\cite{walker2017poseKnow}, namely the posemap image and appearance image are concatenated as input to the image-to-image translation network and the FCN is removed. The same loss is used as our Ada-R approach.

{\bf Pose-GAN$^\star$ (PG$^\star$) w/o style loss}: We adopt the generation structure of PG and remove the style loss from the loss function.

{\bf Visual Analogy Making$^\star$ (VAM$^\star$)}: We adopt the analogy based generation structure used in~\cite{Villegas2017LearningToGenerate,NIPS2015_5845_analogy}. Same loss is used as our Ada-R approach.

For evaluation, posemaps and images are normalized to $[-1,1]$. To measure the quality of the poses of the generated images, we propose a new \textit{perceptual pose score} which uses a state-of-the-art pose estimator~\cite{cao2017realtime} to extract pose from generated images and compares each pose joint with the corresponding ground truth pose joint using Euclidean distance. Quantitative results showing comparisons among our approach with all baselines are shown in Tab.~\ref{tbl:fashion_measure} and visualizations of all approaches are shown in Fig.~\ref{fig-fashion1} and Fig.~\ref{fig-fashion2}.

\begin{figure}[h]
\center
\includegraphics[width=0.95\textwidth]{figures_for_main_paper/fashion-1-new.pdf}
\caption{Visualization of generation results of Ada-R using different loss terms on DeepFashion.}
\label{fig-fashion1}
\end{figure}

\begin{figure}[h]
\center
\includegraphics[width=0.95\textwidth]{figures_for_main_paper/fashion-2-new.pdf}
\caption{Visualization of generation results of different state-of-the-art approaches on DeepFashion.}
\label{fig-fashion2}
\end{figure}

The quantitative evaluation results show that our \textit{Ada-R} models, except for the ablated one without $L_1$ loss, uniformly outperform \textit{Pose-GAN} and \textit{Visual Analogy Making} models by significant margins across all measures. The ablation study results for \textit{Ada-R} models on different components of the loss function also show that each component contributes positively to the model's performance. Since the target image directly supervises the model training through the content loss and $L_1$ loss, removing one of them, especially the $L_1$ loss, causes the largest degradation of model performance. This degradation in performance is also reflected in visualization results presented in Fig.~\ref{fig-fashion1}. As we can see from Fig.~\ref{fig-fashion1}, removing $L_1$ or content loss results in: (1) the pose of the target in the generated images being inferior (missing arms or hands); (2) images generated being more blurry; (3) the appearance of the generated images showing more errors in details (color transfer to arms, wrong colors, uneven colors in clothes). As seen from Tab.~\ref{tbl:fashion_measure}, removing the style loss from the training objective causes relatively smaller impacts on the model's performance and the model can generate person images striking the correct pose. However it is observed that many examples generated by \textit{Ada-R w/o style loss} do not reflect the colors of the style reference image correctly and the colors tend to be flat and unvaried compared with our full model.


When compared with \textit{PG$^\star$} models that learn the representation for the pose and the style together, \textit{Ada-R} which adopts a two-stream approach and encodes the pose and style separately also shows clear advantages. As shown in Fig.~\ref{fig-fashion2}, \textit{PG$^\star$} tends to generate images that show both the pose of the input posemap and the pose in the style reference image so as to match the color distribution of the style image, resulting in two overlapping targets in the generated images. While \textit{PG$^\star$ w/o style loss} tends to generate blurry images with incorrect poses or appearance as shown by the pose score and examples in Fig.~\ref{fig-fashion2}. The comparison demonstrates the advantage of disentangling the representations of pose and style and targeting each representation with a specific loss. \textit{Visual Analogy Making$^\star$ (VAM$^\star$)}~\cite{NIPS2015_5845_analogy}, also uses disentangled representations for pose and style and we use the same loss function as our model for training. However, we find that it cannot generate images with correct poses most of the time. Failure examples of \textit{Visual Analogy Making$^\star$} are presented in Fig. ~\ref{fig-fashion2}.
\input{fashion_measure.tex}

\subsection{Experiments on Volleyball}
\label{eval:volleyball}
The Volleyball dataset contains sequences of volleyball games. For this dataset, our model is trained to observe players in the $1^{st}$ input frames and predict their future appearances from frame 6 to frame 10. To get training sequences of each player, we run person detection~\cite{ren2015faster} and tracking~\cite{dlib09} to get tracklets of each player in each clip. We follow the data split of original dataset and preprocessing is conducted to filter out instances with less than 10 joints and clips containing less than 10 targets. We get 1262 clips for training and 790 clips for testing. Images of players are cropped and then resized to $256 \times 256$ pixels for both training and testing. For evaluations, we compare our model with state-of-the-art approaches including Pose-GAN and VAM as described in Sec.~\ref{eval:fashion}. Comparisons among our approach and two state-of-the-art approaches are shown in Tab.~\ref{tbl:volleyball_measure} and visualizations of all approaches are shown in Fig.~\ref{fig:volley_visual}. 

\input{volleybal_measure.tex}

\begin{figure*}[!tph]
\center
\includegraphics[width=0.9\textwidth]{figures_for_main_paper/volleyball-1-new.pdf}
\caption{Visualizations on Volleyball dataset.}
\label{fig:volley_visual}
\end{figure*}

As shown in both quantitative and qualitative results, our model performs very well on this application. Our model can generate clean and sharp person image sequences with correct appearance generated and consistent poses as in the posemap input, despite the complex scenario in terms of delicate pose changes, motion blur, and appearance variation.

We could also generate frames in original resolution $1280 \times 720$ by replacing players in a frame by generated ones. Examples of the frame synthesis results are shown in Fig.~\ref{fig:volley_whole_frame}, where the generated players are highlighted using blue bounding boxes. 


\begin{figure*}[!tph]
\center
\includegraphics[width=0.9\textwidth]{figures_for_main_paper/volleyball-whole-frame-new.pdf}
\caption{Visualizations on whole frame generation on Volleyball dataset. The generated players are highlighted using \textcolor{blue}{blue} bounding boxes in each frame.}
\label{fig:volley_whole_frame}
\end{figure*}
\section{Conclusion}
We proposed a novel approach for synthesizing realistic images or sequences that generate the appearance of people taking the desired poses. Our approach encodes the appearance into convolutional filters. These filters are learned using a fully convolutional network, and utilized in an image-to-image translation structure that transfers the desired appearance to the desired pose. Both quantitative and qualitative results show that our model is superior to state-of-the-art approaches and can generate better images involving complex appearance and better videos involving complex human activities. The success of our model demonstrates that the combination of appearance filters and style loss can render the desired target appearance while adapting to the predicted pose.



