Motion Transformer for Unsupervised Image Animation

Jiale Tao, Biao Wang, Tiezheng Ge, Yuning Jiang, Wen Li, Lixin Duan

Abstract

Image animation aims to animate a source image by using motion learned from a driving video. Current state-of-the-art methods typically use convolutional neural networks (CNNs) to predict motion information, such as motion keypoints and corresponding local transformations. However, these CNN-based methods do not explicitly model the interactions between motions; as a result, the important underlying motion relationship may be neglected, which can potentially lead to noticeable artifacts being produced in the generated animation video. To this end, we propose a new method, the motion transformer, which is the first attempt to build a motion estimator based on a vision transformer. More specifically, we introduce two types of tokens in our proposed method: i) image tokens formed from patch features and corresponding position encoding; and ii) motion tokens encoded with motion information. Both types of tokens are sent into vision transformers to promote underlying interactions between them through multi-head self-attention blocks. By adopting this process, the motion information can be better learned to boost the model performance. The final embedded motion tokens are then used to predict the corresponding motion keypoints and local transformations. Extensive experiments on benchmark datasets show that our proposed method achieves promising results compared to state-of-the-art baselines.

Introduction

Image animation, or motion transfer, is the task of generating a video sequence where a static source image is animated according to the movements observed in a driving video. The primary challenge lies in accurately transferring motion while preserving the identity and appearance details of the source subject.

Existing state-of-the-art frameworks, such as First Order Motion Model (FOMM) and Multi-Region Animation (MRAA), typically rely on Convolutional Neural Networks (CNNs) to estimate motion. While effective, CNNs are inherently limited by their local receptive fields. They excel at capturing local textures but struggle to model long-range dependencies and global interactions between different moving parts of an object. For instance, in facial animation, the movement of the mouth is often highly correlated with the eyes and jaw. Neglecting these global relationships can lead to jittery animations or "ghosting" artifacts. The Motion Transformer addresses this by leveraging the global attention mechanism of Vision Transformers (ViTs) to explicitly model these interactions.

Methodology

The proposed framework consists of two main stages: Motion Estimation and Image Generation. The core innovation is the replacement of the standard CNN-based motion estimator with a Transformer-based module.

The Motion Transformer Architecture

As illustrated in the architecture overview, the Motion Transformer processes the driving and source images through a shared CNN backbone (e.g., HRNet-W32) to extract patch features. These features are then transformed into two distinct sets of tokens:

  1. Image Tokens: These are derived from the flattened patch features and augmented with position encodings to maintain spatial awareness.
  2. Motion Tokens: These are a set of learnable embeddings. Each token is designed to capture the motion of a specific semantic part of the object (e.g., a specific limb or facial feature).
Overview of the Motion Transformer architecture and its integration into the general image animation framework.

These tokens are concatenated and passed through a series of $N$ Transformer layers. Within these layers, multi-head self-attention allows motion tokens to query the entire image and interact with one another, establishing a global context for the estimated movement. Finally, a regression head (FC Layer) processes the embedded motion tokens to predict the $(x, y)$ coordinates of keypoints and their associated $2 \times 2$ affine transformation matrices.

Image Generation

The estimated motion is used to compute a dense optical flow and an occlusion map. These components guide a generator (comprising an encoder and decoder) to warp the source image features and synthesize the final animated frame. The model is trained in an unsupervised manner using perceptual loss, equivariance loss, and background-specific losses to ensure realistic results without requiring manual keypoint annotations.

Experiments and Results

Datasets and Evaluation

The Motion Transformer was rigorously evaluated on four diverse benchmark datasets:

  • VoxCeleb: Human talking heads.
  • TaiChiHD: Full-body Tai Chi movements.
  • TED-talks: Upper-body gestures.
  • MGIF: Non-rigid cartoon animal animations.

Performance Analysis

The Motion Transformer consistently outperformed previous CNN-based baselines like FOMM and MRAA. Key findings include:

  • Motion Accuracy: The model achieved lower Average Keypoint Distance (AKD), indicating that the generated motion more faithfully follows the driving video.
  • Identity Preservation: Lower Average Euclidean Distance (AED) scores demonstrated that the source's identity remains more stable, even during complex or extreme movements.
  • Global Awareness: Qualitative results suggest that the Transformer's ability to "see" the whole image allows for more stable and anatomically consistent relationships between moving parts compared to local CNN approaches.

Conclusion

The Motion Transformer represents a significant step forward in unsupervised image animation by introducing global motion modeling via Vision Transformers. By treating motion parts as learnable tokens that interact with the full image context, the model produces more realistic and stable animations. While the computational complexity (FLOPs) is higher than some CNN counterparts due to the attention mechanism, the improvement in animation quality and identity preservation makes it a compelling approach for high-fidelity motion transfer. Future work will focus on optimizing the efficiency of the Transformer layers to reduce the computational overhead.

Summary updated

BibTeX
@inproceedings{tao2022motion,
  author = {Jiale Tao and Biao Wang and Tiezheng Ge and Yuning Jiang and Wen Li and Lixin Duan},
  title = {{Motion Transformer for Unsupervised Image Animation}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  url = {https://openreview.net/forum?id=FEkJWRC7UBj},
}
Figure