Arrange the steps in the order they must occur, from initial teleoperated data collection through final autonomous deployment.
Section 7.4 Chapter 7 Interactive Mastery Suite (Lab 7 Preparation)
Before embarking on the physical or simulated implementation in LAB 7: End-to-End Autonomous Driving, use these interactive exercises to test your mastery of the data pipelines, regression evaluations, and bias mitigation strategies introduced in Chapter 7.
Subsection 7.4.1 Section 7.4 Interactive Exercises
Subsubsection 7.4.1.1 Exercise 7.4.1: ActiveCode Challenge β Complete the End-to-End Data Augmentation Pipeline
In Section 7.3, we learned that horizontal image flipping paired with steering angle inversion (\(\omega_{\text{new}} = -\omega\)) is critical for eliminating left/right dataset bias (e.g., escaping the "Right-Turn Trap").
Task: Complete the
augment_driving_dataset() function below.
-
Iterate through the recorded dataset of
(image_matrix, linear_velocity_v, angular_velocity_w). -
For every sample where the robot is turning right (\(\omega > 0.1\)), generate a synthetic left-turn sample by:
-
Horizontally flipping the 2D image matrix (reversing each row).
-
Keeping linear velocity \(v\) unchanged.
-
Inverting the angular velocity (\(\omega_{\text{new}} = -\omega\)).
-
-
Append both the original and augmented samples to the returned dataset.
Subsubsection 7.4.1.2 Exercise 7.4.2: Parsons Problem β End-to-End Behavioral Cloning Execution Pipeline
Reorder the steps below to form the correct sequence for collecting data, mitigating dataset bias, training an end-to-end regression model, and deploying it on physical or simulated hardware for Lab 7.
Checkpoint 7.4.1.
Subsubsection 7.4.1.3 Exercise 7.4.3: Conceptual Check β Troubleshooting Behavioral Cloning Failures
Scenario Matching Check
Match each robot failure scenario observed during testing to its underlying architectural or dataset root cause.
Checkpoint 7.4.2.
| Observed Failure Behavior | Root Cause |
|---|---|
| 1. "Wall Trapping": The robot drives straight down a hallway fine, but as soon as it drifts slightly off-center toward a wall, it fails to recover and crashes straight into it. | A. Environmental/Lighting Bias: The training dataset was recorded under different illumination conditions than the test arena. |
| 2. "One-Way Bias": When encountering a symmetrical fork in the path, the robot always steers right, even when an obstacle blocks the right path. | B. Lack of Recovery Demonstrations: The human driver only recorded smooth, centered driving data and never demonstrated how to steer away from walls. |
| 3. "Sunlight Hesitation": The robot navigates correctly indoors under fluorescent lighting, but stops randomly or turns wildly when driven near outdoor windows. | C. Imbalanced Turn Distribution: The training set suffered from the "Right-Turn Trap" (e.g., recorded on a clockwise track). |
Answer.
-
1 β B (If a human only recorded perfect centered driving, the robot never learned how to recover from near-wall positions.)
-
2 β C (Always favoring one steering direction indicates an imbalanced training set.)
-
3 β A (Failing under new glare or sunlight conditions stems from environmental/lighting bias.)
Reading Questions 7.4.2 Reading Questions
Check your understanding
1. Exercise 7.4.4: Regression Metrics for End-to-End Systems Conceptual Check.
When evaluating an end-to-end behavioral cloning model in Python before deploying it to physical hardware in Lab 7, why do we evaluate performance using regression metrics like Mean Absolute Error (MAE) rather than classification accuracy (e.g., 95% correct)?
-
End-to-End models output continuous velocity numbers \((v, \omega)\text{,}\) making classification accuracy mathematically undefined without arbitrary threshold bins.
-
Correct! Motor commands like linear velocity \(v\) in m/s and turn rate \(\omega\) in rad/s are continuous variables. Because there are infinite possible numerical velocity values, we measure performance using regression distance metrics like MAE or MSE rather than discrete class accuracy.
-
Regression metrics run faster on microcontrollers than classification metrics.
-
Incorrect. The choice between regression and classification metrics is about the nature of the output (continuous vs. discrete), not computational speed.
-
MAE automatically corrects for physical wheel friction during runtime.
-
Incorrect. MAE is an offline evaluation metric; it measures prediction error and does not adjust anything during runtime.
-
Classification accuracy can only be used on black-and-white images, whereas regression works on RGB images.
-
Incorrect. Both classification and regression models can take RGB images as input; the distinction is in the type of output they predict.
You have attempted of activities on this page.
