Professional Documents
Culture Documents
(Ieee) A Method For Anomaly Prediction in Power Consumption Using Long Short-Term Memory and Negative Selection
(Ieee) A Method For Anomaly Prediction in Power Consumption Using Long Short-Term Memory and Negative Selection
(Ieee) A Method For Anomaly Prediction in Power Consumption Using Long Short-Term Memory and Negative Selection
Abstract—To identify and predict anomalous power consump- measured value of the power, thus enabling the verification
tion, this paper proposes a method based on Long Short- and classification of next consumption values by means of
Term Memory (LSTM) and Negative Selection technologies that Negative Selection technique. As a case study, the method was
anticipates the occurrence of anomalies in power consumption,
and to provide useful information for energy efficiency. Using applied to the 20-week power consumption data of a building
the proposed method it is possible to anticipate the occurrence at the Federal University of Campina Grande, Brazil, and the
of anomalies in power consumption. When applied to the power obtained results shows the feasibility of the proposed method.
consumption recorded during 20 weeks of a building the method The paper is divided as follows: Section II presents Negative
yielded promising results. Finally, the effectiveness and advan- Selection essentials, while Section II-A presents and Long
tages of this method is demonstrated which it could be directly
used for real-time electricity monitoring and anomaly prediction. Short-Term Memory essentials. In Section III, the proposed
method is introduced and detailed. In Section IV, the ex-
Index Terms—Power Consumption, Anomaly Detection, perimental results are depicted, while Section V presents the
Anomaly Prediction, Negative Selection, Long Short-Term Mem- conclusions and future works.
ory.
II. N EGATIVE S ELECTION
I. I NTRODUCTION Artificial Immune Systems (AIS) are adaptive systems based
Anomalies can be defined as behaviors, values or set of on theoretical immunology to solve problems [12]. Negative
values having different probability distribution of the data selection is an AIS algorithm inspired by maturation of T-cells
that a system normally presents [10]. Anomalous values were that are produced in the bone marrow and undergo maturation
caused by non common events in a system, so their identi- in the thymus. When T-cells are exposed to the body’s proteins
fication can provide indications of the anomalous behavior (self-proteins) and if they bind, then that T-cell is killed. In
causes [3] [11] [8]. With the increasing volume of data, contrary, If they do not bind with the body’s proteins, then the
methods to handle anomalous values or behaviors are neces- T-cell is kept [13].
sary [1]. Anomaly identification is getting more attention [2] Negative selection algorithm consists of two stages, called
and already has a considerable number of applications in censoring and monitoring. In the former detectors are gen-
various areas [3]. erated and to react to the self-data, then they are discarded.
Anomalies identification methods are based in methods If they do not react, they are added to the set of competent
like classification, clustering, nearest neighbors, among oth- detectors. In the second stage data from the system is verified
ers [11] [14] [7] [19] [2] [12] [9]. Most of these methods only by detectors belonging to set of competent detectors generated
identify anomalous data. In practice, it is necessary predict in the first stage. If received data in the monitoring stage
and identify whether and when anomaly will occur [2]. matches any of the detectors, then the data is not non-self.
In energy power consumption anomalous behavior cause Matching verification occurs by the use of an affinity
unwanted expenditures and faults. Thus forecast of anomalous measure between detectors, self-data and monitored data. To
consumption provides information to better manage the sys- compute the affinity data is divided in vectors of length L,
tem. This paper presents a method using LSTM and Negative called self-strings. Thus monitored data will be divided into
Selection to predict anomalies occurrence in power consump- vectors of size L and the detectors will be also vectors
tion. The proposed method combines LSTM and Negative of length L. Self-strings and detectors may have elements
Selection techniques in order to anticipate the occurrence of belonging to set of real numbers. This encoding is called real-
anomalies in the consumption of electric energy, enabling valued encoding.
actions aimed at energy efficiency. For this encoding, several affinity measures can be used.
Unlike other methods using LSTM for anomalies detec- The r-Hamming affinity measure is described as follow. Given
tion, the proposed method does not requires the value of a detector Ab = [x11 x12 . . . x1L ] and a string Ag =
the error between value predicted by the LSTM and actual [w11 w12 . . . w1L ] of monitored data, is verified how many
where m is the number of Mondays (consequently the number Given the k measured values
of weeks) and n is a total of measurements in each Monday.
Y = y11 y12 ... y1k
Thus, each element xij represents the j-th measurement of the
i-th week. Measurements represents the power consumption in an LSTM was used to predict the consumption values
15 minute intervals, and this interval was chosen based on the [y1k+1 , . . . y1k+L−1 ], where L is the length of the self-string.
Brazilian Electricity Regulatory Agency (ANEEL) norms. Then, the predicted values were presented to the set of
Data were divided into two sets. The first one contains 15 detectors to be classified.
weeks and it was used to determine the self-data. The second The proposed method is based on two stages:
one contains 5 weeks, and it was used to test the method. • Censoring: The detector set is generated from the nega-
In Fig. 1 we present week trials (Week 1-5) and self-data tive selection.
• Monitoring: Given the consumption values the next L TABLE I
consumption values are predicted and it is checked if PARAMETERS USED IN THE EXPERIMENTS .
expected values indicate a consumption anomaly, when Negative Selection
an alarm is generated. Otherwise, next consumption value Parameters Divided Complete
is expected to begin the monitoring cycle once again. Encoding Real-valued Real-valued
The flowchart of adopted method is shown in Fig. 2. The Distance r-Hamming r-Hamming
parameters adopted in the experiments are presented in Table I. Length of self- 2 2
string (L)
Threshold (r) 1 1
Censoring Number of divi- 4 1
sions in the data
self-data (N )
Number of detec- 30 120
tors for each divi-
sion
Generate Deviation () 2.9 × standard de- 2.9× standard de-
Rejected viation of each di- viation of the data
condidate Match? vision in the data
detector Yes
LSTM
Parameters Divided Complete
No Units in the hidden 150 150
layers of LSTM
Add to Monitoring Number of epochs 300 300
the set of
Optimization Adam Adam
competent method
detectors