Skip to main content

Advances, Systems and Applications

An internet of things enabled machine learning model for Energy Theft Prevention System (ETPS) in Smart Cities


Energy theft is a significant problem that needs to be addressed for effective energy management in smart cities. Smart meters are highly utilized in smart cities that help in monitoring the energy utilization level and provide information to the users. However, it is not able to detect energy theft or over-usage. Therefore, we have proposed a multi-objective diagnosing structure named an Energy Theft Prevention System (ETPS) to detect energy theft. The proposed system utilizes a combination of machine learning techniques Gated Recurrent Unit (GRU), Grey Wolf Optimization (GWO), Deep Recurrent Convolutional Neural Network (DDRCNN), and Long Short-Term Memory (LSTM). The statistical validation has been performed using the simple moving average (SMA) method. The results obtained from the simulation have been compared with the existing technique in terms of delivery ratio, throughput, delay, overhead, energy conversation, and network lifetime. The result shows that the proposed system is more effective than existing systems.


The concept of a smart city refers to an urban environment that has been augmented with advanced technologies, enabling it to gather and analyze data for the purpose of improving the quality of life for its residents. The concept of a smart city encompasses various domains, including citizens, mobility, healthcare, technology, government, energy, and infrastructure, as seen in Fig. 1 [1]. Modern technology incorporates the Internet of Things (IoT) based smart peripherals, which help to provide a sophisticated lifestyle. Especially, smart technologies are highly utilized in cities where smart meters are utilized rather than utilizing convolutional meters. In smart cities, Advanced Metering Infrastructure (AMI) based technologies are enabled for effective information exchange by smart meters with IoT devices, which can be adapted to various locations based on requirements [2, 3]. Due to its complex nature, end-users may face difficulties in utilizing its full benefits. It is challenging to collect massive data, and the speed is possibly less [4, 5]. On the other hand, a smart city enables various functionalities to its infrastructure by adopting an effective communication medium, forecasting devices, and making changes in system design and its architecture [6].

Fig. 1
figure 1

A broad overview of smart cities components

The advanced technologies provide few applications such as reliability of energy consumption, control, and monitoring [7]. This paper implements a Demand Side Management System (DSMS) for effective management and controls the level of energy saving and power consumption in smart cities. The objective of energy saving has broadened research to improve DSMS techniques such as static cost management, load transfer, economic forecasting, and the size of the system. These achievements have been enhanced to utilize statistical modeling and machine learning [8].

In the energy efficiency industry, they include algorithms such as Grey Wolf Optimization (GWO), Simple Moving Average (SMA), Deep Recurrent Neural Network (DDRCNN), Gated Recurrent Unit (GRU), and Long Short-Term Memory (LSTM). In energy theft detection, the dataset can be undefended. Theft of energy is becoming an increasingly pressing problem in various countries worldwide. Even so, few energy theft prevention methods have been developed to resist this problem. Zhou al. proposed a dynamic algorithm to improve the performance analysis for optimal energy theft detection. This system provides the assignment of a Feeder Remote Terminal Unit (FRTU), resulting in extra customer costs. Liu Y. and Hu S. planned a detective method with an average detection precision of 92.55%. This proposed detection method combines the Partially Observable Markov Decision Process (POMDP) with Bollinger Bands-Based Detection. In the home atmosphere, the above conditions are not affecting the home appliances.

Initially, household consumption data has been constant for 24-hour energy consumption [9, 10]. Energy consumption per hour is not zero. The following condition of the Bollinger Band method is that the rejection can only be reported within a constant range of power consumption. However, when the power consumption range becomes more due to deviation, the Bollinger Band system cannot be utilized. The article suggests a new awareness of an ETPS for a smart city. This theft energy detective process is reliable and more efficient than the earlier methods. Due to the discreet data collection method [11], we implement an energy monitoring system that can save energy. The data collection process contains energy consumption from actual time-series data in an uncontrolled home environment [12,13,14,15,16]. In this work, we provide information about the problems of existing technologies in smart cities. We present problems and research gaps as below:

  • Data management is becoming a highly difficult task in the smart environment due to the tremendous development of massive data. One of the considerable issues in the smart environment is energy theft; it should be focused on reducing by implementing a security system.

  • Lacking better optimization in the presence of constraints

  • In the existing technology, the optimization technique utilized for analyzing the presence of constraints is not effective; therefore, there is a need for implementing better optimization.

  • The performance of the existing technology is not providing better results. So, the need for enhancing performance and efficiency is highly demanded.

The contributions of this work are as follows:

  • To propose a mechanism to detect the energy theft in the smart cities.

  • To propose a machine learning algorithm to make the decision faster and more accurate.

  • To analyze the network parameters and their effect on energy theft.

The rest of the paper is organized as follows: "Background of study" section presents a literature review of energy theft and prevention. "Materials and methods" section presents the proposed methodology for the Energy Theft Prevention System. "Results and discussion" section presents the simulation and result analysis. Finally, "Conclusion" section presents the conclusion and future work.

Background of study

Lindsay [17] recommended the following plan: a science research cycle to create and assess a displaying system that intends to examine the utilization of Internet Control Message Protocol (ICMP) information to perceive collaboration and conditions in shrewd city areas. This article gives a short portrayal of the plan and use of the system and clarifies the plan information picked up during the preparation. Neural organization and affectability investigation can be utilized as an apparatus to characterize these objectives. To test the practicality of this idea, two models of coordinated wrongdoing on board in shrewd urban communities were created and assessed. The examination results demonstrated that the model models were compelling in foreseeing wrongdoing, showing an adequate relationship between the wrongdoing factors and the boundaries utilized in this investigation to affirm the utilization of altered KPI Smart Cities. for wrongdoing location. This article, accordingly, analyzes the utilization of the proposed displaying structure on the degree of momentary administration.

Ridhima Rani et al. [18] have proposed that this study provides an overview of the literature on the role of the Internet of Things and cloud ecosystems in smart cities, as well as evaluation parameters and future research guidelines in smart cities. The whole conversations and discussions between experts and architects on topics related to smart cities and advances on the Internet of Things must be constantly revived to ensure clear action plans. The remaining problems and the directions of their research are described. Most of these surveys overlook real-time systems in smart cities. This control method encourages the study of a large number of references in the future to deal with critical applications in time and in real-time.

Mengmeng Wang et al. [19] have proposed an investigation that has ventured out this heading by investigating the all-inclusive advancement cycles of savvy urban communities to accomplish this assessed execution and productivity of 32 shrewd urban areas in China somewhere in the range of 2012 and 2017. Those urban areas are partitioned into four classes as indicated by normal execution and proficiency. The cycle of changes in the savvy urban communities was planned somewhere in the range of 2012 and 2017, at that point, additionally, three essential patterns of execution and proficiency were distinguished. The last status coming to the 32 urban areas was anticipated by the three patterns. To all the more adequately executed brilliant city activities, two transformative courses for shrewd urban areas are proposed. The discoveries exhibit that the presentation of keen city usage is reliable for monetary advancement yet without effectiveness. The stage of the implementation process is not stable; it depends upon the shift in four stages in the framework of the city. The creative technology showed proper governmental guidance in smart cities.

Manu Sharma et al. [20] To achieve this objective, this study uses a hybrid MCDM (Multicriteria Decision Making) technique. Based on a review of the literature that hinders adoption, 15 barriers to IoT (IoT) adoption were identified. Application of IoT in smart cities in India. The IoTB is then investigated using the TISM (Total Interpretative Structural Modeling) approach, Fuzzy Matriced'Impacts Croises Multiplication Appliquean Classement (MICMAC) model, and the DEMATEL (Testing and Evaluation Laboratory) method. The TISM approach is utilized to develop an IoTB framework for smart municipal waste management (SCWM) projects. This research will support stakeholders, policymakers, and the government, appreciate the important elements of the Internet that affect the management of waste practices, and will surely help to make decision-making on removing the barriers for better adoption of the Internet. Internet of things in SCWM project.

Sharmila Majumdar et al. [21] presented long-term and short-term memory organizations to foresee the dissemination of clog in the street organization. Improving these estimates will permit better administration of insightful vehicle frameworks, decrease travel time, and diminish traffic contamination in urban areas. It is related to information on vehicle speed from sensors of the movement in two areas. Our model predicts the spread of clogs over 5 minutes in a bustling city. Investigation of the univariate and multivariate prescient system shows a precision of 84 to 95% contingent upon the course. This explanation demonstrates that long-term memory networks are valuable for anticipating gridlock and are a vital segment of future traffic, displaying methods from savvies to manageable urban communities about the universe.

Daming Li et al [22] enhanced the accuracy of communications security, this manuscript simulates the security system related to an observation concept. In a security system, monitoring the global and local changes in data exchange behavior between IoT devices. Global and local behaviors are changed to utilize the behavior modeling and device attributes. Input observations from devices and service providers can be managed through a neural network-based learning scheme to detect resource access faults. Connectivity between users and IoT devices is provided by a selection of trusted data sources and service providers to improve the use of distributed resources in an IoT-based smart city. The proposed system presents the stabilities of user needs for resource utilization and security by reducing waste in the choice and selection of unreliable devices.

Ikram Ud Din et al. [23] have investigated the various IoT-based ML mechanisms utilized in the stated areas, among others. Additionally, lesson reporting and scoring are explored by examining the main goals of machine learning techniques utilized in IoT networks. This overview proposes a machine learning model in a number of IoT-based machines, taking into account their contribution and specific architecture to many fields, namely, medicine, agriculture, VANET, device security, energy management, and environment. Mainly, it focused on the IoT systems that should be in stock, and it may have altered the lives of the crowds. At the same time, it introduces a common function as well as IoT applications and exploring machine learning techniques. Then, this article provided the researchers with the framework to identify the common function in IoT applications and use the appropriate instruments consistent with their needs.

The existing literature discussed here are based on the static parameters and a single machine-learning algorithm. In the proposed work, we have explored multiple machine-learning models and joined them to achieve more efficient results. Moreover, the proposed framework work has both detection and prevention mechanisms, which are missing in other models.

Materials and methods

The proposed technique is related to providing the solution for existing problems in smart city management processes. This work is developed related to the Internet of Things (IoT) based advanced technique for monitoring the resource utilization and energy consumption with the utilization of advanced metering technology [14, 15]. In the smart city, energy management is considered as a significant task for preventing the energy loss from unauthorized utilization [11, 16].

Proposed system for energy theft prevention

In smart cities, the Demand Side Management System (DSMS) is utilized for gathering demand-based information to determine the optimal energy consumption, such as unloading program during peak hours, after that to allow the use of electricity markets. In specific, with this technology, the user can be enabled to monitor the smart appliance on mobile devices. Moreover, there is a need to improve the data collection mechanism of a smart city by considering the cost-effective and energy-efficient technology by analyzing the history of user's early activities by consumption patterns. However, the energy theft is serious, and it causes the reason for the failure of various countries [7]. Therefore, it is becoming a big issue, and massive research are being held for reducing its impact on smart cities [12]. Thus, the reason for the development of smart meter, it provides a digital report about energy losses in a particular area [8]. Methods of energy theft include hacking smart city devices and plugging other households directly into the power grid. Other techniques that include are mechanisms, manipulating data through cloud storage, and tampering with the smart meter's software. Accordingly, attackers can diminish their power utilization by controlling different families through hacking and altering to create power use, since the complete bill of all customers in the network stays unaltered. An illustration of energy robbery conditions appears in Fig. 2 which has energy data as input and alerts/advisory and actions as output. The proposed has deployed machine learning algorithm such as GWO, DRCNN, LSTM and GRU to predict the power consumptions.

Fig. 2
figure 2

Proposed Energy Theft Prevention System

In this particular area, the energy theft can be occurred due to the person utilizing the connection of one user with their knowledge; the intruders steal the connection of a user and utilize it for their own usage. This causes the reason for the high energy consumption rate for a victimized user; therefore, they need the smart and effective system to prevent energy theft with the utilization of smart prediction devices to reduce the electricity bill. The ultimate purpose of proposing the ETPS is to provide a warning about energy theft to the consumers by alerting them at the right time. This technology is based on gathering by utilizing monitoring and analyzing the data for detecting energy theft by continuous monitoring. In our proposed technology, we incorporated three levels of process where initially data gathering process, prediction model, and decision making model. The proposed work is based on multi-objective prediction framework where we utilized machine learning technique to provide better prediction. The techniques utilized in this work are Grey Wolf Optimization, DRCNN, LSTM, and Gated Recurrent Unit. With the utilization of these techniques, the abnormality in the energy consumption range can be predicted and compare the reading with actual data. Then, the ETPS plays the role for decision-making with the utilization of a statistical model (Simple Moving Average) SMA to separate the anonymous activities from the initial stage. Finally, the ETPS is a history-based decision-making model. The remaining stages can be filtered through the subsequent section and whether choose energy burglary happened. In the wake of taking an official conclusion, the entire cycle will be rehashed with the following approaching information. ETPS is best actualized with an autonomous equipment framework straightforwardly at the keen meters, this is because any impedance for energy robbery, paying little need to alter equipment or control of information, can be recognized. It is more exactly contrasted with simply observing the information from the cloud or administrator's data set, the same number of different components may influence the examination.

Data collection

Demand Side Management System (DSMS) orders the data from different ongoing observing shrewd gadgets in the house. The data collection module for setting up Energy Theft Prevention System is to prepare the constant observing. Data collection module utilized a bunch of savvy plugs called Eon Labs Z-Wave UK Plug-in Switches in addition to Power Meters and the principal regulator was a Vera Edge Home Controller. Our energy theft prevention system recognizes startling energy robbery from any type of malignant assault. These executive modules can be planned in the accompanying following steps:

  • Steps 1: multi-Objective prediction framework: The prediction model gauge followed 24 hours through utilizing multi-objective prediction framework. The data can be measured, and it utilizes the expectations, correlation and determining the theft energy burglary circumstance.

  • Step 2: Algorithms and Multi-Model Forecasting Systems: Multi-objective diagnosing method utilize distinctive AI strategies and uses the most exact system with condition expectation method for dynamic condition \(sp(n)\). This predictive method Grey Wolf Optimization (GWO), Deep Recurrent Conventional Neural Network (DRCNN), Gated Recurrent Unit (GRU), and Long Short-Term Memory (LSTM). These methods are utilized in steps and deep explanations are given below.

GREY WOLF optimization

The algorithm of grey wolf optimization is the usage of imitators, because it interacts with the social and behavior tolerating leaders for a specified grey wolf optimization package. The grey wolves mostly preferred conscious as the collection of group package, the discipline and behavior of leadership were well maintained.

Leadership hierarchy

In the optimization problem, the three most suitable solutions were selected, such as Alpha, Beta, Delta and Head Wolf. The choice impersonators leadership grading of the Gray Wolves optimization. Omega Wolf is defined as solving other optimization problems. Whole Omega Wolves solutions / solutions seek the Leading Hunter, Alpha, Beta and Delta guidelines.

Encircling behavior

When the gray wolves take their place of prey, the prey is surrounded. This environment prevents the victim from moving. To mimic environmental behavior, the standard GMO uses the following equations:


where \({X}_{t+1}\) is the iteration (t + 1) in wolf position, \({A}_{p.t}\) is observed at iteration t, in the prey position, \({A}_{t}\) is the vector coefficient that is responsible for exploitation and exploration. \({E}_{t}\) is the modified vector that's decides the wolf movement towards the region of prey and opposite of it, \({C}_{t}, { B}_{t}\) is the vector coefficient, which is used to explore the solution of the space vector at failing of coefficient. The random numbers \({r}_{1}\) and \({r}_{2}\) are uniformly distributed in the interval (0,1). When the iteration can be increase with the transition parameter linearly decreases. It can be formulated as the following segments.


where \(t\) is denoted by the current iteration and T indicates the maximum number of iterations.

Hunting behavior

In a grey wolf package, it is believed that large wolves are capable of hunting prey. Therefore, these lines can be used simultaneously to approach the position of the victim. The hunting strategy of a mathematical representation is given below,

$${E}_{\alpha ,t}=\left|{B}_{\alpha ,t}.{A}_{\alpha ,t}-{A}_{t}\right|$$
$${E}_{\beta ,t}=\left|{B}_{\beta ,t}.{A}_{\beta ,t}-{A}_{t}\right|$$
$${E}_{\delta ,t}=\left|{B}_{\delta ,t}.{A}_{\delta ,t}-{A}_{t}\right|$$

where \({A}_{\alpha ,t}\), \({A}_{\beta ,t}\) and \({A}_{\delta ,t}\) are the tth iteration in the positions of leading hunters. \({B}_{\alpha ,t}\), \({B}_{\beta ,t}\) and \({B}_{\delta ,t}\) are defined as random numbers in Eq. (4). \({E}_{\alpha ,t}\), \({E}_{\beta ,t}\) and \({E}_{\delta ,t}\), are different vectors that can be calculated for updating the level of \({(t+1)}^{th}\) iteration in grey wolf optimization is shown in Fig. 3.

Fig. 3
figure 3

Evolution of position in GWO

$${F}_{1}={A}_{\alpha ,t}-{C}_{\alpha ,t}.{E}_{\alpha ,t}$$
$${F}_{2}={A}_{\beta ,t}-{C}_{\beta ,t}.{E}_{\beta ,t}$$
$${F}_{3}={A}_{\delta ,t}-{C}_{\delta ,t}.{E}_{\delta ,t}$$

where the vectors \({C}_{\alpha ,t}\), \({C}_{\beta ,t}\) and \({C}_{\delta ,t}\) are manipulated in Eq. (911). Here, \({F}_{1},{F}_{2},{F}_{3}\) is the fitness function for first best search, second best search and third best search. It is believed in the wolf packs that all large wolves are capable of hunting prey. Therefore, these lines can be used simultaneously to approach the position of the victim. The hunting strategy of a mathematical representation is given below:

Exploration and exploitation in GWO

In the pursuit conditions, unmistakably, the vectors Ct and Bt are acquainted with keeping the abuse and investigation process for calculation. | Ct | < 1 or potentially Bt < 1, exploration sections are misused with circumstance speaking to conduct for pursuing prey. Then | Ct | > 1 as well as Bt > 1, the novel hunt sections are investigated, it keeps the neighborhood optima of the wolve package of stagnation. The imitators assaulting prey conduct through the dimly wolves. Then the iterations T/2 can be passed, and Ct is the coefficient of GWO that's misuses the arrangement system. For this circumstance, the investigation was kept up and the calculation process through the Bt coefficient. The harmony placed between the administrator's abuse and the investigation were kept up and diminishing the idea for process boundaries in GWO. Algorithm 1 is provided as the introduction to step-by--by-step portrayal for standard GWO. The hidden layers feature will help you get the best result online. When the capabilities to the study about the trained data from GWO predictive and tie the best test data to a particular output in a hierarchical or layered network structure. It uses a supervised learning technique called retransmission to train the network. Due to their widespread ability to solve complex problems, many GWOs have been designed to optimize the outcome for different types of problems. The Recurrent Conventional Neural Network (DRCNN) DRCNN is one of the models in artificial neural network. The data sequences, namely, images, numeric data, and time series text patterns are examined by the usage of artificial neural network. This powerful artificial neural network organization is utilized in enterprises, for example, sensors, stock trades, and government offices. The complete (extended) DRCNN network, this network can be completely sequenced in another network organization. The three digital values are placed in series, the neural network system is formed in three layers, and it is released to the network system which maintains each layer to combine all digital numbers.

The mathematical representation of an DRCNN happens as given below:

$${D}_{t}=\sigma \left({d}_{t-1}.A+{l}_{t}.B+m\right)$$

Where,\({p}_{t}\) is related to the current memory in the step time t and it is denoted by the predicted output.\({s}_{t}\) is the Hidden state that employed in network memory; then it analyses and gives the information for any critical situation arrives in the preceding step over time and it is the most important in DRCNN. A: Hidden-to-hidden weights, B: Input-to-hidden weights, C: Hidden-to-output weights, m: Bias value, σ: Activation function, \({l}_{t}\): Input data, \(t\): Time step, \({p}_{t}\): Predicted output, and \({d}_{t}\): Hidden state. The DRCNN B, C, A weights stay steady during the manner, unlike traditional neural systems wherever they are several at any level. This decreases the level of parameters that need to be learned by making the task analysis step by step to handle the different types of inputs. Long Short-Term Memory (LSTM) is the main advantage of DRCNN and the previous information can be related to the task at hand. In situations wherever this way between the related data and this asked location is small, DRCNNs can learn and use the previous information. However, if the difference is large, DRCNN will not do able to combine the data together to start the learning process. To address long-term dependence problems, a particular variety of DRCNN estimated long-term memory networks (LSTMs) was formed. It was organized by Hochreiter & Schmidhuber who then generalized and realized various people in several enterprises because it works greatly for many problems [24]. The computational formulas:

$${e}_{t}=\sigma ({A}_{f}.\left[{g}_{t-1};{l}_{t}\right]+{m}_{f})$$
$${j}_{t}=\sigma ({A}_{i}.\left[{g}_{t-1};{l}_{t}\right]+{m}_{i})$$
$${p}_{t}=\sigma ({A}_{o}.\left[{A}_{t-1},{l}_{t}\right]+{m}_{o}$$

where, \({A}_{o}\): Output gate weights, \({A}_{f}\): Forget gate weights, \({A}_{i}\): Input gate weights, \({A}_{c}\): Cell state weights, \({l}_{t}\): Input value,\({q}_{t}\), Output value\({g}_{t}\), t: Time step,\({e}_{t}\): Forget gate \({p}_{t}\): Output gate, \({N}_{t}\): Cell state, \({N1}_{t}\): Candidate value, \({m}_{i}\): Input gate bias value, \({m}_{o}\): Output gate bias value, mf: Forget gate bias value,\(\sigma\): Gate state and \({m}_{c}\): Cell state bias values.

The GRU band is acquired in the LSTM zone which happens in related equalizations:

$${q}_{t}=\sigma ({A}_{z}.\left[{g}_{t-1};{l}_{t}\right])$$
$${t}_{t}=\sigma ({A}_{r}.\left[{g}_{t-1};{l}_{t}\right])$$

Where,\({A}\): Candidate gate weights, \({A}_{r}\): Reset gate weights, \({A}_{z}\): Update gate weights, \(\sigma\): Gate state.\({l}_{t}\): Input value, \({g}_{t}\): Output value\({q}_{t}\), \(t\): Time step, \({q}_{t}\): Update gate, \({g}_{t}\): Candidate value, and \({t}_{t}\): Reset gate.

With reset the port regulates the innovative combination of previous and input storage to update, port regulates how much relates to the preceding storage keep. The locking mechanism idea is used to make similar models in LSTM for looking at long-term dependencies:

  • GRU –It has three LSTMs and two gates.

  • GRU –It haven't internal memory and output gate.

  • GRU – It sequences the faster movement according to lesser parameters.

GRU and LSTM models are used to overcome the problem of long-term addiction. Then the trade-off system is not satisfied for the complete process.

In the State of Prediction Model \(({sp}_{\left(n\right)})\) regulates the abnormal energy theft through stage 1. The subsequent formulas are utilized for further stages.

The hidden layer formula:


where,\({x}_{t}\): Number of the training sets,\({x}_{h}\): Number of the hidden layer, \({x}_{i}\): Number of the input layer, and \({x}_{o}\): Number of the output layer.

The Mean Absolute Percentage Error (MAPE) is given by

$${MAPE}_{n}=\frac{100}{n}\sum\nolimits_{i=1}^{n}\left|\frac{{R}_{i}-{Z}_{i}}{{R}_{i}}\right|where\ {R}_{i}\ne 0$$

where,\({Z}_{i}\): Forecast output data, Number of data, and \({R}_{i}\): Actual output data.

The Absolute Percentage Error (APE) is given by,

$${APE}_{n}=\frac{100}{n}\sum\nolimits_{i=1}^{n}\left|\frac{{R}_{n}-{Z}_{n}}{{R}_{n}}\right|where\ {Z}_{n}\ne 0$$

where \({APE}_{n}\)= Absolute Percentage Error for \(n\).

The prediction state is given by:

$${sp}_{\left(n\right)}=\left\{\begin{array}{c}0, if {APE}_{n}\le {MAPE}_{n}\\ 1, otherwise\end{array}\right.$$

where, \({sp}_{\left(n\right)}\): State of prediction model decision-making condition.

  • Level 1: Procedures: The following steps are taken for this level:

    This is initiated by Pre-processing the data to accumulative data, and then the next one is done by utilizing the prediction model to predict the data. This is followed by the usage of Mean Absolute Percentage Error (MAPE), and it provides the best model prediction continued by utilizing the MAPE for the updated system and comparing the Absolute Percentage error (APE) for every hour. Then finally, in level 1, if \({sp}_{\left(n\right)}\) = 1. It went to the next stage, and the remaining data goes to the next iteration.

  • Level 2: Primary Decision-Making Model: The Simple Moving Average (SMA) can be determined for energy theft detection by the usage of the following levels,

    1. a)

      Level 2.1: Algorithms: The subsequent formulas can be used to determine theft prediction for further stages:

      Level 2.1 starts up by the Simple Moving Average (SMA) as below given equation.


      where, \(n\) represents the hours level in SMA and \(l\) represents the different quantities in the hour list. For the next step is the Maximum SMA difference algorithm given by

      $${SMA}_{(md)}=\begin{array}{c}max\\ i\in n\end{array}\left|{SMA}_{(i)}-{SMA}_{(i-1)}\right|, where n\ne 0$$

      where, \({SMA}_{(md)}\) represents the determined difference level in between before and after process of SMA and the level of hour state is given by

      $${sh}_{\left(n\right)}=\left\{\begin{array}{c}0, if \left({SMA}_{\left(i\right)}-{SMA}_{\left(i-1\right)}\right)\le \frac{3}{4}{SMA}_{\left(md\right)}\\ 1, otherwise \end{array}\right.$$

      where, \({sh}_{\left(n\right)}\) represents the algorithm for state of hours to take the decision-making condition.

    2. b)

      Level 2.2: Procedures: The ensuing steps are taken at this stage:

  • Level 3: Continuous Hour Model:

    In this, first step determines the Simple Moving Average (SMA) to utilize the whole day and to determine the difference between the SMA calculation for the current hour and the last hour after the measured data for 24 h. The next step is used to determine the extreme difference in algorithm SMA and provide the algorithm in the state of hours. In \({sh}_{\left(n\right)}\)= 1, to start the hour model in the day and else the data went to the next iteration.

  • Level 4: Same Day and Hour Model:

    Here the first process is rearranging data according to the day and hour and then to determine SMA utilized for 4 h continuously when the data transfer from the day and the data differs to the hour. The next process is to develop the alteration between the SMA calculation for the current point and the last point after the measured data in point 5. Next, the Maximum SMA algorithm can be used in difference clarification and proceed to the level of hours algorithm. Then finally, \({sh}_{\left(n\right)}\) = 1 is went to the next stage, else the data goes to the next iteration and next iteration.

  • Level 5: Secondary Decision-Making model: In this level, we used to find the history of user's with maximum occasional usages of power.

    • Level 5.1: Algorithms: The below mathematical models are utilized in that stage:

      • The Maximum wattage:

      $${O}_{(md)}=\begin{array}{c}max\\ i\in n\end{array}f\left|{O}_{(i)}\right|$$

      where P (md) represents the maximum power. It is taken from the measurement list.

      • energy theft detection state:

      $${sets}_{\left(n\right)}=\left\{\begin{array}{c}0, if \frac{3}{4}\left({O}_{\left(md\right)}\le {O}_{n}\le {O}_{(md)}\right)\\ 1, otherwise \end{array}\right.$$

      where,\({sets}_{\left(n\right)}\) represents the energy theft state in the algorithm in the decision-making condition.

    • Level 5.2: Procedures: In this stage utilize several steps taken by the algorithm:

    In the initial step to determine the level of energy theft detection from the algorithm and maximum watt and then the next is if, \({sets}_{\left(n\right)}\)= 1 is the possible energy theft, else unexpected usage of consumer for high power consumption. Then finally proceed the data in the next iteration.

    Once all the preceding phases have been completed, it will move to the next period and repeat the process from stage 1. However, ETPS requires at least 5 weeks of non-malicious data collection at every hour in order for the system to learn from the historical data. This learning will be continually updated for real-time monitoring, and it has the potential to increase its accuracy as additional data is brought in.

Results and discussion

In this work, we provide detailed inform the whole implementation process for the proposed ETPS in NS2 Platform. The parameter selected for the simulation is presented in Table 1 as follows:

Table 1 Simulation parameters

The result, we deliberate the different kinds of output obtained by some performance analysis based on calculating the delivery ratio, delay, throughput, Network Lifetime, energy conservation, and overhead. With these calculations, we obtained better results than the existing techniques. The resulted outcome of our work shows that the delivery ratio of the proposed work is higher than the existing technique. The result based on delay calculation shows the proposed technique has obtained low, while the existing technique shows high. For throughput calculation, we obtained high as a result, meanwhile the existing techniques provides low. The network life of the proposed is high, while the existing is low. Energy conservation is lower than the existing technique utilizing higher amount of energy. Finally, we obtained the overhead result as low but the existing consumed higher amount. For better understanding, we here provide the graphical diagram and the tabulation of the results. We also give the graphical diagram of every result in Fig. 4.

Fig. 4
figure 4

Performance analysis of the proposed system

For our comparative analysis, we provide the results based on the proposed technology through existing technology in terms of calculating the delivery ratio, delay ratio, throughput analysis, network lifetime, energy consumption, and overhead calculation. Therefore, we got the effective results than the existing technique.

In the above result and analysis section, we tabulate and provide the results in graphical (as shown in Fig. 4) representation as well. These outcomes showed the executing technique shows the great outcome than the existing technique. For node-based calculation, the number of nodes utilized are 30, 50, 70, 90, 110. In the first column of Table 2, we provide the results of node vs energy consumption, we obtained the results of proposed technology are 88, 177, 177, 266, 355, while non-ETPS provides 108, 197, 207, 296, 385. In the second column of Table 2, we obtained 456, 273, 195, 152, 124 as the result of proposed. In other hand, the non-ETPS provides 304, 182, 130, 101, 82. In third column of Table 3, we obtained 76023, 45614, 32581, 25341, 20733 for proposed and 70023, 40614, 30581, 20341, 10733 for non-ETPS technique. In fourth column of Table 1, we obtained the result for proposed technique are 0.102563, 0.061538, 0.043956, 0.034188, 0.027972, while non-ETPS has obtained 0.112563, 0.081538, 0.063956, 0.054188, 0.047972. By the comparison results we obtained, we conclude that our proposed technique provides better results than the existing techniques.

Table 2 Comparative analysis of the performance


In a rapidly growing technological world, smart cities have become the most ubiquitous technology. These smart cities have reduced people's responsibility because most of them abuse them. The study of this work to detect theft attacks and we use a multi-objective diagnosing structure named an Energy Theft Prevention System to detect energy theft. This work gleaned to take the combination of machine learning concepts like Gated Recurrent Unit (GRU), Grey Wolf Optimization (GWO), Deep Recurrent Convolutional Neural Network (DDRCNN), and Long Short-Term Memory (LSTM) has been developed as part of ETPS. In addition to this, a statistical model known as Simple Moving Average (SMA) has been also established for ETPS. Such processes help us to overcome the drawbacks of existing systems and to detect energy theft activities. Comparing the proposed ETPS technique with the existing technique, we achieved the best results for analyzing parameters such as delivery ratio, throughput, delay, overhead, energy conversation, and network lifetime. In the proposed system we are dependent on the structed and formatted data coming from smart cities, however, this is not always possible. The proposed system can work with guided data only, which is a limitation. In future work, we plan to improve the performance analysis and data format independent of the proposed system to get better results.


  1. Quasim, M.T., Khan, M.A., Algarni, F., Alshahrani, M.M, Fundamentals of Smart Cities. In: Khan, M.A., Algarni, F., Quasim, M.T. (eds) Smart Cities: A Data Analytics Perspective. Lecture Notes in Intelligent Transportation and Infrastructure. Springer, Cham. 2021

  2. Bolton T, Dargahi T, Belguith S, Al-Rakhami MS, Sodhro AH (2021) On the Security and Privacy Challenges of Virtual Assistants. Sensors (Basel) 21(7):2312.;PMCID:PMC8036736

    Article  Google Scholar 

  3. Abuhasel KA, Khan MA (2020) A Secure Industrial Internet of Things (IIoT) Framework for Resource Management in Smart Manufacturing. IEEE Access 8:117354–117364.

    Article  Google Scholar 

  4. Alghamdi NS et al (2021) Energy-efficient and blockchain-enabled model for internet of things (IoT) in smart cities. Comput Mater Continua 66(3):2509–2524

    Article  Google Scholar 

  5. Alam, T., Khan, M.A., Gharaibeh, N.K., Gharaibeh, M.K. (2021). Big Data for Smart Cities: A Case Study of NEOM City, Saudi Arabia. In: Khan, M.A., Algarni, F., Quasim, M.T. (eds) Smart Cities: A Data Analytics Perspective. Lecture Notes in Intelligent Transportation and Infrastructure. Springer, Cham., 2020

  6. Lakhan A, Sodhro AH, Majumdar A, Khuwuthyakorn P, Thinnukool O (2022) A Lightweight Secure Adaptive Approach for Internet-of-Medical-Things Healthcare Applications in Edge-Cloud-Based Networks. Sensors 22:2379.

    Article  Google Scholar 

  7. Mohammad, Nazeeruddin. "A Multi-Tiered Defense Model for the Security Analysis of Critical Facilities in Smart Cities." IEEE Access 7 PP: 152585–152598, 2019.

  8. Otuoze, Abdulrahaman Okino, Mohd Wazir Mustafa, Abdulhakeem Temitope Abdulrahman, Olatunji Obalowu Mohammed, and Sani Salisu. "Penalization of electricity thefts in smart utility networks by a cost estimation-based forced corrective measure." Energy Policy. 2020 ;143:111553, .

  9. S. Verma, S. Kaur et al., "Toward Green Communication in 6G-Enabled Massive Internet of Things," in IEEE Internet of Things Journal, vol. 8, no. 7, pp. 5408–5415, 1 April1, 2021, doi:

  10. A. Mukherjee, P. Goswami, L. Manman, L. Yang and P. Pillai, "Energy-Efficient Resource Allocation Strategy in Massive IoT for Industrial 6G Applications," in IEEE Internet of Things Journal, vol. 8, no. 7, pp. 5194–5201, 2021, doi:

  11. Cheng, Bin, Gürkan Solmaz, Flavio Cirillo, Ernö Kovacs, Kazuyuki Terasawa, and Atsushi Kitazawa. "Fogflow: Easy programming of iot services over cloud and edges for smart cities." IEEE Internet of Things Journal 5, No. 2 ,PP.696–707, 2017.

  12. Cirillo, Flavio, David Gómez, Luis Diez, Ignacio Elicegui Maestro, Thomas Barrie Juel Gilbert, and Reza Akhavan. "Smart City IoT Services Creation through Large Scale Collaboration." IEEE Internet of Things Journal 2020.

  13. Ullah, Rehmat, Yasir Faheem, and Byung-Seo Kim. "Energy and congestion-aware routing metric for smart grid AMI networks in smart city." IEEE access 5,PP.13799–13810,2017.

  14. M. A. Khan, Amit Kumar, Scalable Design and Processor Technology for IoT Applications, Khan, M.A. (Ed.). (2022). Internet of Things: A Hardware Development Perspective (1st ed.). CRC Press.\

  15. Khan, M. A. (2021). A formal method for privacy-preserving in cognitive smart cities. Expert Systems, e12855.

  16. A. Munusamy et al., "Edge-Centric Secure Service Provisioning in IoT-Enabled Maritime Transportation Systems," in IEEE Transactions on Intelligent Transportation Systems, doi:

  17. Westraadt L, Calitz A (2020) A modeling framework for integrated smart city planning and management. Sustain Cities Soc 63:102–444

    Article  Google Scholar 

  18. Rani, Ridhima, Vijaita Kashyap, and Meenu Khurana. "Role of IoT-Cloud Ecosystem in Smart Cities: Review and Challenges." Materials Today: Proceedings, Nov 2020.

  19. Wang M, Zhou T, Wang Di (2020) Tracking the evolution processes of smart cities in China by assessing performance and efficiency. Technol Soc 63:101–353

    Article  Google Scholar 

  20. Sharma, Manu, Sudhanshu Joshi, Devika Kannan, Kannan Govindan, Rohit Singh, and H. C. Purohit. "Internet of Things (IoT) adoption barriers of smart cities' waste management: An Indian context." J Cleaner Prod. 2020;270:122–047.

  21. Majumdar Sharmila, Subhani Moeez M, Roullier Benjamin, Anjum Ashiq, Zhu Rongbo (2021) Congestion prediction for smart sustainable cities using IoT and machine learning approaches. Sustainable Cities and Society. 64:102–500

    Article  Google Scholar 

  22. Li D, Deng L, Liu W, Qinglang Su (2020) Improving communication precision of IoT through behavior-based learning in a smart city environment. Futur Gener Comput Syst 108:512–520

    Article  Google Scholar 

  23. Din, Ikram Ud, Mohsen Guizani, Joel JPC Rodrigues, Suhaidi Hassan, and Valery V. Korotaev. "Machine learning in the Internet of Things: Designed techniques for smart cities." Fut Gen Comput Syst. 2019;100:826–843.

  24. Li W, Logenthiran T, Phan V-T, Woo WL (2019) A Novel Smart Energy Theft System (SETS) for IoT-Based Smart Home. IEEE Intern Things J 6(3):5531–5539.

    Article  Google Scholar 

Download references


This manuscript has no funding support.

Author information

Authors and Affiliations



Mohammad Tabrez Quasim, Khair ul Nisa, Mohammad Zunnun Khan and Mohammad Shahid Husain data curation, and methodology, Shadab Alam, Mohammed Shuaib, Mohammad Meraj and Monir Abdullah software and writing. All authors have read, reviewed, and agreed to the published version of the manuscript.

Corresponding author

Correspondence to Monir Abdullah.

Ethics declarations

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Institutional review board statement

Not applicable.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Quasim, M.T., Nisa, K.u., Khan, M.Z. et al. An internet of things enabled machine learning model for Energy Theft Prevention System (ETPS) in Smart Cities. J Cloud Comp 12, 158 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: