Electrical Energy Management Based on a Hybrid Artificial Neural Network-Particle Swarm Optimization-Integrated Two-Stage Non-Intrusive Load Monitoring Process in Smart Homes

Concerning electrical energy used in today’s modern society, electrical energy demands requested from downstream sectors in a smart grid are continuously increasing. One way to meet the electrical demands requested is to monitor and manage industrial, commercial, as well as residential electrical appliances efficiently in response to Demand Response (DR) programs for Demand-Side Management (DSM). Monitoring and managing electrical appliances that consume electrical energy in fields of interest can be realized through use of Energy Management Systems (EMS) with Non-Intrusive Load Monitoring (NILM). This paper presents an Internet of Things (IoT)-oriented Home EMS (HEMS). Also, a novel hybrid Artificial Neural Network-Particle Swarm Optimization (ANN-PSO)-integrated NILM approach is proposed and used to model and identify electrical appliances for DSM in the HEMS. ANN can be applied in NILM as a load identification task. Nevertheless, the performance of ANN used for load identification depends on three principal design factors: The network topology designed, the type of activation functions chosen, and the training algorithm adopted. As a result, PSO is conducted and used to incorporate meta-heuristics with ANN considering the three principal design factors relating to an ANN design. The HEMS with the novel hybrid ANN-PSO-integrated NILM proposed in this paper was deployed and evaluated in a realistic residential house environment. As the experimentation reported in this paper shows, the presented HEMS utilizing the proposed novel hybrid ANN-PSO-integrated NILM to model and identify monitored electrical appliances is feasible and workable, with an overall classification rate of 91.67% in load classification for DSM.


Introduction
Nowadays, owing to global warming and climate change, it is very critical to monitor and manage industrial, commercial, and residential individual electrical appliances such that (1) the efficiency of electrical energy used in modern society and requested from downstream sectors of a smart grid can be improved, and (2) the pollution of greenhouse gases such as carbon dioxide can be mitigated.In a smart grid, Demand-Side Management (DSM) refers to initiatives and technologies that encourage consumers to optimize their electrical energy uses.The benefits gained from direct participation in DSM are potentially two-fold.First, consumers can reduce their electricity bills by adjusting the amount of electricity used.Second, the energy system, a power grid injected with distributed generation such as wind and solar energy, can benefit by shifting electrical energy consumption from peak hours to non-peak hours.To participate in DSM, the first step is to keep track of electrical energy used by consumers and that consumed by individual electrical appliances in fields of interest.In a smart grid with Internet of Things (IoT) paradigms, advances in integrated energy systems, called smart Energy Management Systems (EMS), are being made for industrial factories, commercial buildings, and residential houses forming communities.To a smart house connected with a smart grid via Advanced Metering Infrastructure (AMI), smart Home EMS (HEMS) can be used to intrusively keep track of electric power consumption on monitored individual electrical household appliances, where plug-load smart e-meters are installed and used in a field of interest.However, the construction of such an HEMS using plug-load smart e-meters to intrusively keep track of individual electrical household appliances modeled from load patterns burdens consumers with a high installation investment, including annual maintenance costs [1,2].Therefore, researchers [1][2][3][4][5][6][7][8][9] have proposed Non-Intrusive Load Monitoring (NILM)-type load disaggregation approaches.NILM approaches non-intrusively identify electrical appliances by analyzing aggregated electrical signals acquired at the electrical service entrance (the electrical panel) in fields of interest.In contrast with HEMS, NILM just requires one single minimal set of plug-panel voltage and current sensors installed and used in a field of interest.
To NILM, load identification can be viewed as a load classification problem, and it can be solved by Artificial Intelligence (AI)/Computational Intelligence such as Artificial Neural Networks (ANNs).ANNs in AI are powerful connectionist systems, which are vaguely inspired by biological neural networks and are composed of artificial neurons.ANN can be applied for load identification in NILM.
In References [1,[3][4][5][6][7][8][9], widely-used Back Propagation-ANNs (BP-ANNs) were used as load identifiers to identify electrical appliances for NILM.In particular, in References [4,5], a hybrid classification strategy that combines conventional Particle Swarm Optimization (PSO) with BP-ANN for NILM was proposed.The conventional PSO optimizes weight coefficients of the BP-ANN, with the purpose of improving the classification accuracy of the used BP-ANN.However, the performance of ANN used to carry out classification as well as function approximation depends on three principal design factors relating to an ANN design: (1) the network architecture/topology determined, (2) the type of activation functions chosen, and (3) the training algorithm adopted.Therefore, as motivated and surveyed above, this paper presents an IoT-oriented smart HEMS utilizing a novel hybrid ANN-PSO-integrated NILM approach.The steps involved in approach are detailed as follows.

•
The HEMS was constructed, conducted, and used as a benchmark to intrusively acquire electrical power consumption on monitored individual electrical appliances through ZigBee.

•
The novel hybrid ANN-PSO-integrated NILM approach was used in the HEMS as a benchmark, to non-intrusively identify uses of electrical appliances consuming electrical energy.The methodology that automatically designs an ANN (feed-forward ANN) based on bio-inspired meta-heuristics (PSO) was proposed for load classification in NILM.In this case, the goal of PSO combined with feed-forward ANN was to simultaneously evolve the network architecture determined for load classification, the type of activation functions used by artificial neurons, and the set of synaptic weights/weighting connections including biases.In the PSO method used in this paper, the three aforementioned principal design factors relating to an ANN design were codified into individuals that represent candidate solutions of an ANN to be evolved with a declared fitness function.In addition, the ANN designed by the proposed methodology was compared with a commonly used BP-ANN trained through the well-known Gradient Descent (GD) process.

•
The HEMS with the novel hybrid ANN-PSO-integrated NILM was deployed and experimentally validated in a realistic house environment.The experimentation reported in this paper showed that the HEMS utilizing the proposed methodology to design an ANN for load identification in This paper is organized as follows.The methodology of the HEMS with the novel hybrid ANN-PSO-integrated NILM approach is presented in Section 2. The proposed NILM approach hybridized PSO with ANN to automatically design ANN, considering the three principal factors for load classification in NILM.In Section 3, the experimentation regarding the experimental setup and evaluation results of the proposed methodology is reported.Finally, Section 4 concludes this paper with indications for future work.

Methodology
The methodology of the IoT-oriented HEMS with the proposed novel hybrid ANN-PSO-integrated NILM is presented in this section.Section 2.1 presents the IoT-oriented HEMS with a ZigBee wireless communication network; Section 2.2 outlines preliminaries regarding ANN and PSO and then presents the proposed novel hybrid ANN-PSO-integrated NILM for load classification.This paper is organized as follows.The methodology of the HEMS with the novel hybrid ANN-PSO-integrated NILM approach is presented in Section 2. The proposed NILM approach hybridized PSO with ANN to automatically design ANN, considering the three principal factors for load classification in NILM.In Section 3, the experimentation regarding the experimental setup and evaluation results of the proposed methodology is reported.Finally, Section 4 concludes this paper with indications for future work.

Methodology
The methodology of the IoT-oriented HEMS with the proposed novel hybrid ANN-PSOintegrated NILM is presented in this section.Section 2.1 presents the IoT-oriented HEMS with a ZigBee wireless communication network; Section 2.2 outlines preliminaries regarding ANN and PSO and then presents the proposed novel hybrid ANN-PSO-integrated NILM for load classification.As shown in Figure 1, the residential environment conducting the HEMS with the NILM is connected with a smart grid via AMI.In this situation, a power company-owned smart meter (instead of a traditional wattmeter) is installed and used to transmit data records/energy consumption data and receive Demand Response (DR) programs from a power utility for DSM.One of the most important functionalities of the smart grid is the self-decision-making ability [10].To enable this characteristic for DSM, DR, an effective mechanism for DSM in a smart grid, has been developed.DR in a smart grid is a viable approach to motivate users towards shifting their demands during peak load periods [11].As electrical appliances monitored in the residential environment are able to react to the DR programs received, the HEMS with the NILM in this paper was developed and used to identify electrical appliances monitored and modeled with their load patterns.In Figure 1, the Home Gateway (HG), the central entity of the HEMS, is based on an Advanced RISC Machine (ARM ® ) Cortex TM -A9 embedded system (Texas Instruments Inc., Dallas, TX, USA), which is configured with an LAMP (a Linux Operating System (Linus Torvalds, Helsinki, Suomi) + an Apache Hyper Text Transfer Protocol (HTTP) server (Apache Software Foundation, Forest Hill, MD, USA) + a MySQLTM relational database (Oracle Corporation, Redwood City, CA, USA) + PHP: Hypertext Preprocessor (PHP) scripting language (Rasmus Lerdorf, Qeqertarsuaq/Disko Island, Greenland)) development As shown in Figure 1, the residential environment conducting the HEMS with the NILM is connected with a smart grid via AMI.In this situation, a power company-owned smart meter (instead of a traditional wattmeter) is installed and used to transmit data records/energy consumption data and receive Demand Response (DR) programs from a power utility for DSM.One of the most important functionalities of the smart grid is the self-decision-making ability [10].To enable this characteristic for DSM, DR, an effective mechanism for DSM in a smart grid, has been developed.DR in a smart grid is a viable approach to motivate users towards shifting their demands during peak load periods [11].As electrical appliances monitored in the residential environment are able to react to the DR programs received, the HEMS with the NILM in this paper was developed and used to identify electrical appliances monitored and modeled with their load patterns.In Figure 1, the Home Gateway (HG), the central entity of the HEMS, is based on an Advanced RISC Machine (ARM ® ) Cortex TM -A9 embedded system (Texas Instruments Inc., Dallas, TX, USA), which is configured with an LAMP (a Linux Operating System (Linus Torvalds, Helsinki, Suomi) + an Apache Hyper Text Transfer Protocol (HTTP) server (Apache Software Foundation, Forest Hill, MD, USA) + a MySQL TM relational database (Oracle Corporation, Redwood City, CA, USA) + PHP: Hypertext Preprocessor (PHP) scripting language (Rasmus Lerdorf, Qeqertarsuaq/Disko Island, Greenland)) development environment.The configured MySQL TM relational database is an enabled remote-access database.In the residential environment in which the HEMS with the NILM was tested, the HEMS continually acquired power consumption on each of the monitored individual major electrical household appliances linked in a ZigBee-based wireless communication network.Compared with the central HEMS, used as a benchmark, that intrusively identifies individual household appliances based on the deployment of installed smart e-meters, the proposed novel hybrid ANN-PSO-integrated NILM that non-intrusively identifies individual household appliances deduces which household appliance(s) is energized or de-energized based on an analysis of aggregated voltage and current signals acquired at the electrical service entrance of the residential environment.Related information identified by either the HEMS or the NILM is then stored in the MySQL TM relational database configured on the HEMS.The NILM proposed in this paper is implemented on a laptop computer (ASUSTeK Computer Inc., Taipei, Taiwan) and in LabVIEW TM with R programming language.R language is a free software (Ross Ihaka & Robert Gentleman, Auckland, New Zealand) environment for statistical computing and graphics; it publicly provides a free package repository that features more than 11,800 available software packages ranging from machine learning and statistical learning to graphics for data science/big data analytics and data visualization [12].In the NILM implemented with the HEMS, a standardized MySQL Connector/Open Database Connectivity (ODBC) driver, LabSQL Virtual Instruments, using the ADO (ActiveX Data Objects) object collection, and SQL (Structured Query Language) in LabVIEW TM , were conducted and used.The flow of data stores and signal requests as well as the remote control of monitored electrical household appliances in the HEMS with the NILM in this paper is shown in Figure 2. ZigBee (the Institute of Electrical and Electronics Engineers (IEEE) 802.15.4 standard) [13] is arguably the most popular technology for creating wireless sensor networks, and it has been included in some of the latest commercial [14] and academic home automation cases, including water pump control in smart fish farms with efficient energy consumption [15][16][17].Thanks to the ZigBee wireless communication network, the HG communicating with the monitored household appliances is able to perform remote direct as well as distributed load control for DSM/electrical energy management.As shown in Figures 1 and 2, Common Gateway Interface (CGI) programs are coded in Perl programming language and configured on the HG.An HTTP server-based user interface showing detailed electrical energy information identified by either the HEMS as a benchmark or the novel hybrid ANN-PSO-integrated NILM proposed and utilized in this paper was designed.The HTTP server configured on the HG interacts dynamically with residents via the Internet.Universal Asynchronous Receiver/Transmitter (UART for short), a RS232 Remote Terminal Unit (RTU)-format protocol, is used in the HEMS developed with the NILM in this paper for DSM.

NILM Based on an Innovative Hybrid ANN-PSO-Integraed Approach to Model and Identify Electrical Household Appliances Consuming Electrical Energy
The workflow of the NILM based on an innovative hybrid ANN-PSO-integrated approach proposed in this paper and used in the HEMS to identify the operation On/Off status of individual electrical power-intensive household appliances is shown in Figure 3.The novel hybrid ANN-PSO-integrated NILM conducted in a real house environment was used to identify power-intensive household appliances modeled and addressed as a load classification task.The proposed NILM is composed of data acquisition, event detection, and feature extraction, as well as load identification as load classification.It was implemented, in LabVIEW TM with R language, on a laptop computer linked with a National Instruments TM (NI) Data Acquisition (DAQ) device (Texas Instruments Inc., Dallas, TX, USA) via a USB (Universal Serial Bus) interface.During the data acquisition process, both the aggregated raw analog current and voltage signals were simultaneously and continuously acquired by an NI TM DAQ device with Low-Pass Filters (LPF) and Analog-to-Digital Converters (ADC).The DAQ device was installed at the electrical service entrance (the main electrical panel) of a realistic house environment conducting the HEMS with the NILM.The aggregated raw analog voltage and current signals sensed by only one single minimal set of voltage and current sensors were filtered by the LPF.Then, the filtered signals without high-frequency noise were digitized by the ADC.Once the digitized signals were analyzable, the proposed NILM was executed and used to perform (1) event detection and feature extraction, and (2) load identification.Event detection aims to detect abrupt power changes that reflect the occurrence of the electrical household appliance(s) being turned on or off.Minor power changes in the base load are not considered for event detection.In an event detected, the NILM proposed in this paper takes features reading, analyzes it, and then deduces which electrical appliance(s) is being turned on (energized) or off (de-energized).During the feature extraction process, features representing individual electrical appliances monitored in a realistic house environment are extracted from analyzable signals digitized.In the NILM addressed in this paper as a load classification task, the proposed novel hybrid ANN-PSO-integrated NILM learned from a training dataset collected on-site and off-line; the on-site load monitoring was executed on-line once the training process was complete.This two-stage process involving the novel hybrid ANN-PSO-integrated NILM that will be presented in detail in Section 2.2.3 is depicted in Figure 4.During the off-line load modeling stage, in the PSO, individuals/particles as candidate solutions of the ANN-considering the three principal design factors-were evaluated and evolved.At the end of the training process, it was expected that the ANN, which was automatically and meta-heuristically designed, would provide an acceptably high level of accuracy regarding overall classification rates during the training and testing processes.As the main focus of this paper is to develop an innovative methodology through which the NILM is able to automatically and meta-heuristically design an ANN for load classification, on-line training implemented in an un-supervised and self-organized learning sense is not covered in this paper.
the residential environment in which the HEMS with the NILM was tested, the HEMS continually acquired power consumption on each of the monitored individual major electrical household appliances linked in a ZigBee-based wireless communication network.Compared with the central HEMS, used as a benchmark, that intrusively identifies individual household appliances based on the deployment of installed smart e-meters, the proposed novel hybrid ANN-PSO-integrated NILM that non-intrusively identifies individual household appliances deduces which household appliance(s) is energized or de-energized based on an analysis of aggregated voltage and current signals acquired at the electrical service entrance of the residential environment.Related information identified by either the HEMS or the NILM is then stored in the MySQLTM relational database configured on the HEMS.The NILM proposed in this paper is implemented on a laptop computer (ASUSTeK Computer Inc., Taipei, Taiwan) and in LabVIEW TM with R programming language.R language is a free software (Ross Ihaka & Robert Gentleman, Auckland, New Zealand) environment for statistical computing and graphics; it publicly provides a free package repository that features more than 11,800 available software packages ranging from machine learning and statistical learning to graphics for data science/big data analytics and data visualization [12].In the NILM implemented with the HEMS, a standardized MySQL Connector/Open Database Connectivity (ODBC) driver, LabSQL Virtual Instruments, using the ADO (ActiveX Data Objects) object collection, and SQL (Structured Query Language) in LabVIEW TM , were conducted and used.The flow of data stores and signal requests as well as the remote control of monitored electrical household appliances in the HEMS with the NILM in this paper is shown in Figure 2. ZigBee (the Institute of Electrical and Electronics Engineers (IEEE) 802.15.4 standard) [13] is arguably the most popular technology for creating wireless sensor networks, and it has been included in some of the latest commercial [14] and academic home automation cases, including water pump control in smart fish farms with efficient energy consumption [15][16][17].Thanks to the ZigBee wireless communication network, the HG communicating with the monitored household appliances is able to perform remote direct as well as distributed load control for DSM/electrical energy management.As shown in Figures 1 and 2, Common Gateway Interface (CGI) programs are coded in Perl programming language and configured on the HG.An HTTP server-based user interface showing detailed electrical energy information identified by either the HEMS as a benchmark or the novel hybrid ANN-PSO-integrated NILM proposed and utilized in this paper was designed.The HTTP server configured on the HG interacts dynamically with residents via the Internet.Universal Asynchronous Receiver/Transmitter (UART for short), a RS232 Remote Terminal Unit (RTU)-format protocol, is used in the HEMS developed with the NILM in this paper for DSM.The preliminaries regarding ANN and PSO used in the proposed NILM are outlined in Sections 2.2.1-2.2.2.The proposed novel hybrid ANN-PSO-integrated NILM is presented in Section 2.2.3.

ANN
Biologically-inspired feed-forward ANN, such as the widely used and popular connectionist BP-ANN, have been in use since the mid-1980s.In a feed-forward BP-ANN, as shown in Figure 5, artificial neurons with synaptic weights including biases (weighting connections) are arranged and fully connected in the input, hidden, and output layers.As input data/training samples are fed through the network, the actual output(s) of the network computed is compared to target value(s) in a supervisory manner, and the error(s) compared and computed is then fed back through the network to incrementally adjust the updates of the weighting connections.The BP-ANN network will  The preliminaries regarding ANN and PSO used in the proposed NILM are outlined in Sections 2.2.1-2.2.2.The proposed novel hybrid ANN-PSO-integrated NILM is presented in Section 2.2.3.

ANN
Biologically-inspired feed-forward ANN, such as the widely used and popular connectionist BP-ANN, have been in use since the mid-1980s.In a feed-forward BP-ANN, as shown in Figure 5, artificial neurons with synaptic weights including biases (weighting connections) are arranged and fully connected in the input, hidden, and output layers.As input data/training samples are fed through the network, the actual output(s) of the network computed is compared to target value(s) in a supervisory manner, and the error(s) compared and computed is then fed back through the network to incrementally adjust the updates of the weighting connections.The BP-ANN network will The preliminaries regarding ANN and PSO used in the proposed NILM are outlined in Sections 2.2.1 and 2.2.2.The proposed novel hybrid ANN-PSO-integrated NILM is presented in Section 2.2.3.

ANN
Biologically-inspired feed-forward ANN, such as the widely used and popular connectionist BP-ANN, have been in use since the mid-1980s.In a feed-forward BP-ANN, as shown in Figure 5, artificial neurons with synaptic weights including biases (weighting connections) are arranged and fully connected in the input, hidden, and output layers.As input data/training samples are fed through the network, the actual output(s) of the network computed is compared to target value(s) in a supervisory manner, and the error(s) compared and computed is then fed back through the network to incrementally adjust the updates of the weighting connections.The BP-ANN network will ultimately be trained (the total error is systematically reduced, since weights adjust as the network learning proceeds).
Processes 2017, 5, x FOR PEER REVIEW 7 of 16 ultimately be trained (the total error is systematically reduced, since weights adjust as the network learning proceeds).The adjustable parameters (that is, the weighting connections) of the BP-ANN network in Figure 5 include vqj and wiq.The weighting connections of the BP-ANN network constructing only one single hidden layer as a demonstration in this paper are updated according to Equation (1) and Equation (2).They are updated during the backward-pass process of the whole training process of the network.

] )][ ( ][ [
In Equation (1), η is the learning rate; di is the desired/target output of the i-th artificial neuron in the output layer of the BP-ANN network; yi is the computed output of the i-th artificial neuron in the output layer of the network; a denotes the user-specified activation function-an abstraction representing the rate of action potential firing in a biological neuron cell, which can be, for example, a continuous sigmoid-type function; and neti is computed and considered the net input of the i-th artificial neuron in the output layer of the BP-ANN network (from neurons outputted in the hidden layer during the forward-pass process of the whole training process of the network), which is usually a weighted sum of the inputs of the i-th artificial neuron.Furthermore, zq, is the computed output of the q-th artificial neuron in the hidden layer of the network (its net input, a weighted-sum value, is computed when xj is presented during the forward-pass process).
The commonly-used GD learning algorithm using Equations ( 1) and ( 2) can be conducted for use of training the BP-ANN.Equations ( 1) and ( 2) adopt the incremental approach in updating the weighting connections of the BP-ANN network; that is, the weighting connections are changed immediately after one training sample is presented.

PSO
The conventional PSO method [18][19][20][21][22][23], inspired by the swarming or collaborative behavior of biological populations and developed by Dr. Eberhart and Dr. Kennedy in 1995, is a populationbased stochastic optimization technique.PSO is similar to Genetic Algorithms (GAs) in the sense that The adjustable parameters (that is, the weighting connections) of the BP-ANN network in Figure 5 include v qj and w iq .The weighting connections of the BP-ANN network constructing only one single hidden layer as a demonstration in this paper are updated according to Equations ( 1) and (2).They are updated during the backward-pass process of the whole training process of the network.
In Equation (1), η is the learning rate; d i is the desired/target output of the i-th artificial neuron in the output layer of the BP-ANN network; y i is the computed output of the i-th artificial neuron in the output layer of the network; a denotes the user-specified activation function-an abstraction representing the rate of action potential firing in a biological neuron cell, which can be, for example, a continuous sigmoid-type function; and net i is computed and considered the net input of the i-th artificial neuron in the output layer of the BP-ANN network (from neurons outputted in the hidden layer during the forward-pass process of the whole training process of the network), which is usually a weighted sum of the inputs of the i-th artificial neuron.Furthermore, z q , a(net q ) = a( m ∑ j=1 v qj x j ) is the computed output of the q-th artificial neuron in the hidden layer of the network (its net input, a weighted-sum value, is computed when x j is presented during the forward-pass process).
The commonly-used GD learning algorithm using Equations ( 1) and ( 2) can be conducted for use of training the BP-ANN.Equations ( 1) and ( 2) adopt the incremental approach in updating the weighting connections of the BP-ANN network; that is, the weighting connections are changed immediately after one training sample is presented.

PSO
The conventional PSO method [18][19][20][21][22][23], inspired by the swarming or collaborative behavior of biological populations and developed by Dr. Eberhart and Dr. Kennedy in 1995, is a population-based stochastic optimization technique.PSO is similar to Genetic Algorithms (GAs) in the sense that these two meta-heuristics are population-based search methods.Compared with the GAs solving engineering optimization problems, in which the search space is highly modal, discontinuous, and/or constrained [18], the PSO technique that is able to solve the same engineering optimization problems addressed by the GA has the following three advantages: First, there are no explicit evolution operators-such as selection operations, crossover operations, and mutation operations.Second, it has a low probability of solutions falling into local optimization regions.Third, the designed optimization process has fewer adjusted parameters than that of the GA.PSO has been successfully applied in many engineering fields, such as continuous function optimization and fuzzy logic control.Conventional PSO is initialized with a population of randomly generated particles as solution candidates.It searches for global optima by updating particles through iterations; particles having their own velocity to direct the flying of themselves fly through the search space by following the current optimal particles (this represents the best strategy to find the best solution).In each generation of the optimization process, each particle is updated by p best and g best , where p best is the best solution (from the local view) that has been achieved so far and g best is the best solution (from the global view) that is obtained currently by any particle in the population.After finding p best and g best , the particle updates its velocity and position as follows [18].
In Equation (3), t denotes the t-th iteration; w is the inertia weight parameter; rand() is a randomly generated real number belonging to (0, 1); c 1 andc 2 are acceleration factors.
In this paper, w in Equation (3) varies, as expressed by Equation (4).Moreover, in this paper, c 1 and c 2 in Equation (3) are adaptively changed, which impacts the convergence speed and optimization accuracy [22].c 1 and c 2 are adapted by Equations ( 5) and ( 6), respectively, during the optimization process.
In Equation ( 4), Iteration tmax stands for the maximum number of iterations.
From generation to generation, particles converge to the best solution.

Novel Hybrid ANN-PSO Optimizing the Three Principal Design Factors Relating to an ANN Design
Feed-forward ANNs are made up of artificial neurons arranged in input, hidden and output layers.The design of an ANN is a complex task; the performance of the ANN outlined in Section 2.2.1 depends on the three principal design factors-the network topology, type of activation functions, and training algorithm.In this paper, the PSO outlined in Section 2.2.2 was used to automatically and meta-heuristically design an ANN considering the three principal design factors.No recurrent connections appeared in an ANN design in this paper.PSO, instead of several classic algorithms Processes 2018, 6, 236 9 of 16 such as the commonly used GD algorithm, was employed in this paper since classic algorithms other than bio-inspired soft-computing algorithms cannot explore multimodal and non-continuous, minimized error surfaces.By employing PSO to (1) cope with such complexities, thanks to its superior capabilities, and (2) automatically and meta-heuristically design an ANN, taking into consideration the three principal design factors, the first important step was to encode the ANN into evolved particles.Suppose the ANN shown in Figure 5 has an m-q-n network structure, where m is the total number of input artificial neurons, n is the total number of output artificial neurons, and q is the maximum number of artificial neurons defined and computed as c•(n + m + [round((n + m)/2)]).Totally, there are (m + 1)•q + (q + 1)•n synaptic weights including biases (weighting connections) in the ANN.For the topology of the ANN to be evolved, the number of artificial neurons, a positive integer number, is codified into a (c•q)-bit binary string; each bit of the (c•q)-bit binary string indicates whether the corresponding artificial neuron exists in the hidden layer of the ANN or not (it is interpreted that an artificial neuron is observed as a bit when a value of "1" is generated).Additionally, the activation function used in hidden neurons of the ANN is one of the following six different types of activation functions: Sigmoid function, hyperbolic tangent function, sinusoidal function, Gaussian function, linear function, or hard-limit function.Across the three principal design factors considered and described above, a total of (c•q) + [(m + 1)•q + (q + 1)•n] + 1 free parameters encoded with respect to the ANN in Figure 5 need to be evolved, each of which is codified into a real number.The codification of the ANN encoded into each particle for the PSO process is illustrated in Figure 6.The vector that represents a particle/individual codifies the three principal design factors of designing an ANN automatically and meta-heuristically.Following the first important step of the PSO described above, the next important step is to define a fitness metric that is totally problem-dependent.A good fitness metric can gradually guide the PSO to find the global optimal solution.In this paper, the fitness metric is mathematically clarified as Equation (8).In this case, the best individual is that for which the ANN gives an acceptable value of the Sum of Squared Errors (SSE) with the quasi-optimal architectural design of an ANN.SSE is the sum of the squares of residuals in statistics, which represents the algebraically computed error/disturbance between the computed forward-propagation output of ANN and the desired output of the fed input.The fitness metric clarified in Equation ( 8) is in a weighted-sum form.Also, w 1 + w 2 = 1.During the evaluation procedure of PSO, each particle must be decoded and transformed into an ANN, forming from the evolved candidate solution relating to the three principal design factors.The PSO presented in Section 2.2.2 and used in this paper was employed to automatically and meta-heuristically design an ANN considering the three principal design factors; at the same time, all the constraints in Equation ( 8) are respected.The methodology of the novel hybrid ANN-PSO-integrated NILM proposed in this paper and presented in this section refers to the process depicted in Figure 4.The pseudo code of the PSO process used to automatically and meta-heuristically design the ANN considering the three principal design factors in this paper is given in Table 1.
Processes 2017, 5, x FOR PEER REVIEW 9 of 16 Totally, there are (m + 1)•q + (q + 1)•n synaptic weights including biases (weighting connections) in the ANN.For the topology of the ANN to be evolved, the number of artificial neurons, a positive integer number, is codified into a (c•q)-bit binary string; each bit of the (c•q)-bit binary string indicates whether the corresponding artificial neuron exists in the hidden layer of the ANN or not (it is interpreted that an artificial neuron is observed as a bit when a value of "1" is generated).Additionally, the activation function used in hidden neurons of the ANN is one of the following six different types of activation functions: Sigmoid function, hyperbolic tangent function, sinusoidal function, Gaussian function, linear function, or hard-limit function.Across the three principal design factors considered and described above, a total of (c•q) + [(m + 1)•q + (q + 1) •n] + 1 free parameters encoded with respect to the ANN in Figure 5 need to be evolved, each of which is codified into a real number.The codification of the ANN encoded into each particle for the PSO process is illustrated in Figure 6.The vector that represents a particle/individual codifies the three principal design factors of designing an ANN automatically and meta-heuristically.Following the first important step of the PSO described above, the next important step is to define a fitness metric that is totally problem-dependent.A good fitness metric can gradually guide the PSO to find the global optimal solution.In this paper, the fitness metric is mathematically clarified as Equation ( 8).In this case, the best individual is that for which the ANN gives an acceptable value of the Sum of Squared Errors (SSE) with the quasi-optimal architectural design of an ANN.SSE is the sum of the squares of residuals in statistics, which represents the algebraically computed error/disturbance between the computed forward-propagation output of ANN and the desired output of the fed input.The fitness metric clarified in Equation ( 8) is in a weighted-sum form.Also, w1 + w2 = 1.During the evaluation procedure of PSO, each particle must be decoded and transformed into an ANN, forming from the evolved candidate solution relating to the three principal design factors.The PSO presented in Section 2.2.2 and used in this paper was employed to automatically and meta-heuristically design an ANN considering the three principal design factors; at the same time, all the constraints in Equation ( 8) are respected.The methodology of the novel hybrid ANN-PSO-integrated NILM proposed in this paper and presented in this section refers to the process depicted in Figure 4.The pseudo code of the PSO process used to automatically and meta-heuristically design the ANN considering the three principal design factors in this paper is given in Table 1.
Table 1.The PSO with its variants proposed in Reference [22] and used in this paper.
For each particle Randomly Initialize the particle End Do For each particle Compute its fitness value (the fitness function used for ANN design in Equation ( 8) and described in Section 2.2.3)If the fitness value is better than p best in history, then Set the current value as the new p best End Choose the particle with the best fitness value (against all the other particles in the population) as the g best For each particle Compute its particle velocity, according to Equation (3) Update its particle position, according to Equation (7), where the binary PSO inspired in Reference [21] is conducted here as shown in Figure 6 End During the PSO process, the constraints of the fitness function in Equation (8) need to be satisfied While the pre-specified maximum iteration or the minimum error tolerance is not attained PSO was used in this paper to automatically and meta-heuristically design an ANN considering the three principal design factors; at the same time, all the constraints in Equation (8) were respected

Experimentation
The experimentation conducted to test the proposed methodology is presented in this section.The IoT-oriented HEMS utilizing the novel hybrid ANN-PSO-integrated NILM proposed in this paper and presented in Section 2 was deployed and experimentally evaluated in a realistic house environment in Taiwan.Figure 7 shows the experimental setup of the HEMS with the NILM.In this experiment, major electrical household appliances identified in Line Branch 1 (L1) of the electrical wiring of the residential environment in Taiwan include an electric rice cooker (~1.10 kW), an electric water boiler (~0.90 kW), a steamer (~0.80 kW), and a television (~0.22 kW).The electricity is Alternating Current (AC) 110 V/60 Hz in Taiwan.For the HEMS that intrusively identified the electrical household appliances in the house environment, ZigBee-based plug-load smart e-meters were installed.For the NILM that non-intrusively identified the electrical household appliances in the house environment, the aggregated current and voltage signals acquired from the main electrical panel of the residential environment were simultaneously and continuously sampled by an NI TM 9225 DAQ device first.The incoming analog signal on each channel of the DAQ device was conditioned, buffered, and then sampled by a 24-bit Delta-Sigma ADC.The DAQ device used a combination of analog and digital filtering, with the purpose of providing an accurate representation of in-band signals while rejecting out-of-band signals.An active current transformer that generates output voltage proportional to its input current was connected to L1; its output voltage was wired to one of the input channels of the DAQ device.For voltage measurements, the electricity was directly wired to one of the remaining channels of the DAQ device.The data rate of the DAQ device used was set to 2000 samples/s.The DAQ device passed the digitized signals to the laptop computer via USB every second for further NILM analysis.The laptop computer, an ASUS ZENBOOK TM Prime Core TM i7 UX31A computer (ASUSTeK Computer Inc., Taipei, Taiwan), ran the NILM proposed in this paper, presented in Section 2.2 and implemented in LabVIEW TM with R language.By taking an electrical feature reading, the NILM deduced which electrical appliance(s) was being energized or de-energized.The HEMS, taken as a benchmark, continually collected data from each of the monitored individual electrical household appliances every 20 s by talking to the installed ZigBee-based plug-load smart e-meters.In this experimentation, the total number, N, of electrical household appliances powered in L1 in the house environment and monitored by the proposed NILM was four; a total of 16 (2 N ) load classes needed to be classified.The load classes that needed to be classified included scenarios in which electrical appliances were simultaneously turned on or off.In the house environment, four load classes/scenarios were excluded, since in reality the power-intensive electrical household appliances should not be operated and used at the same time so the conductor of the electrical wiring in the residential environment would not be overloaded.As shown in Figure 7, the HEMS benchmark with the installed ZigBee-based smart e-meters was compared.Thus, for the NILM, only one single minimal set of current and voltage sensors needed to be installed.The centralized HEMS, communicating with the monitored household appliances via a ZigBee-based wireless communication network, identified the household appliances intrusively, Meanwhile, the NILM, analyzing the aggregated voltage and current signals acquired from the main electrical panel in the residential environment, identified the household appliances non-intrusively.In this experiment, for each load class, on-site 80 voltage and current measurements were performed off-line; 40 voltage and randomly chosen current measurements were used for the training process of the NILM, while the remaining 40 voltage and current measurements were used for tests of the NILM.There were, in total, 960 data/load instances collected.Figure 8 shows the whole feature space addressed in this paper.The feature space included the electrical features real power (P) and reactive power (Q) extracted from each load instance in this experiment.In the residential environment, the base load including phantom loads was ~0.55 kW.For load classification, the novel hybrid ANN-PSO-integrated NILM was conducted.q was computed to be equal to 27.The parameters used by the PSO to automatically and meta-heuristically design the ANN in this experiment are listed in Table 2.The length of each particle, len, was 221 (= 27 + (3 × 27 + 28 × 4) + 1), since the ANN shown in Figure 8 and used in this experiment had an m-q-n network structure where m, q, and n were equal to 2, 27, and 4, respectively.The inertia weight, w, was used to balance the local and global search during the PSO process; typically, it varies linearly from 1 to near 0 during the execution of the PSO process [22].The acceleration coefficients, c 1 and c 2 , had an impact on the convergence speed and optimization accuracy; they changed with the time-varying acceleration coefficients [22].The population size, N pop , used in this experiment was 5500.The maximum number of iterations, Iteration tmax , was set to 50.The PSO trajectory obtained in this experiment is shown in Figure 9.The PSO process was terminated when the maximum number of iterations was reached.To verify the efficiency of the proposed methodology, the PSO ran for 25 trials, at which point its mean and standard deviation of the meta-heuristics were 2.46 and 0.26, respectively.Table 3 shows the load identification results obtained by different ANN approaches used in the experimentation.As shown in Table 3, the novel hybrid ANN-PSO-integrated NILM proposed in this paper gave an overall classification rate of 91.67% in tests, achieving an SSE of 62.83.The ANN obtained in this experiment and used with the sigmoid-type activation functions is illustrated in Figure 10.The ANN enhanced by the parallel meta-heuristics, the PSO, in this paper was produced with improved classification performance.Meanwhile, the overall classification rate is improved by 8.34%, with the use of the proposed methodology.In this paper, the ANN was hybridized with the PSO for DSM, which is different from the approaches in References [4,5].This method achieves a connection between (1) the structural changes of connectionists having the best set of weighting connections and (2) the number of iterations of meta-heuristics for an ANN design.The proposed methodology automatically and meta-heuristically designed an ANN, taking into consideration the three principal design factors-the network topology for determining the superiority of the empowered ANN, the type of activation functions for approximating the influence of an extracellular field on neurons, and the training algorithm for adjusting the relevant weighting connections.The fully-connected ANN was used in this paper, as it is easy to be implemented [24].It is possible to allow PSO to learn variable-length ANN architectures involving weighting connections, while a particle encoding strategy proposed in Reference [24] and conducted for image classification was used to hide some dimensions of the particle vectors to achieve variable-length particles.
Processes 2017, 5, x FOR PEER REVIEW 13 of 16 Iterationtmax 50 Maximum velocity 25 Range of weighting connections (−25, 25) 1 The fully-connected ANN was used in this paper, as it is easy to be implemented [24].It is possible to allow PSO to learn variable-length ANN architectures involving weighting connections, while a particle encoding strategy proposed in Reference [24] and conducted for image classification was used to hide some dimensions of the particle vectors to achieve variable-length particles.

Conclusions and Future Work
Electrical energy forms an indispensable part of today's modern society; our current way of life would be impossible without the aid of electricity.Monitoring and managing industrial, commercial, and residential electrical appliances in fields of interest such that the efficiency of electrical energy used in today's modern society can be improved in DSM can be realized through use of EMS.In this paper, an IoT-oriented smart HEMS utilizing a novel hybrid ANN-PSO-integrated NILM approach to model and identify electrical appliances consuming electrical energy was proposed for DSM and experimentally evaluated in a realistic house environment in Taiwan.For DSM, treated as load classification in NILM, ANN can be used as a classification model to map electrical feature inputs to approximate desired load outputs [27].However, it is very hard to determine an optimal ANN design for a given problem.In this paper, the ANN is hybridized with PSO for DSM, which is different from the approaches in References [4,5] and forges a connection between (1) the structural changes of connectionists having the best set of weighting connections and (2) the number of iterations of metaheuristics for an ANN design.The proposed methodology automatically and meta-heuristically designed an ANN taking into consideration the three principal design factors-the network topology for determining the superiority of the empowered ANN (usually, the number of hidden neurons used is determined by a rule of thumb), the type of activation functions for approximating the influence of an extracellular field on neurons, and the training algorithm for adjusting the relevant weighting connections.As the experimental results reported in this paper showed, the novel hybrid ANN-PSO-integrated NILM proposed in this paper gave the overall classification rate of 91.67%.The ANN enhanced by the parallel meta-heuristics, the PSO, was produced with improved classification performance; specifically, the overall classification rate was improved by 8.34% with the use of the proposed methodology.The work reported in this paper could be incorporated with the Multi-Agent System (MAS) of Reference [10].In this case, the ANN in Reference [10] would forecast precise shortterm loads based on detailed load profiles identified from consumers in downstream sectors of a smart grid, and then the MAS would reduce more peak loads, yielding deep insights on the selfdecision-making process by the smart distributed generation-equipped distribution network system.
The novel hybrid ANN-PSO-integrated NILM for DSM was proposed in this paper.In the future, a mechanism to achieve variable-length particles by hiding some dimensions of particle vectors for the PSO process should be developed.Furthermore, it will be interesting to see how different ANN topologies affect the performance of the hybridized PSO, as this information could be used to automatically and meta-heuristically design the best ANN.

Conclusions and Future Work
Electrical energy forms an indispensable part of today's modern society; our current way of life would be impossible without the aid of electricity.Monitoring and managing industrial, commercial, and residential electrical appliances in fields of interest such that the efficiency of electrical energy used in today's modern society can be improved in DSM can be realized through use of EMS.In this paper, an IoT-oriented smart HEMS utilizing a novel hybrid ANN-PSO-integrated NILM approach to model and identify electrical appliances consuming electrical energy was proposed for DSM and experimentally evaluated in a realistic house environment in Taiwan.For DSM, treated as load classification in NILM, ANN can be used as a classification model to map electrical feature inputs to approximate desired load outputs [27].However, it is very hard to determine an optimal ANN design for a given problem.In this paper, the ANN is hybridized with PSO for DSM, which is different from the approaches in References [4,5] and forges a connection between (1) the structural changes of connectionists having the best set of weighting connections and (2) the number of iterations of meta-heuristics for an ANN design.The proposed methodology automatically and meta-heuristically designed an ANN taking into consideration the three principal design factors-the network topology for determining the superiority of the empowered ANN (usually, the number of hidden neurons used is determined by a rule of thumb), the type of activation functions for approximating the influence of an extracellular field on neurons, and the training algorithm for adjusting the relevant weighting connections.As the experimental results reported in this paper showed, the novel hybrid ANN-PSO-integrated NILM proposed in this paper gave the overall classification rate of 91.67%.The ANN enhanced by the parallel meta-heuristics, the PSO, was produced with improved classification performance; specifically, the overall classification rate was improved by 8.34% with the use of the proposed methodology.The work reported in this paper could be incorporated with the Multi-Agent System (MAS) of Reference [10].In this case, the ANN in Reference [10] would forecast precise short-term loads based on detailed load profiles identified from consumers in downstream sectors of a smart grid, and then the MAS would reduce more peak loads, yielding deep insights on the self-decision-making process by the smart distributed generation-equipped distribution network system.
The novel hybrid ANN-PSO-integrated NILM for DSM was proposed in this paper.In the future, a mechanism to achieve variable-length particles by hiding some dimensions of particle vectors for the PSO process should be developed.Furthermore, it will be interesting to see how different

Figure 1
Figure 1 depicts the block diagram of the central IoT-oriented HEMS with the novel hybrid ANN-PSO-integrated NILM proposed in this paper and deployed in a residential environment.

Figure 1
Figure 1 depicts the block diagram of the central IoT-oriented HEMS with the novel hybrid ANN-PSO-integrated NILM proposed in this paper and deployed in a residential environment.

Figure 1 .
Figure 1.Block diagram of the proposed central Internet of Things (IoT)-oriented Home Energy Management System (HEMS) utilizing the novel hybrid Artificial Neural Network (ANN)-Particle Swarm Optimization (PSO)-integrated Non-Intrusive Load Monitoring (NILM) proposed in this paper and deployed in a realistic residential environment for Demand-Side Management (DSM) as a load classification task.

Figure 1 .
Figure 1.Block diagram of the proposed central Internet of Things (IoT)-oriented Home Energy Management System (HEMS) utilizing the novel hybrid Artificial Neural Network (ANN)-Particle Swarm Optimization (PSO)-integrated Non-Intrusive Load Monitoring (NILM) proposed in this paper and deployed in a realistic residential environment for Demand-Side Management (DSM) as a load classification task.

Figure 2 .
Figure 2. Flow of data stores, signal requests, and remote control of monitored electrical appliances in the IoT-oriented HEMS employing the novel hybrid ANN-PSO-integrated NILM proposed in this

Figure 2 .
Figure 2. Flow of data stores, signal requests, and remote control of monitored electrical appliances in the IoT-oriented HEMS employing the novel hybrid ANN-PSO-integrated NILM proposed in this paper.DSM in the IoT-oriented HEMS is mainly realized through a heterogeneous network involving ZigBee, Radio Frequency (RF), and Infrared Radiation (IR).

Figure 3 .
Figure 3. Workflow of the innovative hybrid ANN-PSO-integrated NILM used in the HEMS and proposed in this paper.

Figure 4 .
Figure 4. Illustration of the two-stage NILM used to automatically and meta-heuristically design ANN.This NILM is trained on-site and off-line for load modeling, and is subsequently executed online for on-site load monitoring.Features used and identified by the proposed novel hybrid ANN-PSO-integrated NILM can be P, Q, Root-Mean-Square (RMS) values, and/or Fast Fourier Transform (FFT).

Figure 3 . 16 Figure 3 .
Figure 3. Workflow of the innovative hybrid ANN-PSO-integrated NILM used in the HEMS and proposed in this paper.

Figure 4 .
Figure 4. Illustration of the two-stage NILM used to automatically and meta-heuristically design ANN.This NILM is trained on-site and off-line for load modeling, and is subsequently executed online for on-site load monitoring.Features used and identified by the proposed novel hybrid ANN-PSO-integrated NILM can be P, Q, Root-Mean-Square (RMS) values, and/or Fast Fourier Transform (FFT).

Figure 4 .
Figure 4. Illustration of the two-stage NILM used to automatically and meta-heuristically design ANN.This NILM is trained on-site and off-line for load modeling, and is subsequently executed on-line for on-site load monitoring.Features used and identified by the proposed novel hybrid ANN-PSO-integrated NILM can be P, Q, Root-Mean-Square (RMS) values, and/or Fast Fourier Transform (FFT).

Figure 5 .
Figure 5. Structure of the feed-forward ANN conducting the Gradient Descent (GD) process as well as the PSO as the training algorithm.

Figure 5 .
Figure 5. Structure of the feed-forward ANN conducting the Gradient Descent (GD) process as well as the PSO as the training algorithm.

Figure 6 .
Figure 6.Codification of the ANN encoded into each particle for an ANN designed through the PSO process.

Figure 6 .
Figure 6.Codification of the ANN encoded into each particle for an ANN designed through the PSO process.

Processes 2017, 5 ,Figure 7 .
Figure 7. Experimental setup of the HEMS with the NILM proposed in this paper, deployed and experimentally evaluated in a realistic house environment in Taiwan.The HEMS, taken as a benchmark with the installed ZigBee-based smart e-meters, was compared.For the NILM, only one single minimal set of current and voltage sensors needed to be installed.

Figure 8 .
Figure 8. Treated whole feature space being of extracted electrical features 'P' and 'Q'.

Figure 7 .Figure 7 .
Figure 7. Experimental setup of the HEMS with the NILM proposed in this paper, deployed and experimentally evaluated in a realistic house environment in Taiwan.The HEMS, taken as a benchmark with the installed ZigBee-based smart e-meters, was compared.For the NILM, only one single minimal set of current and voltage sensors needed to be installed.

Figure 8 .
Figure 8. Treated whole feature space being of extracted electrical features 'P' and 'Q'.

Figure 8 .
Figure 8. Treated whole feature space being of extracted electrical features 'P' and 'Q'.

Figure 9 .
Figure 9. PSO trajectory obtained in this experiment.The elapsed time is ~1289.30s.

Figure 9 .
Figure 9. PSO trajectory obtained in this experiment.The elapsed time is ~1289.30s.

Figure 10 .
Figure 10.Illustration of the ANN obtained and used in this experiment.

Figure 10 .
Figure 10.Illustration of the ANN obtained and used in this experiment.
NILM gave an overall classification rate of 91.67%.The overall classification rate was improved by 8.34% with the use of the proposed methodology.

Table 2 .
Parameters used by the PSO for the ANN in this paper.

Table 2 .
Parameters used by the PSO for the ANN in this paper.

Table 2 .
Parameters used by the PSO for the ANN in this paper.

Table 3 .
Load identification results obtained by different ANN approaches used in this experiment.

Table 3 .
Load identification results obtained by different ANN approaches used in this experiment.

Results Back Propagation (BP)-ANN Hybrid ANN-PSO
[25]he class label of a test instance/query identified by the proposed novel hybrid ANN-PSO-integrated NILM matched its actual class label, the query was made correctly; otherwise, it was not made correctly.The overall classification rate[25]is computed as: