Skip to content

IntelligentSystemsLab/CHARGED

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CHARGED: A City-scale and Harmonized Dataset for Global Electric Vehicle Charging Demand Analysis

Python PyTorch License DOI

A comprehensive framework for electric vehicle charging demand prediction and analysis across multiple global cities. This project provides harmonized datasets, advanced prediction models, and federated learning capabilities for city-scale EV charging behavior analysis and infrastructure planning.

πŸ“š Citations

If this project is helpful to your research, please cite our papers:

Guo, Z., You, L., Zhu, R. et al. A City-scale and Harmonized Dataset for Global Electric Vehicle Charging Demand Analysis. Sci Data 12, 1254 (2025). https://doi.org/10.1038/s41597-025-05584-7

@article{guo2025a,
  author={Guo, Zihan and You, Linlin and Zhu, Rui and Zhang, Yan and Yuen, Chau},
  title={A City-scale and Harmonized Dataset for Global Electric Vehicle Charging Demand Analysis},
  journal={Scientific Data},
  volume={12},
  pages={1254},
  year={2025},
  doi={10.1038/s41597-025-05584-7},
}

Li, H., Qu, H., Tan, X. et al. UrbanEV: An Open Benchmark Dataset for Urban Electric Vehicle Charging Demand Prediction. Sci Data 12, 523 (2025). https://doi.org/10.1038/s41597-025-04874-4

@article{li2025urbanev,
  author={Li, Han and Qu, Haohao and Tan, Xiaojun and You, Linlin and Zhu, Rui and Fan, Wenqi},
  title={UrbanEV: An open benchmark dataset for urban electric vehicle charging demand prediction},
  journal={Scientific Data},
  volume={12},
  pages={523},
  year={2025},
  doi={10.1038/s41597-025-04874-4},
}

You, L., Guo, Z., Yuen, C. et al. A framework reforming personalized Internet of Things by federated meta-learning. Nat Commun 16, 3739 (2025). https://doi.org/10.1038/s41467-025-59217-z

@article{you2025framework,
  author={You, Linlin and Guo, Zihan and Yuen, Chau and Chen, Calvin Yu-Chian and Zhang, Yan and Poor, H Vincent},
  title={A framework reforming personalized Internet of Things by federated meta-learning},
  journal={Nature communications},
  volume={16},
  pages={3739},
  year={2025},
  doi={10.1038/s41467-025-59217-z},
}

🌟 Key Features

  • Multi-City Dataset: Harmonized charging data from 6 major cities worldwide
  • Advanced Prediction Models: Support for state-of-the-art time series forecasting models
  • Federated Learning: Privacy-preserving distributed training across cities
  • Comprehensive Preprocessing: Data cleaning, anomaly detection, and feature engineering
  • Knowledge Transfer: Cross-city model adaptation and transfer learning

πŸ“Š Supported Cities

City Country Code
Amsterdam Netherlands AMS
Johannesburg South Africa JHB
Los Angeles United States LOA
Melbourne Australia MEL
SΓ£o Paulo Brazil SPO
Shenzhen China SZH

πŸ—οΈ Project Structure

CHARGED/
β”œβ”€β”€ api/                          # Core API modules
β”‚   β”œβ”€β”€ dataset/                  # Data loading and processing
β”‚   β”‚   β”œβ”€β”€ common.py            # Single-city dataset handling
β”‚   β”‚   └── distributed.py       # Federated dataset management
β”‚   β”œβ”€β”€ federated/               # Federated learning components
β”‚   β”‚   β”œβ”€β”€ client.py           # Client-side training logic
β”‚   β”‚   └── server.py           # Server-side aggregation
β”‚   β”œβ”€β”€ model/                   # Prediction models
β”‚   β”‚   β”œβ”€β”€ config.py           # Model configuration
β”‚   β”‚   β”œβ”€β”€ layers.py           # Neural network layers
β”‚   β”‚   └── modules.py          # Model architectures
β”‚   β”œβ”€β”€ parsing/                 # Command-line argument parsing
β”‚   β”‚   β”œβ”€β”€ common.py           # Standard prediction arguments
β”‚   β”‚   └── federated.py        # Federated learning arguments
β”‚   β”œβ”€β”€ trainer/                 # Training utilities
β”‚   β”‚   β”œβ”€β”€ common.py           # Standard training loop
β”‚   β”‚   └── federated.py        # Federated training logic
β”‚   └── utils.py                 # Utility functions
β”œβ”€β”€ data/                        # Dataset storage
β”‚   β”œβ”€β”€ [CITY]/                 # City-specific data directories
β”‚   └── [CITY]_remove_zero/     # Preprocessed data (zero clusters removed)
β”œβ”€β”€ example/                     # Usage examples and scripts
β”‚   β”œβ”€β”€ knowledge_transfer.py   # Federated learning example
β”‚   β”œβ”€β”€ univariate_prediction.py # Single-city prediction
β”‚   β”œβ”€β”€ multivariate_prediction.py # Multi-feature prediction
β”‚   └── test_*.py               # Model evaluation scripts
β”œβ”€β”€ script/                      # Data processing and utility scripts
β”‚   β”œβ”€β”€ aggregate/              # Data aggregation tools
β”‚   β”œβ”€β”€ auxiliary/              # Auxiliary data collection
β”‚   β”œβ”€β”€ optimize/               # Data optimization and cleaning
β”‚   └── visualization/          # Data visualization tools
└── README.md                   # This file

πŸš€ Quick Start

Prerequisites

# Install required packages
pip install torch pandas numpy scikit-learn matplotlib seaborn
pip install geopandas osmnx tqdm pyproj shapely
pip install chronos momentfm gluonts uni2ts

Basic Usage

1. Single-City Prediction

# Run univariate prediction for a specific city
python example/univariate_prediction.py \
    --city SZH \
    --model transformer \
    --feature volume \
    --seq_l 24 \
    --pre_len 12 \
    --epoch 100 \
    --is_train True

2. Federated Learning

# Run federated learning across multiple cities
python example/knowledge_transfer.py \
    --city AMS JHB LOA MEL SPO SZH \
    --model transformer \
    --feature volume \
    --pred_type site
    --global_epoch 50 \
    --local_epoch 10

3. Model Evaluation

# Evaluate pretrained models (Chronos, Moirai, MOMENT)
python example/test_chronos_all.py
python example/test_moirai_all.py
python example/test_moment_all.py

πŸ“ˆ Supported Models

Traditional Models

  • Linear Regression (LR): Baseline linear prediction
  • Auto-Regressive (AR): Time series autoregression
  • ARIMA: Integrated autoregressive moving average

Deep Learning Models

  • Transformer: Attention-based sequence modeling
  • LSTM: Long short-term memory networks
  • GRU: Gated recurrent units
  • TCN: Temporal convolutional networks
  • Informer: Efficient transformer variant
  • Autoformer: Auto-correlation transformer
  • FEDformer: Frequency enhanced transformer
  • Pyraformer: Pyramid attention transformer
  • LogTrans: Log-sparse transformer
  • Reformer: Efficient transformer with reversible layers
  • Performer: Linear attention transformer
  • ConvTimeNet: Convolutional time series network
  • ModernTCN: Modern temporal convolutional network

Foundation Models

  • Chronos: Large language model for time series
  • Moirai: Unified time series foundation model
  • MOMENT: Multi-modal time series foundation model

πŸ”§ Data Processing Pipeline

Data Preprocessing

  • Anomaly Detection: Identify and fix outliers using IQR method
  • Zero Sequence Handling: Detect and interpolate continuous zero sequences
  • Site Clustering: Geographic clustering using DBSCAN algorithm
  • Feature Engineering: Temporal and spatial feature extraction

Data Aggregation

  • Temporal Aggregation: Hourly to daily aggregation
  • Spatial Aggregation: Charger-level to sitevel aggregation
  • Cross-Validation: Time-based data splitting for evaluation

πŸ“Š Data Schema

Core Metrics

  • Volume: Number of charging sessions per time period
  • Duration: Average charging session duration

Auxiliary Features

  • Fee: Charging cost information
  • Weather: Temperature, humidity, precipitation, wind speed
  • Temporal: Hour of day, day of week, month
  • Spatial: Site coordinates, cluster centroids, distance matrices
  • POI: Nearby amenities, commercial areas, transportation hubs

🎯 Use Cases

1. Infrastructure Planning

  • Capacity Planning: Predict future charging demand
  • Location Optimization: Identify optimal siteacement
  • Grid Integration: Plan electrical infrastructure upgrades

2. Operational Optimization

  • Load Balancing: Distribute charging load across site
  • Pricing Strategy: Dynamic pricing based on demand patterns
  • Maintenance Scheduling: Predictive maintenance planning

3. Policy Making

  • Incentive Programs: Design effective EV adoption incentives
  • Regulatory Framework: Develop charging infrastructure regulations
  • Urban Planning: Integrate EV charging into city development

πŸ”¬ Research Applications

1. Time Series Forecasting

  • Short-term Prediction: Hourly/daily demand forecasting
  • Long-term Planning: Monthly/quarterly trend analysis
  • Anomaly Detection: Identify unusual charging patterns

2. Federated Learning

  • Privacy Preservation: Train models without sharing raw data
  • Cross-City Learning: Transfer knowledge between cities
  • Scalable Training: Distributed training across multiple locations

3. Transfer Learning

  • Domain Adaptation: Adapt models to new cities
  • Knowledge Transfer: Leverage data from similar cities
  • Cold Start: Handle cities with limited historical data

🀝 Contributing

We welcome contributions!

How to Contribute

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Data Sources: OpenStreetMap, Weather APIs, City Open Data Portals
  • Model Implementations: PyTorch, HuggingFace
  • Research Community: Time series forecasting and federated learning researchers

πŸ“ž Contact


Note: This is a research project. Please ensure compliance with local data privacy regulations when using this dataset.

About

CHARGED is a city-scale and harmonized dataset for global electric vehicle charging demand analysis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published