r/computervision • u/YvesMG1 • 21h ago
Showcase Built my first self-driving Raspberry Pi RC car (imitation learning + DAgger, runs fully on the Pi)
built a Raspberry Pi 5 RC car that drives itself with a small neural network, trained with imitation learning and DAgger. In the video it drives a track layout it never saw in training: 2 minutes without a takeover.
Setup
- Keyestudio 4WD chassis, Raspberry Pi 5, one Pi camera, PlayStation controller
- MobileNetV3-Small (~1M params) gets the last 3 frames + a route command (left/right/forward) and outputs steering and throttle at 20 Hz
- Runs fully on the Pi's CPU with ONNX Runtime, ~9 ms per frame
Training I first trained it on my own driving, then improved it with DAgger: the car drives while I hold the controller, and moving the stick takes over instantly. Each takeover, plus the frames just before it when the model was already drifting, becomes training data for the next round.
Next: steering as bins on the car, and predicting action chunks instead of one step ahead. What else would you try?
Code + write-up: https://github.com/YvesMG1/keyecar-pi
Full 2-min run: https://www.youtube.com/watch?v=Jv9juVpWOz4