Loquito is an interpretable, end-to-end autonomous driving model that predicts future waypoints and task actions (steering and stopping) from sequences of multi-camera RGB images. It combines a ResNet-based visual encoder, attention-based feature pooling, and temporal GRUs to learn driving behavior from data.
Important
This repository is open-sourced and maintained by the Institute for Automotive Engineering (ika) at RWTH Aachen University.
End-to-End Automated Driving is one of many research topics within our Vehicle Intelligence & Automated Driving domain.
If you would like to learn more about how we can support your advanced driver assistance and automated driving efforts, feel free to reach out to us!
π§ opensource@ika.rwth-aachen.de
loquito-teaser.mp4
- Attention-based visual encoder using ResNet backbones with learnable spatial pooling.
- Multi-camera input support: Processes synchronized image sequences from 4 viewpoints.
- Waypoint prediction: Outputs relative spatial displacements for future trajectory planning.
- Task prediction: Predicts binary stop signals and continuous steering angles.
- MLflow integration: Tracks all experiments and metrics.
- TorchScript export: Easily export models for deployment.
- Dockerized: Fully containerized environment for training and MLflow server.
A detailed description of Loquitoβs architecture, attention-based explainability, and embedding space is available in the overview document:
β‘οΈ Loquito Overview
loquito/
βββ configs/ # YAML configs for training and model variants
βββ docker/ # Dockerfiles and docker compose setup
βββ eval/ # Evaluation Tools
βββ loquito/ # Core library
β βββ data/ # Dataset indexing & downloading
β βββ lib/ # Utilities and coordinate transforms
β βββ models/ # Loquito model definition
β βββ training/ # Trainer, dataloader, and loss functions
βββ scripts/ # Training and export scripts
git clone --recurse-submodules https://github.com/ika-rwth-aachen/loquito.git
cd loquitoLoquito requires the LOQUITO_DATA_DIR environment variable to be set. This directory will host the dataset, models, and MLflow artifacts.
The path below is just an example. Please adjust it to the desired storage location on your system.
export LOQUITO_DATA_DIR=${HOME}/workspace/dataYou can use your own dataset or download the LMDrive dataset, which was used for training the provided pretrained models. To download the LMDrive dataset, run the following commands:
python3 loquito/data/dataset_downloader.py --num_workers 8docker compose -f docker/docker-compose.yaml up -d loquito-mlflowAccess MLflow UI at http://localhost:5000
βΉοΈ Configure MLflow Connection (Optional)
By default, the training config uses mlflow_tracking_uri: "http://loquito-mlflow:5000". This works out-of-the-box because Docker's internal DNS resolves loquito-mlflow to the correct container IP within the shared network.
If you encounter networking issues, want to connect via the host IP, or use a remote MLflow server, you can change the URI in configs/train.yaml:
# configs/train.yaml
# Default (Docker DNS):
mlflow_tracking_uri: "http://mlflow:5000"
# Alternative (Host IP or Remote Server):
# mlflow_tracking_uri: "http://192.168.1.50:5000"
# mlflow_tracking_uri: "http://my-remote-mlflow.com:5000" Start Training:
Start the docker container
docker compose -f docker/docker-compose.yaml run --name loquito_train_1 loquito-trainThen within the docker container, first verify the MLflow connection:
python scripts/tests/test_mlflow_connection.pyIf the connection is successful, train the model by choosing a model config (e.g., loquito_v1s.yaml) and run:
python scripts/train.py --config configs/models/loquito_v1s.yaml --device 0Training logs and saved checkpoints will appear under data/models/<model_name>/.
python scripts/export.py --model-path results/loquito_v1s/<timestamp>/model_epoch_5.pth| Config File | Backbone | Embed Dim | Image Size |
|---|---|---|---|
loquito_v1s.yaml |
ResNet18 | 256 | 288Γ384 |
loquito_v1s_hd.yaml |
ResNet18 | 256 | 576Γ768 |
loquito_v1m.yaml |
ResNet34 | 256 | 288Γ384 |
loquito_v1m_hd.yaml |
ResNet34 | 256 | 576Γ768 |
loquito_v1l.yaml |
ResNet50 | 1024 | 288Γ384 |
loquito_v1l_hd.yaml |
ResNet50 | 1024 | 576Γ768 |
Each variant balances trade-offs between model size, resolution, and performance.
| Name | Description |
|---|---|
waypoint |
L2 loss on predicted vs. ground-truth waypoints |
perpendicular |
Distance to expert trajectory |
smoothness |
Penalizes sudden changes between predicted points |
stop |
Binary cross-entropy for stop signal |
steer |
L1 loss for steering angle |
embedding |
Cosine similarity to future embeddings |
Weights are configurable in the YAML config.
- Automatically logs hyperparameters and all loss metrics.
- Models saved after every epoch.
- Set tracking URI in
configs/train.yaml.
mlflow.Dockerfile: Minimal image to run an MLflow server.train.Dockerfile: Full CUDA-enabled image to run training.- Use
docker-compose.yamlto bring up both environments.
A pretrained Loquito model is available, trained with the LMDrive dataset and evaluated on the Longest6 benchmark.
Download the trained model checkpoints:
β‘οΈ Loquito Pretrained Weights
These weights can be used for further evaluation, inference, or fine-tuning.
The model used for the evaluation and driving videos is
loquito_v1m_hd(Epoch 3).
Watch Loquito drive autonomously in the Longest6 benchmark:
β‘οΈ YouTube Playlist: Longest6 Driving Results
π¬ Each video shows the model completing a different route from the 36 test routes in the benchmark.
Closed-loop evaluation on Longest6. All infractions are reported per kilometer driven.
| Metric | Value |
|---|---|
| Driving Score (DS) | 29.78 |
| Route Completion (RC) | 56.40β―% |
| Infraction Score (IS) | 61.40β―% |
| Collisions with pedestrians | 0.063 / km |
| Collisions with vehicles | 3.176 / km |
| Collisions with layout | 0.346 / km |
| Red light infractions | 0.126 / km |
| Stop sign infractions | 0.220 / km |
| Off-road infractions | 0.126 / km |
| Route deviations | 0.000 / km |
| Route timeouts | 0.063 / km |
| Agent blocked | 0.692 / km |
π¦ Evaluation Scripts (eval)
The eval/ folder contains a collection of scripts and notebooks for evaluating, analyzing, and visualizing Loquito model results. Note: Most of these scripts are provided for completeness and may not represent production-quality code.
These scripts support both closed-loop (simulated driving) and open-loop (offline dataset) evaluation. Use them to generate plots, videos, and interactive visualizations for reporting and analysis.
eval/
βββ closed_loop
β βββ carla_garage/ # Submodule: Carla simulation & leaderboard tools (with Loquito integration)
β β βββ leaderboard/scripts/
β β β βββ local_evaluation_loquito.sh # Script to run the evaluation
β β βββ team_code_loquito/
β β βββ loquito_agent.py # Custom agent logic wrapping the model
β β βββ navigator.py # Route navigation and target extraction
β βββ visualization
β βββ combine_images.py # Combine images for qualitative review
β βββ create_video.py # Create videos from image sequences
β βββ create_viz.py # Visualize outputs: attention maps, trajectories, embeddings
βββ open_loop
βββ explainability
β βββ eval_xai.py # Explainability analysis (PCA, feature importance, etc.)
β βββ imagesearch.ipynb # Notebook for image-based search and explainability
βββ statistics
β βββ analyse_model_stats.py # Statistical analysis and plotting
β βββ combine_csvs.py # Aggregate CSV result files
β βββ create_statistics.py # Compute evaluation metrics from predictions
βββ visualizer
βββ loquito_visualizing.ipynb # Interactive visualization of model outputs
The closed_loop/carla_garage submodule integrates the carla_garage repository for closed-loop testing in the CARLA simulator. This version includes:
- Loquito Agent (
loquito_agent.py): Custom agent for leaderboard evaluation. - Navigator (
navigator.py): Access to the complete route for advanced planning. - EgoLocation Pseudosensor: Provides precise ego-vehicle localization.
- Enhanced Logging: Logs BEV and game camera views, infractions, and driving scores.
To run a local evaluation, use the provided script local_evaluation_loquito.sh. This setup enables realistic, interactive evaluation of Loquito in simulated urban driving scenarios.
This repository was developed as part of Lars Ippen's master's thesis in cooperation between the Institute for Automotive Engineering (ika) at RWTH Aachen University the Chair of Integrated Digital Systems and Circuit design at RWTH Aachen University.
The work is accomplished within the project autotech.agil (FKZ 01IS22088A). We acknowledge the financial support for the project by the Federal Ministry of Education and Research of Germany (BMBF) π©πͺ.