Accurate prediction of electric vehicle charging profiles and durations is critical for adoption and optimising infrastructure. Direct current fast charging presents complex behaviours shaped by many factors. This work introduces a deep learning framework trained on close to one million real-world sessions, capable of predicting charging profiles and durations from minimal input with uncertainty estimates. The model initiates predictions from a single point on the power and state-of-charge profile and incrementally refines them as new observations arrive, enabling real-time updates. The model generalises across vehicle types and charging scenarios. It achieves 90% accuracy in predicting charging duration from a single point, and 95% accuracy with an absolute error under one minute using six points within five minutes. This work shows that using readily available input data at charge time enables accurate prediction of charging behaviour and offers a practical, scalable solution for deployment, energy planning, and infrastructure reliability.
- Tested on: Ubuntu 22.04
- Recommended GPU: NVIDIA A100 or equivalent
conda env create -f ./env/environment.yamlA Jupyter Notebook Demo.ipynb is provided to demonstrate model usage. This notebook:
- Loads a pre-trained charging profile prediction model.
- Randomly selects an unseen charging session.
- Generates an animated GIF visualising how predictions evolve as more input data becomes available.
To run the demo, open and execute the Demo.ipynb notebook.
The framework supports training multiple deep learning architectures for charging profile prediction:
- RNN
- GRU
- LSTM
- VSN-LSTM
- Transformer
- TFT (Temporal Fusion Transformer)
# Train different model architectures on HPC cluster
bash scripts/train_profile_regression_hivemind.sh # TFT with seed 42
bash scripts/train_lstm_hivemind.sh
bash scripts/train_gru_hivemind.sh
bash scripts/train_rnn_hivemind.sh
bash scripts/train_transformer_hivemind.sh
bash scripts/train_vsnlstm_hivemind.sh
bash scripts/train_profile_regression_hivemind_123.sh # TFT with seed 123
bash scripts/train_profile_regression_hivemind_816.sh # TFT with seed 816
# Train with categorical capacity features
bash scripts/train_profile_regression_discretise_capacity_hivemind.shTraining configurations are stored in configs/ directory:
tft_5_lstm_3_attn_256_state.yaml: Standard TFT configurationtft_split_123,tft_split_816: TFT with different train/val splits and random seedslstm.yaml,gru.yaml,rnn.yaml: RNN-based modelstransformer.yaml: Pure transformer architecturevsn_lstm.yaml: Variable State Network with LSTMcvae_revin.yaml: VAE for anomaly detection
# Evaluate specific model architectures
bash scripts/evaluate_tft_123.sh # TFT model (seed 123)
bash scripts/evaluate_tft_816.sh # TFT model (seed 816)
bash scripts/evaluate_lstm.sh # LSTM model
bash scripts/evaluate_gru.sh # GRU model
bash scripts/evaluate_rnn.sh # RNN model
bash scripts/evaluate_transformer.sh # Transformer model
bash scripts/evaluate_vsnlstm.sh # VSN-LSTM model# Evaluate ensemble of multiple models
bash scripts/evaluate_ensemble_hivemind.sh
# Python script for ensemble evaluation
python scripts/evaluate_ensemble.py# Evaluate models with different feature combinations
bash scripts/evaluate_woc.sh # Without capacity
bash scripts/evaluate_wot.sh # Without temperature
bash scripts/evaluate_woc_wot.sh # Without capacity and temperature# Evaluate best single model
bash scripts/evaluate_best_single.sh
# Evaluate with binned capacity features
bash scripts/evaluate_bin_capacity.sh
# Inference time
bash scripts/evaluate_time.sh
python scripts/evaluate_time.py# Direct evaluation with Python scripts
python scripts/evaluate_profile_regression.py --ckpt_dir <model_checkpoint>
python scripts/evaluate_profile_regression_loss.py --ckpt_dir <model_checkpoint>