International Journal of Electrical and Computer Engineering (IJECE) Vol. No. June 2025, pp. ISSN: 2088-8708. DOI: 10. 11591/ijece. Energy consumption prediction methods in a cyber-physical Kenzhegali Nurgaliyev. Akylbek Tokhmetov Department of Information Systems. Gumilyov Eurasian National University. Astana. Republic of Kazakhstan Article Info ABSTRACT Article history: In recent decades, cyber-physical systems (CPS) have become an essential part of modern industry and daily life. These systems integrate physical processes with computer and network components, allowing them to interact with their environment and manage their components autonomously. One of the most significant aspects of CPS efficiency is managing energy consumption, which significantly affects their reliability, efficiency, and economic performance. CPS devices generate vast amounts of diverse data, which is crucial to accurately model. Researchers use predictive analysis to develop models that forecast trends and simulate real-world conditions, enabling them to make better-informed decisions. This article presents a comparative analysis of different predictive models for CPS data analytics, focusing on energy consumption in smart buildings. Short-term models include gradient-boosted regressor (XGBoos. , random forest (RF) and long short-term memory (LSTM). The comparative results have been studied in terms of prediction errors to determine accuracy. Received Jun 26, 2024 Revised Jan 8, 2025 Accepted Mar 3, 2025 Keywords: Computational processes Cyber-physical systems Energy consumption prediction Machine learning Optimization algorithms This is an open access article under the CC BY-SA license. Corresponding Author: Akylbek Tokhmetov Department of Information Systems. Gumilyov Eurasian National University Astana. Republic of Kazakhstan Email: tohmetovakylbek@gmail. INTRODUCTION Cyber-physical systems (CPS) represent the integration of physical and computational procedures, wherein computational systems monitor and regulate physical processes via feedback loops. In modern conditions, the development of CPS is important for industry fields such as smart cities, industrial automation, medicine, and transportation. CPS enables more efficient and intelligent management of various processes and resources, which in turn requires accurate methods for predicting and optimizing energy consumption. Energy consumption in CPS is a critically important aspect as it directly affects the performance, reliability, and operational costs of systems . Predicting energy consumption allows for advanced planning and resource management, optimizing their use and minimizing costs. This is particularly important given the continuously growing volumes of data and the increasing complexity of energy resource management. Predicting electricity usage effectively conserves energy, as numerous scientific studies . Researchers use many methods at the same time to guess how much electricity people will use. These include fuzzy logic mathematical models . , deep and classical machine learning techniques . , . , and models that take into account how electricity use changes with the seasons and the influence of various characteristics . , . Considering the great range of power consumption forecasting methodologies, there is no common approach that allows the presentation of a reliable electricity consumption forecast for each subject area. The main reasons for this include evolving forecasting accuracy standards, the necessity to consider numerous Journal homepage: http://ijece. Int J Elec & Comp Eng ISSN: 2088-8708 factors that define the subject area's specifics, and advancements in data mining technologies, which enable more efficient handling of vast data sets compared to conventional mathematical statistics methods. Therefore, we decided to conduct an applied study that involves electricity consumption prediction using data regression tools. Accordingly, the goal of this research is to create an optimal technique for predicting electricity demand and evaluate how accurate these techniques are. Following the introduction, we describe the various types of data analytics techniques and assessment metrics. The following section presents the results of an exploratory data analysis experiment for energy consumption model selection. LITERATURE REVIEW We shall categorize the forecasts employed in this study according to the duration of anticipation before moving on to specific methods. Forecasts are categorized differently depending on how long prediction needed . We shall follow the following guidelines in the context of this investigation. The projections that we will take into consideration are classified as long-term, which spans several months to years, and as short-term, which spans days to several weeks as shown in Figure 1. By separating the methodologies based on the expected lead time, we were able to look more closely at the approaches that work well for corresponding lead time forecasting. We believe that this division of approaches makes it easier for us to explore the related literature and helps us to tag the characteristics of the application conditions for every forecasting period. Figure 1. Power consumption prediction categories Short-term forecasting Operational forecasts are essential for managing electricity consumption with its peak loads which can be decreased by having a forecast that is accurate one day or several weeks in advance. This type of forecasting is relevant for planning power demand supported by an analysis of small power grids . Ikeda and Nagai . present an approach that allows optimal management of the energy consumption of a building . The method made it possible to reduce operating costs for electricity consumption by more than 10%. The researchers explain that creating such method allows for the nonlinearity of power consumption data for some types of equipment to be considered. The findings of applying machine learning to forecast office building cooling energy consumption while taking human behavior into account are presented by the author in . When developing the model, several machine learning algorithms were tested and compared. The simulation results demonstrated the great influence of the variables considered in the study on the target result-electricity consumption. The activities of office building workers affected energy consumption by more than 7 times. Researchers argue in . that a precise comprehension of energy load slope is essential for managing plant power systems effectively and serves as the foundation for anomaly identification. Scientists also note that load curve analysis is an important addition in the absence of methods for assessing various time transitions between energy states. The article presents the results of utilizing a deep spatiotemporal residual neural network (ST-ResNe. to forecast power generation . For both short-term . and medium-term . forecasting, the average absolute percentage forecast error may be decreased by more than 2. 5 percent by using ST-ResNet. On the one hand, the development and application of data mining methods, in particular for the task of predicting electrical loads, helps to reduce and rationalize the use of resources. However, performing machine learning procedures requires significant computing resources which raises the amount of electrical energy used. Long-term forecasting Ongoing forecasts are used to plan the construction or renovation of important infrastructure and manufacturing facilities, as well as to develop plans for the expansion of smart energy systems both independently within a particular industrial sector and at the state level. A variety of long-term scenarios are typically employed to get the projection numbers for total energy consumption. Forecasting makes it possible Energy consumption prediction methods in a cyber-physical system A (Kenzhegali Nurgaliye. A ISSN: 2088-8708 to regulate energy storage devices' operating modes optimally, which promotes more sensible usage of them. The outcomes of applying a decision tree model to anticipate power usage are shown in the research . The procedure of figuring out an electrical storage device's ideal capacity makes use of the results gathered. Machine learning and conventional approaches to predicting power use were compared in the paper . The findings demonstrate that, in terms of forecast accuracy, machine learning techniques execute noticeably better than conventional techniques, indicating the significance of developing prediction models using conventional machine learning methods and neural networks. The primary drawback of employing these techniques, as mentioned in . , is their computational complexity, which makes improving data mining algorithms' efficiency a particularly pertinent job. A model was created in . that combines an entirely connected neural network using single spectrum evaluation to separate the time series of power Such an application is a promising direction, since it uses a combination of several methods of intellectual analysis. Scientists observe, nonetheless, the restrictions in the use of some techniques even with the most contemporary tools to estimate power usage . This just reaffirms the necessity of research to update and broaden the toolkit of methods used to solve the power consumption forecasting problem. Therefore, comprehensive analyses such as in . , which reflect the current level of research in power load prediction, are advised to be conducted. Hybrid forecasting is necessary to create recommendations regarding the possible use of essential building facilities due to the scientific community's interest in energy-saving issues, the advancement of smart data processing methods and the necessity of energy-saving solutions in real-world applications. Hybrid forecasting Nowadays, achieving maximum energy efficiency is anticipated to be the main emphasis of internet of things (IoT) innovation in the future. This issue may be met by incorporating artificial intelligence (AI)powered technologies such as machine learning (ML) and deep learning . AI research fields are advanced as a result of ML systems' constant self-improvement. ML employs algorithms that enable them to react to environmental inputs and recognize nonlinear relationships in complex or uncertain systems. Predicting how much energy a CPS will use in various time intervals is a useful approach to optimize energy use, forecast future energy requirements, and spot possible inefficiencies in energy use, among other agents in a smart The quality and relevancy of the data that ML algorithms use has a significant impact on how well they Electricity usage was divided into several categories in . : raw measurements and records of private loads . ir conditioners, refrigerator. at certain periods as it enables precise energy management, load disaggregation, and appliance identification. Machine learning algorithms have overcome the primary shortcomings of hybrid prediction systems. For instance, scientists in . developed a forecasting model for building energy usage by integrating expanded short-term memory networks with a sine-cosine optimization algorithm to provide predictions in real time. Subsequently. Suranata et al. concentrated on forecasting dining room energy usage. Authors used LSTM model. its features were extracted using principal component analysis (PCA). Furthermore. Shapi et al. used cloud-based machine learning framework (Microsoft Azur. to offer following Using three strategies . -nearest neighbors, artificial neural networks, and support vector machine. , the study employs two tenants from an industrial building in Malaysia. The experimental findings show that each renter's energy consumption has a certain distribution pattern, and the proposed model is capable of precisely calculating each renter's energy consumption. Hybrid network is a term used to describe some interconnected systems with different forecasting Mohammed et al. focus on enhancing thermal comfort and energy loads in heating, ventilation, and air conditioning (HVAC) systems by the application of an intelligent control algorithm. The authors suggest optimizing heat transfer coefficients and air temperature values by combining supervisory control and data acquisition (SCADA) systems with a smart building management tool. Then, genetic algorithms are utilized to minimize energy usage and preserve user comfort. Regarding power usage. He and Tsang . designed a hybrid solution that combines long short-term memory (LSTM) with Improved complete ensemble empirical mode decomposition with adaptive noise . CEEMDAN). Researchers used it to identify trends in the first power usage data, and then they forecasted each mode separately using a Bayesianoptimized LSTM. METHOD This section describes the research methods used to predict energy demand in CPS. Forecasting energy consumption is a complex task that requires the use of various techniques and approaches to ensure the accuracy and reliability of predictions. A multitude of sources, including sensor data streams, environmental data, and other entities, are used as input for hybrid prediction method. Cutting edge processing tools and algorithms are Int J Elec & Comp Eng. Vol. No. June 2025: 3054-3063 Int J Elec & Comp Eng ISSN: 2088-8708 needed to process this data accurately and quickly. Several categories of data analytics exist according to the needs of specific applications. Time series of data is used for forecasting purposes and tasks have a number of Since a time, series is a sequence of values in which each subsequent value contains the past for the subsequent ones, any attempt to forecast the future without studying the time series of the past is unscientific and erroneous. Therefore, to obtain sufficiently accurate and reliable forecasts, in-depth research on the present status of this procedure is required. For example, to separate the series into its constituent parts and eliminate the influence of systematic components on the change of random ones, check the series for the presence of a main trend and, if there is one, to isolate it, identify the trend and its direction. Regarding short-term forecasting methods might be used as shown in Table 1. Table 1. Short-term forecasting methods analysis Method Least squares method (LS) Moving Description and Limitations By minimizing the sum of squares of the differences between actual and anticipated values, it is used to estimate the parameters of mathematical models . It describes time series changes using Slope and Shift. This affects sum of squares minimization in readings deviations. Trend model is rigidly fixed. Final forecast considers an influence of the latest values. High sensitivity to detecting unusual data It calculates series average by taking the average of a certain initial values. This creates an impression that the average is AuslidingAy along the series, discarding one level and adding the next each time . Fluctuations are replaced by the arithmetic mean in selected time series. Consumption values . ime serie. are Identification of large number of model parameters is resource intensive. Exponential smoothing (ES) It is used to forecast future values based on past observations, useful for data without significant seasonal fluctuations. The larger time series interval width, the smoother a trend will be . Trend model was formed end of the chosen period and does not extrapolate current dependencies into long future. Provides a much tighter value for close outputs than for long-term extreme. Math Slope = . ayca y y. ayca y y. yc2 Oe slope y yc shift = Oe ycu ycu (Ea Ae actual consumption value, n Ae number of time series, t Ae time of observation perio. ycEycyceycc. cEy. = ycycoycuycyyce y yc ycEaycnyceyc . PC = yaycaycycuOe1 y ycu y . aycu Oe yaycuOe1 ) . (Eav Ae average consumption except the last value. En Ae last value, n Ae number of time serie. yaycu 1 = yaycaycyceyc yu . aycu Oe yaycaycyceyc ) . (Eaver Ae average consumption. En Ae last value before forecasting, - smoothing paramete. If Ie 1, then the influence of past values is reduced, only the last value is considered for the forecast. Considering limitations in Table 1, it is clear that these research objectives should not be covered by short-time forecasting only but a complex of suitable methods to overcome all possible restrictions and tune forecasting results according to needed time period whether its long- or short-time. It means that for this study a hybrid prediction should be considered, so that following machine learning (ML) methods are proposed: gradient boosting regressor (XGBoostin. , random forest (RF), and long short-term memory (LSTM). XGBoost is a powerful and effective machine learning method for regression and classification tasks . The basis for it is in the idea of gradient boosting, which aggregates several weak models . sually decision tree. into one powerful prediction model. In the context of energy consumption forecasting. XGBoost allows to explore intricate nonlinear dependencies and interactions among numerous elements that effect energy consumption, thereby enhancing the accuracy of predictions. Multiple decision trees are used in RF, a machine learning technique, to improve prediction accuracy and dependability . This technique allows for the assessment of the significance of each feature, helping to interpret the model and identify key factors influencing energy consumption. RF is well-suited for handling large amounts of data and can effectively process high-dimensional datasets. The type of recurrent neural network (RNN) to process time series and to account for long-term dependencies is called an LSTM . This method can adapt to changes in data and dynamically update its predictions based on new data. Before the data is utilized to train and test the models, it will be prepared and examined. Case study was conducted using Jupiter programming tool and common libraries to analyze selected ML algorithms. Energy consumption prediction methods in a cyber-physical system A (Kenzhegali Nurgaliye. A ISSN: 2088-8708 Total consumption CASE STUDY Data preprocessing The dataset consists of information collected over a period of 3 years from IoT sensors that were installed in the building of Cornell University . Every sensor node is set up to record and operate every 24 hours on average as well as energy data was recorded too. The appliances energy consumption (MW) is to be measured, then it was chosen as the target variable. Data preprocessing is necessary to identify trends and features in electrical power consumption statistics. Due to the inconsistent value scales between features and missing data, preprocessing is time-consuming issue for standardization and imputation. It is evident that the data must be split into two sets: training and test samples. Object selection for each sample was performed using the GridSearchCV method. Several key data preparation strategies were employed to enhance forecasting efficiency. One such strategy is featuring engineering, aiming to explore not only the relationships between features but also how these features relate to the target variable. Feature engineering involved extracting new features from existing data. Correlation analysis was conducted to establish relationships between various variables. Additionally, values related to time parameters . our, day, month, yea. were consolidated into a single format, as unique time series over several years are required for forecasting. To ensure the data is ready for modeling, we checked for missing or empty values, duplicates, and addressed outliers using other statistical This process aids in providing more relevant and valuable information. Identifying correlation between variables is beneficial for various purposes, including detecting and subsequently removing irrelevant variables, as well as uncovering unique correlations that might not be evident during direct forecasting. In some cases, certain attributes can be modified and normalized within a specific range to reduce data imbalance. Figure 2 illustrates the energy consumption dynamics of a building over a period of one year. Time period Figure 2. Energy consumption for 1-year period Predictive model development As was mentioned before, the proposed model consists of three ML algorithms to analyze patterns of hybrid forecasting. Considering time series data with different lengths. LSTM works appropriately. It is helpful for predicting energy use because it can handle variable-length sequences, recall prior data, and capture long-term associations. Three layers make up the LSTM model structure: input, unit, and output. Long sequences of data may be effectively collected and sent using LSTM. A machine learning technique called random forest regressor combines many decision trees to provide a prediction model for regression A portion of the training data and features is chosen at random to build each tree. The final output is produced during prediction by the regressor combining predictions from each tree as shown in Figure 3. This method is widely operated for pattern recognition and prediction as it can analyze complicated behavior. Failures at every level are given priority in gradient boosting approach. This algorithm lowers prediction error and improves prediction performance by matching weak training sets to the loss function. Gradient boosting was used due to its strong predictive performance, capacity to recognize intricate data relationships and nonlinear models, and adaptability features. Int J Elec & Comp Eng. Vol. No. June 2025: 3054-3063 Int J Elec & Comp Eng ISSN: 2088-8708 Figure 3. Random forest regressor algorithm Evaluation To avoid overfitting, a straightforward data partitioning technique was used throughout two sets of As was mentioned above, the dataset was divided into training . % of given dat. and testing . % of dat. ML algorithms and prediction models for consumption recordings were trained on training set. The effectiveness of selected models was assessed using a testing set as shown in Figure 4. Figure 4. Prediction model with used data modelling The accuracy and efficiency of prediction models produced by ML algorithms were evaluated using metrics such as mean absolute percentage error (MAPE). When contrasting the range of actual values or various time series with the projected accuracy of a model. MAPE can be considered as helpful tool due to fact that MAPE is able to scale the error measure to the actual value. The accuracy increases as the MAPE decreases . This is a widely used technique for calculating prediction errors, which is easier to grasp because of its scaled units. For every time period, it computes the average absolute percent error, minus real values, divided by actual values. The quality metrics were obtained by MAPE, showing the level of errors made by the algorithm in percentage: MAPE = ycuycycoycayceyc ycuyce ycycaycoycyycoyceyc y ( yaycaycyceycycayciyce Oe yaycyycyceyccycnycaycyceycc yaycaycyceycycayciyce y 100%) . There are 2 scenarios of analytics: . energy index during given period . ctual value. , . energy consumption after optimization . redicted value. DISCUSSION Table 2 indicates that lower MAPE values suggest a better model fit since they identify the difference between anticipated and actual data. As it follows from Table 2, in the case of model on actual power consumption data, the least value was shown by the model based on the extreme gradient boosting regression algorithm (XGBoos. - the error was 36. 3% which is less than other models. The GBR approach performed exceptionally well in every building. Nonetheless, there were differences in performance between buildings when comparing LSTM with random forest technique. Furthermore. LSTM produced less mistakes than Random Forest, which showed a significant difference. This discovery implies that LSTM outperformed RF in terms of mistakes and generated fewer errors overall. After this analysis, it was evident that XGBoosting approach worked the best in all buildings. It is evident from the data provided in Table 3 that random forest approach, which exhibits high accuracy, is the one that comes the closest to the actual testing results. Regarding the precision of calculating average consumption. XGBoosting algorithm comes in bottom, followed by LSTM technique in second Energy consumption prediction methods in a cyber-physical system A (Kenzhegali Nurgaliye. A ISSN: 2088-8708 Nonetheless, there is a crucial performance disparity between LSTM and XGBoosting, indicating that both methods are not appropriate for the same types of data. Although LSTM is helpful for handling nonlinear, time-dependent data because of its recurring nature. XGBoosting performs well in all scenarios. Table 2. Prediction performance Testing set Building 1 Building 2 Building 3 Method LSTM XGBoosting LSTM XGBoosting LSTM XGBoosting MAPE (%) Table 3. Prediction performance using three presented ML methods Scenario 1 Actual metrics Scenario 2 Scenario 2 LSTM Scenario 2 XGBost Comparing to other articles, scientists and researchers are increasingly used hybrid models that combine more than two methodologies. The studies presented in Table 4 describe various approaches used to predict power consumption in comparison to the proposed model. Chou and Tran . used DE-LSTM algorithm to predict electricity price through accuracy estimation in market of Germany. France and Austria. In comparison with the proposed model, it achieves better forecasting performance in most cases. Massidda and Marrocu . authors addressed the household energy load forecasting using hybrid models of RF . and linear regression (LR) for short-term predictions. The dataset contained measurements taken from a house near Paris from 2006 to 2010. Table 4. Comparative analysis Method Proposed model Hybrid (Differential evolution (DE) LSTM) . Hybrid (RF Linear regressio. Forecast period Min 1 month Min 1 month Min 1 month MAPE (%) 3 Ae 76. 8 - 35. 4 Ae 51. By taking into consideration proposed interpretation of MAPE . as was given in Table 5, it is possible to state that proposed model has reasonable accuracy in comparison to mentioned above related However, exogenous factors-such as meteorological, social, and economic factors-that have a nonlinear impact on electricity demands have not been examined in the compared articles and the proposed As a result, it is evident that the forecast error may vary if the study's assumptions about weather factors are not met. On the one hand. MAPE should likely drop when employing more precise climate data, such as many settlements with varying climate conditions. Therefore, greater study into more specific climatic parameters and their effects on the desired outcome is one of the potential topics. Since energy consumption forecasting is based on historical data and known relationships between variables, fresh projections may be considered if a significant mismatch error is found at the time of the In this instance, the inaccuracy will happen right away, and it is feasible to investigate how the additional component affects the electricity consumption projection. One of the difficulties in predicting energy consumption is the absence of generic models appropriate for different topic areas and forecast lead therefore, the search for universal methods to forecast model generation is a possible area of study. Therefore, the results of this study, especially the input predictor factor structure, might be used in similar Using neural networks and gradient boosting models to predict power consumption is one of the study's recommendations. Int J Elec & Comp Eng. Vol. No. June 2025: 3054-3063 Int J Elec & Comp Eng ISSN: 2088-8708 Table 5. MAPE values interpretation MAPE (%) More than 51% 21% to 50% 11% to 20% Less than 10% Forecast level Inaccurate Reasonable Good Highly accurate CONCLUSION To study the prediction of power consumption of CPS, we applied long-term forecasting and used three ML methods: XGBoosting. RF and LSTM. XGBoosting and RF are based on ensemble learning and generates a more accurate forecast by combining the output of many weak models. XGBoosting uses gradient boosting to successively improve models, minimizing the error of each subsequent tree. RF, on the other hand, builds many decision trees in parallel and averages their predictions to improve robustness and LSTM is made especially to handle data sequences and take long-term dependencies into This makes LSTM especially useful for time series forecasting, where it is important to take historical data into account. Each of these methods was tested on real power consumption data, allowing us to evaluate their effectiveness and accuracy in real cyber-physical systems. Our research results show that the combined use of these methods can significantly enhance forecasting accuracy and contribute to energy consumption optimization in the CFS. The study's findings demonstrated that XGBoosting continuously produces the greatest outcomes. LSTM is suitable for tasks like time series forecasting because it was created especially for processing sequential data. A comparison was done based on the evaluation of these approaches' predicting ability. The conducted study is relevant both for the scientific community as a topic for researching forecasting methods, and for enterprises in terms of the economic benefits of implementing energy-saving systems. Even though energy consumption can be considered as one of major issues for the IoT sector, forecasting electricity demand for each individual area in the smart environment is quite specific, requiring taking into account many factors and their intelligent analysis. FUNDING INFORMATION Authors state no funding involved. AUTHOR CONTRIBUTIONS STATEMENT This journal uses the Contributor Roles Taxonomy (CRediT) to recognize individual author contributions, reduce authorship disputes, and facilitate collaboration. Name of Author Kenzhegali Nurgaliyev Akylbek Tokhmetov C : Conceptualization M : Methodology So : Software Va : Validation Fo : Formal analysis ue ue ue ue ue ue ue ue ue I : Investigation R : Resources D : Data Curation O : Writing - Original Draft E : Writing - Review & Editing ue ue ue ue ue ue ue Vi : Visualization Su : Supervision P : Project administration Fu : Funding acquisition CONFLICT OF INTEREST STATEMENT Authors state no conflict of interest. DATA AVAILABILITY The authors confirm that the data supporting the findings of this study are available within the REFERENCES