Next Article in Journal
Accidents in Oil and Gas Pipeline Transportation Systems
Previous Article in Journal
Topology-Optimized Latent Heat Battery: Benchmarking Against a High-Performance Geometry
Previous Article in Special Issue
A Novel Approach for Predicting CO2 Emissions in the Building Industry Using a Hybrid Multi-Strategy Improved Particle Swarm Optimization–Long Short-Term Memory Model
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

24 Hours Ahead Forecasting of the Power Consumption in an Industrial Pig Farm Using Deep Learning

by
Boris Evstatiev
1,*,
Nikolay Valov
1,
Katerina Gabrovska-Evstatieva
2,
Irena Valova
3,
Tsvetelina Kaneva
3 and
Nicolay Mihailov
4,*
1
Department of Automatics and Electronics, University of Ruse “Angel Kanchev”, 7004 Ruse, Bulgaria
2
Department of Computer Science, University of Ruse “Angel Kanchev”, 7004 Ruse, Bulgaria
3
Department of Computer Systems and Technologies, University of Ruse “Angel Kanchev”, 7004 Ruse, Bulgaria
4
Department of Electrical Power Engineering, University of Ruse “Angel Kanchev”, 7017 Ruse, Bulgaria
*
Authors to whom correspondence should be addressed.
Energies 2025, 18(15), 4055; https://doi.org/10.3390/en18154055 (registering DOI)
Submission received: 29 June 2025 / Revised: 25 July 2025 / Accepted: 29 July 2025 / Published: 31 July 2025
(This article belongs to the Special Issue Application of AI in Energy Savings and CO2 Reduction)

Abstract

Forecasting the energy consumption of different consumers became an important procedure with the creation of the European Electricity Market. This study presents a methodology for 24-hour ahead prediction of the energy consumption, which is suitable for application in animal husbandry facilities, such as pig farms. To achieve this, 24 individual models are trained using artificial neural networks that forecast the energy production 1 to 24 h ahead. The selected features include power consumption over the last 72 h, time-based data, average, minimum, and maximum daily temperatures, relative humidities, and wind speeds. The models’ Normalized mean absolute error (NMAE), Normalized root mean square error (NRMSE), and Mean absolute percentage error (MAPE) vary between 16.59% and 19.00%, 22.19% and 24.73%, and 9.49% and 11.49%, respectively. Furthermore, the case studies showed that in most situations, the forecasting error does not exceed 10% with several cases up to 25%. The proposed methodology can be useful for energy managers of animal farm facilities, and help them provide a better prognosis of their energy consumption for the Energy Market. The proposed methodology could be improved by selecting additional features, such as the variation of the controlled meteorological parameters over the last couple of days and the schedule of technological processes.

1. Introduction

The electrical energy system operates based on the so-called conservation of power, which states that the power of the sources is always equal to the power of the consumers. The importance of this dependency became even more important and acquired a completely new meaning with the creation and development of the European Electricity Market [1]. According to this legislation, energy can be sold and bought one day in advance, with its price being formed on an hourly basis, depending on energy availability and demand. This means that hourly forecasts should be made of energy production by the renewable sector, on the one hand, and of the energy consumption of all consumers, on the other. The latter means that if a consumer (whether industrial, agricultural, domestic, etc.) wants to use cheaper energy, it should be able to make reliable enough 24-hour-ahead forecasts of the consumption.
Numerous problems exist when it comes to the dynamics of the energy market, such as price-matching [2], the impact of renewable energy and energy storage systems [3,4], cybersecurity [5], etc. The development of artificial intelligence, and more specifically machine learning and deep learning, has opened many new opportunities that could be used to provide solutions to answer the energy management needs. Previously, machine learning has been widely used for forecasting energy production by renewable energy sources [6], such as photovoltaic [7] and wind power [8] generation. Different authors have applied it to implement power forecasting for smart grid optimization [9] and peak energy demand forecasting [10]. Many machine-learning-based approaches also exist for synthetic load profile generation, which is very similar to forecasting, however, from a statistical/probabilistic point of view [11,12,13].
Considering the needs of the energy market, time-series forecasting should be used, also known as multi-step forecasting. Several approaches exist for its implementation. The first one is called recursive multi-step forecasting and is based on a single model, which uses the previously predicted values as input for the next steps [14,15]. This approach is simpler, but may suffer from error accumulation. On the other hand, direct multi-step forecasting relies on different models for each step, which are trained independently of each other [14,16]. This approach is more accurate, yet it requires more resources for training and exploitation. Other approaches are the multiple output forecasting strategy [17], where a single model estimates several outputs simultaneously, and the hybrid approach, which combines all of the above to achieve better results [18].
Depending on the scenarios of application, several forecasting horizons are used: very short-term, short-term, medium-term, and long-term [19]. In [20], 77 scientific publications focused on load profiles forecasting models used were analyzed. The authors classified forecasting methods into two main categories—engineering models (correlation approaches) and artificial intelligence-based (data-driven) models. They concluded that 90% of the most used algorithms are artificial intelligence (AI)-based, with the most common being the artificial neural network (ANN) (28%), followed by Support Vector Machine (SVM), Long Short-Term Memory (LSTM), and hybrid approaches. Furthermore, according to [20], 80% of the studies are focused on short-term forecasting, while medium-term and long-term remain poorly studied.
In another study [21], the different types of models for time-series forecasting were summarized in three categories: statistical, machine learning, and deep learning. A commonly used statistical method is the so-called Autoregressive Integrated Moving Average (ARIMA), which is of the type recursive multi-step [22]. It allows predicting future values of a time series based on the previous ones. A major limitation of the ARIMA-based models is that they cannot incorporate the effect of additional factors, such as meteorological conditions, technological processes, day type, etc. [23]. The machine learning approach relies on algorithms, such as SVM, Random Forest (RF), Naive Bayes (NB), Extreme Gradient Boosting, and many hybrid ones [24,25,26]. The third approach is based on different types of neural networks, such as convolutional neural networks (CNN), recurrent neural networks (RNN), graph neural networks (GNN), different generative models, and many others [27]. The Generative Adversarial Networks (GAN) models are widely used when it comes to time series forecasting. They include two types of networks: a generator and a discriminator network, responsible respectively for generating data and for its classification as either real or synthetic [28].
A systematic overview of state-of-the-art deep neural networks used for time-series forecasting was conducted in [29,30]. The authors present key architectural approaches (including CNN, RNN, LSTM, and attention/transformers) and analyze their role in single- and multi-term forecasts. They emphasize that the flexibility of neural networks allows for high accuracy, but also carries risks of overfitting and sensitivity to preprocessing. Therefore, approaches that include inductive Bayesian structures with explainability (e.g., attention-weight analyses) and integration of expert knowledge are considered a leading research direction.
Energy forecasting can also be classified as large-scale and small-scale, depending on the object of the study. Different studies have used large-scale forecasting, based on the electrical consumption of whole cities or countries. In [31], the daily (short-term) electricity consumption in Thailand was forecasted using several machine learning algorithms—MLP, ANN, SVM, hybrid models, and sequential grid search. The input data includes five moving averages (weekly, monthly, quarterly, seasonal, and yearly), lagged daily consumption variables, seven days ago peak consumption, previous day highest temperature, regional, and national holidays. All models achieved good performance, with one of the hybrid modifications being optimal.
In [32], short-term 24-h-ahead forecasting of the energy consumption was performed using a radial basis function neural network (RBFNN) and data obtained from the Taiwan Power Company. Three models were evaluated for weekdays, weekends, and holidays, with the training data ranging from 2 February to 15 March, from 12 May to 27 October, and from 1 July to 9 December, respectively, and one day of testing data each. The authors achieved very good Mean absolute percentage error (MAPE) results below 0.5%; however, the limited amount of training and testing data means that the results could be worse with larger datasets. In [33], week-ahead forecasting was performed based on an MLP feed-forward neural network with Grey Wolf Optimizer and more than one year of actual data for Jordan. The additionally selected features include temperature, hour of the day, day type (workday, holiday), day of the week, week of the year, and month of the year.
Other studies tried to perform small-scale, i.e., site-specific forecasting. In [34], an ensemble-based neural network approach was used for 24-hour ahead forecasting the power consumption of domestic buildings with 15-min resolution. A combination of parallel and series approaches was used for capturing the general load trend and the short-term changes, respectively. The authors claimed an increase in the mean average error (MAE) and root mean square error (RMSE) by 23% and 24%, respectively, compared to other models. In another study [35], the electrical consumption of a building was forecasted 24 h ahead using two types of neural networks: a Nonlinear Autoregressive with Exogenous Inputs (NARX) RNN and an LSTM ANN. The models were trained using the historic load profile, the temperature of the environment, and the type of day (workday, weekend, holiday) as features. After the first hourly load is forecasted, the next ones are based on the previously forecasted values, i.e., a parallel architecture is used (closed loop).
Numerous studies exist that forecast the load profile in the domestic sector, as was shown in the review performed by [36]. They address different aspects of energy demand, such as overall energy consumption [37,38], cooling energy [39], heating energy [40,41], etc. The authors in [42] used a historical 20-year-long dataset for half a million customers in Pennsylvania, New Jersey, and Maryland (USA) to predict the electrical energy consumption. The proposed hybrid model is divided into a long-term trend, a seasonal component, a weekly cycle, and hourly data, and is based on cubic splines. Furthermore, four different models were created, respectively for the winter, spring, summer, and fall seasons. In [43], ANN, support vector regression (SVR), Gaussian process regression (GPR), and Bayesian network (BN) were used to forecast domestic consumers’ electrical consumption 24 h ahead. The training was based on day, hour, ambient temperature, and load data, with the ANN and SVR models obtaining optimal results.
Other studies have proposed models for forecasting the energy consumption in other sectors, such as industrial [44,45], retail [45,46], and agricultural [47]. In [45], ridge regression (RR), random forest (RF), and gradient boosting (GB) models were used for short-term large-scale forecasting of the energy consumption of different non-domestic consumers in the UK—industrial, entertainment, retail, social, and other. The selected features include the electrical consumption, hour of the day, day of the week, month of the year, season, public holiday, wet bulb temperature, dew point, and air temperature. The GB model achieved the best metrics, reaching R2 above 0.91. Similarly, the active and reactive power consumption of a mining plant was forecasted in [48] (i.e., small-scale forecasting) using a nonlinear auto-regressive (NAR)-type neural network. One month of data about the power consumption was used with a 30-min time step, out of which 7% was selected for testing. The data was additionally smoothed to improve the performance of the models. The authors reported forecasting errors between 2% and 4% for the active power and between 3% and 10% for the reactive power.
Many studies also exist for short-term forecasting of other energy-related processes, such as energy production by renewable energy sources and electrical energy price forecasting. For example, the wind power was forecasted 24 h ahead in [8], using different models. Optimal results were achieved by the hybrid physical-ANN model. The selected features include wind speed, wind direction, air density, temperature, pressure, relative humidity, cloud cover, precipitation, and wind-power data. Other authors used an MLP ANN to forecast the power production of photovoltaic installations, based on pyranometer data and predicted solar irradiation [49]. The study investigated the influence of the number of neurons on the performance of the model. Similar hybrid-ANN models were investigated in [50], where the solar radiation was forecasted using an ANN model and PV generation data based on a physical model. The authors concluded that this approach returns very good results and is appropriate for forecasting PV power production. In [51], distant (3 weeks), short (3 days), and ultra-short (3 h) forecasting of the electrical energy sales was conducted, using different neural networks. The optimal ST-ResNet model achieved an MAPE of 2.37%, 2.87%, and 3.17% for ultra-short, short, and distant forecasting, respectively.
The performed analysis shows that numerous studies exist for short-term (hours to several days ahead) forecasting of energy consumption in different sectors of the economy. Many of these studies deal with building energy consumption in both large- and small-scale scenarios. It was observed that large-scale forecasting achieved significantly better accuracy compared to small-scale forecasting, which can be explained by the lower influence of different random events occurring with individual facilities. Furthermore, many studies have dealt with large-scale forecasting of industrial, retail, agricultural, etc., consumers, and have achieved excellent accuracies. However, we were able to identify very few of them, which deal with small-scale, short-term forecasting in the above-mentioned sectors, and almost no studies were found that forecast the electrical energy consumption of individual agricultural facilities, which is an obvious research gap.
This study aims to propose a methodology for short-term (24 h ahead) forecasting of the power consumption in individual industrial pig farm consumers, which is its main contribution. The forecasting relies on easily accessible data, making it applicable to most farmers dealing with energy management in animal husbandry facilities. Furthermore, considering long-term data availability is a common problem, the proposed methodology is focused on working with a limited amount of actual energy consumption data to widen its area of application.
The remaining part of the manuscript is as follows: In Section 2, the experimental data used, the proposed methodology, and the means of the investigation are presented. In Section 3, the proposed methodology is applied to the pig farm dataset, and the obtained results are analyzed and discussed. Furthermore, they are compared with those obtained in previous studies. Finally, the main contributions of the paper are summarized in Section 4, and guidelines for future studies are provided.

2. Materials and Methods

2.1. Experimental Data

In this study, a load profile containing the power consumption from 01.01.2023 to 31.12.2023 of a pig farm located near Silistra, Bulgaria, was used (Figure 1). It was obtained from Huawei’s Fusion Solar platform, as the agricultural infrastructure has a photovoltaic installation and a power meter.
In addition to the power consumption, a corresponding weather dataset was obtained from the website stringmeteo.com for the Romanian city of Calarasi, which is located 24 km away from the farm. In the current case, this distance does not lead to significant differences in the microclimate of the two areas for the following reasons:
-
Both the farm and Calarasi are situated near the Danube River;
-
Their altitudes are 105 m and 133 m, respectively;
-
There are no mountains, lowlands, or other specific geographic anomalies between or near them that could impact their climate.
During the investigated period, the temperature varied from −10 °C in February to +40 °C in August (Figure 2). The relative humidity varied from 14% to 100%, and the wind speed from 0 m/s to 12 m/s.

2.2. Methodology

The methodology proposed in this study contains several phases and is summarized in Figure 3.
Phase 1. Data acquisition
The methodology begins with the data acquisition procedure, which includes two types of data:
  • Electric power consumption—considering the study aims to make 24 h ahead forecasts, hourly data is used. It can be obtained either from a smart meter or from the inverter of a renewable energy installation, if such is available.
  • Meteorological data—it could be obtained either from a local meteorological station or from an online database. In this study, we use three types of meteorological data, which are expected to have an impact on energy consumption in pig farms: the ambient temperature, relative humidity, and wind speed.
Phase 2. Data preparation
In the second phase, the available data is further processed in several steps. Initially, the raw data is pre-processed and prepared. The following features have been selected, which are expected to improve the forecasting accuracy:
  • Hour of the day—the schedule of the technological processes in a pig farm depends on the time of the day.
  • Month of the year—It is expected that the load profile has a seasonal component.
  • Average, minimum, and maximum daily temperatures—it is expected that the environmental temperature influences some of the loads of the farm, such as the climatization system.
  • Average, minimum, and maximum daily relative humidity—similarly to temperature, relative humidity is expected to influence the comfort of the animals, and as a result, the power consumption by the climatization system.
  • Average, minimum, and maximum daily wind speed—strong winds are expected to increase the convective heat transfer by the animal farms, and as such, could influence the performance of the climatization system.
  • The power consumption for the current hour.
  • The power consumptions 1 h ago, 2 h ago, … 72 h ago are created as 72 individual features.
It was decided that it is not necessary to use actual meteorological data but daily statistical data (average, minimum, and maximum values) for the following reasons:
  • The power consumption component, which depends on the weather, has a seasonal character, and therefore, it is not necessary to use hourly values.
  • The model should be easily applicable under different situations and for different consumers, and daily weather data is freely available on the internet for the majority of the locations around the world.
Next, the targets for the models’ training were prepared. Considering we want to be able to forecast the hourly consumption day ahead, 24 targets were prepared for the power consumption: 1 h ahead, 2 h ahead, …, and 24 h ahead. The Pearson correlations between the power consumption of the farm 1 h to 24 h ahead and the abovementioned features are summarized in Table 1. It can be seen that the highest correlation exists between the future and previous power consumption, reaching up to 0.814. Out of the weather parameters, the temperature has the highest correlation with the future power consumption, reaching up to 0.400, which indicates a moderate correlation. The windspeed has shown the lowest correlation, which does not surpass −0.161. In all cases, the correlation strongly depends on the hours ahead forecasting; however, it can be seen that the hours ahead dependency is different for the different features. This shows that the selected features are appropriate for forecasting the power consumption 24 h ahead.
The reliability of all collected data has a level of uncertainty, caused by technological and natural factors. Therefore, in this phase, data cleaning is also performed, aimed at achieving several goals:
  • Remove empty records—if there is missing data in the dataset, the corresponding records should be removed as they are unusable for the training and validation process. Such situations commonly occur because of interruptions in the energy supply, communication channels, server maintenance, etc.
  • Outlier detection—detect data records that are significantly different from the others. Such situations could be caused by problems with the sensors, emergencies, extreme weather conditions, maintenance procedures, etc. Outliers could have a significant impact on the performance of the trained model even without the occurrence of technical problems, and should therefore be removed.
However, the following important aspect of data cleaning should also be considered:
  • If the removal happens because of a missing or inconsistent value in the power consumption, then the previous 24 records and the next 72 records should also be removed.
  • If the removal happens because of a missing or inconsistent value in the meteorological data, then only the corresponding record is removed.
The abovementioned indicates that data cleaning should be carefully considered, as it might lead to a significant reduction in the dataset size.
The finalized data is divided into training and testing datasets. In the current study, we used approximately 90% of the data for training and 10% for testing/validation.
Phase 3. Model selection and optimization
The third phase of the methodology is used for tuning up the models and optimizing their performance. In this study, five machine learning models are selected, which are known to return good results in similar scenarios:
  • Artificial Neural Network (ANN);
  • k-Nearest Neighbor (kNN);
  • Random Forest (RF);
  • Linear Regression (LR);
  • Support Vector Machine (SVM).
During this phase, the parameters of the algorithms are modified and optimized repeatedly using the training dataset and 5-fold cross-validation. The adopted criterion for optimality is the Coefficient of Determination R2:
R 2 = 1 k = 1 n y k y k ^ 2 k = 1 n y k y ¯ 2 ,  
where y k is the actual kth sample, y k ^ is the kth forecasted sample, and y ¯ is the average value of all samples.
Phase 4. Models training
Once the optimal model type and model parameters have been determined in Phase 3, it is applied in Phase 4, where 24 models are trained using:
  • The input features, described in Phase 2;
  • And the 24 different target values, corresponding respectively to the power consumption 1 h ahead, 2 h ahead, …, and 24 h ahead.
Phase 5. Models evaluation
Finally, in Phase 5 of the methodology, the 24 models are applied to the testing dataset, prepared in Phase 2. The evaluation of the trained models is performed using several approaches. The first one is based on several measures, presenting their evaluation scores in either relative or percentile form. This way, they can also be used for direct comparison of the results with those reported in previous studies. The following evaluation metrics are used:
  • Normalized Mean Absolute Error (NMAE)—gives the average of the differences between the observed and the predicted values, normalized on the maximum measured power. This measure is appropriate when no extra penalty should be given to significant differences and provides percentile error:
N M A E = 1 n k = 1 n y k y k ^ y m a x . 100 , % .
  • Normalized Root Mean Square Error (NRMSE)—unlike NMAE, NRMSE gives an extra penalty to big differences between the observed and predicted values. It also provides the results in percentages:
N R M S E = 1 n k = 1 n y k y k ^ y m a x 2 . 100 ,   % .
  • Mean absolute percentage error (MAPE)—as the name suggests, this measure estimates the average relative error between the observed and predicted values:
M A P E = 1 n k = 1 n y k y k ^ y k . 100 ,   %
  • Coefficient of determination, according to Equation (1).
The abovementioned metrics are expected to provide quantitative means for evaluating the models’ performance. The ability of the models to forecast the load profile is also evaluated visually using two approaches:
  • By presenting the data in a graphical form using an actual vs. forecasted graphic;
  • By performing a deeper analysis of several case studies from the testing datasets, presenting in graphical form the 24 actual and predicted values for a certain moment.

2.3. Means of the Study

The implementation of the methodology is based on two software tools. The first one is Orange Data Mining v.3.36 by University of Ljubljana (Ljubljana, Slovenia) [52]. This free tool provides easy-to-use graphical components that can be combined with each other. It supports several classification and regression algorithms, different assessment and visualization tools. Furthermore, it allows importing and exporting data in Excel format, which is important for pre- and post-processing.
The second tool applied in the study is Microsoft Excel 2021 v.2108 by Microsoft Corporation (Redmond, WA, USA). It is used during the data preparation phase, when the 72 h behind and 24 h ahead features/targets are generated. Furthermore, it has been used during the model evaluation phase to calculate some of the evaluation measures, as well as for presenting the results in graphical form.

3. Results and Discussion

3.1. Implementation of the Methodology

As already explained, phase 1 of the methodology is implemented by acquiring the following datasets:
  • The load profile of an industrial pig farm from 01 January 2023 to 31 December 2023 with an hourly step.
  • Meteorological data with average, minimal, and maximal daily values of the temperature, relative humidity, and wind speed for the nearby city of Calarasi, Romania.
Next, according to phase 2 of the methodology, the data was combined, and additional features were extracted from the available ones. The dataset has been prepared in a single Microsoft Excel file, containing the columns shown in Table 2. No outliers were observed in the current study, although a total of 228 records were removed from the dataset due to missing data, leaving it with 8532 records.
Next, the prepared dataset was divided into two files for training and testing purposes:
  • The testing dataset was prepared by extracting the 5th, 15th, and 25th days from each month of the year.
  • The training dataset contains all other records.
After the data cleaning procedure was implemented, the training and testing datasets remained with 7692 and 840 records, respectively.
Phases 3 and 4 of the methodology were implemented in Orange Data Mining, as shown in Figure 4. Initially, the performance of the five selected models (k-NN, RF, LR, SVM, and ANN) was maximized by tuning their hyperparameters repeatedly until a maximal R2 value was reached. The obtained optimal characteristics of the models and the corresponding R2 measures are summarized in Table 3. It can be seen that the artificial neural network achieved the highest R2 metric (0.738), followed by k-NN (0.723) and LR (0.722). The RF and SVM models achieved the lowest values of R2, 0.711 and 0.650, respectively.
During the training of the ANN, numerous scenarios were evaluated with 1 to 5 hidden layers. The optimal R2 obtained for each one of them are 0.738 (100 neurons, logistic activation), 0.727 (50 and 100 neurons, logistic activation), 0.722 (3, 75, and 75 neurons, ReLu activation), 0.724 (6, 9, 9, and 12 neurons, RuLu activation), and 0.723 (3, 19, 15, 12, and 3 neurons, ReLu activation), respectively. It can be noted that with 1 and 2 hidden layers, the logistic activation returned better results, and with 3+ hidden layers, the ReLu activation was preferred. The obtained results also show that, considering the complexity of the current regression problem, 1 hidden layer is enough to provide an optimal solution.
Considering the achieved results, all subsequent analysis following Phase 4 of the methodology is implemented using the neural network model. Twenty-four different models were trained, responsible for forecasting the energy consumption from 1 to 24 h ahead. The results for the selected measures for evaluating the performance of each model are summarized in Table 4.
To give an assessment of the average absolute differences between the forecasted and reference values, the NMAE measure was used. It can be seen that the NMAE varies between 16.59% (for +7 h ahead) and 19.00% (for +22 h ahead), which indicates a good level of accuracy. The NRMSE model is similar to NMAE; however, it gives an extra penalty to large errors. In our study, it varies between 22.19% (for +24 h ahead) and 24.73% (for +22 h ahead), which indicates that in certain situations, all models return larger errors, increasing the values of this measure. Nevertheless, a significant correlation exists between NMAE and NRMSE, reaching 0.93.
The next measure used is MAPE, which in our case varies between 9.49% (for +1 h ahead) and 11.49% (for +20 h and +21 h ahead), which indicates excellent to good accuracy of the models. It is known that MAPE has some limitations when used with small values near zero and disproportionally large values. In the current study, the first is not a problem, as the smallest value is 32.9 kW; as for the second limitation, the results are obviously good, which shows either that there are no outliers or that they didn’t impact the results significantly. Furthermore, an increasing trend can be observed in the MAPE measure with the increase of “hours ahead”. This generally corresponds to the expectations, as it is normal for the uncertainty to increase with the increase of the forecasting horizon. The last measure (R2) is the highest for the 1 h ahead situation (0.74), and between 0.64 and 0.67 for all other models. The R2 values follow the MAPE ones, which is also expected and results in a correlation of −0.91.
For visual assessment of the results, actual vs. predicted charts are presented for the 1 h ahead, 8 h ahead, 16 h ahead, and 24 h ahead models (Figure 5). These visualizations enhance the understanding of the results from Table 4, as it can be visually observed that the “1 h ahead” model indeed performs slightly better compared to the other three situations, which is clearly shown by the lower scattering of the value pairs. Nevertheless, all models operate with a similar error that does not increase significantly with the increase of “hours ahead”.
To better understand the results, several examples are given below. Figure 6 presents four case studies with relatively good 24 h ahead forecasting from the different seasons—winter, spring, summer, and autumn:
  • 24 h ahead forecasting relative from 25 January 2023 16:00 (Figure 6a)—the power consumption varies between 55 kW and 85 kW, and the relative error of most of the predictions is between 0.5% and 16%, with three of them between 19% and 25%.
  • 24 h ahead forecasting relative from 25 April 2023 00:00 (Figure 6b)—the power consumption varies between 40 kW and 70 kW, and the relative error ranges between 2% and 21%, with most of the relative errors being below 15%.
  • 24 h ahead forecasting relative from 25 June 2023 00:00 (Figure 6c)—the power consumption varies between 43 kW and 78 kW, and the relative error ranges between 1% and 26%. Most of the relative errors are below 15%.
  • 24 h ahead forecasting relative from 15 November 2023 07:00 (Figure 6d)—the power consumption varies between 40 kW and 71 kW, and the relative error is between 0% and 22%. Once again, the relative error of most of the forecasts is under 15%.
The observed can be summarized as follows: the forecasting error does not surpass 10% in more than half of the situations, although there are usually several forecasts, whose relative errors reach up to 25%. Furthermore, no increasing trend in the forecasting error with the increase in the “hours ahead” can be observed, which is an interesting observation.
However, there are also several exceptions, such as the situation shown in Figure 7, corresponding to 24 h ahead forecasting from 2023-02-05 06:00. It can be observed that in this case the relative error reaches 90% and in approximately half of the situations it is above 50%. Even though these situations are rare, they do occur. They can be explained by significant differences in the power consumption. For this particular situation, if we go back to Figure 3, it can be noticed that on this date, a sudden decrease in the environmental temperatures began, which is most likely the reason for the inaccurate forecasting. Buildings are known to have certain latency when it comes to temperature response following changes in the environment. It depends on the thermal properties of their construction and insulation elements, such as their specific heat capacity and thermal conductivity. This hypothesis is also confirmed by Figure 7. It can be seen that in most cases the forecasted consumption was significantly higher than the actual one; i.e., the model expected higher consumption because of the lower ambient temperature. One option to deal with such a situation is to include additional features, such as the ambient temperature during the last n days. Another option is to train the model with a larger dataset (in this study, we used 1 year of data); however, as was already mentioned in the paper goals, the proposed methodology is focused on working with a limited amount of actual energy consumption data, so such a solution is not appropriate.

3.2. Comparison with Previous Studies

Forecasting load profiles is applicable in numerous scenarios, and this should be considered when evaluating the achieved results. As was already shown in the introduction, many studies exist that deal with forecasting electrical power consumption and/or generation. In the current study, the normalized versions of measures were selected in order to provide means for comparison with them. We are going to evaluate them in two categories: for small-scale and large-scale forecasting.
The first case applies to situations where the forecasting is done for a single facility and/or a complex of facilities. In [35], 24 h ahead forecasting of building electrical consumption was implemented using the NARX neural network, based on load profile, temperature, and day type data. The MAPE measure varied for the different investigated dates from 9.63% to 33.05%. This indicates that our models achieved higher results, as our MAPE varies between 9.49% and 11.49%. Similarly, in [43], ANN, SVR, and GP were used for 24 h ahead forecasting of the load of domestic consumers. The selected features were the day of the year, time of the day, ambient temperature, and the load profile of the customers. The accuracy of the models varied, depending on the type of house and the model used. The optimal MAPE was reached by the SVR model for a container house (14.9%), while for SIP, AAC, and stick houses, the MAPE measure reached 17.09% (ANN), 25.98% (SVR), and 23.86% (ANN), respectively. Once again, the MAPE measures of our model were significantly better, which indicates higher forecasting accuracy. The authors in [8] tried to forecast the wind power generation using a hybrid physical-ANN model, which accounts for numerous meteorological properties (wind speed, wind direction, temperature, pressure, relative humidity, precipitation, cloudiness, etc.), the wind power generation, and the nominal power curve. The study achieved NMAE and RMSE of 35.32% and 42.07%, respectively, for 24 h analysis. The proposed approach achieved better results compared to an ANN-only or a physical-only model. These results are obviously worse than those achieved by our model, as we achieved NMAE and RMSE of 16.59% to 19.00% and 22.19% to 24.73%, respectively. In other words, it can be seen that the proposed methodology and model in this study provide significantly better accuracy compared to previous small-scale forecasting studies. We couldn’t find a study dealing exactly with an agricultural object, which provided a percentile or normalized measure for comparison.
Other studies dealt with large-scale forecasting; i.e., the load profile of whole sectors or countries was predicted. In [45], the energy consumption of industrial, retail, entertainment, social, and other sectors in several UK towns was forecasted. The features used were enriched with time-specific ones, such as hour of the day, day of the week, season, holidays, as well as meteorological data. The gradient boosting model achieved the highest R2 values for 24 h ahead forecasting, varying between 0.91 and 0.98 for the different types of consumers in the different towns. Similarly, the daily electrical energy consumption in Thailand was forecasted in [31] using several models and several additional features, such as moving averages, lag variables, and temperature. The hybrid model approach achieved the highest MAPE, reaching as low as 1.57%.
These results are significantly better than ours; however, it should be noted that they are for whole sectors/countries, and not for individual facilities, which explains their higher accuracy. It is expected that a sector-wide forecasting will be more accurate because it is less dependent on different random events occurring with individual facilities. In other words, these results cannot be directly compared to those obtained in our study, as the circumstances are different. A summary of all comparisons with previous studies is presented in Table 5.

4. Conclusions

With the creation and development of the European Electricity Market, the need for forecasting the energy consumption and renewable energy generation becomes more and more important for both the selling and buying sides. This study presents a methodology for 24-h ahead forecasting of the energy consumption, which is appropriate for animal husbandry facilities, such as pig farms.
The forecasting is based on several features that were selected based on easy accessibility for the farm owners. The input data includes the daily temperatures, relative humidities, and wind speeds, as well as power consumption from the last 72 h. 24 individual ANN models were trained that forecast the energy production for 1 to 24 h ahead, based on the same features. The models’ MAPEs vary from 9.49% to 11.49% and their coefficients of determination R2 vary from 0.74 to 0.67. The performed case-study analysis showed that in most cases, the forecasting error 24 h ahead does not surpass 10% with several forecasting errors reaching up to 25%. Nevertheless, the results also showed that in rare situations the relative errors could reach up to 90%, which might be caused by anomalies in the operation of the pig farm facility, the weather conditions, etc.
The results of this work could be useful for energy managers of animal farm facilities by helping them provide a better prognosis of their energy consumption for the Energy Market. However, it should be noted that this study has certain limitations. The methodology and especially the chosen features have been prepared and selected in accordance with the agro-technological processes in a pig farm. This means that if applied to a different type of agricultural consumer, the forecasting accuracy might be unsatisfactory, unless some changes are made in the selected features. Therefore, the applicability of this approach to other animal husbandry facilities remains unclear and requires additional studies. The proposed methodology could be improved by selecting additional features as input data, such as the variation of the controlled meteorological parameters during the last couple of days. Another option for improving the accuracy of the models is to include some technological features, such as schedules of the ventilation system, the lighting system, the feeding system, etc., depending on data availability. Such data was not available to the authors during this study and will be investigated in future work.

Author Contributions

Conceptualization, B.E. and N.M.; methodology, B.E. and K.G.-E.; software, K.G.-E. and T.K.; validation, I.V., T.K. and B.E.; formal analysis, B.E. and N.M.; investigation, N.V.; resources, N.M. and N.V.; data curation, K.G.-E. and I.V.; writing—original draft preparation, B.E., I.V., K.G.-E. and T.K.; writing—review and editing, B.E. and I.V.; visualization, B.E.; supervision, N.M. and B.E.; project administration, B.E. and N.M.; funding acquisition, N.M. All authors have read and agreed to the published version of the manuscript.

Funding

This study presents results from the project KП-06-H77/2 “Research and optimization of hybrid system with renewable energy sources for power supply of livestock farm”, financed by the Bulgarian National Science Fund. This study is financed by the European Union—NextGenerationEU, through the National Recovery and Resilience Plan of the Republic of Bulgaria, project No. BG-RRP-2.013-0001.

Data Availability Statement

The datasets used in this study are published under the CC BY 4.0 license and can be found at https://doi.org/10.6084/m9.figshare.29432201 (accessed on 29 June 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Electricity Market Design. Available online: https://energy.ec.europa.eu/topics/markets-and-consumers/electricity-market-design_en (accessed on 10 May 2025).
  2. Zhang, N.; Yan, J.; Hu, C.; Sun, Q.; Yang, L.; Gao, D.W.; Guerrero, J.M.; Li, Y. Price-matching-based regional energy market with hierarchical reinforcement learning algorithm. IEEE Trans. Ind. Inform. 2024, 20, 11103–11114. [Google Scholar] [CrossRef]
  3. Yang, L.; Li, X.; Sun, M.; Sun, C. Hybrid policy-based reinforcement learning of adaptive energy management for the energy transmission-constrained island group. IEEE Trans. Ind. Inform. 2023, 19, 10751–10762. [Google Scholar] [CrossRef]
  4. Kumar, D.; Chauhan, Y.K.; Pandey, A.S. Performance Investigation of Renewable Energy Integration in Energy Management Systems with Quantum-Inspired Multiverse Optimization. Sustainability 2025, 17, 3734. [Google Scholar] [CrossRef]
  5. He, N.; Ma, K.; Li, H.; Li, Y. Resilient self-triggered model predictive control of discrete-time nonlinear cyberphysical systems against false data injection attacks. IEEE Intell. Transp. Syst. Mag. 2023, 16, 23–36. [Google Scholar] [CrossRef]
  6. Krechowicz, A.; Krechowicz, M.; Poczeta, K. Machine Learning Approaches to Predict Electricity Production from Renewable Energy Sources. Energies 2022, 15, 9146. [Google Scholar] [CrossRef]
  7. Evstatiev, B.; Gabrovska-Evstatieva, K.; Kaneva, T.; Valov, N.; Mihailov, N. Evaluation of the Optimal Features and Machine Learning Algorithms for Energy Yield Forecasting of a Rural Rooftop PV Installation. Int. J. Adv. Comput. Sci. Appl. 2024, 15, 568–580. [Google Scholar] [CrossRef]
  8. Ogliari, E.; Guilizzoni, M.; Giglio, A.; Pretto, S. Wind power 24-h ahead forecast by an artificial neural network and an hybrid model: Comparison of the predictive performance. Renew. Energy 2021, 178, 1466–1474. [Google Scholar] [CrossRef]
  9. Yaprakdal, F.; Yılmaz, M.B.; Baysal, M.; Anvari-Moghaddam, A. A Deep Neural Network-Assisted Approach to Enhance Short-Term Optimal Operational Scheduling of a Microgrid. Sustainability 2020, 12, 1653. [Google Scholar] [CrossRef]
  10. Alduailij, M.A.; Petri, I.; Rana, O.; Alduailij, M.A.; Aldawood, A.S. Forecasting peak energy demand for smart buildings. J. Supercomput. 2021, 77, 6356–6380. [Google Scholar] [CrossRef]
  11. Valova, I.; Gabrovska-Evstatieva, K.G.; Kaneva, T.; Evstatiev, B.I. Generation of Realistic Synthetic Load Profile Based on the Markov Chains Theory: Methodology and Case Studies. Algorithms 2025, 18, 287. [Google Scholar] [CrossRef]
  12. Liang, X.; Wang, Z.; Wang, H. Synthetic Data Generation for Residential Load Patterns via Recurrent GAN and Ensemble Method. IEEE Trans. Instrum. Meas. 2024, 73, 2535412. [Google Scholar] [CrossRef]
  13. Gu, Y.; Chen, Q.; Liu, K.; Xie, L.; Kang, C. GAN-based model for residential load generation considering typical consumption patterns. In Proceedings of the 2019 IEEE Power & Energy Society Innovative Smart Grid Technologies Conference (ISGT), Washington, DC, USA, 18–21 February 2019; pp. 1–5. [Google Scholar] [CrossRef]
  14. Wei, S.; Bai, X. Multi-Step Short-Term Building Energy Consumption Forecasting Based on Singular Spectrum Analysis and Hybrid Neural Network. Energies 2022, 15, 1743. [Google Scholar] [CrossRef]
  15. Chen, Y.; Fu, Z. Multi-Step Ahead Forecasting of the Energy Consumed by the Residential and Commercial Sectors in the United States Based on a Hybrid CNN-BiLSTM Model. Sustainability 2023, 15, 1895. [Google Scholar] [CrossRef]
  16. Su, L.; Zuo, X.; Li, R.; Wang, X.; Zhao, H.; Huang, B. A systematic review for transformer-based long-term series forecasting. Artif. Intell. Rev. 2025, 58, 80. [Google Scholar] [CrossRef]
  17. Ardiansyah; Kim, Y.; Choi, D. Lstm-based multi-step soc forecasting of battery energy storage in grid ancillary services. In Proceedings of the 2021 IEEE International Conference on Communications, Control, and Computing Technologies for Smart Grids (SmartGridComm), Aachen, Germany, 25–28 October 2021. [Google Scholar] [CrossRef]
  18. Wei, Y.; Chen, Z.; Zhao, C.; Chen, X.; Tu, Y.; Zhang, C. Big multi-step ship motion forecasting using a novel hybrid model based on real-time decomposition, boosting algorithm and error correction framework. Ocean Eng. 2022, 256, 111471. [Google Scholar] [CrossRef]
  19. Zaini, F.A.; Sulaima, M.F.; Razak, I.A.W.A.; Othman, M.L.; Mokhlis, H. Improved Bacterial Foraging Optimization Algorithm with Machine Learning-Driven Short-Term Electricity Load Forecasting: A Case Study in Peninsular Malaysia. Algorithms 2024, 17, 510. [Google Scholar] [CrossRef]
  20. Nti, I.K.; Teimeh, M.; Nyarko-Boateng, O.; Adekoya, A.F. Electricity load forecasting: A systematic review. J. Electr. Syst. Inf. Technol. 2020, 7, 1–19. [Google Scholar] [CrossRef]
  21. Spiliotis, E. Time series forecasting with statistical, machine learning, and deep learning methods: Past, present, and future. In Forecasting with Artificial Intelligence: Theory and Applications; Springer Nature: Cham, Switzerland, 2023; pp. 49–75. [Google Scholar] [CrossRef]
  22. Pierre, A.A.; Akim, S.A.; Semenyo, A.K.; Babiga, B. Peak Electrical Energy Consumption Prediction by ARIMA, LSTM, GRU, ARIMA-LSTM and ARIMA-GRU Approaches. Energies 2023, 16, 4739. [Google Scholar] [CrossRef]
  23. Crujido, L.J.C.; Gozon, C.D.M.; Pallugna, R.C. Day-Ahead Electricity Load Forecasting with Multivariate Time Series. Mindanao J. Sci. Technol. 2023, 21, 95–115. [Google Scholar] [CrossRef]
  24. Ozdemir, O.; Yozgatligil, C. Forecasting performance of machine learning, time series, and hybrid methods for low-and high-frequency time series. Stat. Neerl. 2024, 78, 441–474. [Google Scholar] [CrossRef]
  25. Ma, Z.; Ye, C.; Li, H.; Ma, W. Applying support vector machines to predict building energy consumption in China. Energy Procedia 2018, 152, 780–786. [Google Scholar] [CrossRef]
  26. Ciampi, F.G.; Rega, A.; Diallo, T.M.; Pelella, F.; Choley, J.Y.; Patalano, S. Energy consumption prediction of industrial HVAC systems using Bayesian Networks. Energy Build. 2024, 309, 114039. [Google Scholar] [CrossRef]
  27. Casolaro, A.; Capone, V.; Iannuzzo, G.; Camastra, F. Deep Learning for Time Series Forecasting: Advances and Open Problems. Information 2023, 14, 598. [Google Scholar] [CrossRef]
  28. Tamayo-Urgilés, D.; Sanchez-Gordon, S.; Valdivieso Caraguay, Á.L.; Hernández-Álvarez, M. GAN-Based Generation of Synthetic Data for Vehicle Driving Events. Appl. Sci. 2024, 14, 9269. [Google Scholar] [CrossRef]
  29. Lim, B.; Zohren, S. Time-series forecasting with deep learning: A survey. Philos. Trans. R. Soc. A 2021, 379, 20200209. [Google Scholar] [CrossRef]
  30. Benidis, K.; Rangapuram, S.S.; Flunkert, V.; Wang, Y.; Maddix, D.; Turkmen, C.; Gasthaus, J.; Bohlke-Schneider, M.; Salinas, D.; Stella, L.; et al. Deep learning for time series forecasting: Tutorial and literature survey. ACM Comput. Surv. 2022, 55, 1–36. [Google Scholar] [CrossRef]
  31. Pannakkong, W.; Harncharnchai, T.; Buddhakulsomsiri, J. Forecasting Daily Electricity Consumption in Thailand Using Regression, Artificial Neural Network, Support Vector Machine, and Hybrid Models. Energies 2022, 15, 3105. [Google Scholar] [CrossRef]
  32. Lee, C.-M.; Ko, C.-N. Short-Term Load Forecasting Using Adaptive Annealing Learning Algorithm Based Reinforcement Neural Network. Energies 2016, 9, 987. [Google Scholar] [CrossRef]
  33. Alhmoud, L.; Abu Khurma, R.; Al-Zoubi, A.M.; Aljarah, I. A Real-Time Electrical Load Forecasting in Jordan Using an Enhanced Evolutionary Feedforward Neural Network. Sensors 2021, 21, 6240. [Google Scholar] [CrossRef]
  34. Pramanik, A.S.; Sepasi, S.; Nguyen, T.L.; Roose, L. An ensemble-based approach for short-term load forecasting for buildings with high proportion of renewable energy sources. Energy Build. 2024, 308, 113996. [Google Scholar] [CrossRef]
  35. Zuazo, I.Z.; Boussaada, Z.; Aginako, N.; Curea, O.; Camblong, H.; Sierra, B. Short-Term Load Forecasting of building electricity consumption using NARX Neural Networks model. In Proceedings of the 2021 6th International Conference on Smart and Sustainable Technologies (SpliTech), Bol and Split, Croatia, 8–11 September 2021. [Google Scholar] [CrossRef]
  36. Bourdeau, M.; Zhai, X.; Nefzaoui, E.; Guo, X.; Chatellier, P. Modeling and forecasting building energy consumption: A review of data-driven techniques. Sustain. Cities Soc. 2019, 48, 101533. [Google Scholar] [CrossRef]
  37. Alobaidi, M.H.; Chebana, F.; Meguid, M.A. Robust ensemble learning framework for day-ahead forecasting of household based energy consumption. Appl. Energy 2018, 212, 997–1012. [Google Scholar] [CrossRef]
  38. He, N.; Guo, J.; Li, Y.; Quan, Y.; Xiong, S.; Cheng, F.; Chu, D. An event-triggered stochastic model predictive control of indoor thermal environment for building energy management. J. Build. Eng. 2025, 109, 113026. [Google Scholar] [CrossRef]
  39. Zhao, X.; Yin, Y.; Zhang, S.; Xu, G. Data-driven prediction of energy consumption of district cooling systems (DCS) based on the weather forecast data. Sustain. Cities Soc. 2023, 90, 104382. [Google Scholar] [CrossRef]
  40. Golmohamadi, H. Data-Driven Approach to Forecast Heat Consumption of Buildings with High-Priority Weather Data. Buildings 2022, 12, 289. [Google Scholar] [CrossRef]
  41. Kemper, N.; Heider, M.; Pietruschka, D.; Hähner, J. Forecasting of residential unit’s heat demands: A comparison of machine learning techniques in a real-world case study. Energy Syst. 2025, 16, 281–315. [Google Scholar] [CrossRef]
  42. Jornaz, A.; Samaranayake, V.A. A Multi-Step Approach to Modeling the 24-hour Daily Profiles of Electricity Load using Daily Splines. Energies 2019, 12, 4169. [Google Scholar] [CrossRef]
  43. Rahman, S.M.; Rolando, V.P.E. Machine Learning Approach Applied in Electricity Load Forecasting: Within Residential Houses Context. ASHRAE Trans. 2015, 121, 1–8. [Google Scholar]
  44. Kialashaki, A.; Reisel, J.R. Forecasting United States’ industrial sector energy demand using artificial neural networks. Int. J. Energy Stat. 2014, 2, 207–226. [Google Scholar] [CrossRef]
  45. Al Shimmari, M.; Wallom, D. Short-term load forecasting using UK non-domestic businesses to enable demand response aggregators’ participation in electricity markets. In Proceedings of the 2023 IEEE PES Grid Edge Technologies Conference & Exposition (Grid Edge), San Diego, CA, USA, 10–13 April 2023. [Google Scholar] [CrossRef]
  46. Li, C.; Ding, Z.; Zhao, D.; Yi, J.Y.; Zhang, G. Building energy consumption prediction: An extreme deep learning approach. Energies 2017, 10, 1525. [Google Scholar] [CrossRef]
  47. Shine, P.; Scully, T.; Upton, J.; Murphy, M.D. Annual electricity consumption prediction and future expansion analysis on dairy farms using a support vector machine. Appl. Energy 2019, 250, 1110–1119. [Google Scholar] [CrossRef]
  48. Al-Suod, M.M.; Victor, B.; Valerii, T.; Olha, C.; Galina, S.; Zannon, M.; Dmytro, Z. Forecasting Energy Consumption of a Mining Plant Using Artificial Neural Networks. IEEE Access 2025, 13, 63237–63247. [Google Scholar] [CrossRef]
  49. Stoyanov, L.; Draganovsk, I. Application of ANN for forecasting of PV plant output power–Case study Oryahovo. In Proceedings of the 2021 17th Conference on Electrical Machines, Drives and Power Systems (ELMA), Sofia, Bulgaria, 1–4 July 2021; pp. 1–5. [Google Scholar] [CrossRef]
  50. Stoyanov, L.; Draganovska, I. Comparison of Hybrid Models for PV Power Output Forecasting—Application to Oryahovo, Bulgaria. In Proceedings of the 2023 18th Conference on Electrical Machines, Drives and Power Systems (ELMA), Varna, Bulgaria, 29 June 2023–1 July 2023; pp. 1–4. [Google Scholar] [CrossRef]
  51. Cao, M.; Wang, J.; Sun, X.; Ren, Z.; Chai, H.; Yan, J.; Li, N. Short-Term and Medium-Term Electricity Sales Forecasting Method Based on Deep Spatio-Temporal Residual Network. Energies 2022, 15, 8844. [Google Scholar] [CrossRef]
  52. Demsar, J.; Curk, T.; Erjavec, A.; Gorup, C.; Hocevar, T.; Milutinovic, M.; Mozina, M.; Polajnar, M.; Toplak, M.; Staric, A.; et al. Orange: Data Mining Toolbox in Python. J. Mach. Learn. Res. 2013, 14, 2349–2353. [Google Scholar]
Figure 1. Load profile of the investigated pig farm from 01.01.2023 to 31.12.2023.
Figure 1. Load profile of the investigated pig farm from 01.01.2023 to 31.12.2023.
Energies 18 04055 g001
Figure 2. Minimum, maximum, and average daily temperatures in Calarasi, Romania from 01.01.2023 to 31.12.2023.
Figure 2. Minimum, maximum, and average daily temperatures in Calarasi, Romania from 01.01.2023 to 31.12.2023.
Energies 18 04055 g002
Figure 3. A summary of the study methodology.
Figure 3. A summary of the study methodology.
Energies 18 04055 g003
Figure 4. Implementation of phases 3 and 4 from the methodology in Orange Data Mining.
Figure 4. Implementation of phases 3 and 4 from the methodology in Orange Data Mining.
Energies 18 04055 g004
Figure 5. Observed vs. predicted chart of the testing results for 1 h ahead (a), 8 h ahead (b), 16 h ahead (c), and 24 h ahead (d).
Figure 5. Observed vs. predicted chart of the testing results for 1 h ahead (a), 8 h ahead (b), 16 h ahead (c), and 24 h ahead (d).
Energies 18 04055 g005aEnergies 18 04055 g005b
Figure 6. Examples for relatively good 24 h ahead forecasting from: 25 January 2023 16:00 (a); 25 April 2023 00:00 (b); 25 June 2023 00:00 (c); 15 November 2023 07:00 (d).
Figure 6. Examples for relatively good 24 h ahead forecasting from: 25 January 2023 16:00 (a); 25 April 2023 00:00 (b); 25 June 2023 00:00 (c); 15 November 2023 07:00 (d).
Energies 18 04055 g006aEnergies 18 04055 g006b
Figure 7. An example with high relative errors of the forecasting models.
Figure 7. An example with high relative errors of the forecasting models.
Energies 18 04055 g007
Table 1. Pearson correlations between the power consumption 1 h to 24 h ahead and the selected features.
Table 1. Pearson correlations between the power consumption 1 h to 24 h ahead and the selected features.
FeaturePearson Correlation
MinMax
1Hour of the day−0.012 (12 h ahead)−0.445 (9 h ahead)
2Month of the year0.154 (24 h ahead)0.162 (1 h ahead)
3Average temperature0.374 (24 h ahead)0.396 (1 h ahead)
4Minimum temperature0.373 (24 h ahead)0.400 (1 h ahead)
5Maximum temperature0.362 (24 h ahead)0.385 (5 h ahead)
6Average relative humidity−0.240 (24 h ahead)−0.269 (5 h ahead)
7Minimum relative humidity−0.208 (24 h ahead)−0.238 (6 h ahead)
8Maximum relative humidity−0.161 (24 h ahead)−0.192 (1 h ahead)
9Average wind speed−0.124 (1 h ahead)−0.161 (21 h ahead)
10Minimum wind speed−0.077 (1 h ahead)−0.120 (24 h ahead)
11Maximum wind speed−0.068 (1 h ahead)−0.094 (23 h ahead)
12Current power consumption0.183 (13 h ahead)0.814 (1 h ahead)
1324 h ago power consumption0.143 (14 h ahead)0.705 (1 h ahead)
1448 h ago power consumption0.106 (14 h ahead)0.661 (1 h ahead)
1572 h ago power consumption0.066 (14 h ahead)0.618 (1 h ahead)
Table 2. Columns of the dataset.
Table 2. Columns of the dataset.
ColumnDescription
Metadata
1TimestampContains the date and time of each record
Features
2Month of the yearExtracted from the “Timestamp” using the function “month”
3Hour of the dayExtracted from the “Timestamp” using the function “hour”
4Tmin, °CThe minimum temperature for the day
5Tmax, °CThe maximum temperature for the day
6Tavg, °CThe average temperature for the day
7RHmin, %The minimum relative humidity for the day
8RHmax, %The maximum relative humidity for the day
9RHavg, %The average relative humidity for the day
10WindSpeedmin, m/sThe minimum wind speed for the day
11WindSpeedmax, m/sThe maximum wind speed for the day
12WindSpeedavg, m/sThe average wind speed for the day
13Pcons, kWThe power consumption for the current hour
14Pt−1, kWThe power consumption 1 h ago
85Pt−72, kWThe power consumption 72 h ago
Targets
86Pt+1, kWThe target power consumption 1 h ahead
109Pt+24, kWThe target power consumption 24 h ahead
Table 3. Optimal parameters and R2 measures of the investigated models.
Table 3. Optimal parameters and R2 measures of the investigated models.
ModelOptimal ParametersR2
k-NNNumber of neighbors: 14
Metric: Euclidean
Weight: Uniform
0.723
RFNumber of trees: 17
Do not split subsets smaller than 5
0.711
LRFit intercept: checked
Regularization: Ridge regression
Regularization strength: 0.01
0.722
SVMType: SVM
Cost (C): 1.5
Regression loss epsilon: 0.20
Kernel: Polynomial
g: auto
c: 5.00
d: 1.3
Numerical tolerance: 0.001
Iterations limit: 200
0.650
ANNNeurons in hidden layers: 100
Activation: Logistic
Solver: Adam
Regularization: 0.0001
Maximal number of iterations: 200
0.738  1
1 Model with highest R2 value.
Table 4. Results from the evaluation of the 24 models for n hours ahead forecasting.
Table 4. Results from the evaluation of the 24 models for n hours ahead forecasting.
ModelNMAE, %NRMSE, %MAPE, %R2
ANN 1 h ahead18.1823.829.490.74
ANN 2 h ahead16.9022.6510.490.67
ANN 3 h ahead17.3023.1010.540.67
ANN 4 h ahead17.3123.1610.660.66
ANN 5 h ahead17.8323.9310.640.66
ANN 6 h ahead16.9422.9610.740.65
ANN 7 h ahead16.5922.2910.790.65
ANN 8 h ahead17.5523.3510.850.65
ANN 9 h ahead18.4224.2611.090.65
ANN 10 h ahead18.2524.0410.990.66
ANN 11 h ahead18.7024.5710.970.66
ANN 12 h ahead18.1623.9610.990.65
ANN 13 h ahead18.3324.1010.990.65
ANN 14 h ahead17.7123.0911.160.65
ANN 15 h ahead18.1323.5111.330.65
ANN 16 h ahead17.6522.8611.300.65
ANN 17 h ahead17.6422.8111.350.64
ANN 18 h ahead17.9323.1711.270.64
ANN 19 h ahead17.9423.2511.400.64
ANN 20 h ahead18.7124.2611.480.64
ANN 21 h ahead18.5824.1711.480.64
ANN 22 h ahead19.0024.7311.370.64
ANN 23 h ahead18.9324.6111.340.65
ANN 24 h ahead17.0422.1911.260.65
Table 5. Summary of the comparison with previous studies.
Table 5. Summary of the comparison with previous studies.
SourceType of ForecastingFeaturesModelsMeasures
This study24 h ahead agricultural consumer forecastinglast 72 h consumption, daily temperature, relative humidity, and wind speed24 ANN modelsMAPE between 9.49% and 11.49%
NMAE between 16.59% and 19.00%
NRMSE between 22.19% and 24.73%
R2 between 0.64 and 0.74
Small-scale forecasting
Zuazo et al. (2021) [35]24 h ahead building electricity consumption forecastingload profile, temperature, day typeNARX neural networkDaily MAPE between 9.63% to 33.05%
Rahman, and Rolando (2015) [43]24 h ahead domestic load forecastingday of the year, hour of the day, temperature, load profileANN
SVR
GP
MAPE 17.09–28.54%
14.90–25.09%
18.32–34.72%
Ogliari et al. (2021) [8]24 h ahead wind power forecastmany meteorological properties, wind power data, physical power dependencyHybrid physical-ANNNMAE 35.32%
NRSME 42.07%
Large-scale forecasting
Shimmariand Wallom (2023) [45]24 h ahead electrical energy forecasting in different sectors—industrial, retail, entertainment, social, and otherelectrical consumption, hour of the day, day of the week, month of the year, season, public holiday, meteorological dataRR, RF, GBR2 between 0.91 and 0.98 for the different types of consumers and towns
Pannakkong et al. (2022) [31]Forecasting of the daily electrical consumption in ThailandMoving averages, lagged consumption variables, temperature, holidaysMLP, ANN, SVM, hybrid models, sequential grid search1.57% MAPE for the hybrid model
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Evstatiev, B.; Valov, N.; Gabrovska-Evstatieva, K.; Valova, I.; Kaneva, T.; Mihailov, N. 24 Hours Ahead Forecasting of the Power Consumption in an Industrial Pig Farm Using Deep Learning. Energies 2025, 18, 4055. https://doi.org/10.3390/en18154055

AMA Style

Evstatiev B, Valov N, Gabrovska-Evstatieva K, Valova I, Kaneva T, Mihailov N. 24 Hours Ahead Forecasting of the Power Consumption in an Industrial Pig Farm Using Deep Learning. Energies. 2025; 18(15):4055. https://doi.org/10.3390/en18154055

Chicago/Turabian Style

Evstatiev, Boris, Nikolay Valov, Katerina Gabrovska-Evstatieva, Irena Valova, Tsvetelina Kaneva, and Nicolay Mihailov. 2025. "24 Hours Ahead Forecasting of the Power Consumption in an Industrial Pig Farm Using Deep Learning" Energies 18, no. 15: 4055. https://doi.org/10.3390/en18154055

APA Style

Evstatiev, B., Valov, N., Gabrovska-Evstatieva, K., Valova, I., Kaneva, T., & Mihailov, N. (2025). 24 Hours Ahead Forecasting of the Power Consumption in an Industrial Pig Farm Using Deep Learning. Energies, 18(15), 4055. https://doi.org/10.3390/en18154055

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop