Papers
Topics
Authors
Recent
Search
2000 character limit reached

SWIM: Single-Instance Whole-Body Imitation for swiMming

Published 29 May 2026 in cs.GR, cs.AI, and cs.LG | (2605.31120v1)

Abstract: We propose a new method for synthesizing physically-based swimming motions. Physically-based character animation aims to generate physically valid, controllable, and natural-looking motions which can respond to unexpected disturbances, where one dictating factor of difficulty is the complexity of the task, especially the level of sophistication of the required interactions with the environment. Existing research has succeeded in various tasks in static and dynamic environments. We push the difficulty further to swimming, which requires full-body coordination and continuous interactions with fluids, a new level of complexity when it comes to interacting with the environment. This complexity imposes challenges in learning control under volatile environmental forces, generalizing control to different environments and swimming styles, lack of data references, and prohibitively slow physical simulation which is inevitable during control learning. To this end, we propose SWIM, a new imitation method for swimming motions, which can learn from a single swimming motion and generalize to unseen environments, body conditions, and swimming styles. Extensive evaluation and comparison demonstrate that SWIM is data-efficient, stable, robust, and generalizable, outperforming alternative methods across multiple classes of tasks and metrics.

Summary

  • The paper proposes an RL framework that leverages a single demonstration to achieve physically plausible swimming control in complex fluid environments.
  • It utilizes a custom state representation and hybrid RL with a progressive eviction buffer to enhance sample efficiency and generalization.
  • Experimental evaluations demonstrate robust performance across varied fluid dynamics, disturbances, and even geometry modifications, confirming its practical impact.

SWIM: Single-Instance Whole-Body Imitation for Physically-Based Swimming Control

Introduction

The paper "SWIM: Single-Instance Whole-Body Imitation for swiMming" (2605.31120) introduces SWIM, a reinforcement learning (RL) framework enabling physically-based characters to synthesize robust, task-driven swimming motions. The work addresses the long-standing challenge of simulating and controlling articulated humanoid swimmers, leveraging a highly data-efficient approach that generalizes from a single demonstration to unseen environments, tasks, and body geometries. The authors emphasize advances in physically plausible character animation, especially within complex, fully coupled fluid environments.

Problem Formulation and State Representation

SWIM formulates swimming control as an MDP with a custom high-dimensional state integrating body kinematics, a multi-horizon goal encoding, and a structured local environment representation. The environment state captures near-body fluid characteristics via a smoothed per-body force/torque vector, crucially balancing informativeness and volatility resistance. The goal encoding employs dynamically updated intermediate waypoints along a reference path, providing both sparse and dense cues for policy training and improved generalization.

The action space is parameterized as joint residuals atop a cyclic reference swimming motion, implemented via a neural network outputting corrective targets. Reward functions include decomposable components penalizing goal deviation, body instability (especially excess roll), and motion temporal roughness, resulting in learning that jointly optimizes controllability, stability, and naturalness. Figure 1

Figure 1: Visual depiction of reward components, multi-horizon intermediate goals, and ideal reference trajectories in SWIM's training task.

Hybrid RL Algorithm and Buffering Strategy

A key contribution is a hybrid on/off-policy RL regime tailored to the unique requirements of fluid-coupled locomotion. Built on PPO, the experience replay is maintained via ProgEvict, a progressive eviction buffer. Early training employs FIFO, while late training transitions (via a sigmoidal schedule) to a reward and recency-aware heuristic. This strategy efficiently exploits rare, high-quality, and informative failure trajectories, empirically accelerating convergence and improving sample efficiency over both vanilla PPO and naïve replay strategies. Figure 2

Figure 2: Sample efficiency and reward curves for diverse environment state representations under FIFO and ProgEvict buffer management.

Physically-Based Rigid-Fluid Coupled Simulator

The simulation stack is a tightly coupled system integrating DFSPH (for Lagrangian incompressible SPH fluid dynamics) and PyBullet (for multi-link rigid body articulation). Surface force and torque integrations occur at the per-body-part level, exploiting particle-to-boundary interactions at a 10 cm offset from the mesh. This yields accurate, physically plausible force transmission necessary for naturalistic swimming, while maintaining tractable computational costs relative to high-resolution Eulerian solvers.

Experimental Evaluation

Ablation Over State Representation and Buffering

Comprehensive ablations demonstrate that SWIM's smoothed per-body force/torque (SmoothFT) combined with ProgEvict yields superior learning speed, reward maximization, and generalization. Simplified or coarsened environmental states fail to capture fluid effects meaningfully, while overly raw signals degrade learning through volatility. The structured, low-dimensional SmoothFT state is essential for robust task transfer.

Comparison to Prior Imitation and RL Baselines

Comparisons against DeepMimic, ADD, TD3, and multiple MimicKit-PPO variants highlight SWIM's unique capacity for full goal-reaching and fine-grained control within a restricted sample budget. Baselines are unable to progress beyond initial stabilization, frequently producing physically implausible or drift-prone behaviors in the presence of water dynamics. Figure 3

Figure 3: Trajectory comparison between SWIM and alternative RL/imitation methods in a goal-reaching task.

Generalization: Unseen Goals, Trajectories, and Fluids

SWIM, trained on a single straight goal-reaching task in a small pool, demonstrates significant generalization capacity:

  • Unseen goal positions: Maintains performance for goals up to 2.5×2.5\times the lateral offset and angular deviation observed in training.
  • Curved trajectories: Zero-shot transfer to nontrivial, polylined, and sinusoidal reference paths.
  • Cross-fluid environment: Stable policy behavior is retained in oil-like, high-viscosity, and high-density fluids, as well as in the presence of surface waves and strong currents. Figure 4

    Figure 4: Boundary sweep of goal-reaching performance across lateral target angles and distances; training domain is marked for comparison.

    Figure 5

    Figure 5: Qualitative cross-environment and cross-style generalization: freestyle in oil, water with waves, and butterfly along control trajectories.

    Figure 6

    Figure 6: Policy robustness as a function of inflow speed and direction change in a 3 m pool.

Robustness to Perturbations and Geometry Modifications

Additional tests expose the policy to large impulsive and continuous disturbances, as well as modifications to body shape (e.g., fin attachments, limb removal). Moderate geometry changes such as adding fins improve propulsion, but larger modifications degrade control, reflecting the limits of the current state abstraction's generality. Figure 7

Figure 7: Swimming speed increase realized by adding 10 cm fins to the feet in freestyle.

Theoretical and Practical Implications

SWIM demonstrates, for the first time, that RL-based character animation in full rigid-fluid coupling is feasible and highly data-efficient, requiring only a single demonstration. The results indicate progress toward generative, physics-constrained policies capable of robust motor control in highly nonstationary, underactuated environments. The approach is broadly extensible—beyond swimming—to other domains where fluid-structure interaction and generalization are required, for example, aquatic robotics, biomechanical hypothesis testing, and adaptive animation in virtual environments.

The buffer strategy and state space design are likely to influence general RL practice in high-cost, high-contact simulation domains. However, limitations remain in policy transferability to substantially altered body geometries and extreme fluid conditions, suggesting future work on geometry-invariant representations and curriculum-based RL.

Conclusion

SWIM provides a generalized, physically-based framework for swimming control, advancing the scope of RL-driven animation to the regime of challenging body-fluid interaction. The method's principled state design, efficient learning strategy, and demonstrated generalization establish a foundation for future research in motor skill learning, multi-modal control, and fluid-coupled agent simulation in both computer graphics and robotics.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 2 likes about this paper.