Sim-to-Real Brush Manipulation using Behavior Cloning and Reinforcement Learning

Biao Jia, Dinesh ManochaarXiv 2023

Abstract

Developing proficient brush manipulation capabilities in real-world scenarios is a complex and challenging endeavor, with wide-ranging applications in fields such as art, robotics, and digital design. In this study, we introduce an approach designed to bridge the gap between simulated environments and real-world brush manipulation. Our framework leverages behavior cloning and reinforcement learning to train a painting agent, seamlessly integrating it into both virtual and real-world environments. Additionally, we employ a real painting environment featuring a robotic arm and brush, mirroring the MyPaint virtual environment. Our results underscore the agent's effectiveness in acquiring policies for high-dimensional continuous action spaces, facilitating the smooth transfer of brush manipulation techniques from simulation to practical, real-world applications.

1. Introduction

Teaching a robot to paint presents unique challenges compared to rigid tool manipulation. A paintbrush is a deformable instrument whose output is highly sensitive to pressure, angle, and the fluid dynamics of the medium. Traditional robotic painting often relies on manual engineering—hard-coding specific rules for every stroke—which limits the ability to replicate diverse artistic styles. Conversely, training directly in the real world is resource-intensive and poses risks to hardware. This paper presents a framework to train an agent in a virtual environment and successfully transfer those artistic capabilities to a physical robotic setup, effectively bridging the "Sim-to-Real" gap.

2. Methodology

2.1 Hybrid Learning Framework

The proposed system utilizes a hybrid pipeline that decouples high-level stroke planning from low-level execution.

  1. Behavior Cloning (BC) for Initialization: To provide the agent with a foundational understanding of stroke order and direction, particularly for structured tasks like calligraphy, the policy is initialized using BC. This uses human-labeled data from the KanjiVG dataset to establish standard stroke sequences.
  2. Egocentric Reinforcement Learning (RL): The agent is further refined in the MyPaint virtual environment using RL. An egocentric observation strategy is employed, where the visual input is always centered on the brush tip. This approach simplifies the learning process and ensures the agent can generalize across different canvas sizes.

2.2 Action Space and Pressure Estimation

The agent operates within a 6D continuous action space, controlling stroke angle, length, width, and RGB color values. Because the target hardware (an UltraArm) lacks integrated force sensors, the framework employs a vision-based proxy for pressure. By analyzing the relationship between brush deformation and stroke width in simulation, the researchers established a mapping between the virtual "width" parameter and the physical "Z-axis depth" of the robotic arm.

Overview of the robotic painting system, including the physical setup (a), the ink dipping process (b-c), and the resulting floral paintings (d) and calligraphy (e).

3. Experimental Setup and Datasets

The agent was trained and evaluated using three primary datasets:

  • MyPaint: The primary virtual environment for simulating natural media and brush dynamics.
  • KanjiVG: A dataset of over 2,000 characters used to train the BC model for calligraphy.
  • CelebA: A large-scale face attributes dataset used to test the agent's ability to replicate complex, non-symbolic imagery.

4. Results and Discussion

4.1 Quantitative Performance

The study compared three configurations: BC-only, RL-only, and a Combined Scheme. The Combined Scheme achieved a cumulative reward of 98.25, significantly outperforming the BC-only baseline (20.15). While pure RL achieved a similar reward (97.74), the Combined Scheme demonstrated superior stroke logic and adherence to traditional calligraphic rules.

4.2 Qualitative Analysis

The robotic system successfully transferred its learned policies to the real world. As shown in the figures, the agent produced recognizable calligraphy and impressionistic floral paintings. The use of curriculum learning—starting with short horizons and gradually increasing task complexity—was found to be essential for achieving high-quality results and stable convergence.

Detailed view of the calligraphic character '永' (Yong) produced by the robotic system, demonstrating the transfer of stroke logic from simulation to paper.

5. Conclusion and Future Work

This research demonstrates that a combination of Behavior Cloning and Reinforcement Learning can effectively bridge the Sim-to-Real gap for delicate tasks like brush manipulation. By using vision-based pressure estimation, the system achieves high-fidelity results without expensive haptic hardware. Future work will focus on expanding the action space to include brush tilting and rotation, as well as exploring more complex interactions with varied paper textures and paint viscosities.

Summary updated

BibTeX
@misc{jia2023sim,
  author = {Biao Jia and Dinesh Manocha},
  title = {{Sim-to-Real Brush Manipulation using Behavior Cloning and Reinforcement Learning}},
  year = {2023},
  eprint = {2309.08457},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.08457},
}
Figure