Visual-based Autonomous Driving Agent using PPO & SAC with Different Environments and Interpretability Analysis
This project implements an End-to-End Reinforcement Learning (RL) pipeline for autonomous driving using the Donkey Simulator(v25.10.06).
- ROI Crop: Remove unnecessary sky/hood
- Resize: Downsample to reduce computation
- Random Lighting: Augment brightness (For Sim-to-Real)
- Grayscale: Reduce dimensionality
- Gaussian Noise: Augment sensor noise
- Canny Edge: Structure extraction
- Cutout: Augment occlusion robustness
- Normalization: Scale to [0, 1]
- Frame Stacking: Temporal information
- Action Space: Continuous control
[Steer, Acceleration](Throttle when Acceleration > 0, Brake when less than 0). - Reward Function:
- Safety Elements
+Speed reward (keeping target velocity).+progress reward (distance).-Collision penalty.-Lane Centering & Out-of-Lane penalty.
- Comfort Elements
-Steering Smoothness penalty(restrict High-frequency oscillation)-Acceleration Smoothness penalty-Lateral Stability(Restrict Lateral Acceleration when high speed)
- Safety Elements
- Triggers upon collision events.
- Generates Attention Maps using VisualBackProp [1], overlaying the last 4 seconds of input frames to visualize what the agent was focusing on (e.g., did it see the obstacle or was it looking at the clouds?).
- clone this repository
git clone https://github.com/Cerealmaster0621/e2e-autonomous-vehicle.git
cd e2e-autonomous-vehicle- clone gym_donkeycar repository
git clone https://github.com/Cerealmaster0621/gym-donkeycar.git
cd gym-donkeycar
pip install -e .
cd ..-
download DonkeySim simulator following the instruction inside the project folder
-
make conda environment and activate, install the requirements
conda create -n e2e-autonomous-vehicle python=3.11 -y
conda activate e2e-autonomous-vehicle
pip install -r requirements.txt- (optional)run the test
python src/test.py --sim {path to donkey_sim.app file}Note: If you get permission errors, do not use
sudounless necessary.
[1] Bojarski, M. et al. (2017). VisualBackProp: efficient visualization of CNNs. arXiv preprint arXiv:1611.05418.