Journal of information and communication convergence engineering 2022; 20(4): 295-302
Published online December 31, 2022
https://doi.org/10.56977/jicce.2022.20.4.295
© Korea Institute of Information and Communication Engineering
Correspondence to : Mintae Hwang (E-mail: professorhwang@gmail.com, Tel: +82-55-213-3832)
Department of Information and Communication Engineering, Changwon National University, Changwon 51140, South Korea
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/3.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
This paper contains the development of a smart power device designed to collect load power data from industrial manufacturing machines, predict future variations in load power data, and detect abnormal data in advance by applying a machine learning-based prediction algorithm. The proposed load power data prediction model is implemented using a Long Short-Term Memory (LSTM) algorithm with high accuracy and relatively low complexity. The Flask and REST API are used to provide prediction results to users in a graphical interface. In addition, we present the results of experiments conducted to evaluate the performance of the proposed approach, which show that our model exhibited the highest accuracy compared with Multilayer Perceptron (MLP), Random Forest (RF), and Support Vector Machine (SVM) models. Moreover, we expect our method's accuracy could be improved by further optimizing the hyperparameter values and training the model for a longer period of time using a larger amount of data.
Keywords Load Power, Smart Power Device, Industrial Manufacturing Machine, LSTM Model, Abnormal Data Detection
Electrical power has become a basic requirement over the last few decades. Hence, instability in power system voltage constitutes a primary concern for power generation utilities, regardless of whether power is being used for household activities, education, office equipment, or production activities in manufacturing. In modern manufacturing, electricity supports efficient and effective production operations in which machines primarily function automatically using sensor technology and applications. Thus, electricity is a critical primary resource for a wide variety of general activities.
However, this naturally involves some unavoidable problems. The use of electrical power to operate various equipment inherently involves some load-balancing issues. Occasional instability in power generation or distribution systems is the main problem that arises owing to variations in load power, which increases excessive current and voltage. This leads to damage to machines and equipment and negatively impacting machine lifetimes and performance as well as production quality and labor productivity [1].
In particular, problems with load power tend to emerge in modern manufacturing environments. Assets and equipment must be appropriately monitored to solve these problems [2]. One key problem is that load power consumption requires multiple parts and simultaneous measurements [3].
Numerous devices have been developed to detect load power data to monitor the condition of machines in cases of sudden instability. Moreover, hardware designed to detect load power consumption has been extensively developed. However, no existing method has adequately resolved this issue.
Information about load power is required to identify power usage characteristics and to analyze and evaluate machine equipment, machine lifetime, manufacturing performance, production quality, and labor productivity in a manufacturing environment. Hence, in this study, we propose a model to predict changes in load power data to mitigate these issues by utilizing information on daily load power data consumption from industrial manufacturing machines. We also designed smart devices to measure and transmit load power data from an industrial machine in a manufacturing facility as a hardware solution.
The remainder of this study is organized as follows. Section II briefly reviews the relevant literature. Section III describes the proposed method to predict load power data. Section IV describes the implementation and results. Finally, Section V presents our conclusions.
Several studies have considered load power data, focusing on topics such as handling load power data due to unstable load power, inaccurate load power data readings, and the common problem of handling load power with big data [4]. Additionally, methods to predict the use of load power data for public interest have recently begun to attract attention [5]. Other studies have considered methods to deal with the predictive problem using the concept of Variational Mode Decomposition and dynamic adjustment Backpropagation (BP) to improve the accuracy of electricity consumption data owing to the redundant information and trend components contained in the original power load data [6]. Although, the authors identified a number of weaknesses, they noted that further study was required to improve accuracy. Other studies have reported on the characteristics of load power consumption data with respect to time, which typically involves several types of problems that are difficult to mitigate. Thus, an accurate prediction model is required to deal with electricity resources, particularly for business owners and the government [7-8].
In this study, we developed a model to predict changes in load power conditions in the manufacturing industry using a Long Short-Term Memory (LSTM) model to monitor the condition of load power data usage in industrial manufacturing machines. The proposed method is designed to monitor the conditions of connected machines with sufficient accuracy, contribute to maintaining machine lifetimes, and reduce maintenance costs, as well as to maximize production performance. Notably, this work is based on previous research related to the design of smart devices and applications for managing the load power of machines in industrial manufacturing facilities [9].
Two smart devices were developed to support this research, which were designed to detect machine load power data in an industrial manufacturing environment. The smart device consists of an Energy Metering Device (EMD) designed to collect load power from the machine and communicate with a Smart Power Device (SPD).
The SPD is designed to collect data from the EMD with additional information such as vibration and humidity. The results are displayed on a small screen attached to the SPD device to be stored in a database. Fig. 1 shows an implementation of the SPD device used to obtain the data. The SPD is intended to be installed with current and voltage metering devices, and can also function as an EMD when applied to some machines.
The load power data measures an electrical load in watts, a unit of power. The load power requires significant equipment to detect electricity at any given moment. In this study, the load power consumption data focused on the periodic usage patterns of industrial manufacturing machines over a given number of days and certain combinations of information that appeared periodically, such as frequency and humidity. Each machine displayed a unique pattern of information during the repetition period.
Fig. 2 illustrates the database design as a relational database structure consisting of three entities, including Device_ info, which contains information about the device, Model_ list, which explains all machine models, and Power_data, which contains information related to the status condition of the electrical machine. In this study, we used the Amazon Web Service (AWS) to host a server with a MariaDB database. In addition, the data shown here were obtained from the SPD.
In technical terms, the fundamental concept of the LSTM architecture is that of the Recurrent Neural Network (RNN). RNN models are considered a special case of neural networks and learn to predict the next step in a sequence based on the previously observed steps. RNN models use sequential observations and learn from earlier stages to forecast or predict future trends.
Data must be maintained during the initial stage while predicting the next sequence. In an RNN, the hidden layer acts as the internal storage to store the information collected during the initial stages of processing sequential data. RNN models are “recurrent” because they perform a similar task for each sequence element while utilizing information captured earlier to predict future values. One key challenge with RNN models is that they retain only a small number of initial steps within the data sequence; thus, they are not suitable for retaining longer sequences. This limitation has motivated the development of other types of recurrent network such as LSTM structures [10].
LSTM models were developed for improved performance in situations in which an RNN model may be unsuitable, such as missing gradients in backpropagation. In contrast, LSTM models can address this problem more effectively. In addition, both LSTM and RNN methods perform well with time-series data [11]. Each LSTM comprises a set of cells or modules in which data stream is captured and stored accordingly. The cells resemble a transport pathway connecting each module to convey past data and gather each module for the present prediction. The different gates in each cell enable data to be disposed, filtered, or added to the following cells. The gates in LSTM cells are divided into three types, including forget gates, memory gates, and output gates. These gates are considered filters and function as part of the neural network. The gates enable the cells to allow data to pass through or discharge the value. However, this disposal is optional.
A proposed predictive model was created using the LSTM algorithm, which uses a sequence of past data to predict electricity consumption. To evaluate the performance of the proposed approach, we conducted an experiment with an example dataset, and the experimental result demonstrates that the proposed method performed well as a solution for time-series data. The architecture of the proposed LSTM network is illustrated in Fig. 3.
To construct this predictive model, we first collected the data, then reformatted the date-time columns, and checked unique data from datasets. Subsequently, we considered the energy distribution and energy with respect to time, and then resampled the data and constructed the model. Then, we tested the data and finally generated the output prediction. During the training process, embedding vectors that represent the characteristics and relationships of the profiles were learned according to the voltages that appear in the sequence.
The LSTM learns to recognize the patterns that appear in the energy sequence, and thus to predict future consumption based on a learned embedding vector. We collected data generated from a load power sequence over several weeks, along with two additional input vectors consisting of the current and the temperature for each day. With three LSTM layers and a SoftMax layer, the network predicts an expected future load profile sequence for the next period.
We began by preparing the training data. The data were measured and collected from the smart devices, and some data were missing owing to system and network connection failures. However, estimating the missing values is beyond the scope of this work; therefore, we did not attempt to do so. The Flask framework and the REST API were used to develop a user in terface to display the prediction results. We adopted Flask because it can be implemented using the Python programming language to facilitate integration with existing predictive models. In addition, Flask is capable of handling issues that occur from the server-side, handling RESTful requests, and securing cookies on the client-side.
Table 1 illustrates the experimental environment and settings implemented to develop a predictive model of load power data consumption in an industrial manufacturing environment based on the architecture of the proposed model, as described in Fig. 3.
Table 1 . Experimental setup
No | Description | Values |
---|---|---|
1 | Environments | Tensorflow 1.8.0 Phyton 3.5 |
2 | Optimizer | Gradient Descent |
3 | Lost function | seq2seq loss |
4 | Dropout | probability: 0.2 |
5 | Batch | Batch size: 32 |
6 | Regularization | L2 regularizer |
7 | Gradient Clipping | O |
8 | Learning Rate | 10-2 |
9 | Softmax | O |
The dataset used to train the model comprised real data from tests performed in an enterprise environment using an SPD installed with current and voltage meters on the machine. After the results were recorded, the current and voltage were sent over a network to be stored in a database.
To train the model, we utilized periodic power patterns of industrial machines for load power data consumption. Some daily consumption patterns repeatedly appeared in the load power data, and several specific combinations of information occurred periodically. Although each machine exhibited unique information patterns and repeated periods, the consumption load data were transformed into a predefined sequence.
Fig. 4 illustrates the output of the load power data received from the SPD to the MariaDB database. These data comprise the results of tests performed by the company in the form of detailed information.
Creating a cleaned master dataset was a crucial step in constructing the proposed model. Specialized cleaning data were used to check unique data from the datasets. The results of data collected directly from the machines in the database cannot be directly used to create machine learning models because these raw data are likely to include many null or zero values, and we observed a similar trend in the data collected in this work. The raw data needs to be initially cleaned by deleting or modifying a number of data columns, including deleting duplicate values and outliers, which is commonly referred to as data normalization. After cleaning the master data, the cleaned data are used for a lower processing time and a more precise projection and to simplify the functionality of the algorithm, improve performance, perform energy distribution, and consider energy with respect to time to predict the result.
An explanation of the detailed range, normal range, and units of each data sample that may appear is provided in Table 2.
Table 2 . Detailed information of load power data
Measurement | Range | Normal Range | Unit |
---|---|---|---|
id | 0~65535 | - | - |
device_id | 0~65535 | - | |
r_voltage | 0~655.35 V | 200V ~ 240 V | 0.01 V |
s_voltage | 0~655.35 V | 200V ~ 240 V | 0.01 V |
t_voltage | 0~65.535 A | 1A ~ 5 A | 0.001 A |
r_current, | 0~65.535 A | 1A ~ 5 A | 0.001 A |
s_current, | 0~65.535 A | 1A ~ 1 A | 0.001 A |
t_current, | 0~65.535 A | 1A ~ 1 A | 0.001 A |
r_active_power | -32.768~32.767 kW | 0.22~1.10 | 0.001 kW |
s_active_power | -32.768~32.767 kW | 0.22~1.10 | 0.001 kW |
t_active_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
r_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
s_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
s_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
r_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
s_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
t_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
r_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
s_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
t_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
frequency | 45.00~65.00 Hz | 58~62 Hz | 0.01 Hz |
temp | -128~127 °C | 10~40 °C | 1 °C |
datetime | - | - | - |
The following section explains the results of the predictive model. The proposed LSTM network generates load power sequence data with five features, including date and time, voltage, current, temperature, and frequency, each day. These five features representatively generate information related to the load power data.
This model implements an average value for the movement of the load power data in the form of a centralized time series measured based on a real dataset for each second. To describe load power consumption in a sequential manner, we adopted an LSTM architecture as an effective and reliable approach for sequential time-series signal decomposition.
In this study, the prediction model applied seventy-five percent (75%) of the pre-processed form parameter dataset as the training dataset. In addition, twenty-five percent (25%) of the total data were used for the test dataset. The results were subsequently compared with the original load power data.
Based on the collected load power data, the model was applied to predict future variations in the load power parameters, while the prediction technology was developed to provide the information in the form of a graph on a web page. The proposed machine-learning-based load power data prediction process is divided into seven steps.
Initialization data are collected by locating initial values for variable data that are implemented in the model as an initial state construction. Raw data collected from SPD and EMD in the previous process were used in this step.
The date and time of the data must be reformatted as required by the software required format (month, year, date, time, and week) to verify the distribution of the number of years or months and date.
In this step, unique data are checked as to whether the data are within an allowed tolerance or include in an abnormal condition. Data considered as indicating an abnormal condition cannot be used for training. Therefore, data cleaning is required to solve this problem. This is also useful to verify the condition of the data distribution in terms of the time required to reproduce the correct prediction result.
Resampling methods use a data sample to improve accuracy and quantify the uncertainty of a population parameter. In this case, the sample comprised cleaned load power data obtained from the manufacturing facility.
This stage presents the process of creating an LSTM model adjusted to the environment described in Table 1 and Fig. 3.
This stage comprises a process used to test the model using a prepared dataset.
In this stage, the prediction results are displayed in the form of a graph representing the actual conditions and the prediction results.
To evaluate the proposed method, we tested MLP, RF, and SVM models on the same dataset with the environment adapted to the proposed model for comparison. The MLP model included two hidden layers. In addition, the number of units, dropout, and activation in each layer was determined carefully. SVM models include three import hyperparameters: kernel type, C, and γ. The kernel type determines how the original data are mapped to a high-dimensional space belonging to the Radial Basis Function, which is a frequently used kernel function in SVM. RF classifiers are ensemble models of several decision trees, where the n_estimators parameter determines the number of decision trees. The maximum features and depth of each decision tree are restricted.
To compare the proposed model with MLP, RF, and SVM more objectively, the parameters of these models were optimized using the respective hyperparameters. We used a negative cross-validation score as an objective function for the SVM model, whereas the same objective function as in the LSTM model was implemented for the MLP.
Fig. 5 illustrates the intermediate results generated through the seven-step prediction process. The results were grouped into states of usage energy and energy distribution, where the results were consistent because the data cleaning had been performed before processing these steps. As previously described, the data cleansing was performed because the estimation of missing values was considered beyond the scope of this the present work.
Fig. 6 illustrates the final result of predicting load power consumption from step seven of the prediction process for the industrial manufacturing machine environment, where the accuracy varied with the number of epoch iterations.
The performance of the proposed model and that of the MLP, RF, and SVM models were evaluated quantitatively in terms of the Mean Absolute Percentage Error (MAPE). MAPE is a comparative indicator that eliminates the impact of size. MAPE is defined by the following equation, where n is the number of observations in the test set, yt is the actual value, and y’t is the predicted value. [12]
Fig. 7 shows that the proposed LSTM model achieved the best performance. The SVM was nearly as accurate as the proposed model. However, its prediction results were slightly lower than those of the proposed model. The MLP models encountered roughly the same limitations as the SVM; nonetheless, MLP performed slightly worse than SVM. Moreover, the prediction of RF fluctuated considerably. The accuracy of these methods can be improved by extending the training time, because accuracy is roughly proportional to the number of iterations, up to a point of diminishing returns.
In this study, we developed a method to obtain information related to changes in load power data and predictions based on an LSTM network in an industrial manufacturing environment. Smart devices including the SPD and EMD were developed and installed in manufacturing machines to detect the load power consumption of each machine. The data obtained from these smart devices were sent to MariaDB for storage.
A sequence of machine load power data, including information such as voltage, current, temperature, and frequency information, was implemented as embedding vectors representing the characteristics and profile relationships of the electrical load. Using the analyzed embedding vector sequence, the LSTM network predicts the obtained data pattern as sequence data. The experimental results demonstrate that the proposed model exhibited the best prediction results with the highest accuracy using the collected dataset compared with MLP, RF, and SVM models. Furthermore, these results are expected to support manufacturing operations and management in monitoring the daily load power consumption of industrial machines in manufacturing facilities to reduce significant equipment damage due to unstable load power issue conditions by considering various appropriate preventative actions. Furthermore, we developed a user interface to display the prediction results using the Flask framework and the REST API.
In future research, other machine learning algorithms must be considered to determine which method may exhibit the best performance in detecting load power data consumption in an industrial manufacturing environment, considering that excluding missing or unique values from the dataset may limit network performance owing to the time intervals between data points in the sequence.
Therefore, the methods must be developed to estimate or deal with missing values, as well as inconsistent time intervals; thus, consistency must be further considered based on time-series data.
This work was supported by Gyeongnam SW Convergence Cluster 2.0 under the contract and the "Leaders in INdustry-university Cooperation +" Project by the Ministry of Education and National Research Foundation of Korea.
received her B.S. degree from the Department of Informatics Engineering, Pasundan University, Bandung, Indonesia in 2007 and M.S. degree from the Department of Informatics Engineering, Langlangbuana University, Bandung Indonesia in 2015. She is currently pursuing the Ph.D. degree from the Department of Information and Communication Engineering at Changwon National University, Changwon, Korea. Her current research interests include IT security, web-based applications, machine learning, and smart manufacturing.
received his B.S., M.S., and Ph.D. degrees from the Department of Computer Engineering, Pusan National University, Pusan, Korea in 1991, 1993, and 1997, respectively. He was a senior research member at ADD (Agency for Defense Development) from 1997 to 2000. He has been with the Department of Electronics Engineering, Changwon National University, Changwon, Korea, since 2004, where he is currently a Professor. His current research interests include communication protocols, Internet of things, machine learning, and smart factories
received his B.S., M.S., and Ph.D. degrees from the Department of Computer Engineering, Pusan National University, Pusan, Korea in 1990, 1992, and 1996, respectively. He was a senior research member of the PEC (Protocol Engineering Center) at ETRI (Electronics and Telecommunications Research Institute) from 1996 to 1998. He has been with the Department of Information and Communication Engineering, Changwon National University, Changwon, Korea, since 1999, where he is currently a Professor. His current research interests include communication protocols, Internet of things, machine learning, web/mobile applications, and smart cities.
Journal of information and communication convergence engineering 2022; 20(4): 295-302
Published online December 31, 2022 https://doi.org/10.56977/jicce.2022.20.4.295
Copyright © Korea Institute of Information and Communication Engineering.
Rita Rijayanti 1, Kyohong Jin
2, and Mintae Hwang1*
, Member, KIICE
1Department of Information and Communication Engineering, Changwon National University, Changwon 51140, South Korea
2Department of Electronic Engineering, Changwon National University, Changwon 51140, South Korea
Correspondence to:Mintae Hwang (E-mail: professorhwang@gmail.com, Tel: +82-55-213-3832)
Department of Information and Communication Engineering, Changwon National University, Changwon 51140, South Korea
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/3.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
This paper contains the development of a smart power device designed to collect load power data from industrial manufacturing machines, predict future variations in load power data, and detect abnormal data in advance by applying a machine learning-based prediction algorithm. The proposed load power data prediction model is implemented using a Long Short-Term Memory (LSTM) algorithm with high accuracy and relatively low complexity. The Flask and REST API are used to provide prediction results to users in a graphical interface. In addition, we present the results of experiments conducted to evaluate the performance of the proposed approach, which show that our model exhibited the highest accuracy compared with Multilayer Perceptron (MLP), Random Forest (RF), and Support Vector Machine (SVM) models. Moreover, we expect our method's accuracy could be improved by further optimizing the hyperparameter values and training the model for a longer period of time using a larger amount of data.
Keywords: Load Power, Smart Power Device, Industrial Manufacturing Machine, LSTM Model, Abnormal Data Detection
Electrical power has become a basic requirement over the last few decades. Hence, instability in power system voltage constitutes a primary concern for power generation utilities, regardless of whether power is being used for household activities, education, office equipment, or production activities in manufacturing. In modern manufacturing, electricity supports efficient and effective production operations in which machines primarily function automatically using sensor technology and applications. Thus, electricity is a critical primary resource for a wide variety of general activities.
However, this naturally involves some unavoidable problems. The use of electrical power to operate various equipment inherently involves some load-balancing issues. Occasional instability in power generation or distribution systems is the main problem that arises owing to variations in load power, which increases excessive current and voltage. This leads to damage to machines and equipment and negatively impacting machine lifetimes and performance as well as production quality and labor productivity [1].
In particular, problems with load power tend to emerge in modern manufacturing environments. Assets and equipment must be appropriately monitored to solve these problems [2]. One key problem is that load power consumption requires multiple parts and simultaneous measurements [3].
Numerous devices have been developed to detect load power data to monitor the condition of machines in cases of sudden instability. Moreover, hardware designed to detect load power consumption has been extensively developed. However, no existing method has adequately resolved this issue.
Information about load power is required to identify power usage characteristics and to analyze and evaluate machine equipment, machine lifetime, manufacturing performance, production quality, and labor productivity in a manufacturing environment. Hence, in this study, we propose a model to predict changes in load power data to mitigate these issues by utilizing information on daily load power data consumption from industrial manufacturing machines. We also designed smart devices to measure and transmit load power data from an industrial machine in a manufacturing facility as a hardware solution.
The remainder of this study is organized as follows. Section II briefly reviews the relevant literature. Section III describes the proposed method to predict load power data. Section IV describes the implementation and results. Finally, Section V presents our conclusions.
Several studies have considered load power data, focusing on topics such as handling load power data due to unstable load power, inaccurate load power data readings, and the common problem of handling load power with big data [4]. Additionally, methods to predict the use of load power data for public interest have recently begun to attract attention [5]. Other studies have considered methods to deal with the predictive problem using the concept of Variational Mode Decomposition and dynamic adjustment Backpropagation (BP) to improve the accuracy of electricity consumption data owing to the redundant information and trend components contained in the original power load data [6]. Although, the authors identified a number of weaknesses, they noted that further study was required to improve accuracy. Other studies have reported on the characteristics of load power consumption data with respect to time, which typically involves several types of problems that are difficult to mitigate. Thus, an accurate prediction model is required to deal with electricity resources, particularly for business owners and the government [7-8].
In this study, we developed a model to predict changes in load power conditions in the manufacturing industry using a Long Short-Term Memory (LSTM) model to monitor the condition of load power data usage in industrial manufacturing machines. The proposed method is designed to monitor the conditions of connected machines with sufficient accuracy, contribute to maintaining machine lifetimes, and reduce maintenance costs, as well as to maximize production performance. Notably, this work is based on previous research related to the design of smart devices and applications for managing the load power of machines in industrial manufacturing facilities [9].
Two smart devices were developed to support this research, which were designed to detect machine load power data in an industrial manufacturing environment. The smart device consists of an Energy Metering Device (EMD) designed to collect load power from the machine and communicate with a Smart Power Device (SPD).
The SPD is designed to collect data from the EMD with additional information such as vibration and humidity. The results are displayed on a small screen attached to the SPD device to be stored in a database. Fig. 1 shows an implementation of the SPD device used to obtain the data. The SPD is intended to be installed with current and voltage metering devices, and can also function as an EMD when applied to some machines.
The load power data measures an electrical load in watts, a unit of power. The load power requires significant equipment to detect electricity at any given moment. In this study, the load power consumption data focused on the periodic usage patterns of industrial manufacturing machines over a given number of days and certain combinations of information that appeared periodically, such as frequency and humidity. Each machine displayed a unique pattern of information during the repetition period.
Fig. 2 illustrates the database design as a relational database structure consisting of three entities, including Device_ info, which contains information about the device, Model_ list, which explains all machine models, and Power_data, which contains information related to the status condition of the electrical machine. In this study, we used the Amazon Web Service (AWS) to host a server with a MariaDB database. In addition, the data shown here were obtained from the SPD.
In technical terms, the fundamental concept of the LSTM architecture is that of the Recurrent Neural Network (RNN). RNN models are considered a special case of neural networks and learn to predict the next step in a sequence based on the previously observed steps. RNN models use sequential observations and learn from earlier stages to forecast or predict future trends.
Data must be maintained during the initial stage while predicting the next sequence. In an RNN, the hidden layer acts as the internal storage to store the information collected during the initial stages of processing sequential data. RNN models are “recurrent” because they perform a similar task for each sequence element while utilizing information captured earlier to predict future values. One key challenge with RNN models is that they retain only a small number of initial steps within the data sequence; thus, they are not suitable for retaining longer sequences. This limitation has motivated the development of other types of recurrent network such as LSTM structures [10].
LSTM models were developed for improved performance in situations in which an RNN model may be unsuitable, such as missing gradients in backpropagation. In contrast, LSTM models can address this problem more effectively. In addition, both LSTM and RNN methods perform well with time-series data [11]. Each LSTM comprises a set of cells or modules in which data stream is captured and stored accordingly. The cells resemble a transport pathway connecting each module to convey past data and gather each module for the present prediction. The different gates in each cell enable data to be disposed, filtered, or added to the following cells. The gates in LSTM cells are divided into three types, including forget gates, memory gates, and output gates. These gates are considered filters and function as part of the neural network. The gates enable the cells to allow data to pass through or discharge the value. However, this disposal is optional.
A proposed predictive model was created using the LSTM algorithm, which uses a sequence of past data to predict electricity consumption. To evaluate the performance of the proposed approach, we conducted an experiment with an example dataset, and the experimental result demonstrates that the proposed method performed well as a solution for time-series data. The architecture of the proposed LSTM network is illustrated in Fig. 3.
To construct this predictive model, we first collected the data, then reformatted the date-time columns, and checked unique data from datasets. Subsequently, we considered the energy distribution and energy with respect to time, and then resampled the data and constructed the model. Then, we tested the data and finally generated the output prediction. During the training process, embedding vectors that represent the characteristics and relationships of the profiles were learned according to the voltages that appear in the sequence.
The LSTM learns to recognize the patterns that appear in the energy sequence, and thus to predict future consumption based on a learned embedding vector. We collected data generated from a load power sequence over several weeks, along with two additional input vectors consisting of the current and the temperature for each day. With three LSTM layers and a SoftMax layer, the network predicts an expected future load profile sequence for the next period.
We began by preparing the training data. The data were measured and collected from the smart devices, and some data were missing owing to system and network connection failures. However, estimating the missing values is beyond the scope of this work; therefore, we did not attempt to do so. The Flask framework and the REST API were used to develop a user in terface to display the prediction results. We adopted Flask because it can be implemented using the Python programming language to facilitate integration with existing predictive models. In addition, Flask is capable of handling issues that occur from the server-side, handling RESTful requests, and securing cookies on the client-side.
Table 1 illustrates the experimental environment and settings implemented to develop a predictive model of load power data consumption in an industrial manufacturing environment based on the architecture of the proposed model, as described in Fig. 3.
Table 1 . Experimental setup.
No | Description | Values |
---|---|---|
1 | Environments | Tensorflow 1.8.0 Phyton 3.5 |
2 | Optimizer | Gradient Descent |
3 | Lost function | seq2seq loss |
4 | Dropout | probability: 0.2 |
5 | Batch | Batch size: 32 |
6 | Regularization | L2 regularizer |
7 | Gradient Clipping | O |
8 | Learning Rate | 10-2 |
9 | Softmax | O |
The dataset used to train the model comprised real data from tests performed in an enterprise environment using an SPD installed with current and voltage meters on the machine. After the results were recorded, the current and voltage were sent over a network to be stored in a database.
To train the model, we utilized periodic power patterns of industrial machines for load power data consumption. Some daily consumption patterns repeatedly appeared in the load power data, and several specific combinations of information occurred periodically. Although each machine exhibited unique information patterns and repeated periods, the consumption load data were transformed into a predefined sequence.
Fig. 4 illustrates the output of the load power data received from the SPD to the MariaDB database. These data comprise the results of tests performed by the company in the form of detailed information.
Creating a cleaned master dataset was a crucial step in constructing the proposed model. Specialized cleaning data were used to check unique data from the datasets. The results of data collected directly from the machines in the database cannot be directly used to create machine learning models because these raw data are likely to include many null or zero values, and we observed a similar trend in the data collected in this work. The raw data needs to be initially cleaned by deleting or modifying a number of data columns, including deleting duplicate values and outliers, which is commonly referred to as data normalization. After cleaning the master data, the cleaned data are used for a lower processing time and a more precise projection and to simplify the functionality of the algorithm, improve performance, perform energy distribution, and consider energy with respect to time to predict the result.
An explanation of the detailed range, normal range, and units of each data sample that may appear is provided in Table 2.
Table 2 . Detailed information of load power data.
Measurement | Range | Normal Range | Unit |
---|---|---|---|
id | 0~65535 | - | - |
device_id | 0~65535 | - | |
r_voltage | 0~655.35 V | 200V ~ 240 V | 0.01 V |
s_voltage | 0~655.35 V | 200V ~ 240 V | 0.01 V |
t_voltage | 0~65.535 A | 1A ~ 5 A | 0.001 A |
r_current, | 0~65.535 A | 1A ~ 5 A | 0.001 A |
s_current, | 0~65.535 A | 1A ~ 1 A | 0.001 A |
t_current, | 0~65.535 A | 1A ~ 1 A | 0.001 A |
r_active_power | -32.768~32.767 kW | 0.22~1.10 | 0.001 kW |
s_active_power | -32.768~32.767 kW | 0.22~1.10 | 0.001 kW |
t_active_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
r_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
s_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
s_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
r_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
s_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
t_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
r_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
s_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
t_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
frequency | 45.00~65.00 Hz | 58~62 Hz | 0.01 Hz |
temp | -128~127 °C | 10~40 °C | 1 °C |
datetime | - | - | - |
The following section explains the results of the predictive model. The proposed LSTM network generates load power sequence data with five features, including date and time, voltage, current, temperature, and frequency, each day. These five features representatively generate information related to the load power data.
This model implements an average value for the movement of the load power data in the form of a centralized time series measured based on a real dataset for each second. To describe load power consumption in a sequential manner, we adopted an LSTM architecture as an effective and reliable approach for sequential time-series signal decomposition.
In this study, the prediction model applied seventy-five percent (75%) of the pre-processed form parameter dataset as the training dataset. In addition, twenty-five percent (25%) of the total data were used for the test dataset. The results were subsequently compared with the original load power data.
Based on the collected load power data, the model was applied to predict future variations in the load power parameters, while the prediction technology was developed to provide the information in the form of a graph on a web page. The proposed machine-learning-based load power data prediction process is divided into seven steps.
Initialization data are collected by locating initial values for variable data that are implemented in the model as an initial state construction. Raw data collected from SPD and EMD in the previous process were used in this step.
The date and time of the data must be reformatted as required by the software required format (month, year, date, time, and week) to verify the distribution of the number of years or months and date.
In this step, unique data are checked as to whether the data are within an allowed tolerance or include in an abnormal condition. Data considered as indicating an abnormal condition cannot be used for training. Therefore, data cleaning is required to solve this problem. This is also useful to verify the condition of the data distribution in terms of the time required to reproduce the correct prediction result.
Resampling methods use a data sample to improve accuracy and quantify the uncertainty of a population parameter. In this case, the sample comprised cleaned load power data obtained from the manufacturing facility.
This stage presents the process of creating an LSTM model adjusted to the environment described in Table 1 and Fig. 3.
This stage comprises a process used to test the model using a prepared dataset.
In this stage, the prediction results are displayed in the form of a graph representing the actual conditions and the prediction results.
To evaluate the proposed method, we tested MLP, RF, and SVM models on the same dataset with the environment adapted to the proposed model for comparison. The MLP model included two hidden layers. In addition, the number of units, dropout, and activation in each layer was determined carefully. SVM models include three import hyperparameters: kernel type, C, and γ. The kernel type determines how the original data are mapped to a high-dimensional space belonging to the Radial Basis Function, which is a frequently used kernel function in SVM. RF classifiers are ensemble models of several decision trees, where the n_estimators parameter determines the number of decision trees. The maximum features and depth of each decision tree are restricted.
To compare the proposed model with MLP, RF, and SVM more objectively, the parameters of these models were optimized using the respective hyperparameters. We used a negative cross-validation score as an objective function for the SVM model, whereas the same objective function as in the LSTM model was implemented for the MLP.
Fig. 5 illustrates the intermediate results generated through the seven-step prediction process. The results were grouped into states of usage energy and energy distribution, where the results were consistent because the data cleaning had been performed before processing these steps. As previously described, the data cleansing was performed because the estimation of missing values was considered beyond the scope of this the present work.
Fig. 6 illustrates the final result of predicting load power consumption from step seven of the prediction process for the industrial manufacturing machine environment, where the accuracy varied with the number of epoch iterations.
The performance of the proposed model and that of the MLP, RF, and SVM models were evaluated quantitatively in terms of the Mean Absolute Percentage Error (MAPE). MAPE is a comparative indicator that eliminates the impact of size. MAPE is defined by the following equation, where n is the number of observations in the test set, yt is the actual value, and y’t is the predicted value. [12]
Fig. 7 shows that the proposed LSTM model achieved the best performance. The SVM was nearly as accurate as the proposed model. However, its prediction results were slightly lower than those of the proposed model. The MLP models encountered roughly the same limitations as the SVM; nonetheless, MLP performed slightly worse than SVM. Moreover, the prediction of RF fluctuated considerably. The accuracy of these methods can be improved by extending the training time, because accuracy is roughly proportional to the number of iterations, up to a point of diminishing returns.
In this study, we developed a method to obtain information related to changes in load power data and predictions based on an LSTM network in an industrial manufacturing environment. Smart devices including the SPD and EMD were developed and installed in manufacturing machines to detect the load power consumption of each machine. The data obtained from these smart devices were sent to MariaDB for storage.
A sequence of machine load power data, including information such as voltage, current, temperature, and frequency information, was implemented as embedding vectors representing the characteristics and profile relationships of the electrical load. Using the analyzed embedding vector sequence, the LSTM network predicts the obtained data pattern as sequence data. The experimental results demonstrate that the proposed model exhibited the best prediction results with the highest accuracy using the collected dataset compared with MLP, RF, and SVM models. Furthermore, these results are expected to support manufacturing operations and management in monitoring the daily load power consumption of industrial machines in manufacturing facilities to reduce significant equipment damage due to unstable load power issue conditions by considering various appropriate preventative actions. Furthermore, we developed a user interface to display the prediction results using the Flask framework and the REST API.
In future research, other machine learning algorithms must be considered to determine which method may exhibit the best performance in detecting load power data consumption in an industrial manufacturing environment, considering that excluding missing or unique values from the dataset may limit network performance owing to the time intervals between data points in the sequence.
Therefore, the methods must be developed to estimate or deal with missing values, as well as inconsistent time intervals; thus, consistency must be further considered based on time-series data.
This work was supported by Gyeongnam SW Convergence Cluster 2.0 under the contract and the "Leaders in INdustry-university Cooperation +" Project by the Ministry of Education and National Research Foundation of Korea.
Table 1 . Experimental setup.
No | Description | Values |
---|---|---|
1 | Environments | Tensorflow 1.8.0 Phyton 3.5 |
2 | Optimizer | Gradient Descent |
3 | Lost function | seq2seq loss |
4 | Dropout | probability: 0.2 |
5 | Batch | Batch size: 32 |
6 | Regularization | L2 regularizer |
7 | Gradient Clipping | O |
8 | Learning Rate | 10-2 |
9 | Softmax | O |
Table 2 . Detailed information of load power data.
Measurement | Range | Normal Range | Unit |
---|---|---|---|
id | 0~65535 | - | - |
device_id | 0~65535 | - | |
r_voltage | 0~655.35 V | 200V ~ 240 V | 0.01 V |
s_voltage | 0~655.35 V | 200V ~ 240 V | 0.01 V |
t_voltage | 0~65.535 A | 1A ~ 5 A | 0.001 A |
r_current, | 0~65.535 A | 1A ~ 5 A | 0.001 A |
s_current, | 0~65.535 A | 1A ~ 1 A | 0.001 A |
t_current, | 0~65.535 A | 1A ~ 1 A | 0.001 A |
r_active_power | -32.768~32.767 kW | 0.22~1.10 | 0.001 kW |
s_active_power | -32.768~32.767 kW | 0.22~1.10 | 0.001 kW |
t_active_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
r_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
s_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
s_reactive_power | -32.768~32.767 kVAR | -0.010~0.010 | 0.001 kVAR |
r_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
s_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
t_apparent_power | -32.768~32.767 kVA | 0.22~1.10 | 0.001 kVA |
r_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
s_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
t_power_factor | -1.000~+1.000 | 0.980~1.000 | 0.001 |
frequency | 45.00~65.00 Hz | 58~62 Hz | 0.01 Hz |
temp | -128~127 °C | 10~40 °C | 1 °C |
datetime | - | - | - |