This repository is based on our paper with title: "On time series representations for multi-label NILM" [1] and it can be used to replicate the experiments. It defines a framework for multi-label NILM systems and includes the following time series representations: Signal2Vec, BOSS, SFA, WEASEL, DFT, SAX, 1d-SAX, PAA; and an implementation of delay embedding using Taken's theorem. Feel free to reuse, modify and extend this repository.
Multi-nilm is a novel framework for efficient non-intrusive load monitoring systems. It has three inherent properties:
- It utilizes a data representation for sufficient dimensionality reduction.
- It uses lightweight disaggregation models.
- It tackles the disaggregation problem as a multi-label classification problem.
Examples of experiments can be found under the directory experiments. The module experiments.py defines three types of experiments (GenericExperiment, ModelSelectionExperiment and REDDModelSelectionExperiment). You can also create your own experiment by extending the abstract class nilmlab.lab.Experiment.
After defining an experiment it requires only a few lines of code to setup and configure it. All files with names run*.py are specific implementations that can be used as a reference. In order to run any of them it is as simple as:
python -m experiments.run_generic_experiment
The results are saved under the directory results as a csv file containing information about the setup, the source of the data, the parameters, the classification models, the performance and others.
Currently only REDD and UK DALE are supported, which have to be downloaded manually. The popular NILMTK toolkit is used for reading the energy data.
A detailed structure of the project is presented below. The key points are:
-
📂 data_exploration: Contains helpful notebooks e.g. how to define delay embedding parameters.
-
📂 datasources: Includes modules related to data e.g. loading using nilmtk, processing labels and others.
-
📂 experiments: Defines some experiments such as model selection and has examples on how to run the defined experiments.
-
📂 nilmlab: This is the main code which encapsulates all the logic of the proposed framework and implements various time series representations.
-
📂 pretrained_models: Any pretrained models that are used for Signal2Vec [1,2].
-
📂 results: Results of the experiments will be saved in this directory.
-
📂 utils: Various tools that have been developed to support the implementation of the various algorithms.
-
📂 multi-nilm
- 📄 LICENSE
- 📄 README.md
- 📄 createtree.sh
- 📂 data_exploration:
- 📄 __init__.py
- 📂 time_delay_embedding
- 📂 datasources
- 📂 experiments
- 📂 nilmlab
- 📂 pretrained_models
- 📄 requirements.txt
- 📂 results
- 📄 tree.md
- 📂 utils
The code has been developed using python3.6 and the dependencies can be found in requirements.txt.
- numpy~=1.18.1
- scikit-learn~=0.21.3
- pandas~=1.0.1
- loguru~=0.4.1
- nilmtk~=0.4.0
- pyts~=0.10.0 https://github.com/johannfaouzi/pyts
- tslearn~=0.3.0 https://github.com/tslearn-team/tslearn
- scikit-multilearn~=0.2.0 http://scikit.ml/
- psutil~=5.6.7
- matplotlib~=3.2.0
- fuzzywuzzy~=0.17.0
- numba~=0.48.0
- PyWavelets https://pywavelets.readthedocs.io/en/latest/install.html
This project is licensed under the MIT License - see the LICENSE file for details
- Nalmpantis, C., Vrakas, D. On time series representations for multi-label NILM. Neural Comput & Applic (2020). https://doi.org/10.1007/s00521-020-04916-5
- Nalmpantis, C., & Vrakas, D. (2019, May). Signal2Vec: Time Series Embedding Representation. In International Conference on Engineering Applications of Neural Networks (pp. 80-90). Springer, Cham. https://doi.org/10.1007/978-3-030-20257-6_7