DyNCA: Real-Time Dynamic Texture Synthesis Using Neural Cellular Automata

Ehsan Pajouheshgar, Yitao Xu, Tong Zhang, Sabine Süsstrunk

Abstract

Dynamic Texture Synthesis (DyTS) aims to generate infinitely long, visually consistent video sequences from a single image or a short video clip. While recent deep learning approaches have improved visual quality, they remain computationally expensive and offer limited control. We present DyNCA (Dynamic Neural Cellular Automata), a framework that synthesizes realistic dynamic textures in real-time. By evolving local cellular rules rather than optimizing global frames, DyNCA achieves a speedup of 2 to 4 orders of magnitude over previous state-of-the-art methods while providing unprecedented interactive control over motion speed and direction.

The Challenge of Dynamic Textures

Synthesizing dynamic textures like flowing water, flickering flames, or waving grass involves capturing both spatial patterns and temporal dynamics. Existing methods face three primary bottlenecks:

  1. Computational Cost: Optimization-based processes are slow, often taking hours for a few seconds of video.
  2. Rigidity: Models are typically constrained to fixed resolutions and predetermined lengths.
  3. Lack of Control: Users cannot easily modify motion characteristics (e.g., wind speed or flow direction) post-training.

DyNCA bridges the gap between high-quality neural optimization and the efficiency of procedural methods.

Methodology: NCA as a Physical Simulator

DyNCA treats video as a stochastic Partial Differential Equation (PDE) parameterized by a small neural network. Instead of predicting pixels directly, the model learns local update rules for a grid of "cells."

Overview of the DyNCA synthesis process, showing how target appearance and motion dynamics are combined to produce the final result.

The architecture introduces two critical modifications to the standard Neural Cellular Automata (NCA) framework:

  • Multi-scale Perception (MSP): Standard NCAs only perceive immediate neighbors. MSP utilizes a pyramid of cell states, allowing cells to communicate across longer distances, which improves stability and visual fidelity.
  • Cartesian Positional Encoding (CPE): To achieve structured motion (e.g., gravity), cells must be aware of their spatial location. By concatenating coordinate information, the model learns global motion fields.

Training Objectives

The model is trained using a dual-loss approach on datasets such as the Describable Textures Dataset (DTD) and DynTex:

  1. Appearance Loss: Employs a pre-trained VGG16 network and optimal-transport-based style loss to ensure each frame matches the target texture's visual style.
  2. Motion Loss: Uses a pre-trained optical flow network to align the movement between frames with either a target video or a hand-crafted vector field.

Key Results and Performance

DyNCA demonstrates remarkable efficiency and flexibility:

  • Speed: It is 10,000x faster than previous optimization-based methods, synthesizing frames in 33–57ms on an A100 GPU. This enables real-time interaction on mobile devices.
  • Compactness: Models are extremely lightweight, requiring only 0.006M to 0.010M parameters, compared to 81M in some competing SOTA models.
  • Flexibility: Once trained, the same model can generate video at any resolution and for any duration.
A synthesized sequence of a waving flag, illustrating the model's ability to maintain temporal consistency and realistic dynamics.

In user studies, DyNCA's results were rated more realistic than existing methods, often achieving "on-par" fooling rates compared to real videos.

Discussion: Disentangling Style and Motion

A profound insight of DyNCA is the ability to perform Dynamic Style Transfer. Because appearance and motion are handled by separate losses, users can combine the "look" of a painting with the "motion" of a natural phenomenon (e.g., a Van Gogh-style whirlpool). Furthermore, the NCA's inherent self-organization makes it robust; the model can perform real-time video inpainting if parts of the frame are modified or erased.

Limitations

Despite its strengths, DyNCA faces challenges when target appearances are physically incompatible with target motions (e.g., horizontal flow on vertical stripes). Additionally, the model assumes texture homogeneity and may struggle with complex, non-repeating foreground objects. Future work will focus on automating loss weighting and extending the framework to more complex scenes.

Summary updated

BibTeX
@inproceedings{pajouheshgar2022dynca,
  author = {Ehsan Pajouheshgar and Yitao Xu and Tong Zhang and Sabine Süsstrunk},
  title = {{DyNCA: Real-Time Dynamic Texture Synthesis Using Neural Cellular Automata}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
}
Figure