This repository contains the code for the paper "Explainable Anomaly Detection for Grid Monitoring using Probabilistic Load Forecasting"
This project uses (probabilistic) load forecasting methods and detection methods for testing anomaly detection in household power consumption data.
The code is separated into different folders containing specific functionalities:
Contains definitions of synthetic anomaly scenarios.
Contains functions for data loading, preprocessing, and feature extraction.
Contains classes for anomaly detection methods (deterministic+probabilistic) and evaluation.
Contains classes for the probabilistic forecasting models, fitting, and evaluation.
This dataset was used: https://www.nature.com/articles/s41597-022-01156-1
The hdf5 files should be placed in the folder "data/" in the root folder.
The workflow is divided into two main steps:
The file main_loadforecast.py loads the training data,
trains the forecasting models,
and saves the models to a pickle file fc_models.pkl.
With the file main_anomalydetection.py,
the previously trained models are loaded,
the defined anomalies are applied to the test data,
and the detection methods are executed.
The results can be evaluated with classification metrics and ROC analysis.
The configuration file config.py contains settings and parameters
for data periods, forecasting methods, defined anomalies, and detection methods.