Princeton Intro to Robotics (Fall 2026) | Lecture 19: Data augmentation and DAgger
Overview
The lecture explains how DAgger, or dataset aggregation, addresses distribution shift in behavior cloning by repeatedly collecting policy-visited observations, labeling them with an expert, and retraining; under the stated theory, this changes error growth from quadratic to linear in the time horizon. It compares offline and online expert labeling, shows how synthetic image augmentation can preserve labels while varying irrelevant scene features, and applies both ideas to Princeton’s drone project, which provides 40 demonstrations and tests reliability under lighting and obstacle-color changes.
Key takeaways
- Behavior cloning can fail even with a strong expert because the learned policy’s small errors change future observations, pushing the robot into states absent from the demonstrations.
- DAgger counters distribution shift by labeling observations from the learner’s own rollouts and aggregating those labels with the original expert dataset; the lecture presents its error growth as O(T) rather than behavior cloning’s O(T²).
- Offline DAgger is useful when robot logs can be replayed and failures are tolerable, while online DAgger avoids some uncontrolled failures but demands timely human intervention or dependable uncertainty prediction.
- Image augmentation preserves supervision only when edits leave task-relevant variables, such as the target object’s location and geometry, unchanged; background, lighting, and texture are safer targets.
- For Princeton’s drone project, the practical starting point is a simple CNN with discrete steering actions and cross-entropy, plus targeted augmentation for lighting, color, frame loss, blur, and camera variation.
- The project’s four trials test both nominal navigation and generalization to lighting or obstacle-color changes, and its score averages the three best trials to reward reliable progress.
Chapters
- Imitation learning maps robot observations to expert actions, with experts ranging from human demonstrators to classical planning algorithms.
- Discretized actions with cross-entropy are stable and simple, but become awkward for large, high-dimensional action spaces.
- Regression on continuous actions can average incompatible modes, such as going left or right around an obstacle, and produce a collision-inducing action.
- Flow matching can model continuous, multimodal actions; vision-language-action models fine-tune pretrained VLMs, though retaining broad semantic capabilities remains an open challenge.
- A behavior-cloned navigation policy can make small errors in states not covered by expert demonstrations, then drift farther from the expert data distribution.
- Because each action changes future robot states and observations, errors accumulate over time in sequential tasks.
- A highly competent expert may never demonstrate recovery from mistakes, leaving the learned policy without guidance once it deviates.
- The same distribution-shift pattern can affect coding agents: executed code changes later observations and decisions.
- DAgger begins with ordinary behavior cloning: collect expert demonstrations, train a policy, and execute it.
- During policy rollout, collect the observations the robot actually encounters, including states reached after mistakes.
- Query an expert for the appropriate action at those observations, then append the new observation-action pairs to the existing dataset.
- Retrain on the aggregated data and repeat for several rounds; the expert can be a person or an algorithm such as a motion planner.
- In a drone simulation example, a human remotely steers while a blue indicator marks autonomous control and a red indicator marks expert takeover.
- The expert intervenes when the drone approaches a crash, labels the visited states with corrective actions, and returns control to the policy.
- The lecture describes the theoretical contrast as quadratic, O(T²), error growth for straightforward behavior cloning versus linear, O(T), growth for DAgger.
- The stated convergence checks include comparing policy actions on the same observations or comparing the distributions of visited states and observations.
- Offline DAgger lets a robot collect logs first, then asks a human what action they would have taken for each recorded observation.
- This approach is most practical when logs can be replayed, environments can be reset or reconstructed, and failures have manageable consequences.
- Tabletop manipulation may tolerate offline failures, while deployment-data refinement is more appropriate for systems whose existing error rate is already low.
- Offline labeling can be tedious: a drone-navigation example replayed logs at roughly three times slower than real time for frame-by-frame human action labels.
- A monocular drone-navigation study used DAgger to recover from situations missing from the original data, including steering away from a tree.
- The drone’s RGB observations and steering commands were logged during autonomous flights, then replayed for human labels after the flights.
- A digital twin can be built from an entire trajectory and queried with a planner such as RRT to label actions at earlier states.
- Offline planning uses privileged future observations to reconstruct the scene, information that may be unavailable to the robot at runtime.
- Human-gated DAgger relies on an operator to monitor the robot, intervene before or during errors, and return control after correction.
- In a manipulation example from Yuke Zhu’s group at UT Austin, a teleoperator used a SpaceMouse to correct a robot arm attempting gear placement.
- Robot-gated DAgger can use a world model to request a human takeover when predicted outcomes indicate failure or uncertainty.
- Robot-gated control requires reliable failure prediction or uncertainty quantification, while human gating places substantial attention and context-switching demands on the operator.
- Effective online DAgger depends on a teleoperation interface that keeps the operator contextually aware and able to intervene at the right time.
- Coding agents also face sequential error accumulation: executing one code change alters the observations used to choose the next change.
- Expert demonstrations are costly; manipulation organizations may employ large teleoperation teams to collect them.
- Data augmentation creates synthetic variations of collected examples so policies can train on broader conditions without collecting a new expert label for every variation.
- A Google research example used diffusion- or flow-matching-based image editors to vary real robot observations.
- The demonstration dataset contained 130,000 examples collected over 17 months with 13 robots, illustrating the cost of large-scale teleoperation.
- For a task such as picking up a Coke can, edits can change backgrounds, lighting, or textures while keeping the can’s location and task geometry fixed.
- Changing object location or geometry can invalidate the original action label; semantic-preserving instruction rewrites, such as “pick up” to “lift,” are another augmentation option.
- The final project trains a vision-based policy to guide a drone through PVC-pipe obstacles, building on the course’s RRT lab.
- The course planned to provide 40 demonstrations collected across four drones and three netted spaces, with RGB images, visual-odometry information, and expert actions.
- The project uses human demonstrations, unlike high-speed drone research that can generate expert trajectories in simulation and transfer a trained policy to real hardware.
- Teams were told to expect a roughly 20-minute demonstration slot around Dean’s Date, December 15.
- Each team gets four trials: two nominal flights through five semi-random, non-adversarial obstacles, one with changed lighting, and one with a different obstacle color.
- Scoring measures forward distance through the course, so landing is not required and partial progress earns partial credit.
- The final score averages the three best trials, emphasizing reliable performance across modest distribution shifts rather than one perfect run.
- Policies should tolerate latency that is usually under 30 milliseconds but can reach about 50 milliseconds, plus dropped frames, blur, and image corruption.
- The teaching assistants’ 40 demonstrations reportedly support a working baseline; teams were encouraged to add roughly five to ten targeted demonstrations.
- Segment Anything or related image tools can isolate obstacles for synthetic color changes, while OpenCV can vary brightness and other image properties.
- Useful robustness augmentations include masking image regions, inserting black frames, repeating frames, and small rotations to mimic camera movement.
- A left-right image flip requires flipping the steering action too, making the transformation equivariant rather than simply label-invariant.
- Teams can collect recovery examples by deliberately approaching an obstacle and demonstrating an avoidance maneuver; DAgger was optional rather than required.
- For a reliable baseline, the lecture recommends a standard PyTorch convolutional network and measuring inference speed early.
- CPU inference on a laptop is the default; Google Cloud GPU or TPU inference can support more expensive models but should be tested for latency and reliability.
- Pretrained ImageNet features may provide robustness to color variation compared with using raw RGB inputs alone.
- For steering actions, start with discrete bins and cross-entropy; the lecture cautions against mean-squared-error regression and offers flow matching as a more ambitious alternative if fast enough.
- Google Colab provides GPU access for training, while the team should decide early whether its final policy can run reliably on a laptop or needs remote inference.
- L2 weight regularization may help if the chosen neural network is large, though the project should not require elaborate regularization.
- Teams were encouraged to divide work between augmentation experiments and a small amount of additional data collection, then combine results.
- Protect the drones and cameras, replace visibly damaged propellers, and report less obvious hardware problems through the course discussion channel.
Transcript excerpt
0:10 All right. I think we can get started. So today is going to be the last lecture on imitation learning. So we've had I think four lectures before this on on imitation learning. I'll quickly recap some of the other things that we've covered. So yeah, I guess broadly speaking, imitation learning is learning from expert demonstrations. The expert is often a person that's showing the robot how to do a task. The expert could also be an algorithm. So some classical motion planning algorithm that you've coded, for instance. And in imitation learning, the data that you're provided looks like this. You have observations that your robot received. You have actions that your expert took given these observations. And the goal is to find some policy, typically parameterized using a neural network that maps observations to actions. And we've seen a few different options
1:00 here. So one option is you discretize your action space and you use a cross entropy loss. You parameterize your network or parameterize your policy with a network, discretize the action space, use a cross entropy loss. The benefit with this is that it's actually quite simple. It's very stable in terms of learning. You don't have to mess around too much with learning rates, batch sizes. It just tends to to work pretty well. The downside, of course, is that it's awkward to discretize large high dimensional action spaces. We then briefly talked about this other option, which is you keep your continuous kind of native action space and then you use a regression loss. And we saw some of the the challenges with this, particularly when you have multimodal data. So for the same
1:46 observation, if your expert takes two very different actions, then your regression loss is just going to average out these actions. And usually the
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Introduction to Robotics @ Princeton.