SocioDiff Codebase
May 12, 2025 ยท View on GitHub
This repository contains the source code for our paper:
SocioDiff: A Socio-aware Diffusion Model for Residential Load Data Generation
(Under review)
SocioDiff is a conditional diffusion model that generates realistic electricity consumption time series conditioned on structured socio-demographic information. It is specifically designed to address data scarcity and representational bias in underrepresented communities, and supports fairness-aware data generation for smart grid research.
๐ Key Features
- Conditional diffusion framework integrating social attributes
- Two-step generation mechanism: global trend + household-specific refinement
- Fairness-aware adversarial training for disadvantaged groups
- Compatible with real-world load datasets (e.g., Irish CER dataset)
๐ Repository Structure
โโโ src/ # Core model components and training pipeline
โ โโโ models/ # Diffusion and denoising networks (4SD)
โ โโโ utils/ # Preprocessing, metrics, and functions
โ โโโ train.py # Training entry point
โโโ configs/ # Training configuration files
โโโ scripts/ # Shell scripts for running experiments
โโโ requirements.txt # Required Python packages
โโโ README.md
๐งช Getting Started
1. Clone the repository
git clone https://github.com/Intelligame/SocialDiff_code.git
cd SocialDiff_code
2. Create environment and install dependencies
conda create -n sociodiff python=3.10
conda activate sociodiff
pip install -r requirements.txt
3. Prepare dataset
- The synthetic dataset used for evaluation can be found at ๐ https://github.com/Intelligame/SocialDiff
- To use other datasets, ensure they are formatted as
.csvfiles with socio-demographic fields and normalized load sequences.
4. Run training
python train.py --config configs/sociodiff.yaml
๐ Evaluation
We provide evaluation metrics including:
- Maximum Mean Discrepancy (MMD)
- Context-FID Score
- Discriminative Score
- Downstream forecasting performance (MSE, MAE, Rยฒ)
Pre-trained models and evaluation scripts will be released upon acceptance.
๐ Release Policy
This repository is currently private. We will release the full codebase publicly upon acceptance of the paper. If you are a reviewer and need access, please contact us directly.
๐ Citation
If you use this framework or dataset, please cite:
@article{SocioDiff2025,
title={SocioDiff: A Socio-aware Diffusion Model for Residential Load Data Generation},
author={Chen, Weilong and others},
journal={IEEE Transactions on Smart Grid},
year={2025},
note={Under review}
}
๐ฌ Contact
For questions or collaborations, feel free to contact: Weilong Chen Email: chenweilong921@gmail.com