Transfer Learning for Autonomous Driving in Duckietown
The goal of this project was to replace part or all of the duckiebot control pipeline with deep models trained in simulation and transferred to the real town. We replaced the pose estimation module in the control pipeline with a convolutional neural network trained to estimate the pose of the duckiebot directly from images.
Control in Duckietown
Each duckiebot is equipped with a forward facing camera. Images from that camera are used to drive the duckiebot around duckietown. The control pipeline is split into two phases: pose estimation and PID control. The pose of the duckiebot is described with two numbers: the displacement of the duckiebot from the center of the right lane, and the angle between the orientation of the duckiebot relative to the road. A duckiebot is successfully driving in its lane when its pose is near [0,0]. The estimated pose is used as the error signal in a PID controller.
Training a Pose Estimation Network
To train a pose estimation network, we leverage a very basic duckietown simulator. The simulator contains a single patch of straight road in an otherwise empty world. While more sophisticated simulators exist now, this was close to the best we could use as of Fall 2017 and given the time constraints on the project.
Simulator | Duckietown |
---|
Domain Randomization
Images taken from the simulator before and after domain randomization was applied. |
Training Process
We train a 5 layer convolutional neural network (3 convolutional layers followed by 2 fully connected layers) to estimate the pose of a duckiebot from images taken from its camera. First we collect a large number of images from the simulater of the duckiebot in various poses. Then we train on that dataset until convergence, applying different domain randomizations for each epoch of the dataset. Then, to further help the transfer, we collect a small dataset of about 70 images from real duckiebots and label the pose associated with each image by hand. We then fine-tune our network on the real data.
Results
We deploy the trained model in the control pipeline described above on real duckiebots. Videos of its performance are shown below. Interestingly, the model was able to transfer from the straight road in the simulator to a curved road in duckietown. Additionally the real data collected was taken only from the outside lane, but the model was able to transfer to the inside lane as well.
Full Model (outside lane) | Full Model (inside lane) |
---|---|
No Domain Randomization (outside lane) | No Domain Randomization (inside lane) |
---|---|
No Real Data (outside lane) | No Real Data (inside lane) |
---|---|
No Simulated Data (outside lane) | No Simulated Data (inside lane) |
---|---|