Domain Randomization
Domain randomization trains models on simulations with randomized textures, lighting, cameras, and physics so they transfer to the real world.
Domain randomization is a technique for training models in simulation so that they work in the real world. A simulator never matches reality exactly, so domain randomization varies its parameters, including textures, colors, lighting, camera pose, object placement, distractor objects, and physical properties such as mass and friction, so widely during training that the real world looks to the model like one more variation. It is a standard tool for closing the sim-to-real gap in robotics, computer vision models trained on synthetic data, and control policies learned with reinforcement learning.
Josh Tobin and colleagues at OpenAI and UC Berkeley described the technique in a 2017 paper that trained an object detection network to localize objects using only simulated images with non-realistic random textures. With no real images in training, the detector located objects in the real world to within about 1.5 cm, accurate enough for a robot arm to grasp them in clutter.
What Gets Randomized#
Every training sample or episode draws fresh values from ranges that engineers set for each parameter:
- Appearance: Object and background textures and colors, the number, position, and type of lights, and image noise.
- Camera: Position, orientation, and field of view, so the model never depends on one viewpoint.
- Scene content: The number, shape, and position of distractor objects, which teach the model to ignore clutter and partial occlusion.
- Dynamics: Masses, friction, joint damping, motor strength, and control latency, so a learned control policy tolerates the mismatch between simulated and real physics.
Training repeats this sampling for every batch, and real-world results decide whether the ranges need to change:
A model that sees an object under thousands of random textures and lights cannot rely on any single texture or light, so it learns features that survive the change, such as shape and geometry. The cost is a harder learning problem: randomized data usually needs more training and larger models, ranges set too wide waste capacity on conditions that never occur, and ranges set too narrow lead to overfitting to the simulator. Randomization also cannot supply what the simulator cannot model, such as deformable materials or sensor artifacts it does not render.
Variants and Results#
Researchers at NVIDIA applied domain randomization to car detection in 2018 and found that a detector trained on randomized synthetic images and then fine-tuned on real KITTI images outperformed one trained on real data alone. Dynamics randomization carried the idea from images to physics, training robot control policies under randomized masses and friction. Automatic domain randomization starts from narrow ranges and widens each one as the model succeeds, and OpenAI used it in 2019 to train a robot hand that solved a Rubik's Cube. Structured domain randomization keeps the randomness inside realistic context, such as placing cars on roads instead of in the sky.
Domain randomization is now widely used in embodied AI: it trains vision-guided pick-and-place systems, drone navigation, and the perception stacks of autonomous vehicles.
Training Ultralytics YOLO on a randomized synthetic dataset adds image-space randomization on top: by default, each training sample receives a random saturation factor between 0.3 and 1.7 and a random brightness factor between 0.6 and 1.4 from the hsv_s and hsv_v augmentation settings, drawn anew every time an image is loaded.
Domain Randomization vs. Related Terms#
- Data augmentation: Transforms images after they are captured or rendered with flips, crops, and color shifts. Domain randomization changes the scene before rendering, so it can vary 3D lighting, materials, and viewpoint that 2D transforms cannot reach.
- Unsupervised domain adaptation (UDA): Uses unlabeled images from the target domain to align a model's features with that domain. Domain randomization needs no target data during training.
- Synthetic data generation: The broader process of creating artificial training data, in which domain randomization is one strategy for choosing what each generated sample looks like.










