ArticlePDF Available

Short-Term Occupancy Forecasting for a Smart Home Using Optimized Weight Updates Based on GA and PSO Algorithms for an LSTM Network

Authors:
  • University of Sfax- Université de Picardie Jules Verne

Abstract and Figures

In this work, we provide a smart home occupancy prediction technique based on environmental variables such as CO2, noise, and relative temperature via our machine learning method and forecasting strategy. The proposed algorithms enhance the energy management system through the optimal use of the electric heating system. The Long Short-Term Memory (LSTM) neural network is a special deep learning strategy for processing time series prediction that has shown promising prediction results in recent years. To improve the performance of the LSTM algorithm, particularly for autocorrelation prediction, we will focus on optimizing weight updates using various approaches such as Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). The performances of the proposed methods are evaluated using real available datasets. Test results reveal that the GA and the PSO can forecast the parameters with higher prediction fidelity compared to the LSTM networks. Indeed, all experimental predictions reached a range in their correlation coefficients between 99.16% and 99.97%, which proves the efficiency of the proposed approaches.
Content may be subject to copyright.
Citation: Mahjoub, S.; Labdai, S.;
Chrifi-Alaoui, L.; Marhic, B.;
Delahoche, L. Short-Term Occupancy
Forecasting for a Smart Home Using
Optimized Weight Updates Based on
GA and PSO Algorithms for an LSTM
Network. Energies 2023,16, 1641.
https://doi.org/10.3390/en16041641
Academic Editors: Paweł Piotrowski,
Grzegorz Dudek and Dariusz
Baczy´nski
Received: 24 December 2022
Revised: 21 January 2023
Accepted: 24 January 2023
Published: 7 February 2023
Copyright: © 2023 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
energies
Article
Short-Term Occupancy Forecasting for a Smart Home Using
Optimized Weight Updates Based on GA and PSO Algorithms
for an LSTM Network
Sameh Mahjoub, Sami Labdai , Larbi Chrifi-Alaoui * , Bruno Marhic and Laurent Delahoche
Laboratory of Innovative Technology (LTI, UR-UPJV 3899), University of Picardie Jules Verne,
80000 Amiens, France
*Correspondence: larbi.alaoui@u-picardie.fr
Abstract:
In this work, we provide a smart home occupancy prediction technique based on environ-
mental variables such as CO
2
, noise, and relative temperature via our machine learning method and
forecasting strategy. The proposed algorithms enhance the energy management system through the
optimal use of the electric heating system. The Long Short-Term Memory (LSTM) neural network
is a special deep learning strategy for processing time series prediction that has shown promising
prediction results in recent years. To improve the performance of the LSTM algorithm, particularly
for autocorrelation prediction, we will focus on optimizing weight updates using various approaches
such as Genetic Algorithm (GA) and Particle Swarm Optimization (PSO). The performances of the
proposed methods are evaluated using real available datasets. Test results reveal that the GA and the
PSO can forecast the parameters with higher prediction fidelity compared to the LSTM networks.
Indeed, all experimental predictions reached a range in their correlation coefficients between 99.16%
and 99.97%, which proves the efficiency of the proposed approaches.
Keywords: deep neural networks; LSTM; time series prediction; optimisation; GA; PSO
1. Introduction
One of the most efficient systems to save energy is to reduce a building’s heating
and cooling load, which is mostly caused by heat transfer over its envelope. Smart build-
ings are required to provide permanent, healthy and comfortable indoor environments,
independent of exterior weather conditions [
1
,
2
]. Indeed, the major part of energy in
such buildings is used by Heating, Ventilation, and Air Conditioning (HVAC) systems,
which have a significant influence on both home comfort and the environment. Therefore,
managing these systems in residential structures should be tackled in order to increase
energy efficiency through improved energy planning [
3
]. One of the most essential features
of smart buildings is their ability to self-control the systems used to maintain the comfort
of the inside atmosphere while also minimizing energy use. Because HVAC systems are
the primary source of energy consumption in buildings, intelligent HVAC system control is
a current trend in research studies that necessitates the insertion of occupancy information
into the control process [
4
]. Moreover, the rise of smart buildings, as well as the pressing
need to reduce energy use, has rekindled interest in building energy demand prediction.
Intelligent controls are a solution for optimizing power consumption in buildings without
reducing interior comfort [
5
]. For example, in [
6
], a Model Predictive Control (MPC) is
developed to obtain a hybrid HVAC control with energy savings while maintaining of
thermal comfort. Building energy consumption prediction strives to achieve various goals
such as evaluating the impact of energy-saving interventions and assume energy demands
based on regular requirements. It can anticipate the fluctuations in power consumption of
certain events at specfic times that may modify the systems’ customary energy usage [
7
].
Furthermore, based on detailed and extensive studies, it was concluded that occupant
Energies 2023,16, 1641. https://doi.org/10.3390/en16041641 https://www.mdpi.com/journal/energies
Energies 2023,16, 1641 2 of 18
behavior is one of the most significant elements affecting residential structure energy use.
Occupancy behavior includes activities such as turning on and off lights, switching on and
off heating and cooling systems, and regulating the temperature.
Previous research has shown that various occupant demands and behaviors necessi-
tate specific technological solutions, which may induce or change behavior patterns, and
that occupant behavior affects the flexibility and deployment of technologies. However, the
lack of comprehensive knowledge of occupant behaviors in residential building leads to
misunderstanding and inaccurate decisions in both technical design and policy making [
8
].
The context of our research is energy efficiency. In recent years, energy efficiency has been
realized by improving the thermal performances of the building envelope’s insulation layer.
The research strategies aim to permanently adjust the comfort conditions to the living
situation, as well as to ensure greater energy supervision and management within the
smart buildings. To achieve this, it is important to automatically characterize the activities
of the building’s residents. The significant challenge in today’s new technical design for
smart buildings is understanding customer behaviors [
9
]. In the future, our occupancy pre-
diction approach will guarantee energy savings in a smart building environment. Ambient
intelligence is an important prerequisite for improving human quality of life.
The rest of this work is structured as follows: Section 2explains the technique em-
ployed in this project. Firstly, it offers the overall framework of the LSTM forecasting model.
Next, it presents, step-by-step, the implementation procedure of the suggested technique; it
includes descriptions of database processing, the parameters, and the assessment indicators.
Section 3features experimental details, as well as an analysis of the results. Finally, Section 4
provides some conclusions and future works.
2. Related Works
Building energy consumption is influenced by the thermal insulation, heating, ven-
tilation, air conditioning, lighting, and occupants’ behaviors [
10
]. Characterising human
activity has become an increasingly prominent application of machine learning in a many
disciplinary fields. Indeed, for the past two decades, researchers from several application
fields have investigated activity recognition by developing a variety of methodologies
and techniques for each of these key tasks. The prediction of human behaviour repre-
sents a key challenge, and many approaches have already been proposed in the industrial,
medical, home care, and energy efficiency domains, and many others [
11
]. For example,
in [
12
], an end-to-end technique for forecasting multi-zone interior temperatures using
LSTM-based sequence to sequence has been introduced. The goal of this prediction is to
improve the building’s energy efficiency while maintaining occupant comfort. Authors
in [
13
] also proposed implementing simple XGBoost machine learning methods to predict
the interior room temperature, relative humidity, and CO
2
concentration in a commercial
structure. The proposed technique presents a practical option because it does not require
a large data set for training. Additionally, these models eliminate the necessity for multiple
sensors, which create sophisticated and expensive networks. In [
14
], a short-term load
consumption forecasting approach for nonresidential buildings using artificial occupancy
attributes and based on Support Vector Machines (SVM) has been developed. However, the
determination of human behaviour in this work is imprecise. The authors in [
15
], present
a load forecasting model for office buildings based on artificial intelligence and regres-
sion analysis to effectively extract the cooling and heating load characteristics. However,
the model assumes that the building’s internal disturbing influences are steady. In [
16
],
an optimal deep learning LSTM model for forecasting electricity consumption utilizing
feature selection and a Genetic Algorithm (GA) is implemented. The goal of this suggested
technique is to determine the optimal time delays and number of layers for LSTM architec-
ture’s predictive performance optimisation, as well as to minimize overfitting, resulting
in more accurate and consistent forecasting. Furthermore, recently, machine learning ap-
proaches based on Artificial Neural Networks (ANNs) have been widely used to forecast the
thermal behavior of modern buildings for modeling HVAC systems.
As an example
, in [
17
],
Energies 2023,16, 1641 3 of 18
four comparative models have been developed and refined to forecast the inside tempera-
ture of a public building. These proposed techniques can be adapted to various scenarios.
However, we must keep in mind that the adoption of an online technique such as OMLP
(Online MultiLayer Perceptron) might be influenced by outliers. The authors also in [
18
]
tackle a non-linear autoregressive neural network methodology for forecasting interior
air temperature in the short and medium terms. Realistic artificial temperature data are
used to train the proposed model. The goal of this strategy is to make up for the lack of
real-world data collected by sensors in energy experiments. Thus, an improved technique
integrating real-time information and addressing possible noise or missing data is necessary
to prove the reliability of the proposed strategy in real scenarios. Differently from previous
research solutions, which typically rely on a basic and simple LSTM model, we designed
an optimised architecture exploiting GA and PSO algorithms to update weights and select
the optimal values that give the best prediction precision and reduce model overfitting.
As a matter of fact, these two methods (PSO and GA) were chosen due to their good
reputation in the literature, and they add a stochastic approach to the neural network that
resulted in better performance. We compared our results with the LSTM method, which
is considered the best neural approach in time series forecasting, as proven in previously
conducted works based on LSTM. As an example, Ref. [
19
] introduces comprehensive
comparative studies that include several deep learning methods used in forecasting extra-
short-term Plug-in Electric Vehicle (PEV) charging loads such as ANN, RNN, LSTM, gated
recurrent units (GRU), and bi-directional long short-term memory (Bi-LSTM). Among
these approaches, the LSTM model outperforms the others, and it is competent in giving
satisfactory results.
3. Materials and Methodologies
3.1. Data Description
A year of data were collected from a smart home between 1 January 2018 and
31 December 2018
with a resolution of 10 min. Each room of the house was equipped
with several sensors, including set points of the room temperature, CO
2
concentration,
pressure, noise, lighting, and occupancy:
CO2values of a floor of house;
Outdoor temperature;
Noise values.
Pressure values.
The concentration of these factors varied depending on the room; for example, the
concentration of CO
2
in the living room differed from that in the office or the kitchen.
Moreover, the CO
2
variable does not have a direct relationship with the interior temperature.
However, because CO
2
is a strong predictor of room occupancy, it may have a direct impact
on the indoor temperature during the cold season. The variation in the CO
2
, the noise, and
the temperature are given by Figures 13, respectively.
3.2. Data Pre-Processing
The prediction of building energy use based on an occupant behavior assessment is
a multivariate time series issue in which sensors create data that may contain uncertainty, re-
dundancy, missing values, non-unified time intervals, noise, and so on. Traditional machine
learning techniques struggle to reliably anticipate power usage due to unpredictable trend
components and seasonal trends. The collection of suitable data contributes to efficiently
addressing prediction challenges. As a result, several considerations should be made [20].
So, numerous techniques have been proposed to obtain meaningful inferences and insights;
nevertheless, these solutions are still in the early phases of development. Therefore, current
research is focusing on improving the procedures for processing and cleaning the collected
data in order to produce accurate prediction [21].
Energies 2023,16, 1641 4 of 18
0 1000 2000 3000 4000 5000 6000
Time (min)
400
600
800
1000
1200
1400
1600
CO2 concentration (ppm)
Figure 1. Overview of the CO2set points.
0 1000 2000 3000 4000 5000 6000
Time (min)
30
35
40
45
50
55
60
65
70
Noise (dB)
Figure 2. Overview of the room noise set points.
0 1000 2000 3000 4000 5000 6000
Time (min)
-10
0
10
20
30
Temperature (°C)
Figure 3. Overview of the room temperature set points.
Energies 2023,16, 1641 5 of 18
3.2.1. Missing Values
Many real-world datasets may include missing values for various reasons. So, training
a model using a dataset that has a large number of missing values can have a consider-
able influence on the machine learning model’s quality. To prevent information leakage,
missing data were interpolated using Exponential Moving Average (EMA). This method is
described in [22].
3.2.2. Normalisation
The data for a sequence prediction problem probably need to be normalised to the
range of [
1, +1] when training a neural network such as a long short-term memory
recurrent neural network. When a network is fit on unscaled data, it is possible for large
inputs to slow down the learning and convergence of that network and, in some cases,
prevent the network from effectively learning the problem. The Z-score is used for the
normalization, and the formula is given as [23]:
ZScore =xxmean
xσ
(1)
where:
xσ=s1
n1
n
i=1
(xixmean )2(2)
xmean =1
n
n
i=1
xi(3)
and nis the number of time periods.
4. Modeling Approaches
The main aim of this research is to investigate the performance of various occupancy
forecasting strategies to identify the most accurate ones. In fact, we choose three distinct
methods, based on a deep learning method: GA-LSTM and PSO-LSTM as optimiser based-
models and LSTM as a simple deep learning technique.
4.1. LSTM Architecture
Recurrent Neural Networks (RNNs) struggle with learning long-term dependencies.
LSTM-based models are an extension of RNNs that can solve the vanishing gradient prob-
lem and exploding gradient problem of RNNs and which perform more favorably than
RNN on longer sequences. LSTM models basically expand the memory of RNNs to allow
them to maintain and learn long-term input dependencies properly. This memory expan-
sion can recall data for a longer amount of time, allowing them to read, write, and delete
information from their memories. The LSTM memory is referred to as a “gate” structure
because it has the power to decide whether to keep or discard memory information [
24
,
25
].
A gate is a way of transferring information selectively that includes a sigmoid neural net-
work layer and a bitwise multiplication operations. The LSTM process and mathematical
representation consists mostly of the four phases listed below [26]:
1. Deciding to remove useless information:
ft=σ(wf[ht1,Xt] + bf)(4)
where
ft
represents the forget gate and
σ
is the sigmoid activation function and it can be
defined as:
σ(x) = (1+ex)1(5)
This function is utilized for this gate to decide what information should be removed from
the LSTM’s memory. This decision is mainly dependent on the values of the previous
hidden layer output
ht1
and the input
xt
. The output
ft
takes a value between 0 and 1,
Energies 2023,16, 1641 6 of 18
where 0 means fully discard the learned value and 1 means preserve the entire value.
wf
is
the recurrent weight matrix, while bfis the bias term.
2. Updating information:
it=σ(wi[ht1,Xt] + bi)(6)
˜
ct=tanh(wc[ht1,Xt] + bc)(7)
in which
it
is the input gate and denotes if the value needs to be updated or not and
˜
ct
designates a vector of new candidate values that will be added into the LSTM memory.
Indeed, the sigmoid layer determines which values require updating, and the
tanh
layer
generates a vector of new candidate values.
3. Updating the cell status:
ct=ftct1+it˜
ct(8)
where
ct
and
ct1
represent the current and previous memory states, respectively. This
phase is carried out by updating the previous cell’s state, multiplying the old value by
ft
, deleting the information to be forgotten, and adding
it˜
ct
to generate a new candi-
date value.
4. Outputting information:
ot=σ(wo[ht1,Xt] + bo)(9)
ht=ottanh(ct)(10)
where
ot
is the output gate and
ht
is the current hidden layer outputs whose representations
are a value between
1 and 1. This step defines the ultimate result. To begin, a sigmoid
layer, represented by
ot
, selects which part of the cell state will be output. The cell state is
then processed by the
tanh
activation function and multiplied by the sigmoid layer output
to create the output.
A typical LSTM network is seen in Figure 4. LSTM layers are composed of memory
blocks rather than neurons. These memory blocks are interconnected across the layers,
and each block may contain one or more recurrently connected memory elements or cells.
As indicated in this figure (yellow shaded area), the flow of information is managed by
three types of gates: the forget gate ( ft), the input gate (It), and the output gate (Ot).
4.2. LSTM Model Settings and Optimisation
Optimizing an LSTM model entails establishing a set of model parameters that yields
the best model performance. The number of units and hidden layers and the optimiser,
activation function, batch size, and learning rate are typical examples of such elements. So,
the choice of a suitable algorithm is critical to success in addressing any type of optimisation
issue. Wolpert and Macready demonstrated this in their “no free lunch” theorem, which
states that no method is perfect for solving every type of optimisation issue. As a result,
the basic idea is to select an effective optimisation approach to solve a given hand-in
optimisation problem with less computational effort and a greater rate of convergence [
27
].
4.2.1. Genetic Algorithm (GA)
Genetic algorithms (GAs) have been around for over four decades. GAs are heuristic
search algorithms that provide answers to optimisation and search problems. The name
“GA” is derived from the biological terminology of natural selection, crossing, and muta-
tion. In reality, GAs simulate natural evolutionary processes [
28
]. Thus, a literature review
provides many instances of using GA in the analysis and optimisation of various elements
from many sectors, such as energy systems. Moreover, GA can be used for the optimisa-
Energies 2023,16, 1641 7 of 18
tion of ANN predictions or for the optimisation of ANN architecture [
29
]. GAs provide
a general and global optimisation process. Since the GA is a global search technique, it will
be less vulnerable to local search flaws such as back-propagation. The GA may be used to
design the network’s architecture as well as its weight. There have been various attempts
to utilise GAs to determine the architecture of a neural network and the link weights for
a fixed architecture network. Many attempts have been made to use a GA to determine the
architecture as well as the link weights.
*
*
*
+
σσ σ
tanh
tanh
Ct1
ht1
It
Ot
Cel l state ht
ht
Ct
ft~
Ct
Y
LSTM
LSTM
LSTM
x1
x2
xn
xt
Inputs Hidden layer
Output
Figure 4. A typical Long Short-Term Memory (LSTM) network topology.
4.2.2. Particle Swarm Optimization (PSO)
The particle swarm optimisation (PSO) method is a swarm-based stochastic optimi-
sation approach introduced by Eberhart and Kennedy (1995). This technique replicates
the social behavior of birds inside a flock to reach the food objective. A swarm of birds
approaches their food goal using a combination of personal and communal experience.
They constantly update their position based on their best position as well as the best
position of the entire swarm, and reunite themselves to form an ideal configuration [
30
].
This nature-inspired method is becoming increasingly popular due to its reliability and
easy implementation. In addition, classical neural networks do not operate well when
forecasting parameters within short intervals. Moreover, because of their dependability,
hybrid ANNs based on particle swarm optimisation have been frequently advocated in
literature reviews. The PSO method, like the GA, is used as an optimisation technique
within neural networks to optimise ANN forecasts or ANN architecture (the number of
layers, neurons, etc.) [31]. Thus, we use this algorithm to optimise the weights.
4.3. LSTM Network Parameters
The network’s trainable parameters, known as the trainable weights, influence the
network’s complexity. They are represented in LSTMs via connections between the input,
hidden, and output layers, as well as internal connections. The following formula is used
to calculate the Number of Trainable Weights (NTW) of a neural network with
x
inputs,
youtputs, and zLSTM cells in the hidden layer:
NTW =4xz +4zz +4z+yz +y(11)
Energies 2023,16, 1641 8 of 18
where:
- 4xz: the connection weights between the input layer and the hidden layer;
- 4zz: the hidden layer’s recursive weights;
- 4z: the hidden layer ’s bias;
-yz: the connection weights between the hidden layer and the output layer;
-y: the output layer ’s bias.
Choosing ideal neural network settings can frequently imply the difference between
mediocre and peak performance. However, there is limited information in the literature on
the selection of different neural network parameters
x
,
y
, and
z
; it requires the expertise
of professionals.
4.4. Train–Validation–Test dataset
The one-year target variables were divided into three datasets: the first served as
the training set, the second served as the test set, and depending on the length of the
output sequence, random samples drawn from the last part served as the validation
set. So, for the validation, we use cross-validation, which is a popular data resampling
approach for estimating the true forecasting prediction error of models and tuning model
parameters. This technique evaluates the generalization capabilities of prediction models
and prevents over-fitting. It is the process of generating numerous train–test splits from
the training data, which are then applied to adjust the model [
32
] .
k
-fold cross-validation
is identical to repeated random sub-sampling, but the sampling is performed in such
a manner that no two test sets overlap. The available learning set is divided into
k
disjoint
subsets of about equivalent size. Indeed, each time, one of the
k
subsets is utilised as the
validation/test batch, while the remaining (
k
1) subsets are combined to form the training
set. The total efficacy of the model is calculated by averaging the error estimation over all
k
trials. Each sample is placed in a validation/test set precisely once and in the training
set (
k
1) times [
33
]. Figure 5illustrates this process as a popular evaluation mechanism in
machine learning.
kk - 1
123 4
1st iteration
kk - 1
1 3 4
2nd iteration
kk - 1
124
3rd iteration
k- 1
123 4
kth iteration
1
2
3
k
Validation Training
Figure 5. k-fold cross-validation.
We train the LSTM with various architectures for 12-h forecasting of thermal parame-
ters such as CO
2
, noise, and temperature. As a result, the window size of the input and
output parameters is determined by the time scale of the chosen parameter prediction. We
apply the ADAM optimiser, which is one of the optimisation methods employed in deep
learning. The learning rate is fixed to 0.01 and gradually drops after every 50 epochs. We
train the LSTM with 60, 60, and 100 hidden units for the forecasting of the CO
2
, the noise,
and the temperature, respectively. The window size of the input and output parameters
depends on the time scale of the load prediction. The validation and training results of
each parameter are illustrated in Figures 68.
Energies 2023,16, 1641 9 of 18
01234567
Day
-1
-0.5
0
0.5
1
CO2
Observed
Validation
Figure 6. Training and validation of the CO2data.
01234567
Day
-1.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
Noise
Observed
Validation
Figure 7. Training and validation of the noise data.
4.5. Evaluation Metrics
This study uses the Root Mean Square Error (
RMSE
) as the loss function and the
Mean Absolute Error (
MAE
) and the Correlation Coefficient (
CC
) to evaluate the various
performance measures. These indicators are measurements of the anticipated value’s
departure from the actual data, and they indicate the prediction’s overall inaccuracy. The
corresponding definition of each indicator is given by the following as [34]:
RMSE =v
u
u
t
1
N
N
i=1
(yi˜
yi)2(12)
Energies 2023,16, 1641 10 of 18
MAE =N
i=1|yi˜
yi|
N(13)
CC =N
i=1(˜
yi¯
p)(yi¯
yi)
qN
i=1(˜
yi¯
p)2N
i=1(yi¯
yi)2
(14)
where
yi
and
˜
yi
represent the real value and the forecasted value at the time t,
N
denotes
the total time step, and ¯
yiand ¯
pare the average of the real value and the forecasted value,
respectively. The smaller the values of
RMSE
and
MAE
, the smaller the deviation of the
projected outcomes from the actual values. A value of
CC
closer to 1 indicates lower errors
and a more accurate prediction.
Figure 8. Training and validation of the temperature data.
5. Experimental Results
5.1. Parameters Forecasting
We show in this research a forecast of the thermal characteristics of a smart house
outfitted with various types of sensors. The fundamental architecture of LSTM networks is
predetermined and immutable; each LSTM unit has a vector input of
n
values, including
the current value of the specified parameters (CO
2
, noise, and temperature) at time
t=
0 as
well as the past values. We create three neural networks with various designs, each one
adapted to the predicting parameter. After 10 min, these neural networks can forecast. We
can anticipate the full period of the required horizon by repeating the process and selecting
the appropriate parameters for these models.
5.2. CO2Forecasting
In the first experiment, we give the CO
2
prediction of a house for 12 h. Figures 911
show the predicted results obtained by the LSTM, the GA-LSTM, and the PSO-LSTM
algorithms, respectively. As shown, the predicted results are closer to the real data values
and the RMSE of each technique is quite low, which proves the forecasting performance of
the suggested strategies.
Energies 2023,16, 1641 11 of 18
Figure 9. CO2forecasting by LSTM.
Figure 10. CO2forecasting by GA-LSTM.
Energies 2023,16, 1641 12 of 18
Figure 11. CO2forecasting by PSO-LSTM.
5.3. Noise Forecasting
The second experiment also illustrates the noise prediction results for 12 h.
Figures 1214 show the findings with the error rate of the LSTM, the GA-LSTM, and
the PSO-LSTM models. It appears that each model’s curve prediction retains the shape of
the real data curve.
Figure 12. Noise forecasting by LSTM.
Energies 2023,16, 1641 13 of 18
0 24 48
Time (hour)
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
Noise
RMSE = 0.03
Observed
Forecasted
Figure 13. Noise forecasting by GA-LSTM.
0 24 48
Time (hour)
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
Noise
RMSE = 0.026
Observed
Forecast
Figure 14. Noise forecasting by PSO-LSTM.
5.4. Temperature Forecasting
The third experiment shows the temperature forecasted results for 12 h. Figures 1517
depict the results with the RMSE value of the LSTM, the GA-LSTM, and the PSO-LSTM
approaches. Likewise, each model’s curve prediction looks to keep the form of the real
data curve.
Energies 2023,16, 1641 14 of 18
0 24 48 72 96 120
Time (hour)
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
Temperature
RMSE = 0.028 Observed
Forecasted
Figure 15. Temperature forecasting by LSTM.
0 24 48 72 96 120
Time (hour)
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
temperature
RMSE = 0.024
Observed
Forecasted
Figure 16. Temperature forecasting by GA-LSTM.
Energies 2023,16, 1641 15 of 18
0 24 48 72 96 120
Time (hour)
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
temperature
RMSE = 0.007 Observed
Forecasted
Figure 17. Temperature forecasting by PSO-LSTM.
5.5. Analysis of Results
This work basically assesses the performance of the suggested model from two angles:
precision and running time. Tables 13provide the various performance measures for
testing predictions on the studied building.
We can see that the implemented approaches produce quite excellent results, and the
predicted findings are precise and dependable.
Tables 13reveal that the two performance metrics,
RMSE
and
MAE
, have small
values. These predictions are fairly close and representative to the real data. The correlation
coefficient (
CC
) is also very close to 1, which proves the high precision of the forecasting
strategies. As indicated in the tables and figures of forecasting results, the simple LSTM
model without optimisation gives the worst results compared with the GA-LSTM and the
PSO-LSTM techniques. We emphasize that the experimental results of the CO
2
prediction
show that the GA-LSTM outperforms the PSo-LSTM and the LSTM models with
RMSE
s of
0.0135, 0.0185, and 0.0281 and
CC
s of 99.80%, 99.62%, and 99.16% for GA-LSTM,
PSO-LSTM
,
and LSTM, respectively. For noise and temperature prediction, the performance of the PSO-
LSTM outperforms the GA-LSTM in terms of
RMSE
and
CC
. Overall, we have successfully
shown that the proposed optimisation techniques (GA-LSTM and PSO-LSTM networks)
may successfully extract relevant information from noisy human behavior data.
The statistical analysis of the obtained results shows that the proposed model tuned by
the two evolutionary metaheuristic search algorithms (GA and PSO) provides more precise
results than the benchmark LSTM model, whose parameters were established through
limited experience and a discounted number of experiments.
Table 1. Performance criteria of the CO2prediction.
Algorithms LSTM GA-LSTM PSO-LSTM
RMSE 0.0281 0.0135 0.0185
MAE 0.0102 0.0039 0.0061
CC 0.9916 0.9980 0.9962
Energies 2023,16, 1641 16 of 18
Table 2. Performance criteria of the noise prediction.
Algorithms LSTM GA-LSTM PSO-LSTM
RMSE 0.0405 0.0290 0.0256
MAE 0.0097 0.0070 0.0080
CC 0.9942 0.9970 0.9978
Table 3. Performance criteria of the temperature prediction.
Algorithms LSTM GA-LSTM PSO-LSTM
RMSE 0.0275 0.0243 0.0070
MAE 0.0063 0.0075 0.0017
CC 0.9968 0.9974 0.9997
6. Conclusions
In this work, we have proposed two optimised metaheuristic algorithms based on the
LSTM architecture for dealing with occupancy forecasting in the context of smart buildings.
The GA-LSTM and PSO-LSTM models give very satisfactory prediction results with a high
level of precision and reliability compared with the LSTM forecasting results. The choice of
these two methods (PSO and GA) is based on their reputation in literature. A comparison
shows that the implementation of the two metaheuristic algorithms (GA and PSO) for
the optimal configuration of occupancy forecasting derived an optimal LSTM model that
performs significantly better than the benchmark models, including other machine learning
approaches such as the basic LSTM model. The predicted values have been used to check
the presence of residents and then control real electrical consumption. This was carried
out to prove that the optimised LSTM can decrease power consumption, improve security,
and maintain comfort for the occupants. A potential field for future research would be
to perform thermal parameters forecasting, using recurrent neural networks, for various
construction such as hospitals, hotels, and public establishments. It would be worthwhile
to investigate whether a recurrent neural network can maintain such a high accuracy to
forecast thermal features and room occupancy rates in a smart building. Thus, future
studies will also focus on the deployment and integration of various hybrid optimisation
algorithms in recurrent neural networks such as the LSTM model in order to select the best
architecture, weights, and learning rate in order to achieve greater energy savings in the
building energy management system. As a result, our findings provide a solid foundation
for future research aimed at providing a more accurate assessment of building occupancy.
Nonetheless, the current findings will provide a basis for occupancy prediction, which
might be used to enhance our context-driven approaches for managing active building
systems such as the HVAC, lighting, and shading systems. Again, a forecasting model
for thermal characteristics and room occupancy rates with a low estimation error would
help energy producers in making operational, tactical, and strategic decisions. Finally,
better building load forecasting allows the implementation of the real-time management of
smart buildings.
Author Contributions:
Conceptualization, L.C.-A. and B.M.; methodology, S.M., B.M. and L.D.; soft-
ware, S.M. and S.L.; validation, S.M. and L.C.-A.; formal analysis, L.D. and L.C.-A.; investigation, S.M.
and S.L.; resources, B.M. and L.D.; data curation, B.M. and L.D.; writing—original draft preparation,
S.M.; writing—review and editing, L.C.-A. and S.L.; visualization, S.M.; supervision, L.C.-A. and
L.D.; project administration, B.M., L.D. and L.C.-A.; funding acquisition, B.M. All authors have read
and agreed to the published version of the manuscript.
Funding: This research received no external funding.
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Conflicts of Interest: The authors declare no conflict of interest.
Energies 2023,16, 1641 17 of 18
References
1. Stazi, F. Thermal Inertia in Energy Efficient Building Envelopes; Butterworth-Heinemann: Oxford, UK, 2017.
2.
Lotfabadi, P.; Hancer, P. A comparative study of traditional and contemporary building envelope construction techniques in
terms of thermal comfort and energy efficiency in hot and humid climates. Sustainability 2019,11, 3582. [CrossRef]
3.
Alawadi, S.; Mera, D.; Fernández-Delgado, M.; Alkhabbas, F.; Olsson, C.M.; Davidsson, P. A comparison of machine learning
algorithms for forecasting indoor temperature in smart buildings. Energy Syst. 2020,13, 1–17. [CrossRef]
4.
Dai, X.; Liu, J.; Zhang, X. A review of studies applying machine learning models to predict occupancy and window-opening
behaviours in smart buildings. Energy Build. 2020,223, 2020. [CrossRef]
5.
Boodi, A.; Beddiar, K.; Amirat, Y.; Benbouzid, M. Building Thermal-Network Models: A Comparative Analysis, Recommendations,
and Perspectives. Energies 2022,15, 1328. [CrossRef]
6.
Turley, C.; Jacoby, M.; Pavlak, G.; Henze, G. Development and evaluation of occupancy-aware HVAC control for residential
building energy efficiency and occupant comfort. Energies 2020,13, 5396. [CrossRef]
7.
Fotopoulou, E.; Zafeiropoulos, A.; Terroso-Saenz, F.; Simsek, U.; Gonzalez-Vidal, A.; Tsiolis, G.; Gouvas, P.; Liapis, P.; Fensel, A.;
Skarmeta, A. Providing Personalized Energy Management and Awareness Services for Energy Efficiency in Smart Buildings.
Sensors 2017,17, 2054. [CrossRef]
8.
Hu, S.; Yan, D.; Guo, S.; Cui, Y.; Dong, B. A survey on energy consumption and energy usage behavior of households and
residential building in urban China. Energy Build. 2017,148, 366–378. [CrossRef]
9.
Cao, T.D.; Delahoche, L.; Marhic, B.; Masson, J.B. Occupancy Forecasting using two ARIMA Strategies. In Proceedings of the
ITISE 2019, Granada, Spain, 25–27 September 2019; Volume 2.
10.
Mariano-Hernández, D.; Hernández-Callejo, L.; García, F.S.; Duque-Perez, O.; Zorita-Lamadrid, A.L. A review of energy
consumption forecasting in smart buildings: Methods, input variables, forecasting horizon and metrics. Appl. Sci.
2020
,10, 8323.
[CrossRef]
11.
Scheurer, S.; Tedesco, S.; Brown, K.N.; O’Flynn, B. Using domain knowledge for interpretable and competitive multi-class human
activity recognition. Sensors 2020,20, 1208. [CrossRef]
12.
Fang, Z.; Crimier, N.; Scanu, L.; Midelet, A.; Alyafi, A.; Delinchant, B. Multi-zone indoor temperature prediction with LSTM-based
sequence to sequence model. Energy Build. 2021,245, 111053. [CrossRef]
13.
Kaligambe, A.; Fujita, G.; Keisuke, T. Estimation of Unmeasured Room Temperature, Relative Humidity, and CO
2
Concentrations
for a Smart Building Using Machine Learning and Exploratory Data Analysis. Energies 2022,15, 4213. [CrossRef]
14.
Massana, J.; Pous, C.; Burgas, L.; Melendez, J.; Colomer, J. Short-term load forecasting for non-residential buildings contrasting
artificial occupancy attributes. Energy Build. 2016,130, 519–531. [CrossRef]
15.
Zhao, J.; Liu, X. A hybrid method of dynamic cooling and heating load forecasting for office buildings based on artificial
intelligence and regression analysis. Energy Build. 2018,174, 293–308. [CrossRef]
16.
Bouktif, S.; Fiaz, A.; Ouni, A.; Serhani, M.A. Optimal deep learning lstm model for electric load forecasting using feature selection
and genetic algorithm: Comparison with machine learning approaches. Energies 2018,11, 1636. [CrossRef]
17.
Alawadi, S.; Mera, D.; Fernandez-Delgado, M.; Taboada, J.A. Comparative study of artificial neural network models for forecasting
the indoor temperature in smart buildings. In International Conference on Smart Cities; Springer: Cham, Switzerland, 2017;
pp. 29–38.
18.
Aliberti, A.; Bottaccioli, L.; Macii, E.; Di Cataldo, S.; Acquaviva, A.; Patti, E. A non-linear autoregressive model for indoor
air-temperature predictions in smart buildings. Electronics 2019,8, 979. [CrossRef]
19.
Zhu, J.; Yang, Z.; Mourshed, M.; Guo, Y.; Zhou, Y.; Chang, Y.; Wei, Y.; Feng, S. Electric Vehicle Charging Load Forecasting:
A Comparative Study of Deep Learning Approaches. Energies 2019,12, 2692. [CrossRef]
20.
Liu, Z.; Wu, D.; Liu, Y.; Han, Z.; Lun, L.; Gao, J.; Jin, G.; Cao, G. Accuracy analyses and model comparison of machine learning
adopted in building energy consumption prediction. Energy Explor. Exploit. 2019,37, 1426–1451. [CrossRef]
21.
Saleem, T.J.; Chishti, M.A. Data analytics in the Internet of Things: A survey. Scalable Comput. Pract. Exp.
2019
,20, 607–630.
[CrossRef]
22.
Mahjoub, S.; Chrifi-Alaoui, L.; Marhic, B.; Delahoche, L. Predicting Energy Consumption Using LSTM, Multi-Layer GRU and
Drop-GRU Neural Networks. Sensors 2022,22, 4062. [CrossRef]
23.
Mahjoub, S.; Chrifi-Alaoui, L.; Marhic, B.; Delahoche, L.; Masson, J.B.; Derbel, N. Prediction of energy consumption based on
LSTM Artificial Neural Network. In Proceedings of the 2022 19th International Multi-Conference on Systems, Signals Devices
(SSD), Setif, Algeria, 6–10 May 2022; pp. 521–526.
24.
Siami-Namini, S.; Tavakoli, N.; Namin, A.S. The performance of LSTM and BiLSTM in forecasting time series. In Proceedings of
the 2019 IEEE International Conference on Big Data (Big Data), Los Angeles, CA, USA, 9–12 December 2019; pp. 3285–3292.
25.
Apaydin, H.; Feizi, H.; Sattari, M.T.; Colak, M.S.; Shamshirband, S.; Chau, K.W. Comparative analysis of recurrent neural network
architectures for reservoir inflow forecasting. Water 2020,12, 1500. [CrossRef]
26.
Zhang, X.; Zhao, M.; Dong, R. Time-series prediction of environmental noise for urban IoT based on long short-term memory
recurrent neural network. Appl. Sci. 2020,10, 1144. [CrossRef]
27.
Jain, M.; Saihjpal, V.; Singh, N.; Singh, S.B. An Overview of Variants and Advancements of PSO Algorithm. Appl. Sci.
2022
,12, 8392.
[CrossRef]
28. Hoschel, K.; Lakshminarayanan, V. Genetic algorithms for lens design: A review. J. Opt. 2019,48, 134–144. [CrossRef]
Energies 2023,16, 1641 18 of 18
29.
Lorencin, I.; Andelic, N.; Mrzljak, V.; Car, Z. Genetic algorithm approach to design of multi-layer perceptron for combined cycle
power plant electrical power output estimation. Energies 2019,12, 4352. [CrossRef]
30. Wang, D.; Tan, D.; Liu, L. Particle swarm optimization algorithm: An overview. Soft Comput. 2018,22, 387–408. [CrossRef]
31.
Aljanad, A.; Tan, N.M.; Agelidis, V.G.; Shareef, H. Neural network approach for global solar irradiance prediction at extremely
short-time-intervals using particle swarm optimization algorithm. Energies 2021,14, 1213. [CrossRef]
32.
Berrar, D. Cross-validation. In Encyclopedia of Bioinformatics and Computational Biology; Elsevier: Amsterdam, The Netherlands,
2019; Volume 1, pp. 542–545. [CrossRef]
33.
Xiong, Z.; Cui, Y.; Liu, Z.; Zhao, Y.; Hu, M.; Hu, J. Evaluating explorative prediction power of machine learning algorithms for
materials discovery using k-fold forward cross-validation. Comput. Mater. Sci. 2020,171, 109203. [CrossRef]
34.
Xiao, Y.; Yin, H.; Zhang, Y.; Qi, H.; Zhang, Y.; Liu, Z. A dual-stage attention-based Conv-LSTM network for spatio-temporal
correlation and multivariate time series prediction. Int. J. Intell. Syst. 2021,36, 2036–2057. [CrossRef]
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.
... However, this method also has some disadvantages, such as difficulty in handling nonlinear data and the ability to optimize model parameters to achieve high performance. Hence, applying two deep learning neural networks, Long Short-Term Memory Optimized by Particle Swarm Optimization (PSO-LSTM) and Long Short-Term Memory Optimized by Genetic Algorithms (GA-LSTM), solved the current limitations of the LSTM method [20]. Using PSO and GA optimized hyperparameters such as window size, epochs, neurons, and learning rate of the LSTM network more efficiently. ...
... As mentioned above, many studies demonstrated that the efficiency of the LSTM model increases significantly after applying GA-LSTM and PSO-LSTM [20,26]. However, the experiments on the GPS data to forecast the average velocity of segments of the arterial roads having parallel multiple lanes are limited. ...
Article
Full-text available
Early forecasting of vehicle flow speeds is crucial for sustainable traffic development and establishing Traffic Speed Forecasting (TSF) systems for each country. While online mapping services offer significant benefits, dependence on them hampers the development of domestic alternative platforms, impeding sustainable traffic management and posing security risks. There is an urgent need for research to explore sustainable solutions, such as leveraging Global Positioning System (GPS) probe data, to support transportation management in urban areas effectively. Despite their vast potential, GPS probe data often present challenges, particularly in urban areas, including interference signals and missing data. This paper addresses these challenges by proposing a process for handling anomalous and missing GPS signals from probe vehicles on parallel multilane roads in Vietnam. Additionally, the paper investigates the effectiveness of techniques such as Particle Swarm Optimization Long Short-Term Memory (PSO-LSTM) and Genetic Algorithm Long Short-Term Memory (GA-LSTM) in enhancing LSTM networks for TSF using GPS data. Through empirical analysis, this paper demonstrates the efficacy of PSO-LSTM and GA-LSTM compared to existing methods and the state-of-the-art LSTM approach. Performance metrics such as Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Median Absolute Error (MDAE) validate the proposed models, providing insights into their forecasting accuracy. The paper also offers a comprehensive process for handling GPS outlier data and applying GA and PSO algorithms to enhance LSTM network quality in TSF, enabling researchers to streamline calculations and improve supposed model efficiency in similar contexts.
... Many studies have used either the classical LSTM or modified LSTMs. In study [48], both Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) were used for LSTM weights optimization. The model was used to predict multi-variables such as CO 2 , noise, and relative temperature. ...
Article
Full-text available
Accurate occupancy prediction in smart buildings is crucial for optimizing energy management, improving occupant comfort, and effectively controlling building systems, particularly for short- and long-term horizons. Recently, deep learning-based occupancy prediction methods have gained considerable attention. However, the full potential of these methods remains under explored in terms of model architecture variations and prediction horizons. This study introduces cascaded LSTM and cascaded Bi-LSTM models for multi-horizon predictions from 10 minutes to 24 hours, integrating a modified activation function, additional input features, and optimized hyper-parameters using OPTUNA. Traditional performance metrics and various other analyses were conducted to compare the models. Both models performed well for short- and long-term predictions, with minimal differences in the results. Nevertheless, analysis focusing on non-zero data errors (accounting for approximately 11% of occupied periods) and occupancy-wise errors showed a significant performance gap between the two models. The cascaded Bi-LSTM model demonstrated consistent performance across various prediction horizons and occupancy variations, with accuracy approximately 10-15% higher than the cascaded LSTM model, highlighting its superior capability in capturing complex dataset dynamics through a bidirectional process. This study highlights the importance of additional input features, data feature analysis, and multi-perspective result analysis to select the most suitable model for occupancy prediction, validated with pre- and post-modeling feature importance analysis.
... In the literature, LSTM has been widely used for occupancy prediction. The study in [139] introduced a method for predicting occupancy in smart homes, which relied on environmental factors like CO 2 levels, noise, and temperature, and employed a ML method and a forecasting strategy. The proposed algorithms aimed to improve the energy management system by optimizing the use of the electric heating system. ...
Article
Full-text available
In today’s world, a significant amount of global energy is used in buildings. Unfortunately, a lot of this energy is wasted, because electrical appliances are not used properly or efficiently. One way to reduce this waste is by detecting, learning, and predicting when people are present in buildings. To do this, buildings need to become “smart” and “cognitive” and use modern technologies to sense when and how people are occupying the buildings. By leveraging this information, buildings can make smart decisions based on recently developed methods. In this paper, we provide a comprehensive overview of recent advancements in Internet of Things (IoT) technologies that have been designed and used for the monitoring of indoor environmental conditions within buildings. Using these technologies is crucial to gathering data about the indoor environment and determining the number and presence of occupants. Furthermore, this paper critically examines both the strengths and limitations of each technology in predicting occupant behavior. In addition, it explores different methods for processing these data and making future occupancy predictions. Moreover, we highlight some challenges, such as determining the optimal number and location of sensors and radars, and provide a detailed explanation and insights into these challenges. Furthermore, the paper explores possible future directions, including the security of occupants’ data and the promotion of energy-efficient practices such as localizing occupants and monitoring their activities within a building. With respect to other survey works on similar topics, our work aims to both cover recent sensory approaches and review methods used in the literature for estimating occupancy.
... This approach allows buildings to become cognitive and selfadapting, thereby achieving energy efficiency and reducing wastage without compromising privacy concerns. Similarly, another recent study [42] employs a machine learning forecasting approach that utilized an LSTM neural network to predict occupancy in buildings and, accordingly, to optimize the energy management of electric heating systems. The study improves the LSTM algorithm's performance using optimization techniques such as Genetic Algorithms (GA) and Particle Swarm Optimization (PSO). ...
... Due to the advancement of machine/deep learning-based techniques, several scholars have begun to concentrate on these tactics [6], [7]. A unique deep learning method for processing time series predictions, the LSTM neural network, has recently shown encouraging prediction results [8], [9]. The gated unit mechanism used in this model improves the conventional recurrent neural network (RNN) by preventing the vanishing gradient issue. ...
Article
Full-text available
A smart city utilizes vast data collected through electronic methods, such as sensors and cameras, to improve daily life by managing resources and providing services. Moving towards a smart grid is a step in realizing this concept. The proliferation of smart grids and the concomitant progress made in the development of measuring infrastructure have garnered considerable interest in short-term power consumption forecasting. In reality, predicting future power demands has shown to be a crucial factor in preventing energy waste and developing successful power management techniques. In addition, historical time series data on energy consumption may be considered necessary to derive all relevant knowledge and estimate future use. This research paper aims to construct and compare with original deep learning algorithms for forecasting power consumption over time. The proposed model, LSTM-GRU-PPCM, combines the Long -Short-Term -Memory (LSTM) and Gated- Recurrent- Unit (GRU) Prediction Power Consumption Model. Power consumption data will be utilized as the time series dataset, and predictions will be generated using the developed model. This research avoids consumption peaks by using the proposed LSTM-GRU-PPCM neural network to forecast future load demand. In order to conduct a thorough assessment of the method, a series of experiments were carried out using actual power consumption data from various cities in India. The experiment results show that the LSTM-GRU-PPCM model improves the original LSTM forecasting algorithms evaluated by Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE) for various time series. The proposed model achieved a minimum error prediction of MAE=0.004 and RMSE=0.032, which are excellent values compared to the original LSTM. Significant implications for power quality management and equipment maintenance may be expected from the LSTM-GRU-PPCM approach, as its forecasts will allow for proactive decision-making and lead to load shedding when power consumption exceeds the allowed level
... While traditional approaches to occupancy prediction often rely on centralized data aggregation and analysis, recent research has explored the use of FL to address privacy concerns and enable distributed prediction models. For instance, the work by Mahjoub et al. [32] introduces a novel technique for predicting occupancy in smart homes utilizing environmental variables such as CO 2 levels, noise, and relative temperature. The proposed method and forecasting strategy optimize the energy management system by effectively utilizing the electric IEEE DASC/CyberSciTech/PICom/CBDCom 2023 heating system. ...
Conference Paper
Energy efficiency and energy saving have become crucial issues in the face of increasing energy demand, the need for sustainable solutions, and concerns about climate change. Buildings, as significant contributors to energy consumption and greenhouse gas emissions, require effective measures for energy optimization that can also be reached by predicting the usage of the building spaces. This paper introduces a data-driven approach combining Internet of Things sensors, Machine Learning, Edge computing, and Federated Learning to predict multi-occupancy in buildings. The proposed approach is used on real data from the ICAR-CNR IoT Laboratory in order to extract insights into occupancy patterns within a multi-occupant environment. Finally, a comparative analysis conducted by varying Federated Learning configurations demonstrates the robustness of the solution.
... Thus, to enhance the LSTM forecasting model's accuracy, many authors combined the features of different optimization algorithms with LSTM models to get the best optimal parameters, such as [33][34][35][36]. However, according to [36], when the optimized hyperparameters return, the time slots need to be taken out concerning the real-time data. ...
... Paper [6] proposed a smart home occupancy prediction technique using environmental variables such as CO 2 , noise, and relative temperature via an ML forecasting strategy. The LSTM neural network was used to process time series prediction, and two metaheuristic optimization algorithms (GA and PSO) were used to enhance the performance of the LSTM algorithm. ...
Article
Full-text available
A modern power system is a complex network of interconnected components, such as generators, transmission lines, and distribution subsystems, that are designed to provide electricity to consumers in an efficient and reliable manner [...]
Article
As the economy continues to develop and technology advances, there is an increasing societal need for an environmentally friendly ecosystem. Consequently, natural gas, known for its minimal greenhouse gas emissions, has been widely adopted as a clean energy alternative. The accurate prediction of short-term natural gas demand poses a significant challenge within this context, as precise forecasts have important implications for gas dispatch and pipeline safety. The incorporation of intelligent algorithms into prediction methodologies has resulted in notable progress in recent times. Nevertheless, certain limitations persist. However, there exist certain limitations, including the tendency to easily fall into local optimization and inadequate search capability. To address the challenge of accurately predicting daily natural gas loads, we propose a novel methodology that integrates the adaptive particle swarm optimization algorithm, attention mechanism, and bidirectional long short-term memory (BiLSTM) neural networks. The initial step involves utilizing the BiLSTM network to conduct bidirectional data learning. Following this, the attention mechanism is employed to calculate the weights of the hidden layer in the BiLSTM, with a specific focus on weight distribution. Lastly, the adaptive particle swarm optimization algorithm is utilized to comprehensively optimize and design the network structure, initial learning rate, and learning rounds of the BiLSTM network model, thereby enhancing the accuracy of the model. The findings revealed that the combined model achieved a mean absolute percentage error (MAPE) of 0.90% and a coefficient of determination (R ² ) of 0.99. These results surpassed those of the other comparative models, demonstrating superior prediction accuracy, as well as exhibiting favorable generalization and prediction stability.
Article
Nowadays, data are more and more used for intelligent modeling and prediction, and the comprehensive evaluation of data quality is getting more and more attention as a necessary means to measure whether the data are usable or not. However, the comprehensive evaluation method of data quality mostly contains the subjective factors of the evaluator, so how to comprehensively and objectively evaluate the data has become a bottleneck that needs to be solved in the research of comprehensive evaluation method. In order to evaluate the data more comprehensively, objectively and differentially, a novel comprehensive evaluation method based on particle swarm optimization (PSO) and grey correlation analysis (GCA) is presented in this paper. At first, an improved GCA evaluation model based on the technique for order preference by similarity to an ideal solution (TOPSIS) is proposed. Then, an objective function model of maximum difference of the comprehensive evaluation values is built, and the PSO algorithm is used to optimize the weights of the improved GCA evaluation model based on the objective function model. Finally, the performance of the proposed method is investigated through parameter analysis. A performance comparison of traffic flow data is carried out, and the simulation results show that the maximum average difference between the evaluation results and its mean value (MDR) of the proposed comprehensive evaluation method is 33.24% higher than that of TOPSIS-GCA, and 6.86% higher than that of GCA. The proposed method has better differentiation than other methods, which means that it objectively and comprehensively evaluates the data from both the relevance and differentiation of the data, and the results more effectively reflect the differences in data quality, which will provide more effective data support for intelligent modeling, prediction and other applications.
Article
Full-text available
Smart buildings that utilize innovative technologies such as artificial intelligence (AI), the internet of things (IoT), and cloud computing to improve comfort and reduce energy waste are gaining popularity. Smart buildings comprise a range of sensors to measure real-time indoor environment variables essential for the heating, ventilation, and air conditioning (HVAC) system control strategies. For accuracy and smooth operation, current HVAC system control strategies require multiple sensors to capture the indoor environment variables. However, using too many sensors creates an extensive network that is costly and complex to maintain. Our proposed research solves the mentioned problem by implementing a machine-learning algorithm to estimate unmeasured variables utilizing a limited number of sensors. Using a six-month data set collected from a three-story smart building in Japan, several extreme gradient boosting (XGBoost) models were designed and trained to estimate unmeasured room temperature, relative humidity, and CO2 concentrations. Our models accurately estimated temperature, humidity, and CO2 concentration under various case studies with an average root mean squared error (RMSE) of 0.3 degrees, 2.6%, and 26.25 ppm, respectively. Obtained results show an accurate estimation of indoor environment measurements that is applicable for optimal HVAC system control in smart buildings with a reduced number of required sensors.
Article
Full-text available
Particle swarm optimization (PSO) is one of the most famous swarm-based optimization techniques inspired by nature. Due to its properties of flexibility and easy implementation, there is an enormous increase in the popularity of this nature-inspired technique. Particle swarm optimization (PSO) has gained prompt attention from every field of researchers. Since its origin in 1995 till now, researchers have improved the original Particle swarm optimization (PSO) in varying ways. They have derived new versions of it, such as the published theoretical studies on various parameters of PSO, proposed many variants of the algorithm and numerous other advances. In the present paper, an overview of the PSO algorithm is presented. On the one hand, the basic concepts and parameters of PSO are explained, on the other hand, various advances in relation to PSO, including its modifications, extensions, hybridization, theoretical analysis, are included.
Article
Full-text available
With the steep rise in the development of smart grids and the current advancement in developing measuring infrastructure, short term power consumption forecasting has recently gained increasing attention. In fact, the prediction of future power loads turns out to be a key issue to avoid energy wastage and to build effective power management strategies. Furthermore, energy consumption information can be considered historical time series data that are required to extract all meaningful knowledge and then forecast the future consumption. In this work, we aim to model and to compare three different machine learning algorithms in making a time series power forecast. The proposed models are the Long Short-Term Memory (LSTM), the Gated Recurrent Unit (GRU) and the Drop-GRU. We are going to use the power consumption data as our time series dataset and make predictions accordingly. The LSTM neural network has been favored in this work to predict the future load consumption and prevent consumption peaks. To provide a comprehensive evaluation of this method, we have performed several experiments using real data power consumption in some French cities. Experimental results on various time horizons show that the LSTM model produces a better result than the GRU and the Drop-GRU forecasting methods. There are fewer prediction errors and its precision is finer. Therefore, these predictions based on the LSTM method will allow us to make decisions in advance and trigger load shedding in cases where consumption exceeds the authorized threshold. This will have a significant impact on planning the power quality and the maintenance of power equipment.
Article
Full-text available
The development of smart buildings, as well as the great need for energy demand reduction, has renewed interest in building energy demand prediction. Intelligent controllers are a solution for optimizing building energy consumption while maintaining indoor comfort. The controller efficiency, on the other hand, is mainly determined by the prediction of thermal behavior from building models. Due to the development complexity of the models, these intelligent controllers are not yet implemented on an industrial scale. There are primarily three types of building models studied in the literature: white-box, black-box, and gray-box. The gray-box models are found to be robust, efficient, computationally low cost, and of moderate modeling complexity. Furthermore, there is no standard model configuration, model development method, or operation conditions. These parameters have a significant influence on the model performance accuracy. This motivates the need for this review paper, in which we examined various gray-box models, configurations, parametric identification techniques, and influential parameters.
Article
Full-text available
Hourly global solar irradiance (GSR) data are required for sizing, planning, and modeling of solar photovoltaic farms. However, operating and controlling such farms exposed to varying environmental conditions, such as fast passing clouds, necessitates GSR data to be available for very short time intervals. Classical backpropagation neural networks do not perform satisfacto-rily when predicting parameters within short intervals. This paper proposes a hybrid back-propagation neural networks based on particle swarm optimization. The particle swarm algo-rithm is used as an optimization algorithm within the backpropagation neural networks to op-timize the number of hidden layers and neurons used and its learning rate. The proposed model can be used as a reliable model in predicting changes in the solar irradiance during short time interval in tropical regions such as Malaysia and other regions. Actual global solar irradiance data of 5-s and 1-min intervals, recorded by weather stations, are applied to train and test the proposed algorithm. Moreover, to ensure the adaptability and robustness of the proposed tech-nique, two different cases are evaluated using 1-day and 3-days profiles, for two different time intervals of 1-min and 5-s each. A set of statistical error indices have been introduced to evaluate the performance of the proposed algorithm. From the results obtained, the 3-days profile’s per-formance evaluation of the BPNN-PSO are 1.7078 of RMSE, 0.7537 of MAE, 0.0292 of MSE, and 31.4348 of MAPE (%), at 5-s time interval, where the obtained results of 1-min interval are 0.6566 of RMSE, 0.2754 of MAE, 0.0043 of MSE, and 1.4732 of MAPE (%). The results revealed that pro-posed model outperformed the standalone backpropagation neural networks method in predicting global solar irradiance values for extremely short-time intervals. In addition to that, the proposed model exhibited high level of predictability compared to other existing models.
Article
Full-text available
Multivariate time series (MTS) prediction aims at predicting future time series by extracting multiple forms of dependencies of past time series. Traditional prediction methods and deep learning‐based prediction methods focus on extracting the dynamic relationships of certain aspects of MTS, especially the temporal characteristics, often neglecting the spatial and temporal dynamic correlations of MTS. Inspired by convolution neural network (CNN) and attention mechanism, this paper proposes a convolution LSTM network model based on MTS prediction with two‐stage attention. Specifically, we first propose a new MTS preprocessing method to perform convolution operations better. Then convolution layer extracts spatial correlation of MTS and LSTM model extracts temporal correlation. It is worth mentioning that the combination of attention mechanism and LSTM can effectively solve the problem of insufficient time dependency in MTS prediction. In addition, dual‐stage attention mechanism can effectively eliminate irrelevant information, select the relevant exogenous sequence, give it higher weight, and increase the past value of the target sequence to further eliminate irrelevant information. Finally, the MTS spatio‐temporal correlation is extracted to improve the prediction accuracy, and the model is interpreted. Experimental results show that the model has broad application prospects. Experiments based on typical datasets of finance, environment, and energy determine the optimal window size and hidden size of the prediction, and demonstrate that the model achieves the state‐of‐the‐art effect compared to the other four deep learning models. On top of that, the model is not only suitable for single‐step prediction of MTS, but also suitable for multistep prediction of time step in a certain range.
Article
Full-text available
Buildings are among the largest energy consumers in the world. As new technologies have been developed, great advances have been made in buildings, turning conventional buildings into smart buildings. These smart buildings have allowed for greater supervision and control of the energy resources within the buildings, taking steps to energy management strategies to achieve significant energy savings. The forecast of energy consumption in buildings has been a very important element in these energy strategies since it allows adjusting the operation of buildings so that energy can be used more efficiently. This paper presents a review of energy consumption forecasting in smart buildings for improving energy efficiency. Different forecasting methods are studied in nonresidential and residential buildings. Following this, the literature is analyzed in terms of forecasting objectives, input variables, forecasting methods and prediction horizon. In conclusion, the paper examines future challenges for building energy consumption forecasting.
Article
Full-text available
Occupancy-aware heating, ventilation, and air conditioning (HVAC) control offers the opportunity to reduce energy use without sacrificing thermal comfort. Residential HVAC systems often use manually-adjusted or constant setpoint temperatures, which heat and cool the house regardless of whether it is needed. By incorporating occupancy-awareness into HVAC control, heating and cooling can be used for only those time periods it is needed. Yet, bringing this technology to fruition is dependent on accurately predicting occupancy. Non-probabilistic prediction models offer an opportunity to use collected occupancy data to predict future occupancy profiles. Smart devices, such as a connected thermostat, which already include occupancy sensors, can be used to provide a continually growing collection of data that can then be harnessed for short-term occupancy prediction by compiling and creating a binary occupancy prediction. Real occupancy data from six homes located in Colorado is analyzed and investigated using this occupancy prediction model. Results show that non-probabilistic occupancy models in combination with occupancy sensors can be combined to provide a hybrid HVAC control with savings on average of 5.0% and without degradation of thermal comfort. Model predictive control provides further opportunities, with the ability to adjust the relative importance between thermal comfort and energy savings to achieve savings between 1% and 13.3% depending on the relative weighting between thermal comfort and energy savings. In all cases, occupancy prediction allows the opportunity for a more intelligent and optimized strategy to residential HVAC control.
Article
Accurate indoor temperature forecasting can facilitate energy savings of the building without compromising the occupant comfort level, by providing more accurate control of the HVAC (heating, ventilating, and air conditioning) system. In order to make the best use of different input variables, a long short-term memory (LSTM) based sequence to sequence (seq2seq) model was proposed to make multi-step ahead forecasting. The out-of-sample forecasting capacity of the model was evaluated with regard to different forecast horizons by various evaluation metrics. A tailor-made metric was proposed to take account of the small daily-variation characteristic of indoor temperature. The model was benchmarked against Prophet and a seasonal naive model, showing that the current model is much more skillful and reliable in very short-term forecasting. A cross-series learning strategy was adopted to enable multi-zone indoor temperature forecasting with a more generalised model. Furthermore, the uncertainty in model parameters was quantified by prediction intervals created by Monte-Carlo dropout (MC-dropout) technique.