Done by Vuk Antovic and Aleksandar Ivanovic. A CNN+LSTM model that predicts steering angles from dashcam footage and detects lane changes in real time. Trained on the Udacity self-driving car dataset.
The model takes a sequence of 5 consecutive frames, extracts spatial features from each using a shared CNN, then feeds those features into an LSTM to capture temporal context. The output is a single steering angle in the range [-1, 1].
Lane changes are detected by watching the rolling mean of predicted steering angles over a sliding window. If the mean exceeds a threshold for long enough, a lane change event is fired.
pip install -r requirements.txtThe dataset is downloaded automatically on first run via kagglehub.
# Train the model
python main.py --mode train
# Run tests on the test set
python main.py --mode predict
# Train then immediately run tests
python main.py --mode allAdditional flags:
--epochs N number of training epochs (default: 10)
--lr FLOAT learning rate (default: 0.001)
--start N first frame index for tests (default: 0)
--count N number of frames to run tests on (default: 200)
You can also run train.py and predict.py directly if you prefer.
config.py all paths and hyperparameters
dataset.py data loading, preprocessing, sequence building
model.py CNN+LSTM architecture
train.py training loop
predict.py tests and visualisation
lane_change.py sliding-window lane change detector
main.py entry point
During tests, each frame is annotated with the predicted steering angle and a direction bar. Lane change events are highlighted with a red border and a text overlay. After test completes, a plot comparing predicted vs real data steering angles is saved as steering_plot.png.
Everything lives in config.py.
