Skip to content

Repository files navigation

Python License Code Style DOI

Synthesizing Distribution Grid Congestion Data Using Multivariate Conditional Time Series Generative Adversarial Networks

⚠️ Note: 1st update on 09.07.2025, 2nd update on 13.08.2026

The Multivariate Conditional Time-series Generative Adversarial Networks (MC-TimeGAN) is a generative model designed to synthesize multivariate conditional time series. It extends the TimeGAN framework to generate synthetic time-series data in a conditional manner, focusing on grid congestion multivariate time series for a power distribution grid by modifying labels.

MCTimeGAN Structure

Compatibility

MC-TimeGAN has been tested and works with the following versions of PyTorch:

  • PyTorch version: 2.2.0+cu121 (GPU)
  • PyTorch version: 2.3.1+cpu (CPU)

Usage Command Line

Click to expand/collapse

Run the MC-TimeGAN training and data generation with default arguments by using the main.py script directly from the command line:

  • Example bash script to run main.py with default values
python __main__.py --data "helper/data/raw/feeder_sgens_4w_data.csv"  --labels "helper/data/raw_labels/feeder_sgens_4w_labels_ordinal.csv"  --horizon 96 --hidden_dim 24 --num_layers 3 --epochs 2000 --batch_size 128 --learning_rate 1e-3 --csv_filename "helper/synthetic_data/main_mctimegan_synthetic_sgen_data.csv"
  • or outside the MC-TimeGan folder
python MC-TimeGAN --data "helper/data/raw/feeder_sgens_4w_data.csv"  --labels "helper/dat
a/raw_labels/feeder_sgens_4w_labels_ordinal.csv"  --horizon 96 --hidden_dim 24 --num_layers 3 --epochs 2000 --batch_size
128 --learning_rate 1e-3 --csv_filename "helper/synthetic_data/main_mctimegan_synthetic_sgen_data.csv"

Arguments:

Argument Type Default Value Help
--data str helper\data\raw\feeder_sgens_4w_data.csv, helper\data\raw\feeder_loads_4w_data.csv Path to the data file
--labels str helper\data\raw_labels\feeder_sgens_4w_labels_ordinal.csv, helper\data\raw_labels\feeder_loads_4w_labels_ordinal.csv Path to the labels file
--horizon int 96 Horizon for sequence slicing
--hidden_dim int 24 Hidden dimension size for the model
--num_layers int 3 Number of layers in the model
--epochs int 2000 Number of training epochs
--batch_size int 128 Batch size for training
--learning_rate float 1e-3 Learning rate for training
--csv_filename str mctimegan_synthetic_data.csv Filename for the exported CSV of synthetic data

Replicating Results

Click to expand/collapse

To replicate the results from the paper, follow these steps:

  1. Clone the repository:
    git clone git@github.com:KIT-IAI/MC-TimeGAN.git
  2. Navigate to the cloned directory:
    cd MC-TimeGAN
  3. Run the following command to install the packages:
    pip install -r requirements.txt
  4. To train and generate data using the MC-TimeGAN framework, simply run the Jupyter notebook tutorial:
  5. For label generation on original data, modification of labels, and comparison between original and synthetic data, run:
  6. For the extended evaluation metrics, run:
    chmod +x ./eval_coverage_diversity_scores_jobs.sh
    ./eval_coverage_diversity_scores_jobs.sh all

Repository Structure

MC-TimeGAN/
├── __main__.py
├── helper/
│   ├── data/
│   │   ├── modify_labels/
│   │   ├── raw/
│   │   └── raw_labels/
│   ├── img/
│   ├── models/
│   ├── slurm/
│   ├── synthetic_data/
│   ├── data_processing.py
│   ├── eval_coverage_diversity_scores.py
│   ├── eval_fidelity_scores.py
│   ├── eval_summary_tables.py
│   ├── evaluation_processing.py
│   ├── grid_manager.py
│   ├── label_processing.py
│   ├── mctimegan.py
│   └── metrics.py
├── LICENSE
├── README.md
├── requirements.txt
├── run_mctimegan_label_generation_and_evaluation_tutorial.ipynb
└── run_mctimegan_training_and_data_generation_tutorial.ipynb

License

This code is licensed under the MIT License.

Citation 📝

If you use this framework in your research, please consider citing our paper 📝 and giving the repository a star ⭐:

BibTeX format

@INPROCEEDINGS{Demirel2024,
  author={Demirel, Gökhan and Hauf, Jan and Butt, Hallah and Förderer, Kevin and Schäfer, Benjamin and Hagenmeyer, Veit},
  booktitle={2024 IEEE Sustainable Power and Energy Conference (iSPEC)},
  title={Synthesizing Distribution Grid Congestion Data Using Multivariate Conditional Time Series Generative Adversarial Networks},
  year={2024},
  volume={},
  number={},
  pages={385-390},
  keywords={Deep learning, distribution grid congestion, generative models, multivariate time series, photovoltaic power systems},
  doi={10.1109/iSPEC59716.2024.10892479}}

Contact

For any questions or inquiries, please contact goekhan.demirel@kit.edu.

About

MC-TimeGAN – a multivariate conditional Time-Series GAN framework for synthesizing distribution-grid congestion data.

Resources

Stars

17 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages