Research Project Group 13: Aurélien Bertrand, Bart van Gool, Abdulmuizz Khalak, Ronja Langrock, Juliette Maes.
Predictive maintenance is a proactive maintenance strategy that seeks to predict when failures are likely to occur in machinery to maintain it before any critical failures take place. Predictive maintenance aims to minimize the costs associated with both the downtime of machinery and undergoing major repair operations. This approach involves continual monitoring of machinery during use so that any deterioration that may lead to faults can be detected ahead of time. To monitor the machinery, various types of sensors are fitted which provide data on how different parts of the machines are operating. This data must then be analyzed to find signs of potential issues and degradation. The data from many of these sensors comes in the form of signals, and analyzing these signals for signs of faults is no trivial task. Although various techniques including machine learning and statistical modeling have already been applied, this project endeavours to discover the utility of Singular Spectrum Decomposition (SSD) within this domain
SSD is a decomposition method that decomposes non-linear and nonstationary signals into narrow-banded frequency components. By applying SSD to both real-world and synthetic datasets our research hopes to discover whether the acquired components can help identify signs of failure and give additional insight into the specific nature of the faults. Resulting decompositions will be studied both visually and through machine learning techniques to identify how and when SSD can be most useful in the predictive maintenance domain.
_tests
: Includes all unit tests to ensure code integrity. After any modification to the code, please run therun_tests.m
file to ensure everything works as intended.app
: Includes the main application developed, you can openSSDApp.mlapp
and enjoy it!data_generation
: Includes both the simple and advanced data generators built throughout this project. There is ademo
folder to showcase how to use the generators.faults_classification
: Includes the different classification models built to classify faults in both the simple and advanced generators.monitoring
: Includes sample files showcasing how to use the code to continuously monitor a signal. More information regarding the run configuration follows. Note: if you are unable to runcontinuous_monitoring.m
, then refer tocontinuous_monitoring_api.m
instead (you also need to startserver.py
, located in the root folder).plotting
: Includes different files to plot raw signals, components, etc.singular_spectrum_decomposition
: Includes code related to SSD decompositions, both the randomized and normal versions.utils
: Includes files that are widely used in the repository.
In order to run the code, several steps need to be undertaken.
In this project, we use an API to create a connection from MATLAB to Python. However, MATLAB only allows the use of Python 3.9 or earlier version.
It is best to create a virtual environment for this project. There are 2 possibilities:
If you have anaconda installed, you can just create a new environment for the project:
- Open a terminal
- Run
conda create -n ssd python=3.9
- Activate it using
conda activate ssd
In any case, you can still create a temporary environment for the project:
- Open a terminal
- Make sure you have Python 3.9 already installed by running
where python3.9
(if not, please install it) - Go to the project repository in your terminal using
cd path_to_project
- Run
path_to_your_python -m venv env
, wherepath_to_your_python
is the one showed on step 2 - Run
source env/bin/activate
In case you run on MacOS and have an Apple-M ship, you need to install torch without NNPACK (otherwise you would not be able to run the code). For that, follow these steps:
- Open a terminal
- Run
git clone --recursive https://github.com/pytorch/pytorch
- Run
cd pytorch
- Run
USE_NNPACK=0 python setup.py install
- Verify the installation: open a Python script and write
import torch; print(torch.__version__)
- Run
cd ..
- Run
rm -rf pytorch
Note: you have now installed pytorch without NNPACK. You now need to comment out the torch==2.2.2
line from the requirements.txt
file in the root folder of the project. You can now proceed to the next step.
As the title suggests, it's all good. You now have your Python environment ready specifically for the project. What is left to do is to installed the necessary packages. For that, you still need to run the following command in your terminal (from the project repository): pip install -r requirements.txt
. Now you're done!
Once your Python is settled up, you still need to link it to MATLAB. Follow these steps to do so:
- Open MATLAB
- Run the following command:
pyenv(Version="path_to_your_python3.9_environment")
; the path would either be the Anaconda one, orpath_to_project/env/bin/python
- Verify by running
pyenv
andpyversion
; it should display the path you provided
Whenever running the code, users may have troubles running the code as it is. We experienced difficulties across our team as everyone did not have the same PYTHONPATH
. To tackle this, please run the following command before running the code: export PYTHONPATH=path_to_project
if you are on MacOS, or set PYTHONPATH=path_to_project
if you are on Windows. Note that you need to write this command everytime you open a new terminal / close and open your IDE.
It should be all good now! Enjoy running the project :D
Should you have any question regarding the code, feel free to contact us at: