Dynamic User Preference Parameters Selection and Energy Consumption Optimization for Smart Homes Using Deep Extreme Learning Machine and Bat Algorithm

The advancements in electronic devices have increased the demand for the internet of things (IoT) based smart homes, where the connecting devices are growing at a rapid pace. Connected electronic devices are more common in smart buildings, smart cities, smart grids, and smart homes. The advancements in smart grid technologies have enabled to monitor every moment of energy consumption in smart buildings. The issue with smart devices is more energy consumption as compared to ordinary buildings. Due to smart cities and smart homes’ growth rates, the demand for efficient resource management is also growing day by day. Energy is a vital resource, and its production cost is very high. Due to that, scientists and researchers are working on optimizing energy usage, especially in smart cities, besides providing a comfortable environment. The central focus of this paper is on energy consumption optimization in smart buildings or smart homes. For the comfort index (thermal, visual, and air quality), we have used three parameters, i.e., Temperature (°F), illumination (lx), and CO2 (ppm). The major problem with the previous methods in the literature is the static user parameters (Temperature, illumination, and CO2); when they (parameters) are assigned at the beginning, they cannot be changed. In this paper, the Alpha Beta filter has been used to predict the indoor Temperature, illumination, and air quality and remove noise from the data. We applied a deep extreme learning machine approach to predict the user parameters. We have used the Bat algorithm and fuzzy logic to optimize energy consumption and comfort index management. The predicted user parameters have improved the system’s overall performance in terms of ease of use of smart systems, energy consumption, and comfort index management. The comfort index after optimization remained near to 1, which proves the significance of the system. After optimization, the power consumption also reduced and stayed around the maximum of 15-18wh.


I. INTRODUCTION
The use of information technology in the smart building environment for connectivity has increased during recent years. It is believed that in the future, more devices will be connected The associate editor coordinating the review of this manuscript and approving it for publication was Jenny Mahoney.
homes' compatibility with grids; internal power units need to be synchronized with the smart grids [4]. The synchronization in terms of the demand and supply of electrical power is required to reduce smart homes' energy consumption. With smart cities' advancements, the traditional grids have also been replaced with smart grids, monitoring the energy demand and producing energy accordingly [5]. The prediction techniques are most commonly used to predict day-ahead energy pricing and energy prediction in smart grids and smart homes [6].
The smart power systems incorporate information technology with the traditional electricity infrastructures [7]. The home area network (HAN) provides a protocol to the devices for communication [8]. Although smart homes have revolutionized the smart home industry, on the other side, it has also increased the cost of living as compared to traditional homes. The cost could be in terms of expensive electrical equipment, electricity bills, maintenance, and so forth. Other expenses depend upon the vendors of equipment and different departments, which cannot be directly controlled [9]. However, the energy consumption of technology inventions for smart homes can be reduced to save smart homes' overall costs to some extent. Further, the energy in smart homes is being wasted due to the 24/7 standby mode of electrical devices; the electronic devices still consume some amount of energy even they are turned off due to connected to the power source. The other factors that contribute to the waste are leaving the light turned on while no one is in the room, not using energy-efficient bulbs, setting the air conditioner to the high thermostat, not changing the filters of the HVAC system, and so forth.
Energy consumption management is the need of time due to precious resources being wasted annually. Further, the production cost of electricity keeps increasing day by day. With the advancement in the information technology sector and the introduction of the IoT, the scenarios are changed. Researchers are trying to get more and more benefit from IoT technologies. Smart cities and smart homes are becoming people's interests due to their advanced features and automation processes.
The energy consumption optimization and prediction are also significant issues in smart homes. Recent studies show that the problem is still not tackled, and countless amounts of energy are being wasted. According to the green energy standards, the design of buildings will ultimately reduce energy consumption, but with the optimization techniques, we can achieve the maximum benefit of energy-saving [10]. Different prediction techniques have been successfully used to predict energy consumption in smart homes [11]- [13].
The other major issue in the smart home is parameter selection, i.e., Temperature, illumination, and CO 2 . The literature review has revealed that the user parameters in the energy consumption optimization model are static. Once, at the initial stage, parameters are set, the system will operate on the same parameters, which increases energy consumption. The same is the case in traditional homes where the residents always set parameters using the remote control or even some other old methods. There are some fluctuations in the environmental parameters in the real environment; the user parameters also have a specific range in which he/she (resident) feels comfortable [14].
Due to the problems mentioned above and the nonsynchronization of the smart home systems with external weather changes, the energy consumption is quite higher. The static parameters also affect the residents' comfort level because the system operates at static parameters despite the consideration of external weather and user preferences. This situation also creates problems for persons with disabilities and children who can not manage the systems correctly; in other words, the current systems are not user-friendly for particular categories of people. This paper focuses on overcoming some of these issues to reduce energy consumption and increase the comfort index. The proposed method will also improve the systems so that the comfort level of special persons (disabled, children) can also be considered.
In this paper, we have used a deep extreme learning machine (DELM) to make the user parameters adaptive and dynamic so that the system can change parameters according to the indoor environmental conditions to reduce the energy consumption to the maximum level. Due to the adaptive parameters, the system operates according to the indoor environmental conditions and calculates the user parameters accordingly to improve the comfort index. The adaptive parameters have improved the comfort index along with the reduced energy consumption, which means two-fold objectives have been achieved [15]. We have used the Bat algorithm in the optimization layer, which takes user parameters and environmental parameters as input and output the optimal parameters for the actuators to operate the relevant cooling/ heating, lighting, or any other system in the smart home.
Bat algorithm (BA) has been selected due to its novel feature, a frequency-tuning technique for expanding diverse solutions in the given data (population). The other characteristics are the zooming for the balance of exploration and exploitation during the search process. These characteristics make it an efficient and quick starter algorithm suitable for energy consumption optimization in smart homes [16]. In the literature, researchers have used three parameters, i.e., Temperature, illumination, and CO 2 , for the thermal, visual, and air quality comfort [17]- [19]. Based on the consideration of three parameters in this paper, we have also used three parameters, i.e., Temperature, illumination, and air quality.
For the calculation of the required power for equipment and user parameters, fuzzy logic has been used. The fuzzy logic contains different rules and membership functions. The Bat algorithm selection has been carried out based on its strong optimization capabilities [20]. The detailed description of the proposed method has been described in relevant subsections.
The remaining structure of the paper is organized as: Section II contains the literature review, the proposed methodology is explained in section III, section IV contains experimental results, section V includes discussion, and finally, the conclusion of the study is presented.

II. LITERATURE REVIEW
A detailed review of some of the prominent methods related to energy consumption optimization and prediction has been carried out in [6]. In [14], a model-based on feed-forward backpropagation neural network, tan-sigmoid function, and linear function has been proposed for the energy consumption prediction in smart homes. Another similar kind of predictive model of short -term energy usage has been suggested by [21] using a multi-layer perceptron (MLP), scaled conjugate gradient, and Levenberg -Marquardt backpropagation algorithms. An energy forecasting method for smart homes proposed in [22] used artificial neural networks for the prediction of energy consumption at different time intervals of a day or week. The dynamic neural network and Energy-Plus program has been useful in predicting building energy load and the Taguchi method to measure the impact of parameters on the load [23]. Another effective hybrid method in [24] used an autoregressive integrated moving average (ARIMA) to predict energy usage. An IoT based home energy management system for the energy consumption optimization of electric equipment in smart homes in [25] used a hybrid artificial neural network and particle swarm optimization algorithms. The home energy management system (HEM) algorithm proposed in [26] is also a useful energy consumption optimization and prediction approach.
An electromagnetism-based firefly algorithm -artificial neural network (EFA-ANN) mentioned in [27] has been used for the energy consumption forecasting using heating and cooling load in terms of prediction accuracy. The model focuses on the early design of energy-efficient buildings. Besides simple neural networks, other algorithms have also been successful for the energy consumption prediction like the extreme learning machine based model in [28], Bat algorithm, and fuzzy logic controller for energy consumption optimization using Temperature, illumination, and air quality in [20]. The genetic algorithm (GA), artificial neural network (ANN), and fuzzy logic have played a useful role in a multi-objective optimization model in [29] for the energy consumption optimization, comfort index management, and prediction of short-term load consumption. The implementation of the genetic algorithm (GA) and firefly algorithm (FA) in [30] to optimize energy consumption and to improve comfort level illustrates the significance of the problem of energy optimization. Kalman filter for the prediction of environmental parameters and the Bat algorithm has been used for the energy consumption reduction and comfort index improvement in smart cars using dynamic membership functions rather than static [31].
Dynamic programming has also been effective in minimizing cost function and reducing energy consumption [32]. In [33], radial basis functions neural network maintained the thermal comfort in the HVAC system with maximum energy consumption optimization. The fog based hybrid intelligent system has also achieved energy efficiency in smart buildings [34]. The energy demand management system in [35] is another effort to reduce the residential building's power demands. The indoor weather conditions have significant importance in smart homes; hence, selecting suitable algorithms for indoor forecasting is important. A comparison of 36 machine learning algorithms has been presented that can be used in smart buildings to predict indoor Temperature [36]. For the management of IoT systems and energy efficiency, authors in [37] presented a smart building template. The planning and identification of the best suitable locations to install sensors and gateways reduce the energy consumption in smart buildings [38]. The fuzzy logic controller based model has been successful in the hydroponics environment for the optimization of humidity and water level [39].
The same technique can be suitable for energy consumption optimization in smart home's garden areas. The concept presented in [40] aims to store the information needed for energy efficiency in smart homes. The thermal comfort strategy has been designed and simulated. Dutra et al. [41] proposed an energy-efficient mixed-integer linear optimization home energy management (HEM) scheduling model. They aimed at the reduction of cost while improving the user comfort level. Essiet et al. [42] proposed an enhanced differential evolution algorithm for load scheduling in smart homes. The occupancy detection system using passive infrared sensors (PIRs) for energy consumption optimization in the buildings is an effort of energy efficiency using resident presence to control the smart home equipment [43]. The proposed framework in [44] base on fog and user location for the smart building energy management system. The framework reduced latency and improved the energy efficiency of the home energy services, among things, and users' location has reduced the energy consumption in the overall building. A cyber-physical system linked with information about the residents' occupancy in [45] uses Wi-Fi probe-occupancy detection and ensemble classification algorithm to save about 26.4% of cooling and ventilation energy consumption.
The authors in the previous literature have focused on energy consumption reduction to make smart homes more energy efficient. Some methodologies focus on the prediction of energy consumption, and some have considered energy consumption optimization. The common gap between methods has been identified as static user parameters that affect the methods' performance. The dynamic user parameters will ultimately reduce energy consumption; somehow, this may decrease the system's complexity.

III. PROPOSED METHODOLOGY
In this paper, we have proposed a general model to address the issue of static user parameters along with energy consumption optimization and comfort index management. The model has three main layers, and each layer has one or more steps to be performed. In the first layer, step 1 is data collection from Temperature, illumination, and air quality sensors. In this paper, we have used the already collected sensor data.
Afterward, we have used the Alpha Beta filter for the smoothening and removal of the noise of the data gathered from the sensors. After the noise removal, in step 2, the Alpha Beta filter predicts initial Temperature, illumination, and CO 2 for the system to proceed further.
These predicted values of Temperature, illumination, and CO 2 will be referred to as indoor environmental values. This step is essential to smooth the data and remove unnecessary values and noise for better accuracy. In the next level, the Apla Beta filter predicted indoor environmental values of Temperature, illumination, and CO 2 would be given as input to the proposed deep extreme learning machine (DELM) along with the user parameters for the prediction of optimal parameters. The layers' detailed structure and the deep extreme learning machine's working mechanism have been discussed in the subsequent subsection.
The second layer of the proposed model is the optimization and prediction layer in which DELM predicts the user set parameters, and environmental parameters are optimized by the Bat algorithm to reduce energy consumption and improve the comfort index. The DELM model has already been trained using the historical data that includes the indoor environmental parameters and user parameters. The historical data contains the indoor values of Temperature, illumination, and CO 2 , along with the user parameter values of Temperature, illumination, and CO 2 . The deep extreme learning machine (DELM) will repeat user parameters' prediction with the changes in the Alpha Beta predicted indoor environmental values of Temperature, illumination, and CO 2 . The time interval for calculating user parameters will be one hour; after every one-hour system will check for the changes in indoor environmental values to avoid the complex calculation process. The third layer is the control process layer, where fuzzy controllers have been used to calculate the required power and control of the environmental conditions. A total of three fuzzy controllers with extended and improved rules have been designed for the Temperature, illumination, and air quality. The coordinator agent used the output of the fuzzy controller to request the necessary power from the power source for the actuators.
In the proposed methodology, the Bat algorithm optimizer takes the Temperature, illumination, and air quality parameters value from the environment and the user set preferences. The Bat algorithm optimizer output is a value that is optimized according to user preferences to increase user comfort. In the next step, the error difference between the optimized values and environmental values is calculated. The error difference is used by fuzzy controllers in the next step to calculate the power needed. Fuzzy controllers take the error difference and optimized values to calculate the required power such that the power consumption remains minimum. The actuators' status is changed by the coordinator agent, which checks the available energy in the power source. Thus, the system status is adjusted according to user preferences, and the Bat algorithm optimizes the power consumption in conjunction with the fuzzy controllers. We can see the model's overall working in Figure 1, the proposed optimization and prediction module can be seen in Figure 2, and the Alpha Beta filter for Temperature in Figure 3.

A. DATASET
The data used by [46] and [20] has been used for the experimentation in this paper. The dataset is acquired from https://github.com/LuisM78/Appliances-energy-predictiondata. The dataset contains a reading of the energy consumption and inside Temperature [47]. Further, the data of CO 2 for (air quality) and lighting energy consumption are acquired from [48] and merged with the already available data set. These values [47], [48] have been used as user parameters. The external environmental weather of Kuala Lumpur has been acquired/purchased from https://openweathermap.org/, and the same has been used as indoor environmental data in the experimentation and training of deep extreme learning machine.

B. ALPHA BETA FILTER
In the proposed model, we have used the Alpha Beta filter to predict the Temperature, illumination, and air quality and remove noise from the sensors' data. Inputs to the Alpha Beta filter are environmental Temperature, illumination, and air quality, respectively. The output of the Alpha Beta filter is predicted Temperature, illumination, and air quality, respectively. These predicted outputs have been used as inputs to the prediction and optimization modules.
Alpha (α) Beta (β) filter is a simple observer normally used to estimate, smooth, and control applications. Its working mechanism is the same as the Kalman filter and linear observers [49]. The key benefit of this filter is its simplicity because it does not need a detailed system model. The Alpha Beta filter is derived from the Kalman filter [50]. Alpha Beta filter requires less computation time and memory as compared to the Kalman filter, and the performance is also better as compared to the linear filter [51].
To develop the Alpha Beta filter, we suppose a system sufficiently approximated by a model having two-interval states. First, we do initialization, as shown in (1-2).
We have used (3) to update the position, and (4) to read the sensor data.
Similarly, we have used (5) for the computation of the difference and (6) for computing predicting position.
Further, we have used (7) for the predicted velocity for updated position & velocity for the next iteration, we have VOLUME 8, 2020 FIGURE 1. The overall working mechanism of the model. used (8) and (9).
The structure diagram of the Alpha Beta filter for temperature prediction is shown in Figure 3.

C. PREDICTION LAYER AND DYNAMIC USER PREFERENCE PARAMETERS
Keeping in view of the strong capability of deep extreme learning machines (DELMs), we have used it in the proposed model for dynamic user parameters. In the previous methods, the user parameters are static means once provided at the beginning remains same throughout the operation of devices until users change them manually. The prediction layer concerns the prediction and automation of the user parameters to make them dynamic so that they can change according to the external environmental conditions. In the prediction layer, we have proposed a deep extreme learning machine. The prediction layer receives user parameters and environmental parameters from the data layer and predicts the system's next user parameters to operate. The environmental parameters in every cycle change as they are coming from the sensors connected to the system. Based on updated environmental values, the prediction layer output the new user parameters for the system [52]. A detailed description of the prediction layer and deep extreme learning machine (DELM) is provided in the following subsection.

1) DEEP EXTREME LEARNING MACHINE
The extreme learning machines (ELMs) has been successfully used in different areas for energy consumption prediction. Although the conventional neural networks can perform the same prediction task, there are specific issues involved with these networks, which limit them in their capabilities to solve particular problems. The most prominent problem is the larger size of training samples, leading to slower training time and overfitting the model [53]. The idea of ELM was coined by [54]. Due to the ELM's quick learning and computational efficiency, it is best suitable for the classification and regression problems in different domains [55], [56]. The proposed DELM has three main layers, i.e., input layer, hidden layer, and output layer, as shown in Figure 4, where i represents input layer nodes, n represents hidden layer nodes, and o indicates output layer nodes. The number of hidden layers depends on the problem under study, wherein we have used six hidden layers in the proposed model. We have used the trial and error method to select the number of nodes in the hidden layers [57].
For the calculation process of hidden layers of the deep extreme learning machine (DELM) network, we have adopted the procedure described by [13]. Where the training     (10) and (11), respectively [13].
The weights of the input layer and the hidden layer can be adjusted using (12) and (13), respectively. Where w op represents the weights between o th input layer nodes and p th hidden layer, as defined in (14). Equation (15) has been used to represent the randomly fixed weights of the hidden neurons and output layer neurons where γ op are the weights between input and hidden layer nodes [13].
The selection of biases, BS of the deep extreme learning machine (DELM) hidden layers, can be randomly selected using (14). While the activation function of the DELM is the g(x), the output matrix VM at this stage can be represented as (15). Respectively column vector of the resulted matrix T is described in (16) [13].
For the calculation of the output of hidden layers, we can use (17) and (18) to obtain (19). While the HL represents the output of the hidden layer, and VM is the transpose of VM [58]. The inverse matrix of the γ can be represented by γ + as in (19). The least-square method, as expressed in (20), has been utilized for the calculation of weight matrix values of γ [59], [60]. For the calculation of values of hidden layer two, we can use the activation function inverse as described in (20).
The weight matrix of the initial two hidden layers, matrix hidden layer one and output hidden layer two, is represented by the terms W 1 , HL, D 1 , and HL 1 , respectively [13].
Whereas in (21) HL + E represents the inverse of HL E . We have used activated function g(x) for the computation of (12). To get updated results of the second hidden layer, we can apply proper activation function g(x), as mentioned in (22) [13].
In (23) HL + 2 indicates inverse of HL 2 , and the updated weighted matrix γ between hidden layer two and hidden layer three has been represented by γ upd as in (23). The estimated result of layer three has been depicted as (24) [13].
Similarly, VM γ + upd is the inverse of the weight matrix γ upd . For the calculation of the output of the third layer, we can use (17 and 18) as in (25). Next step is the definition of matrix W HLE1 = [B 2 , W 2 ] as in (26)(27)(28) [13].
In (25) HL 2 represents hidden layer two, the weight between HL 2 and HL 3 is denoted by W 2 . The bias of HL 3 neurons have been represented by B 2 . HL E1 has been inverted to HL + E1 , and g −1 (x) represents the inverse of the activation function g(x). We have used the logistic sigmoid function as expressed in (29), and for the computation of the third hidden layer (30) has been adopted [13].
The inverse of the weighted matrix VM γ upd has been represented by VM γ + upd . The weighted matrix between HL 3 and the last layer output can be calculated using (31) [13]. Equation (32) represents the estimated result of the hidden layer 3. After that, the DELM defines the matrix W HLE2 = [B 3 , W 3 ]. For the computation of the fourth layer output, we can use equations (31 and 23).
where in (31) the HL 3 is the output of the third hidden layer, while W 3 represents weight between the third hidden layer and the fourth hidden layer. The bias of third hidden layer neurons has been described by B 3 . Similarly, the inverse of HL E1 has been represented by HL + E1 . While the inverse of activation function g(x) has been denoted by g −1 (x). For the calculation of third and fourth layer output, we can use (33).
Finally, for the calculation of the fourth layer and output layer matrix, we can use (34). For the estimated result of hidden layer five, we can use (35). The final output of the proposed DELM can be calculated using (36).
The same methodology can be used to compute further hidden layers. The calculation and demonstration of the hidden layers of the DELM network cycle theory have been applied. If the network's hidden layers increase, the same process can be extended and reused as per the requirements of the DELM network. In the proposed method, the trial and error method has been adopted for the optimal neural network structure of DELM [21], [61].

D. OPTIMIZATION PROCESS
In the proposed model, the most important module is the optimization process. The optimization algorithms take environmental parameters and user set parameters as inputs and reduce the gap between environmental parameters and user set parameters. The accuracy of the optimization algorithm depends on its objective function. In this paper, we have used the Bat algorithm; the parameters have been defined as per mentioned approach in [20]. We carried out various number of experiments in for finding the optimal parameters of the bat algorithm.By using the following parameters, we get the best results and are reported in this paper. Bats population size in a single generation was set to 40 with α = 0.7, γ = 0.7, initial rate of pulse emission r 0 (i) was set to 0.5 and initial loudness A 0 (i) was also set to 0.5. We have used f min = 0, and f max = 1. Maximum number of generations was set to 100.

1) BAT ALGORITHM
The Bat algorithm was introduced by Xin-She Yang in 2010, [62]. The Bat algorithm has some advantages over different algorithms [31]. The most prominent benefits are a high convergence rate under the right conditions for large scale optimization problems [63]. The other benefit is the provision of the solution with frequency tuning, just like the key features of particle swarm optimization [64] and harmony search [16]. Bat algorithm can zoom into the regions having potential solutions. It can also switch from global to local exploration for the solution, further quick convergence rates in early iteration can be achieved [16]. The benefit of parameter control cannot be ignored as well, which is fixed in other algorithms. This helps to explore the optimal solution for the search region.
Bat algorithm is inspired by the echolocation of microbats. The echolocation characteristics of micro-bats can be idealized as; the echolocation helps all the Bats to sense the distance. The other main feature of Bat is that they can differentiate in a mysterious way between the food/prey and the barriers of background [65]. The other properties of Bats are that they can fly randomly, whereas their velocity can be represented as v i at position x i having fixed frequency f min . The wavelength k of Bats remains varying, while the loudness to search for prey can be represented by A 0 . The adjustment of emitted pulses wavelength or frequency is automatic; further, based on the target's proximity, the Bats can also adjust the rate of pulse emission rε [0, 1]. Due to the varying nature of loudness because of different factors and ways, mostly, the varying loudness range is assumed to be from a large positive A 0 to a minimum constant value A min . The necessary steps of the Bat algorithm [66] are summarized in Figure 5.
where β in (37) represents a random vector determined from a uniform distribution of the range [0,1]. In (38), x * has been calculated as the current best global solution among all the possible solutions available in the Bat population n [31]. The velocity increment has been represented as ki or fi, and both can be used to adjust the change in velocity at the time of fixation of other factor ki or fi based on the type of problem.
In the implementation and experimentation, we have used the values of f min = 0 and f max = 1. The [f min , f max ] has been used to assign the random frequencies to each Bat in the Bat population. After the selection of the current best solution, the local random walk, as in (40), has been used in the local search part of the algorithm for the generation of new solutions for each Bat.
where ε represents a random number which has been taken from [−1, 1]. While At = Ati has represented the average VOLUME 8, 2020 loudness of all Bats at the current position. The loudness of the Bats depends on the prey; once they found prey, the loudness decreases while the rate of pulse emission increases. The selection of the loudness in this particular case can be selected as any value as per requirements. For simplicity, we have used A 0 = 1 and A min = 0. Assuming Amin=0 means that a Bat has just found the prey and temporarily stop emitting any sound, we have equation (41).
where α and γ are constants, the role of α is similar to the cooling factor of a cooling schedule in the simulated annealing problem.

E. COMFORT INDEX
The comfort index is the most important factor every proposed method has tried to improve users' comfort index inside the smart homes and buildings. The comfort index (CI) can be calculated using equation (42), as presented in [20].
In equation (42), CI represents the comfort index, and the values of CI ranges between [0, 1]. The user set parameters or preferences of Temperature, illumination, and air quality has been denoted by α 1 , β 1 , γ 1 . The sum of α 1 + β 1 + γ 1 should remain 1; its value should not increase more than 1 [67]. The user and environmental parameters in this study are three, i.e., Temperature, illumination, and air quality; hence the eT, eL, eA represent the error differences between optimized and environmental values of parameters α 1 , β 1 , γ 1 . Combining these error differences defines the comfort index of the residents of a smart building or a smart home. Similarly, the DTs, DLs, and DAs are the user set parameters of α 1 , β 1 , γ 1 . The main aim of this paper is to maximize the value of CI and minimize the values of eT, eL, and eA.

F. FUZZY LOGIC
A logic of many values in which the variables truth values may be any real number between 0 and 1. It is useful when the truth values range between completely true and completely false [68].
Fuzzy controllers are control systems based on fuzzy logic, a concept first introduced by Lotfi. A Zadeh, a professor at the University of California at Berkeley [68]. In the proposed method, each comfort parameter has a separate fuzzy controller, e.g., Temperature, illumination, and air quality. The fuzzy controller takes input values based on the parameter and calculates the required power.
Each fuzzy controller has four components, fuzzifier, rules base, inference engine, and de-fuzzifier. Rules vary for each comfort parameter like Temperature, illumination, and air quality, respectively. The steps involved in the calculation of the required power are.
i. Input member functions are calculated by fuzzifier based on the inputs. ii. The inference engine calculates the output member functions based on the rules stored in the rule base. iii. De-fuzzifier calculates the required power from the output member functions. The proposed model has three controllers for Temperature, illumination, and air quality, each discussed in the following sections.

1) TEMPERATURE FUZZY CONTROLLER
In the proposed model, the temperature fuzzy controller takes the optimized temperature value and error difference e T between environmental and optimized values. The output of the temperature fuzzy controller is the required power to change cooling/heating actuators' status. The following are the set of rules stored in the rule base used by the inference engine of temperature fuzzy controller. Figure 6 shows the fuzzy inference system for Temperature. Seven membership functions labels; EL (extremely low), VL (very low), L (low), N (normal), H (high), VH (very high), EH (extremely high) have been defined for input variable ErrorTemp of temperature fuzzy inference system. Similarly, seven membership functions namely PEL (power for extremely low), PVL, (power for very low), PL (power for low), PN (power for normal), PH (power for high), PVH (power for very high) and PEH (power for extremely high) have been identified for output variable RPTemp of Temperature fuzzy inference system.
Here if we consider Table 1, the mechanism of negative power ranges is quite interesting, and normally the power should be positive. In the proposed work for temperature control, we have considered two actuators (AC/heater), so simply the negative values just provide instructions to the coordinator agent that heater should be on, the coordinator agent takes the absolute of the negative values provided by temperature fuzzy logic and pass to the heater actuator for the required power.
The heater in the current scenario is considered as the Air conditioner with heating function.
In the proposed work, after five minutes, the signal is provided to the Air conditioner actuator system, but the time can be increased or decreased according to the user's requirements.
The methodology is flexible and can be changed; further, the control strategy is based on the author's experience keeping in mind the maximum comfort and optimized energy consumption considering the AC actuators in the scenario.
The ranges of each membership function of input and output variables are given in Table 1. The following rule sets for the temperature fuzzy controller have been identified, as seen in Table 2.

2) ILLUMINATION FUZZY CONTROLLER
The illumination fuzzy controller's input is the error e L difference between the optimized and environmental value of illumination. The output of the illumination fuzzy controller is the required power to change the status of lighting actuators. After five minutes, the control signal is provided to the illumination actuator system for the experimentation, but the users can change the time duration according to their comfort level. In the experiment, the indoor illumination has been considered for visual comfort; there will be no daylight consideration. Figure 7 shows the fuzzy inference system for illumination. Fifteen membership functions have been defined for input variable ErrorILL of illumination fuzzy inference system having the following linguistic terms; EVVL (extremely very very low), EVL (extremely very low), EL (extremely low), VVVL (very very very low), VVL (very very low), VL (very low), L (low), N (normal), H (high), VH (very high), VVH (very very high), VVVH (very very very high), EH (extremely high), EVH (extremely very high), and EVVH (extremely very very high). Similarly, fifteen membership functions have been identified for output variable RPILL of illumination fuzzy inference system having the following linguistic terms; PEVVL (power for extremely very very low), PEVL, (power for extremely very low), PEL (power for extremely low), PVVVL (power for very very very low), PVVL (power for very very low), PVL (power for very low), PL (power for low), PN (power for normal), PH (power for high), PVH (power for very high), PVVH (power for very very high), PVVVH (power for very very very high), PEH (power for extremely high), PEVH (power for extremely very high), and PEVVH (power for extremely very very high). The ranges of each membership function of input and output variables are given in Table 3. The following are the set of rules stored in the illumination fuzzy controller inference engine.

3) AIR QUALITY FUZZY CONTROLLER
The air quality fuzzy controller's input is the error eA difference between optimized and environmental values of air quality. Figure 8 shows the fuzzy inference system for air quality.
Nine membership functions have been defined for input variable ErrorAQ of air quality fuzzy inference system having following linguistic terms; EVVL (extremely very very low), VOLUME 8, 2020   EVL (extremely very low), EL (extremely low), L (low), N (normal), H (high), EH (extremely high), EVH (extremely very high), and EVVH (extremely very very high). Similarly, nine membership functions have been identified for output variable RPAQ of air quality fuzzy inference system having following linguistic terms; PEVVL (power for extremely very very low), PEVL, (power for extremely very low), PEL (power for extremely low), PL (power for low), PN (power for normal), PH (power for high), PEH (power for extremely high), PEVH (power for extremely very high), and PEVVH (power for extremely very very high). The ranges of each membership function of input and output variables are given in Table 5.
The following are the set of rules stored in the air quality fuzzy controller inference engine.

G. COORDINATOR AGENT
The output desired power from the Temperature, illumination, and air quality fuzzy controller is used as input to the coordinator agent. The coordinator agent calculates the total required power by totaling all the required powers of Temperature (ReqPT), illumination (ReqPIL), and air quality (ReqPAQ) as in Equation (43).  The coordinator agent requests the TReqP from the connected internal power source.

H. ACTUATORS
Actuators are the actual devices that consumes the electricity, for example, AC and refrigerators for cooling, heater for heating, exhaust fans for ventilation, electric bulbs/tube lights for lighting. The status of these devices changes according to the power provided by the coordinator agent.

IV. IMPLEMENTATION, RESULTS AND PERFORMANCE EVALUATION A. IMPLEMENTATION
The experimentation has been carried out on Dell Precision 7720, having Intel(R) Core(TM) i7-7820hq CPU @ 2.90 GHz, with 64 GB ram, Nvidia Quadro M1200 4GB graphics card, and Matlab 2019b. For the fuzzy logic rules and membership function design, we have used fuzzy logic toolbox. The design and implementation of the proposed deep extreme learning machine have been carried out in Matlab 2019b.

B. RESULTS
The sensor data mean the sensor's data, and it is unprocessed data having noise, outliers, and missing values. The pre-processed data refers to the data after removing noise, outliers, and missing values using the alpha beta filter. The same is the case for pre-processed Temperature and sensing temperature. Most of the authors have used the Kalman filter  for the pre-processing or simply have used un-processed sensor data in previous works.
For the system's initial parameters, we have used the preprocessed Temperature and sensing Temperature as input to the Alpha Beta filter for the prediction of Temperature. The detailed output predicted Temperature can be seen in Figure 9. Similarly, we have followed the same process using pre-processed illumination and sensor illumination data to predict illumination, as seen in Figure 10. The pre-processed air quality and sensor air quality have been used to predict air quality, as seen in Figure 11. Now the system has initial environmental predicted Temperature, illumination, and air quality values. In the next stage, the DELM will use the predicted environmental Temperature, illumination, and air quality values to predict the user parameters for the system to operate. The DELM has automated the process of the selection of user parameters, which were provided manually by the users in traditional methods. The Bat algorithm will use the predicted Temperature, illumination, and air quality values as input and provide optimal values of the Temperature, illumination, and air quality for the maximum energy saving and improvement in the user comfort index. The resultant optimized Temperature and user temperature can be seen in Figure 12. Similarly, the optimized illumination and user set illumination predicted by DELM can be seen in Figure 13, and the values of Bat algorithm optimized air quality and DELM predicted user set air quality can be seen in Figure 14.

1) TOTAL COMFORT INDEX
The comfort index is also the priority of the proposed model. The comfort index value closer to 1 is considered a better comfort level for smart home residents. For the calculation of the comfort index, we have used (42). It can be seen in Figure 15 that the total comfort index without optimization has too many fluctuations, but after optimization, it has smoothened and remained closer to 1. For the comfort index values of Temperature, illumination, and air quality, the initial required value has been used as 0.33 for each comfort index.
According to Fanger [69], [70], the main contributors to thermal comfort are Temperature, humidity, air flow, and heat radiation inside the smart home [71]. The human factors include; the number of physical activities, amount of metabolic. Other factors are clothes, gender, age, and season of wear. The psychological factors include odor, noise, and visibility [71].
The visual comfort components have been retrieved from [72], [73], are uniform illumination, optimal luminance, no glare, sufficient contrast conditions, correct colors, and absence of stroboscopic effects intermittent light [72], [73]. The human factors are the sensitivity of an individual's visual system to size, contrast, exposure time, susceptibility to glare, and age. The psychological factors are motivational, psychological, and transient adaptation characterization.
The air quality comfort is maintaining the desired concentration of CO 2 below 800ppm [74]. The other factors include a total volatile organic compound and volatile organic compounds in the air [74].

2) TOTAL POWER CONSUMPTION
The power consumption for the Temperature has been calculated after optimization and compared with the original power consumption before optimization. It is clear from Figure 16 that a significant amount of power consumption reduction has been achieved due to the optimization by the Bat algorithm. If we observe the original power consumption in the graph, the higher peaks are visible around the highest peak of 16Wh, but after optimization, the noticeable higher peak is around 11Wh. This shows that the method is energy efficient to reduce energy consumption in smart homes. Similarly, if we observe the illumination power consumption in Figure 17, the higher peak of energy consumption is around 13Wh, but after optimization using the Bat algorithm, the observed highest peak is about 9Wh. Hence, using the  proposed method, a significant amount of energy can be saved in the smart homes' lighting unit.
Furthermore, if we discuss Figure 18, it is evident that the highest power consumption for the air quality before optimization was around 9Wh, but the same has reduced to 6wh after optimization by the Bat algorithm. Hence a significant difference in the original and optimized power consumption has been achieved in the air quality unit.
Suppose we observe the Figure 19, regarding total power consumption of Temperature, illumination, and air quality units. In that case, it is evident that the highest peak of the original power consumption is around 29Wh, which has reduced to a maximum of 18Wh after optimization by the Bat algorithm.

C. PERFORMANCE EVALUATION
To measure the performance of the Alpha Beta filter, the comparison of the values of Temperature, illumination, and air quality has been carried out with original sensing data. The root mean square error (RMSE) of the sensing data and the Alpha Beta filter provided data has been calculated using (44) and illustrated in Table 7. The RMSE for Temperature, illumination, and air quality of the Alpha Beta predicted data is small compared to sensing data, hence it will be more appropriate to consider the predicted Alpha betta filter values for further processing.
In order to measure the performance of the algorithms, the RMSE, as in (44), MAE in (45), and MAPE in (46) for Temperature, illumination, and air quality have been used. The RMSE, MAE, and MAPE values show that the values provided by Bat algorithm are closer to the values set by the deep extreme learning machine.
where N denotes the entire number of observations, A denotes the actual value, and P represents the estimated value. The performance measurement values of the Temperature, illumination, and air quality are given in Table 8. The power consumption with optimization and with optimization is given in Table 9. Hence, the results provided by Bat optimization are better as compared to without optimization.
The power consumption comparison of the proposed dynamic user parameter prediction and optimization using the Bat algorithm with some other optimization algorithms is given in Table 10. Hence, the results provided by Bat optimization using DELM are better as compared to simple optimization using the Bat algorithm. The proposed model also produces better results as compared to GA and PSO algorithms. Ali et al. in [46] deployed particle swarm optimization and genetic algorithm for energy consumption minimization and maximization of user comfort using the same data set of  energy consumption used in this study. So the comparison of proposed techniques has been carried out with the results generated by [46].

V. DISCUSSION
The higher energy consumption in smart homes is the motivation to carry out this research. After the detailed literature review carried out in [6] and further specific review, it has been observed that one of the reasons for higher energy consumption and less comfort index in the smart homes is the static user parameters. In the current scenario, the user parameters selection is a manual process, and once the user sets their preferences at the starting of the cooling/ heating, lighting, and ventilation system, they remain static throughout the complete cycle. This creates two significant problems related to the comfort index; mostly, the weather conditions fluctuate throughout the day, but the system keeps operating on the same parameters. This situation affects the comfort index of the users of the smart home. The other major drawback is the higher energy consumption due to the smart home systems' static operating. To solve these problems, we have proposed a method to automate the user parameters using deep extreme learning machines; the dynamic parameters helped to reduce the energy consumption and also maintain the user comfort index [52].
The traditional techniques have considered bringing the environmental parameters according to the HVAC standards. With the introduction of the smart home, the criteria of comfort index are now changed. The environmental parameters and user parameters are; a temperature for thermal comfort, illumination for visual comfort, and CO 2 for air quality comfort. In this study, it has been decided to consider the comfort index according to the home residents to cover their preferences of Temperature, lighting, and air quality. Giving preference to the resident have improved the comfort index. For example, the parents in the home are over the age of 50 years and can set the Temperature, lighting, and air quality parameters of their room accordingly. Moreover, the children in the house can set their Temperature, lighting, and air quality parameters accordingly and so forth.
The model has been designed so that it can focus on each room of the house if implemented in each room. This is the requirement of the situation because the temperature conditions of different house places are always varying due to external factors like direct sunlight and so forth. Further, the Temperature remains higher in the upper portion than the lower portion, so the overall optimization division into different subparts will save more energy. Unfortunately, no one has focused on this issue, which needs attention for maximum energy saving. In the previous studies, the user set parameters have to be manually provided in the system, but in the proposed methodology, we have automated the process of user parameter selection using a prediction algorithm. The user parameters dynamically change according to the external weather conditions and reduce energy consumption in smart homes. For the prediction, a deep extreme learning machine is the best choice due to its strong capability of learning and accuracy.
The user set parameters can be optimized using the Genetic algorithm, an adaptive selection of features; the parameters can be selected during the algorithm's execution. The initial settings of the parameters are modified during the execution of the algorithm. The adaptive approaches are divided into two categories, limited adaptive parameters and self-adaptive parameters [75]. An algorithm was proposed in [76] to adjust the genetic algorithm's parameters dynamically [18], [46]. Particle swarm optimization (PSO) [64], [77] can also be utilized to select the parameters and achieve the target of the comfort index.
For the last few decades, many algorithms inspired by natural behaviors have been developed for solving many hard optimization problems. The optimization algorithms that can be used for the optimization of energy consumption are; evolutionary algorithms [78], bat algorithm [20], bee colony algorithm [79], genetic algorithm [46], harmony search [80], ant colony algorithm [81] [82], Firefly algorithm [83], fruit fly algorithm [84], and particle swarm optimization (PSO) [64]. Due to their applications in a variety of problems, they are also known as multi-purpose algorithms. The algorithms can be successfully used for energy optimization so that the wastage of energy can be reduced.
The other main contribution to improving comfort index and energy consumption optimization is the fuzzy rules. The number of fuzzy rules has been increased in the proposed method compared to the traditional methods so that more and more states for the operating of the system can be incorporated. The primary reason for energy consumption reduction is due to a variety of rules. The fuzzy control system considers the optimized values of Temperature, illumination, and air quality, and environmental parameters. The values generated by fuzzy controllers depend on the error difference of the environmental values of Temperature, illumination, and air quality with their respective error differences. The aim of using a Bat algorithm for optimization is to minimize the error differences. Without using the Bat algorithm, the difference between the two sets of values (environment and error difference) is very high, resulting in higher energy consumption. With the use of the Bat Algorithm, the difference is minimized, which helps to decrease energy consumption and increases user comfort.
We have made only the user set parameters dynamic. In the previous models, the required parameters are specified by the user, but in the proposed work, we have made it dynamic by involving the deep extreme learning machine algorithm. Now, first, the deep extreme learning machine is trained on previous user behaviors, and the deep extreme learning machine sets the required parameters.
Still, there is a need to implement other optimization algorithms for better results and reduce energy consumption. Some more twists in the fuzzy rules may also decrease energy consumption.

VI. CONCLUSION
This paper has used the Alpha-beta filter for noise removal, smoothening, and prediction of the environmental data of Temperature, illumination, and air quality.
The user parameters for indoor thermal, air quality, and visual comforts have been predicted and automated using a Deep extreme learning machine for energy optimization in smart homes. The deep extreme learning machine has proved the better accuracy of predicting user parameters, and further improvement can be achieved with the more massive datasets. The automated user parameters have improved the comfort index along with the improved usability of the system. The automated user parameters will be helpful for the children and persons having disabilities. The user parameters in the proposed system will change according to internal weather conditions. We have used the Bat algorithm for energy consumption optimization, which has proved better accuracy in optimizing energy consumption in smart homes.
The proposed method has improved the comfort index along with energy consumption optimization. The comfort index's overall value remained close to 1; this proves that the two-fold objective of energy consumption optimization, along with comfort index management, has been achieved. Due to the Bat algorithm's strong optimization capability, the highest peak of the original power consumption around 29Wh has reduced to a maximum of 18Wh after optimization.
Further improvement is possible by the addition of some tweaks in the fuzzy rules. In the future, we will add more algorithms in the optimization layer and compare the results so that the system can be universally implemented. We are also planning to apply the same method on different datasets to analyze the system in detail and measure its performance in various weather conditions. APPENDIX See Table 11.

ACKNOWLEDGMENT
Abdul Salam Shah would like to thank K. Khowaja of Isra University, Pakistan, for his valuable suggestions regarding the restructuring of the article, and improvements in the primary model. MUHAMMAD FAYAZ received the Ph.D. degree in computer engineering from Jeju National University (JNU), Jeju, South Korea, in 2019. During his studies, he worked with the Mobile Computing Laboratory, JNU. He is currently an Assistant Professor of computer science with the UCA's School of Arts and Sciences. Throughout his academic career, he has published over 60 research articles in the reputed Web of Science and Scopus indexed international journals and conferences. His research interests include combinatorial optimization problems, machine learning, image processing, the Internet of Things (IoT), fuzzy inference systems, and other related areas. His responsibilities included preparing project proposals, designing IoT-based smart solutions, the application and implementation of artificial intelligence algorithms, and writing project reports. During his stay in South Korea, he also worked on several projects on the Underground System and the SAR-based Big Data Classification and Analysis of Disaster/Damage type, funded by the Electronics and Telecommunication Research Institute, and Korean Aerospace Research Institute, respectively.
ADIDAH LAJIS received the Ph.D. degree in information technology from the International Islamic University Malaysia, Kuala Lumpur, Malaysia, in 2011. She is currently an Associate Professor with the Computer Engineering Section, Universiti Kuala Lumpur Malaysian Institute of Information Technology. Her research interests include natural language processing, text mining, cognitive assessment, and intelligent system. She actively participated in short terms research projects and received several research grants include Fundamental Research Grant Scheme by Malaysia Ministry of Education. She is a Reviewer of Cognitive Computation journal and some of conference proceedings paper.
ISRAR ULLAH received the M.S. degree in computer science from the National University of Computer and Emerging Sciences (NUCES), Islamabad, Pakistan, in 2009, and the Ph.D. degree in computer engineering from Jeju National University, South Korea, in February 2019. He is currently serving as an Assistant Professor for the Virtual University of Pakistan. His research interest includes development of AI based IoT solutions for smart cities. He also have experience in the field of networks simulation and modeling. His research interests also include designing and analysis of optimization algorithms using AI techniques.
ASADULLAH SHAH (Member, IEEE) received the Ph.D. degree from the University of Surrey, U.K., in 1998, with a specialization in multimedia communication. He started his academic carrier at the University of Sindh, Jamshoro, Pakistan, in 1986, as a Lecturer. He is currently working as a Professor with the Kulliyyah of ICT, International Islamic University Malaysia (IIUM), before joining IIUM, he worked as the Head of the Department of Telecommunication Engineering and Management, IoBM, Karachi, the Dean of the Faculty of Computer and Management Sciences, Isra University, Hyderabad, and the Head of Telecommunication Engineering and IT, Sukkur IBA, Pakistan. He has published more than 200 research articles in highly reputable international and national journal in the field of computers, communication, and IT. Also, he has published 12 books in his 28 years of academic carrier. He is also supervising great number of postgraduate students, working in multiple disciplines, specially, animation, social media, and image processing in the Department of Information Systems, Kulliyyah of Information and Communication Technology, International Islamic University Malaysia.