Training Robot Policies on the Flow Estimator's Mistakes

Robots trained in simulation often fail in the real world because real images look different from rendered ones. One common remedy is to feed the controller a simpler intermediate picture of the scene, such as a depth map or an object mask, that looks similar in both worlds. Those pictures are frozen snapshots, though, and they carry no information about how things are moving. Optical flow is a better fit for dodging or catching. It is a per-pixel map of how far each point moved between two frames, and it throws away texture and color while keeping motion. The catch is that nobody can hand-label flow on real video. Every practical flow estimator is therefore trained on synthetic data and carries its own synthetic-to-real gap. A policy that depends on flow inherits that gap.

This note proposes to stop treating the flow estimator as a clean sensor. In simulation, the policy would be trained on the flow that a frozen, lightweight estimator actually produces from sensor-degraded renders, never on the simulator's perfect ground-truth flow. The motion the robot causes itself would be subtracted using depth and the robot's own odometry, so the policy sees only things that move on their own. The claim is that the quantity to match between simulation and reality is the estimator's error pattern on moving objects, not the pixels and not global flow accuracy. The testbed is reflexive evasion of thrown objects on a quadruped, where the best existing hardware results still rely on an external motion-capture system.

Core Claim

Three kinds of evidence motivate this. First, explicit motion input is necessary for dynamic control. Motion Perception in Reinforcement Learning with Dynamic Objects showed that agents fed stacked frames or recurrent memory score near zero on fast catching tasks, while agents given flow from a small network (TinyFlowNet) succeed. That result was obtained only in simulation, and the authors name real-world lighting, noise and blur as untested.

Second, intermediate representations do close visual gaps. How to Close Sim-Real Gap? Transfer with Segmentation! uses binary masks for grasping, Sim-to-Real via Sim-to-Seg uses segmentation plus depth for off-road driving, and Monocular Event-Based Vision for Obstacle Avoidance with a Quadrotor uses event-derived depth. All three are static and were demonstrated on static or quasi-static scenes.

Third, flow has already crossed the sim-to-real boundary in narrower forms. FabricFlowNet computes flow between a current and a goal depth image for quasi-static cloth folding. EVDodgeNet is the closest prior work. It transfers event-camera flow and moving-object segmentation zero-shot to a dodging quadrotor. Its ego-motion model assumes flat ground, and its downstream controller is a hand-designed PID loop rather than a learned policy.

The proposal differs from all of these in three concrete ways. The policy is learned and closed-loop. It consumes estimated rather than ground-truth motion. Ego-motion is removed using depth and odometry, with no planar assumption. The testable claim is specific: a policy trained on "estimator-in-the-loop" residual flow will transfer with a much smaller success drop than an identical policy trained on ground-truth flow. The other half of the claim is that transfer success will be predicted by flow error measured on the moving object, and poorly predicted by standard benchmark error.

Research Program

The motion front end is a small flow network in the spirit of TinyFlowNet, so that it runs well within a reflex budget. EVDodgeNet reports 12 ms of network compute inside a roughly 60 ms perception-to-response loop, which sets the target. The network would be pretrained on Kubric-style rigid-body video. Kubric showed that this pretraining lowers RAFT's error on real KITTI-15 driving scenes from 7.63 to 4.82 average endpoint error compared with FlyingChairs. Endpoint error is the mean pixel distance between predicted and true flow vectors. After pretraining, the network is frozen.

In the robot simulator, camera frames are rendered with randomized appearance plus injected sensor effects: motion blur, rolling-shutter skew, noise and frame drops, following the sensor-noise layer of the gap described by Rafferty et al.. The frozen estimator then runs on these frames exactly as it would on the robot.

The ego-motion step works as follows. The rigid-scene flow the robot's own movement would produce is predicted from depth and the relative camera pose given by odometry. That prediction is subtracted from the estimated flow, leaving a residual flow that is near zero everywhere except on independently moving objects. The policy input is this residual flow, a depth image and proprioception. The policy is trained with a privileged teacher that sees true obstacle state, distilled into this student, following the teacher-student recipe used in the quadrotor event-camera work.

The task is the quadruped reflexive evasion setting of REBot, which reports 65% Avoidance Success Rate in simulation and 56% on hardware. Its hardware results used OptiTrack motion capture for obstacle position and velocity, and the authors name onboard perception as the open problem. Replacing motion capture with onboard residual flow is the application goal.

The analysis half of the program asks what property of a flow estimator predicts policy transfer. For several estimators of varying quality, we would measure three things: KITTI-15 endpoint error, point-tracking accuracy on TAP-Vid DAVIS, and endpoint error restricted to thrown-object pixels in a small real set labeled through motion capture. We then correlate each with real success rate.

Baselines

The naive reference is an end-to-end policy on raw stacked RGB frames with heavy visual domain randomization. It uses the same simulator, teacher, number of environment steps and hyperparameter search budget as the proposed method. DoorMan shows that this recipe can reach 83% real success on a quasi-static humanoid task, so it is not a straw man.

The strongest existing comparison on this exact platform is REBot's motion-capture-fed policy, at 56% real Avoidance Success Rate. We treat it as an oracle-perception upper reference. Matching it without motion capture would count as success. For context, APREBot reports 78.7% with active LiDAR plus RGB-D targeting, against 66.9% for end-to-end learning and 34.8% for raw LiDAR. Its perception stack and threat set differ from ours, so we would reimplement its end-to-end variant under our setup rather than compare against the reported number directly.

A second strong competitor is a modular state pipeline: an object detector and a Kalman filter produce obstacle position and velocity, which feed the same policy trained on true state. This is the obvious way to replace motion capture.

A third is a static-bottleneck policy that receives a short history of depth images and object masks. From that history it can in principle infer velocity by differencing.

Two ablations isolate the key ingredients. The first is an otherwise identical policy trained on ground-truth sim flow and fed estimated flow at test time; it isolates estimator-in-the-loop training. The second removes the ego-motion subtraction; it isolates that step.

All methods share cameras, compute, latency budget and tuning trials. Beating a baseline means a higher real success rate across a fixed protocol of throws, at matched or lower latency, with confidence intervals that do not overlap.

Why not just…?

Why not just stack RGB frames and randomize appearance? Amiranashvili et al. found that stacked-frame and recurrent agents failed completely on fast dynamic tasks even in simulation, and nothing about randomization supplies the missing velocity signal. DoorMan's success came on a task where velocity perception matters little. That makes it a real threat, and we will run it at full strength. The experiment settles it directly: if randomized RGB matches the flow policy on throws, the proposal's premise fails.

Why not just detect the object and filter its velocity? This is the most serious alternative. For a single sphere on a clean background it may well win. It depends on the detector recognizing the thrown object, while dense residual flow does not care about object category. EVDodgeNet's drop from 86% on known shapes to 76% on unknown shapes hints at the cost of shape priors even in a flow pipeline. We will evaluate on held-out object shapes, multiple simultaneous throws and cluttered backgrounds. If the detector pipeline still matches the flow policy there, we would recommend it and narrow our claim to perception-agnostic cases.

Why not just give the policy a history of depth and masks? Depth differencing does expose motion toward or away from the camera. Motion across the image, and the separation of self-motion from object motion, must be inferred from noisy mask shifts. Evaluating Dynamic Environment Difficulty shows that difficulty in dynamic scenes is captured by velocity-aware measures (0.932 rank correlation for its survivability metric), not by static ones. This baseline tests whether an explicit motion field adds anything beyond what a learned policy can difference out.

Why not just use a stronger zero-shot flow extractor? KL-tracing reaches 44.16 Average Jaccard on TAP-Vid DAVIS, a point-tracking benchmark on real video. It needs sequential point-by-point rollouts of a large video model, which rules out reflex-rate control. We use it only offline, as a high-quality flow source in the estimator-quality correlation study.

Decisive Experiments

In simulation, we first reproduce the Amiranashvili-style catching result and then run the evasion task under a matrix of injected sensor effects. The key readout is the gap between the ground-truth-flow ablation and the estimator-in-the-loop policy as degradation severity grows. The core claim predicts that gap widens with severity.

On hardware, we deploy all baselines on a Go2 quadruped under a fixed throwing protocol that includes held-out shapes, dim lighting and multiple objects. We report Avoidance Success Rate against REBot's 56% motion-capture reference.

The analysis experiment ranks estimators by KITTI-15 endpoint error, TAP-Vid DAVIS accuracy and object-restricted real endpoint error, and asks which ranking matches real success. If object-restricted error predicts transfer and global benchmark error does not, flow estimators for control should be selected and trained differently than they are today.

The proposal is falsified by either of two outcomes. One is that the ground-truth-flow ablation transfers as well as estimator-in-the-loop training. The other is that the detector-plus-filter pipeline matches the flow policy on unknown shapes and clutter.