This repository contains an end-to-end pipeline for Short-Term Load Forecasting (STLF) using advanced deep learning techniques, combined with an Automated Distribution Management System (ADMS)-based optimization module. It is designed to forecast regional electrical load and optimize load shedding/restoration decisions to maintain grid balance.
Key features include:
-
Advanced Forecasting: Leveraging neural networks (CNN/LSTM/attention architecture) for high-accuracy load prediction at granular (5-minute) resolution.
-
Automated Grid Management: Simulates real-world utility operations by optimizing load shedding and restoration with priorities, cooldown logic, and demand/supply balancing using Integer Linear Programming (ILP).
-
Transparent Workflow: Every step, from raw data preprocessing to ADMS optimization, is modular, clearly documented, and fully reproducible via provided Jupyter notebooks and open dataset structure.
-
Real & Synthetic Data Friendly: Out-of-the-box compatibility with both real and simulated generation/demand traces, supporting rapid prototyping and operational benchmarking.
-
Visualization & Logging: Generates intuitive visualizations and action logs for model diagnostics, operational intervention review, and reporting.
STLF_project/
├── data/
│ ├── SEM.csv # Raw electrical load data
│ ├── demand_5min.csv # 5-minute resampled load data (output)
│ ├── features_5min.csv # Engineered feature dataset
│ ├── demand_forecast.csv # Forecasted load data output
│ ├── generation_forecast.csv # Generation forecast input (optional)
│ └── ... # Other data supporting files
├── models/ # Saved models and scalers
├── plots/ # Visualizations output
├── logs/ # ADMS log outputs
└── stlf_notebook.ipynb # Main Jupyter notebook with full workflow
- Python 3.7 or higher recommended
- Install dependencies via pip:
pip install tensorflow scikit-learn pandas numpy matplotlib seaborn holidays requests pulp joblibAlternatively, run this command in your notebook or terminal.
You can also install all dependencies at once by running:
pip install -r requirements.txt(See section Requirements File below)
- Place your raw load data as
SEM.csvinside thedata/folder. - Optionally provide generation forecasts as
generation_forecast.csvin the same folder to run realistic ADMS simulations. - The pipeline automatically processes and creates the required files (
demand_5min.csv,features_5min.csv, etc.).
- Mount your Google Drive or set your
base_pathaccordingly in the notebook. - Run the notebook
stlf_notebook.ipynbsequentially to:- Load and preprocess data
- Engineer features
- Define, train, and evaluate the forecasting model
- Run ADMS optimization for load shedding/restoration decisions
- Generate output plots and logs
- Inspect results and logs inside the
plots/andlogs/directories.
| Metric | Purpose | Ideal Value / Meaning |
|---|---|---|
| MAE | Mean Absolute Error: average absolute deviation (in MW) | Lower is better; indicates average forecasting error |
| MSE | Mean Squared Error: squares errors to penalize large errors | Lower is better; sensitive to large deviations |
| RMSE | Root MSE: square root of MSE in MW (same units as target) | Lower is better; easily interpretable as MW error scale |
| MAPE | Mean Absolute Percentage Error: percentage error relative to true load | Lower is better; 0.9 is high efficiency |
Replace values above with those from your latest run's output.
- Adjust model architecture, training parameters, and sequence length inside the notebook.
- Customize load profiles, priorities, and the ADMS operational parameters like buffer and cooldown periods to match your system’s requirements.
- Replace synthetic generation forecasts with real/forecasted generation data for realistic operation.
The requirements.txt file included in the repository contains exact package dependencies to reproduce the environment easily.
To install all required packages, run:
pip install -r requirements.txttensorflow>=2.6.0
scikit-learn>=1.0
pandas>=1.3.0
numpy>=1.21
matplotlib>=3.4
seaborn>=0.11
holidays
requests
pulp
joblib
For local Jupyter Notebook environments, you may optionally install:
notebook
ipykernel
Clone the repository, then run:
pip install -r requirements.txtIf using Google Colab, copy-paste the pip install commands into a dedicated notebook cell before running the pipeline.