TL;DR
Selecting the best reinforcement learning policy trained in simulation for real-world deployment typically requires hours of expensive and risky physical robot testing. This paper introduces VSDR (Validate on Sim, Detect on Real), a novel model selection method that ranks policies offline by combining simulation validation with out-of-distribution (OOD) detection on a small, static set of real-world images.
What Problem Does This Paper Address?
To bypass the high cost and safety risks of training reinforcement learning (RL) models directly on physical robots, researchers heavily rely on sim2real transfer—training policies in simulation and deploying them in reality. However, because simulators aren't perfect (the "sim-to-real gap"), a technique called Domain Randomization (DR) is used to train policies across a wide variety of randomized visual and physical environments, hoping the policy learns to generalize.
The catch? DR introduces a massive explosion of hyperparameters (e.g., randomization ranges, frequencies, network architectures), resulting in dozens or hundreds of trained candidate policies. Currently, finding the best policy requires running each one on a real robot for hours. This paper tackles a crucial question: Can we accurately rank and select the best policy without executing any of them on the real robot?
Methods
The authors propose VSDR (Validate on Sim, Detect on Real), a framework that scores and ranks policies using a two-pronged approach:
- Validation in Simulation ($s_i$): Each policy is evaluated on a held-out set of simulated environments with randomized attributes not seen during training. This acts as a standard validation set to measure baseline task performance.
- OOD Detection on Real ($r_i$): The authors collect a small, static dataset of real-world observations (independent of any policy). For each policy, they record its internal neural network feature activations when running in its standard simulation environment and fit a Gaussian Mixture Model (GMM) to this distribution. They then compute the log-likelihood of the real-world observations under this GMM. If a policy is truly robust, its internal representations shouldn't view the real world as "out-of-distribution."
The final VSDR score is computed by min-max normalizing both metrics across all candidate policies and multiplying them: $$\text{VSDR}_i = s_i' \cdot r_i'$$
Multiplying ensures that a winning policy must excel at both simulation performance and real-world distribution alignment.
Datasets
The method was evaluated on a vision-based robotic grasping task (based on the Lift task in Robosuite) using a 7DoF Franka Panda robotic arm and an Intel RealSense D415 camera.
- Policy Training Data: 60 distinct policies were trained across 20 different DR configurations (varying lighting, textures, and randomization frequencies) using Soft Actor-Critic (SAC).
- Real-World Validation Data: To test OOD detection, the authors collected real-world images using three protocols: Expert (704 images from 64 successful trajectories), Sparse-expert (100 sub-sampled images), and Initial (64 images of just the starting setups).
- Ground Truth Evaluation: To establish a ground truth ranking for evaluation, every single one of the 60 policies was tested for 49 grasp attempts on the real robot, totaling over 130 hours of real-world robot execution.
Key Insights and Ideas
- The Power of Synergy: OOD detection alone is highly sensitive to hyperparameter choices (like GMM components), and simulation validation alone fails to predict sim-to-real gaps. However, they are perfectly complementary. Simulation validation filters out policies that simply can't solve the task, while the OOD score filters out policies that overfit to simulation quirks and fail in reality.
- Look at Earlier Layers: When fitting the GMM for OOD detection, extracting features from earlier layers of the policy network (like the image encoder output or the first fully connected layer) yielded significantly better rankings than using layers closer to the action output.
- Trajectories Aren't Necessary: Surprisingly, the OOD component doesn't need full action trajectories. A sparse set of 100 random images or even just 64 static images of the initial scene setup provided enough signal to rank the models effectively.
Key Results
- Better than Baselines: VSDR outperformed state-of-the-art offline evaluation baselines like Off-Policy Classification (OPC) and SoftOPC in 100% of evaluated cases.
- Massive Data Efficiency: While OPC baselines required thousands of full real-world trajectories (including successful and failed runs), VSDR achieved superior ranking accuracy using as few as 64 static real-world images.
- Component Improvement: Combining the scores improved ranking accuracy (measured via Spearman rank correlation) over simulation validation alone in 87% of cases, and over OOD detection alone in 86% of cases.
Limitations and Future Work
The primary limitation of this work is its scope: it focuses exclusively on visual domain randomizations (textures, lighting, camera angles) and image-based inputs. The authors note that it remains an open and interesting challenge to extend the VSDR framework to dynamics-based domain randomizations, where physical properties like object mass, friction, and joint inertia are varied.
Summary updated