Application of digital twins in the management of socio-economic systems

The article describes the use of digital twins in socio-economic processes using the example of predictive asset maintenance management. For this, the architecture of a distributed forecasting information system is proposed that collects data from digital twins and provides them with a pre-trained neural network model to obtain forecasts about the need for predictive maintenance. The article discusses two types of forecasts - about the remaining useful life and the possible failure of an asset in the considered time window. Computational experiments have been carried out, confirming that the proposed neural network model allows, due to the simultaneous training of solving two problems, to obtain more accurate forecasts than models trained to solve one problem.


Introduction
Industry 4.0 seeks to impact performance at three levels: • asset level; • the level of operational processes; • enterprise level.
This article discusses asset digital twins. Asset management can be defined as the optimal management of the physical assets of an organization to maximize profits. Organizations can improve asset performance, reduce capital and operating costs associated with assets, extend asset life, and subsequently improve return on assets. In practice, asset management usually focuses on collecting information about assets: their location, configuration, frequency and nature of service and performance. However, the data collected alone does little to improve asset performance and decision making unless it is analyzed in depth.

Digital twins of industrial assets
The asset digital twin is its virtual image maintained throughout its entire life cycle. The asset digital twin collects detailed engineering and economic data to visualize, simulate, and analyze its functions. It is capable of collecting performance and reliability data in a variety of conditions for wind turbines, mining equipment or aircraft engines. For example, collection and processing of reliability data aims to better understand and prevent equipment failures.
With the proliferation of Internet of Things technologies, assets have been able to exchange data, process it, and to some extent perceive the environment. These properties served as the basis for the development of such a concept as intelligent industrial assets, within which assets are given a certain degree of freedom of action.
This article presents a distributed joint forecasting system for predictive maintenance of industrial assets. In the proposed system, each asset is assigned a digital twin that processes asset data and performs predictive maintenance forecast through interaction with a social platform. The social platform collects data from digital twins and provides data exchange between them, if necessary.

Predictive maintenance
Predictive maintenance usually includes regular maintenance of industrial assets to avoid disruptions. However, in many cases this is done without real need, since the determination of the need for predictive maintenance is done based on hard-coded threshold rules. In this case, a service message is issued immediately if the measurement exceeds the threshold. This can lead, for example, to replace a piece of equipment after 8 months of operation, while it could have successfully operated for at least another 12 months. Machine learning predictive maintenance forecasting uses machine learning techniques to predict when the next failure will occur and, accordingly, carry out maintenance ahead of time.
The benefits of predictive maintenance include avoiding unplanned downtime, reducing planned downtime, increasing productivity, and optimizing the use of maintenance resources [1].
One of the key challenges of predictive maintenance is to predict impending equipment failure with a reasonable forecast horizon so that countermeasures can be taken. There are the following two forecasting problems, which are usually solved independently [2][3][4][5]: • estimation of the remaining useful life (RUL), as a long-term forecasting problem to estimate how much time is left until the end of the useful life of equipment; • binary forecast of asset failure in time windows (FTW), as a short-term forecasting problem to determine whether a failure will occur in the considered time window or not. The RUL task is a regression analysis task and the FTW task is a multi-class classification task for asset failure in time windows.
It is clear that these two tasks are related and that performing them separately is not optimal and can lead to incompatible forecasts for the same equipment. To solve these problems, the authors of the article propose an algorithm based on multi-task learning (MTL) [6][7][8][9] for the regression problem and the multi-class classification problem. The RUL prediction is expected to provide useful information for predicting failures over time windows and vice versa.

Architecture of the system of joint distributed forecasting
The architecture used in this article is a hierarchical architecture with two layers: digital twins and social platform. The asset digital twin standardizes asset data and processes that data and requested data from other assets by its analytics engine. The asset digital twin can also communicate with a social platform that performs a variety of tasks, from collecting and presenting data at the system level to running clustering algorithms to form groups of similar assets. Let's look at the architecture levels in more detail.

Level of the digital twin
The digital twin level is represented by a software component that consists of three software modules: a data module, an analytics module, and a data exchange module.
The data module stores and manages asset data, data generated by the analytics engine, and data received by the data exchange module.
Asset data is 1) a time series of sensor values along with the time at which they were recorded; 2) a set of events associated with equipment failures or various warnings; 3) meta-information of an asset -for example, its identifier or its configuration or setting parameters.
The data generated by the analytics module are the data used as a source for building a forecast and the forecasts themselves for each time window. The forecast history can then be used to evaluate the performance of the forecasting algorithm. The analytics module can also be responsible for classifying asset events.
The forecast of the remaining useful life of the asset and the answer to the questionwhether the asset will fail in the considered time window are performed in the analytics module based on a pre-trained neural network model, which is presented in section 3 of the article.
The data received by the data exchange module is information about events of interest to this digital twin, the value of the measure of similarity between the asset of the twin and other assets, and information that will be used in the forecast algorithm. The data exchange module is responsible for managing the communication between the digital twin and the social platform (higher level of the system architecture). The asset digital twin transfers data that it uses to build predictive maintenance forecasts to a social platform. As such data accumulates, the social platform can train the forecasting model of the neural network taking into account new data for each group of sufficiently homogeneous assets. Next, you can distribute the new pre-trained forecasting neural network models among the assets.

Social platform level
The social platform, as the upper level of the system architecture, is responsible for 1) ensuring and regulating communication between digital twins; 2) the formation of groups of interacting digital twins (assets); 3) training of new models of neural networks designed to perform the forecast of predictive asset maintenance; and 4) the formation of information at the enterprise level, in particular, to measure the accuracy of forecasts obtained by digital twins. Also, the social platform can store and update the technical knowledge base, providing a systematic record of failures, warnings and maintenance performed. This makes it easier to make predictive asset management decisions [10].
The social platform stores information about which assets will interact and exchange data with each other in a matrix, which also indicates scalar distances between assets.

Description and preparation of the dataset for training and evaluating
To train and evaluate the forecasting models proposed in this study, the turbofan (aircraft) engine degradation simulation dataset developed at NASA [11][12] is used. This data set was created from synthetic data collected from thermodynamic simulations. The model is called C-MAPSS (Commercial Modular Aero-Propulsion System Simulation).
The simulator consists of 14 inputs and 58 outputs, of which only 21 are specified in the dataset. The following information is provided for each turbofan engine: • operating time (in flight cycles); • 3 parameters of working conditions (height, engine identifier and throttle angle); • 21 sensor signals (4 temperatures, 4 pressures, 6 speeds and 7 others).
The data schema for training and testing is shown in Table 1: The initial dataset consists of 4 time series: FD001, FD002, FD003 and FD004 ( Table  2). The time series contains sensor data from a number of aircraft engines that operate normally at the start of the recording and eventually fail. Two failure modes are possible: failure of the high pressure compressor and failure of the fan.
In the paper is used the following assumption about modeling data: the asset has a progressive degradation pattern that is reflected in the measurement values coming from the asset sensors. By studying the history of changes in sensor values of an asset over time, a machine learning algorithm can study the relationship between changes in sensor values and failures that have occurred in order to predict future failures. Each model takes three datasets as input: • training data -data on the operation of the aircraft engine to failure; • test data -data on aircraft engine operation without registration of failures; • valid data -information about the ground truth remaining operation cycles for each engine from the test data. Input data consists of "train_FD001.txt", "train_FD002.txt", "train_FD003.txt", "train_FD004.txt", "test_FD001.txt", "test_FD002.txt", "test_FD003.txt", "test_FD004.txt" and "RUL_FD001.txt"," RUL_FD002.txt"," RUL_FD003.txt ", "RUL_FD004.txt" from the original dataset.
The training data ("train_FD001.txt", "train_FD002.txt", "train_FD003.txt", "train_FD004.txt") consists of several multivariate time series with "cycle" as a unit of time along with 21 sensor values for each cycle. Each time series is generated by other equipment (aircraft engine) of the same type. Each engine is assumed to initially start and operate normally with varying degrees of initial degradation and manufacturing variance, and this information is unknown to the user. Its degradation begins at some point during a series of operating cycles. Degradation is progressing and increasing. When a predetermined threshold value of one of the sensors is reached, the engine is considered unsafe for further operation. Thus, the last cycle in each time series can be viewed as the point of failure of the corresponding engine. Taking the training data shown in Table 3 as an example, the engine with id = 1 fails in cycle 149 and the engine with id = 2 fails in cycle 269. The test data ("test_FD001.txt", "test_FD002.txt", "test_FD003.txt", "test_FD004.txt") has the same data schema as the training data. The only difference is that the last time period does not represent a point of failure. Taking the data in Table 4 as an example, an engine with id = 1 runs from cycle 1 to cycle 258. It is not shown how many more cycles this engine can take before failing. The valid data ("RUL_FD001.txt", "RUL_FD002.txt", "RUL_FD003.txt", "RUL_FD004.txt") provides information on the number of remaining engine cycles in the test data. Taking the valid data shown in Table 5 as an example, an engine with id = 1 from the test data can complete 18 more cycles before failure occurs.

51
Data labeling Considering the history of aircraft engine operation and the history of failure events, it is possible to predict when a running engine will fail based on two interrelated machine learning models: the regression model (Reg model) answers the question of how many more cycles a running engine will last before it fails; the multi-class classification model (MCC model) answers the question whether the engine will fail in the time window [1, w] of operating cycles or fail in the time window [w + 1, 2w] of operating cycles, or it will not fail in the considered time windows (w is a configurable parameter, the value of which can be selected depending on the subject area. The consumer of forecasting services must decide how far in advance the warning about the failure should be triggered before the actual event of equipment failure. In the article w = 10).
Using the engine with id = 1 as an example, Table 6 shows how the training data is labeled, where "RUL" and "Class label" are labels for regression and multi-class classification models, respectively. For the case of multi-class regression: if engine failure does not occur in the considered time window, then it is marked as class 0. Labels for test data are generated from valid data following the same procedure as when labeling training data. Selection of data features Another important task in step 1 is the selection and processing of features for training and test data.
Features that are contained or generated from training data can be grouped into two categories: • raw features that are contained in the original dataset. In deciding which raw features should be included in the training data, both a detailed description of the data fields and knowledge of the subject area are helpful. In the set under consideration, all sensor measurements (s1-s21) are included in the training data. Other raw features are also used: operating cycle, parameter 1-3 values. • aggregated features -the values of such features reflect the historical changes of each asset. So, for each of the 21 sensors, two types of aggregated features are created: a1-a21: a moving average of the sensor values for the last w1 cycles; sd1-sd21: standard deviation of sensor values in the most w1 recent cycles (for the parameter w1, the value w1 = 5 was used, but it can be adjusted differently depending on the subject area).
Similar to the training dataset, the time series data in the test dataset helps generate aggregate features.

Multi-task learning model (MTL) architecture
Data first from the training dataset and then from the test dataset X = { 1 , 2 , ..., } are fed to the input to a one-dimensional convolutional (Conv1D) layer to extract short-term regularities of the series. The Conv1D layer contains 32 one-dimensional filters of size 5. This is followed by the ReLU activation layer. After that, the Max Pooling layer is located. The Max Pooling layer allows you to reduce the dimension of the hidden representation of the data space and the amount of computations in the neural network. Then there are two layers of Bi-LSTM, 32 and 16 units each. The feature vector is then passed to the Dense layer, followed by the ReLU activation layer and the Dropout layer (a factor of 0.2 is used for the layer). All of the above layers were common to Reg and MCC models. Finally, the common feature vector is transferred to two independent Dense layers. Behind the first Dense layer is the Softmax activation layer and it gives a classification score. This is how the MTL network outputs the probability values of the classes. Behind the second Dense layer is the ReLU activation layer, which evaluates the regression and displays the time at which the engine failed. All used names of neural network layers are standard in the field of machine learning and can be clarified in the relevant literature [13,14,15].

MTL training
Neural network training consists in simultaneous training of Reg multiple regression problems and MCC multi-class classification problems. Let us choose the loss functions for each of the problems in accordance with their type: for the MСС model, this is the crossentropy function , and for the Reg model, we will use the Huber's loss function (to make training more resistant to outliers in the initial data) [16,17,18,19].
The goal of multi-task training is to minimize losses for both tasks. Therefore, the joint loss function is determined by the weighted average sum of all loss functions for the tasks: where the weighting parameters , are determined by the importance of the problem in total losses. For errors in the main task, additional penalties are imposed. Therefore = 3 . According to the architecture of the multi-task learning model, both tasks share common features and structure of the neural network during iterative learning. They are separated only on the last Dense layer.

Evaluating the MTL model
The following metrics were used to evaluate the quality of the classification model: • overall accuracy and average accuracy; • micro-averaged recall and macro-averaged recall; • micro-averaged precision and macro-averaged precision, • which are defined by equalities (2) - (7).
Average accuracy = ∑ =1 (3) The following metrics are used to evaluate the quality of the regression model: the mean absolute error (MAE), which is determined by equality (8) and is a measure of the proximity between the predicted output and the actual output; root mean square error (RMSE), defined by equality (9); R-squared is the proportion of the variance of the dependent variable explained by the model under consideration and determined by equality (10).
where ̅ = 1 ∑ =1 is the sample mean, ̂ is the predicted value of , N is the amount of data.

Experiment
To test the effectiveness of the multi-task learning model for each forecasting problem, two baseline neural network models were selected to compare the score metrics for the Reg and MCC problems. Base models are single-task models for forecasting and classification. For the problem of multi-class classification, the CNN + Bi-LSTM neural network was chosen as the basic model, and for the regression problem, the Bi-LSTM neural network was used as the basic model. All three models were implemented on the basis of tensorflow machine learning framework, trained and tested on the same datasets. The results are shown in Table  7. Based on the obtained results, we can conclude that the multi-task learning model in forecasting predictive maintenance is superior to single-task models on the considered dataset.

Conclusion
Machine Learning empowers Industry 4.0 with the ability to analyze massive amounts of data in real time and generate timely warnings about problems that may arise. The authors in the paper propose the architecture of a system for joint distributed forecasting of predictive maintenance, which allows evaluating the health and behavior of assets based on the collection and processing of information from their digital twins. Based on the proposed multi-task neural network model, the system can detect dangerous deterioration of assets before they fail. The performed computational experiment showed that the proposed neural network model allows one to simultaneously obtain a forecast of the residual useful life and a forecast of the time window in which the equipment will fail. At the same time, the metrics for evaluating the neural network model showed that while simultaneously obtaining a forecast for two predictive maintenance tasks, the accuracy of the model exceeds the models of basic neural networks trained to predict only one task.