techlist.io

Domain Randomization

8 posts

OpenAI2019-10-143 min readCurated summary

Solving Rubik’s Cube with a robot hand

# Solving Rubik's Cube with a Robot Hand OpenAI trained a human-like robot hand to solve a Rubik's Cube using neural networks trained entirely in simulation. The approach pairs the reinforcement learning code behind OpenAI Five with a new technique called Automatic Domain Randomization (ADR), which generates progressively harder simulated environments without human tuning. The resulting system transfers to the physical world and handles perturbations it never saw during training, showing that reinforcement learning can solve dexterous physical manipulation problems, not just virtual ones. ## Why Dexterous Manipulation Is Hard - Robotics has long required custom robots for each task, while general-purpose hands have struggled because of their many degrees of freedom. - The team's hardware, a robot hand that has existed for about 15 years, was not new. The novelty was in the software approach. - Solving the cube one-handed is difficult even for children, who take several years to develop the necessary dexterity. ## Training in Simulation with Automatic Domain Randomization - The system uses reinforcement learning in simulation, with Kociemba's algorithm choosing the solution steps. The networks learn the required face rotations and cube flips. - Manually randomizing physics parameters such as friction, elasticity, and dynamics is hard. Too little randomization fails to transfer to the real robot, and too much makes learning difficult. - ADR begins with a single nonrandomized environment. When the network exceeds a performance threshold, the randomization range expands automatically, such as the cube's size, mass, finger friction, or surface materials. The cycle repeats, so training never converges and always stays challenging. - In a block-flipping comparison, ADR initially performed worse than manual randomization on the real robot but eventually roughly doubled the baseline's transfer performance without human tuning. ## Robustness and Emergent Meta-Learning - The ADR-trained system handled perturbations it was never trained on, performing most flips and face rotations under all tested conditions, though not at peak performance. - The authors hypothesize that a memory-augmented network trained on unboundedly varied environments develops meta-learning, learning to adapt its behavior at deployment time. - In simulation, averaged over 10,000 trials, perturbations such as resetting memory, changing dynamics, or breaking a joint caused time-to-success spikes that recovered as the network re-adapted. - Non-negative matrix factorization of the network's memory revealed groups with semantic meaning. For example, the dominant memory group could indicate whether the network was about to spin the cube or rotate the top face clockwise. ## Current Limitations - The system solves a maximally difficult 26-rotation scramble 20% of the time, and a 15-rotation scramble 60% of the time. - Most failures occur during the first few rotations and flips, as the network balances solving with adapting to the physical world. - A dropped cube counts as a failure, though the network can resume solving from any state if the cube is returned to the hand. ## Prototypes Used Along the Way - The team built custom cube prototypes with increasing sensing capabilities, ranging from a locked cube with no internal sensors to a cube with built-in sensors (the Giiker cube), to benchmark progress before tackling a regular cube. - The only modification to the regular cube was cutting a small piece of each center sticker to break rotational symmetry, which allows the vision system to determine orientation. The authors see human-level dexterity as a step toward general-purpose robots. ADR offers a way to train physical-world policies without an accurate model of the real environment, and it removes the need for domain-specific tuning when applying the method to new tasks.

OpenAI2018-07-294 min readCurated summary

Learning dexterity

# Learning Dexterity: Training a Robot Hand Entirely in Simulation OpenAI's Dactyl system trains a Shadow Dexterous Hand to reorient physical objects using a reinforcement learning policy learned entirely in simulation, with no fine-tuning on the real robot. The core idea is domain randomization: rather than trying to make the simulator physically accurate, the policy is trained across a wide distribution of randomized physical and visual parameters, so that the real world becomes just one more variation it has already seen. The result is a robot that rediscovers human-like grasps and manipulates blocks and other shapes on hardware, reaching up to 46 to 50 consecutive rotations with vision or motion-tracking feedback. ## The Problem - Dexterous manipulation has lagged behind locomotion in robotics, and the Shadow hand has 24 degrees of freedom compared to 7 for a typical arm. - The robot must handle noisy, delayed sensor readings, occluded fingertips, and unobservable properties such as friction and slippage. - Reinforcement learning works well in simulation but has produced limited results on physical robots. ## Why Not Simulate Realistically or Train on Hardware - Simulators can generate enough data to train complex policies, but manipulation physics (contact, deformable fingertips, tendon stretching, rolling resistance) is hard to model accurately. - Training directly on hardware would take years of real experience for a task like object reorientation. - Domain randomization sidesteps this tradeoff: the simulator prioritizes variety over realism, so policies generalize to the real world. ## Control and Vision Architecture - **Control policy:** An LSTM lets the network infer environment dynamics from its history. It achieved about twice as many rotations as a memoryless policy. Training used Rapid, the scaled PPO implementation from OpenAI Five, on 6,144 CPU cores and 8 GPUs, collecting about 100 years of experience in 50 hours. - **Vision network:** A convolutional network takes three RGB camera views and estimates the object's pose. It was trained only on simulated images rendered in Unity with randomized visual properties. Multiple cameras resolve occlusion and ambiguity. - The two networks are independent and combined at deployment, so the hand can manipulate an object by seeing it. ## Emergent Strategies - Dactyl discovered grasp types from the GRASP taxonomy (tip pinch, palmar pinch, tripod, quadpod, power grasp, and five-finger precision grasp) without being taught them explicitly. - For tip pinches, it favored the thumb and little finger, whereas humans typically use the index or middle finger. The robot's extra little-finger degree of freedom likely explains this choice. ## Results - Randomized policies achieved far more rotations than non-randomized ones. A non-randomized policy managed a median of 0 successes, while the fully randomized policy reached a median of 11.5 with vision and 13 with motion tracking, and a maximum of 46 and 50 respectively. - Vision-based pose estimation performed nearly as well as direct motion-tracking readings. - Without randomization, a policy needed about 3 years of simulated experience to rotate an object. Full randomization required about 100 years, and most of the training time went into robustness to dynamics. ## Surprises and Negative Results - **Tactile sensing was unnecessary.** The policy used only fingertip locations and object pose, ignoring the available touch sensors, because a limited sensor set was easier to model in simulation. - **Randomizations transferred across shapes.** Randomizations designed for a block worked on an octagonal prism without modification. A sphere performed poorly, likely because rolling behavior was not randomized. - **Systems engineering mattered as much as algorithms.** One engineer's faster laptop masked a timing bug that hurt performance for everyone else. - **Faster control did not help.** Reducing the action interval from 80 ms to 40 ms increased training time without improving real-world performance. - **Real data did not help vision.** Simulator-only training matched the accuracy of mixed sim-and-real training, and real tracking data suffered from latency, measurement error, and fragility to configuration changes. ## Conclusion Dactyl demonstrates that scaling domain randomization and recurrent reinforcement learning can solve dexterous manipulation tasks that were previously out of reach for robotics, using a simulation-first pipeline. The authors frame it as one step in a cycle of developing a learning algorithm, scaling it on hard simulated tasks, and transferring the result to the real world.

OpenAI2017-10-182 min readCurated summary

Generalizing from simulation

Robot controllers can now be trained entirely in simulation and deployed on physical robots, where they react to unplanned changes in the environment while solving simple tasks. The simulator doesn't need to match the real world in appearance or dynamics. Instead, relevant aspects such as friction, action delays, and sensor noise are randomized during training, and the policy needs only a small amount of real-world self-calibration. The authors argue that randomizing the simulator will be the most important route to general-purpose robots. ## Dynamics Randomization - Training randomizes 95 properties that govern the environment's dynamics, including each link's mass, the friction and damping of the manipulated object, the height of the table, action latency, and observation noise. - An LSTM-based policy trained this way can push a hockey puck around a table. Feed-forward networks fail at the task, while LSTMs use past observations to infer the world's dynamics and adjust their behavior. ## Vision-to-Action Control with Reinforcement Learning - A robot was trained end-to-end in simulation with reinforcement learning, then deployed on hardware. The resulting system maps visual input directly to actions without special sensors and adapts to visual feedback. - Conventional RL works well only when small changes in action produce incremental reward changes, which suits tasks like walking. Most manipulation tasks lack such rewards. A dense reward for block stacking would have to encode arm-to-block proximity, approach orientation, lift height, and distance to the target. - After months of failed attempts at pick-and-place with conventional RL, the team developed Hindsight Experience Replay (HER). HER learns from a binary success/failure reward by treating a failed trajectory as if it had been the intended goal, so every attempt still produces useful learning signal. - The implementation uses an actor-critic setup with asymmetric information. The critic sees the full simulator state and estimates future rewards, while the actor sees only RGB and depth images, which are available on the real robot. The critic's accurate feedback thus trains an actor that relies only on real-world sensor data. - Domain randomization on visual shapes produces a vision system robust enough for the physical world. ## Computational Costs - Dynamics randomization slows training by about 3x. - Learning from images instead of state is about 5–10x slower.

OpenAI2017-10-172 min readCurated summary

Sim-to-real transfer of robotic control with dynamics randomization

Simulators give robot-learning agents abundant, safe training data, but policies trained in them often exploit simulator-specific quirks and fail on real hardware because of modeling error. This paper bridges that "reality gap" by randomizing the simulator's dynamics during training. The resulting policies adapt to a wide range of dynamics, including ones far from those they were trained on, so they transfer to the real world without any physical training. On a robotic-arm object-pushing task trained only in simulation, the policies performed comparably on a real robot, reliably moving an object to a target from random starting configurations. ## Dynamics Randomization as a Sim-to-Real Method - The core idea is to vary the physical parameters of the simulator, such as mass and friction, across episodes during training rather than fixing them to one estimate. - Exposure to this variety pushes the policy to infer the current dynamics from its experience and adjust its behavior, instead of memorizing one simulator's behavior. - Because the real world's dynamics are one more instance within the randomized range, the policy can generalize to it without any real-robot training. ## Results on Object Pushing - The method was evaluated on a robotic-arm task that requires pushing an object to a desired location. - Policies trained exclusively in simulation maintained similar performance on the physical robot, reliably reaching goals from random initial configurations. ## Design Choices and Robustness - The authors examined how various design decisions affect transfer performance. - The resulting policies remain robust to significant calibration error in the simulator's parameters, which reduces the need for precise system identification before deployment.

OpenAI2017-10-172 min readCurated summary

Asymmetric actor critic for image-based robot learning

This post presents an approach to image-based robot learning that uses the simulator's full state information during training without requiring it at deployment. The actor-critic method trains the critic on full states while the policy receives only rendered RGBD images. The authors report that this asymmetry significantly improves performance on simulated tasks, and that combined with domain randomization it transfers to a real robot, for picking, pushing, and moving a block, without any real-world training data. ## Why Simulation-Based Robot RL - Reinforcement learning works well in many sequential decision-making domains, but training on physical robots is expensive and can be dangerous. - This motivates learning control policies in a physics simulator. - Prior sim-to-real work has transferred policies successfully, but the authors argue it often doesn't fully exploit what the simulator offers. ## Asymmetric Actor-Critic Training - The simulator provides full state observability, which is unavailable on a real robot. - The critic is trained on full states, so it can use this privileged information to evaluate actions. - The actor (policy) takes only partial observations, specifically rendered RGBD images, matching what a real robot would have. - Because only the actor is needed at deployment, the image-based policy runs without access to full state. ## Simulated Experiments - The authors evaluate the method on a range of simulated tasks. - Using asymmetric inputs significantly improves performance over the image-based policy trained without this asymmetry. ## Sim-to-Real Transfer - The method is combined with domain randomization to bridge the gap between simulated and real visual inputs. - Real robot experiments cover picking, pushing, and moving a block. - The transfer succeeds without training on any real-world data. ## Takeaway Privileged simulator information can be used to improve image-based policies when it is available only at training time, a way of getting more from simulation than simply copying the same inputs into the policy.

OpenAI2017-10-162 min readCurated summary

Domain randomization and generative models for robotic grasping

Deep learning-based robotic grasping models are often trained on only hundreds or thousands of object instances, which limits how well they generalize. This work addresses that by applying domain randomization to object synthesis: a network trained on millions of unrealistic, procedurally generated objects can grasp real and unseen objects in both simulation and the real world. The authors pair this data pipeline with an autoregressive grasp planner that handles the multimodal distribution of successful grasps. ### Procedurally Generated Training Data - Millions of unique objects are generated procedurally, and they are deliberately unrealistic. - The approach borrows the idea of domain randomization, varying the training data widely so that the model does not overfit to a narrow set of object appearances and shapes. ### Autoregressive Grasp Planning - Successful grasps for a single object can fall into several distinct modes, so a single best-guess grasp is often insufficient. - The model takes sensor inputs of a scene and outputs a probability distribution over possible grasps rather than a single grasp. - Because the output is a distribution, grasps can be sampled efficiently at test time, or sampling can be avoided entirely. ### Results - In simulation, the model achieves over 90% grasp success on previously unseen realistic objects, even though it was trained only on random objects. - On real-world grasp attempts, it achieves about 80% success, again without any training on realistic objects or real-world data. The main takeaway is that training on large volumes of randomized synthetic objects can transfer to realistic objects in simulation and to physical robots, which suggests that object diversity may matter more than object realism for grasping generalization.

OpenAI2017-05-152 min readCurated summary

Robots that learn

# Training Robots in Simulation to Learn Tasks from a Single Demonstration OpenAI describes a robotics system trained entirely in simulation that can learn a new task after watching one human demonstration, then reproduce that task on a physical robot from a different starting configuration. The approach combines domain randomization for vision with a one-shot imitation learning network, so the robot never needs real-world training images or real demonstrations for its core learning. ## Domain Randomization for Vision - The vision network takes a camera image and outputs a state representation of object positions. - It is trained on hundreds of thousands of simulated images with randomized lighting, textures, backgrounds, and object appearance. - It never sees a real image during training, yet transfers to the physical robot. ## One-Shot Imitation Learning - A human demonstrates the task in VR, and the imitation network infers the task's intent from that single demonstration. - The network then performs the same task from a new starting configuration, so it must generalize rather than replay the exact motions. - Training uses dozens of tasks with thousands of demonstrations each. Each example is a pair of demonstrations of the same task: the network sees the full first demonstration plus one observation from the second, and uses supervised learning to predict the action taken at that observation. - To predict actions well, the network must learn which parts of the first demonstration matter for the task. ## Block Stacking Experiment - The task of stacking color-coded blocks into towers was simple enough to solve with a scripted policy in simulation, which generated the imitation network's training data. - Training pairs started from different initial states but produced towers in the same order, so the network learned to match the demonstrator's block ordering and tower sizes without depending on the towers' relative locations. - Despite never seeing messy human data during training, the network parsed real human demonstrations at test time. - Soft attention over the demonstration trajectory lets the system handle demonstrations of variable length. - Attention over individual block locations lets it imitate longer sequences than it saw in training and build towers with more blocks than any training demonstration. - Injecting modest noise into the scripted policy's outputs was necessary. It forced the demonstrations to include recovery from mistakes, and without it the imitation network usually failed to complete the stacking task.

OpenAI2017-03-312 min readCurated summary

Spam detection in the physical world

# Spam Detection in the Physical World OpenAI reports building what it calls the first Spam-detecting AI trained entirely in simulation and deployed on a physical robot. The approach addresses the costly data collection that bottlenecks robotic perception, using domain randomization to let a model trained only on synthetic images transfer to real-world scenes without retraining. ## The Data Bottleneck in Robotics - Deep learning robotic systems require hundreds of thousands of images to train perception alone, which is expensive to collect. - Simulated data is cheap to generate, but the gap between simulation and reality usually forces teams to retrain models from scratch on physical data. ## Domain Randomization for Sim-to-Real Transfer - Domain randomization is an existing technique that OpenAI applied to cluttered scenes. - The method randomly varies colors, textures, lighting conditions, and camera settings across simulated scenes. - The resulting variability is enough for a neural network to generalize to reality rather than overfitting to the simulator's appearance. - Each generated frame contains Spam, often partially hidden among distractor objects. The Spam model comes from the YCB object dataset. ## The Detection Model - The detector is a neural network based on the VGG16 architecture. - It predicts the precise 3-D location of Spam in an image. - Despite being trained only on simulated scenes, it detects Spam in real images, including when unfamiliar distractor items are arranged in random configurations. ## Future Work - The team plans to extend the system to phishing detection. - They also intend to defend against adversarial Spam, meaning inputs deliberately designed to fool the detector. The core takeaway is that randomizing the visual properties of simulated environments can produce perception models that work on physical hardware with no real-world training data.