Skip to content

cbagdel/AutoRUL

 
 

Repository files navigation

This project was a part of a project thesis at Baden-Wuerttemberg Cooperative State University.

Abstract

With increasing digitization, more and more companies try to utilize data to gain insights in their assets. Predicting the remaining useful life of machines is a typical application in this area. Know- ing how much time is left until the machine loses functionality allows down-times to be predicted and avoids redundant maintenance costs by only replacing components that are likely to fail soon. In a recent paper from Karlsruhe Institute of Technology, the authors propose a framework that is supposed to predict the remaining lifespan of machines regardless of the data set. However, the current implementation is limited to specific data sets. To solve this problem, as part of this thesis an automated pipeline which supports all relevant data sets in a way that one can easily pass some data into the framework and receive a remaining useful life prediction was developed. To evaluate the automated pipeline, the results from the original paper is reproduced using the pipeline and additional models are trained and evaluated on other data sets to confirm the generalizability of the framework. This thesis builds the basis for an integration of an Embedded Convolutional Nerual Net- work based approach in SAP Predictive Asset Insights or Asset Performance Management solutions.

Guide to run the application

Install the requirements using: pip install -r requirements.txt

Alternatively use: conda env create -f environment.yml

Usage Example

rul.py contains the automated pipeline. After an object of the python class “RemainingUsefulLife” is created, one can simply pass the training data to the object by calling setTrainData() and train a model using the train_model() method. With train_model(), not only is a model trained, but it is auto- matically saved to a directory as well. This is very useful because model training usually takes a long time and with a saved model, one can reference it whenever needed. With SetTestData(), the test data set can be passed to the object and with the predict() method, a prediction for the remaining useful life of the machines will be printed. Moreover, if loading a pretrained model is needed, one can simply give the path to the location where the model is stored using the method setModel(). With that, the desired model is chosen and one can proceed with passing the test data to the model and predicting the RUL. All of the steps above has been tested on various data sets and works independent of the data set.

Example for C-MAPSS data set:

Training a new model:

rul_cmapss = rul.RemainingUsefulLife(max_life=120,  epochs = 30, data_id = "FD002", rtf_id = "engine_id")
rul_cmapss.setTrainData(train_df=train_FD) # set train data 
rul_cmapss.train_model() # train a model on the previosly configured train data
rul_cmapss.setTestData(test_FD, rul_per_rtf_id= RUL_FD)
rul_cmapss.predict() # predict RUL on previosly configured test dataset

Load a pretrained model and make predictions:

rul_cmapss = rul.RemainingUsefulLife(max_life=120,  epochs = 30, data_id = "FD002", rtf_id = "engine_id")
rul_cmapss.setModel(path_to_model_dir=  Path(f"{cwd}/logs/FD002_120_30_16_5_2022_10_25_14_26_1"), training_data = train_FD) # the pretrained models are located in /logs/ directory. 
rul_cmapss.setTestData(test_FD, rul_per_rtf_id= RUL_FD)
rul_cmapss.predict()

Furthermore, you can plot the calculated target variable (RUL) using plot_rul(self) method. plot_predictions(self) plots the RUL predictions for the truncated datasets according to m and step paramter. For further information see the comments in src/rul.py.

For each dataset tested in this project, there is a jupyternotebook containing some of the results.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.4%
  • Python 1.6%