electronics
Review
Machine Learning in Wireless Sensor Networks for Smart
Cities: A Survey
Himanshu Sharma 1 , Ahteshamul Haque 2 and Frede Blaabjerg 3,*
Citation: Sharma, H.; Haque, A.;
Blaabjerg, F. Machine Learning in
Wireless Sensor Networks for Smart
Cities: A Survey. Electronics 2021, 10,
1012. https://doi.org/10.3390/
electronics10091012
Academic Editors: Dongkyun Kim,
Qinghe Du, Mehdi Sookhak, Lei Shu,
Nurul I. Sarkar, Jemal H. Abawajy
and Francisco Falcone
Received: 13 March 2021
Accepted: 21 April 2021
Published: 23 April 2021
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affiliations.
Copyright: © 2021 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
1 Department of Electronics & Communication Engineering, KIET Group of Institutions,
Ghaziabad 201206, India; [email protected]
2 Advanced Power Electronics Research Lab, Department of Electrical Engineering, Jamia Millia Islamia,
New Delhi 110025, India; [email protected]
3 Department of Energy Technology, Aalborg University, 9220 Aalborg Øst, Denmark
* Correspondence: [email protected]
Abstract: Artificial intelligence (AI) and machine learning (ML) techniques have huge potential
to efficiently manage the automated operation of the internet of things (IoT) nodes deployed in
smart cities. In smart cities, the major IoT applications are smart traffic monitoring, smart waste
management, smart buildings and patient healthcare monitoring. The small size IoT nodes based on
low power Bluetooth (IEEE 802.15.1) standard and wireless sensor networks (WSN) (IEEE 802.15.4)
standard are generally used for transmission of data to a remote location using gateways. The WSN
based IoT (WSN-IoT) design problems include network coverage and connectivity issues, energy
consumption, bandwidth requirement, network lifetime maximization, communication protocols
and state of the art infrastructure. In this paper, the authors propose machine learning methods as
an optimization tool for regular WSN-IoT nodes deployed in smart city applications. As per the
author’s knowledge, this is the first in-depth literature survey of all ML techniques in the field of low
power consumption WSN-IoT for smart cities. The results of this unique survey article show that the
supervised learning algorithms have been most widely used (61%) as compared to reinforcement
learning (27%) and unsupervised learning (12%) for smart city applications.
Keywords: Internet of Things (IoT); sensor nodes; WSN-IoT; artificial intelligence; reinforcement
learning; smart city
1. Introduction
A smart city is an urban area that uses remote sensors and the Internet of Things
(IoT) enabling technologies to collect data from different locations and uses to enhance the
quality of life of the people. The low power, low data rate wireless sensor networks (WSN)
are used for monitoring and control applications in smart cities. The WSN nodes are used
as the underlying technology infrastructure in the IoT. In the IoT, the “things” refer to the
tiny embedded physical sensing devices (i.e., WSN nodes) connected to the internet to
perform a specific application. Currently, a new revolutionary technique known as artificial
intelligence (AI) and machine learning (ML) is evolving as the future of fully automated
IoT applications. Machine learning is a part of AI, in which, the computer algorithms learn
by themselves by improving from past experiences. A detailed survey of ML algorithms
was performed in [1] until the year 2013. As the ML and IoT, technologies are emerging
rapidly, therefore, the authors extend their survey work also. The IoT applications in
smart cities are smart traffic monitoring [2], smart grids [3], smart waste management [4],
smart agriculture [5], smart medical healthcare [6], etc. Table 1 provides a full form of all
important abbreviations used in this paper.
Electronics 2021, 10, 1012. https://doi.org/10.3390/electronics10091012 https://www.mdpi.com/journal/electronics
Electronics 2021, 10, 1012 2 of 22
Table 1. List of abbreviations in alphabetical order.
Acronym Description
5G 6G AMQP ANN BLE |
5th Generation Cellular Networks 6th Generation Cellular Networks Advanced Message Queuing Protocol Artificial Neural networks Bluetooth Low Energy |
CoAP | Constrained Application Protocol |
DDS | Data Distribution Service |
DL | Deep Learning |
DT | Decision Tree |
IoT k-NN LDA |
Internet of Things K Nearest Neighborhood Linear Discriminant Analysis |
LoRaWAN | Long Ranged Wide Area Network |
LTE | Long Term Evolution |
MAC | Medium Access Control |
MLMDP MLP MQTT NB-IoT PCA |
Machine LearningMarkov Decision Process Multi-Layer Perceptron Message Query Telemetry Transport Narrowband IoT Principle Component Analysis |
QoS | Quality of Service |
RL RFID SARSA SVM |
Reinforcement Learning Radio frequency Identification State-Action-Reward-State-Acton Support Vector Machines |
TCP | Transmission Control Protocol |
UDP WSN-IoT WSN |
User Datagram protocol WSN based IoT Wireless Sensor Networks |
The major problems in WSN based IoT (WSN-IoT) are fully autonomous operation,
maximum network lifetime, energy efficiency, quality of service (QoS), cross-layer optimization, high bandwidth requirement, sensor data analysis, cloud computing, communication
protocol design, etc. Currently, the industrial IoT (IIoT) or industry 4.0 is the biggest
revolution for smart industries, smart manufacturing sector, automobile sector, smart cities
and medical healthcare sector. Worldwide, various major companies like Microsoft, Google
and Amazon are working on the development of AI and ML-based algorithms in advanced
IoT applications for smart cities.
Machine learning can be applied in WSN-IoT for dynamic updating of routing tables
in WSNs, node localization in mobile WSN-IoT nodes, identification and separation of
faulty nodes for network optimization and prediction of the amount of energy harvesting
in energy harvesting WSN (EH-WSN). Through this paper, the authors have tried to answer
the following research questions: Why machine learning methods are used in WSN-IoT?
What is its superiority of using ML over traditional optimization methods in WSN-IoT?
Why is the smart city a typical use case of IoT applications?
IoT offers new opportunities for smart cities to use data to manage traffic, reduce
pollution and make better use of infrastructure. The following are the advantages of using
machine learning in traditional WSN-IoT:
• WSNs are generally deployed in a dynamically changing environment. Therefore,
self-adaption to the new environment is expected from a fully automated IoT scenario.
• Unknown parameter monitoring requires automatic adjustment of network topology
and configurations, e.g., temperature measurement in a glacier or volcano monitoring.
• Lack of accurate mathematical models of the unknown parameters in WSN-IoT.
• WSN-IoT deals with a large amount of sensor data, therefore the correlation between
different data set may be of critical concern.
Electronics 2021, 10, 1012 3 of 22
• Integration of WSN in IoT using cloud-based services for better monitoring and control.
• Future predictions and possible actions in WSN-IoT.
• The IoT generates a large amount of data from millions of sensor nodes. Machine
learning is powered by data and generates useful information from previous data.
Machine learning uses past IoT data to identify hidden patterns and builds models
that help predict future behavior and events.
As WSN-IoT are resource-limited (finite bandwidth and power availability) therefore,
there are some limitations for running ML-based inferences on IoT nodes also such as:
• A large number of computations are required to process the more amount of data,
hence computation complexity increases.
• Additional power consumption.
• Training of WSN-IoT nodes for various ML algorithms requires complex operations
and multi-domain skilled programmers.
The following are the contributions of this survey article in the field of WSN-IoT:
• In this paper, ML techniques are proposed as an optimized solution for traditional
WSN-IoT problems in smart cities.
• Design guidelines of the WSN-IoT framework using AI and ML have been proposed.
• An in-depth literature survey of WSN-IoT in smart cities is presented in detail for ML
engineers and data scientists.
This paper is organized as follows: Section 2 provides operation of WSN-IoT in smart
cities, Section 3 provides machine learning for WSN-IoT, Section 4 provides open research
issues in WSN-IoT, which can be solved by machine learning techniques, Section 5 provides
a literature survey of machine learning in WSN, Section 6 provides a summary of ML
techniques in WSN-IoT, Section 7 provides the survey report and, finally, Section 8 provides
the conclusion and future work.
2. Wireless Sensor Networks Based Internet of Things (WSN-IoT)
The operation of WSN-IoT in a smart city is shown in Figure 1. Here, the WSN nodes
are deployed in smart city applications such as smart traffic monitoring, smart grids in
buildings, remote health care monitoring, smart agriculture and industrial applications.
The function of an IoT-WSN node deployed in a smart city is to continuously monitor
and control any physical quantity like temperature, humidity, pressure, acceleration, etc.
The main function of these sensor nodes is to sense the data and send it to the main WSNIoT gateway node. From the gateway node, the data is sent to the cloud server. At the IoT
cloud, cloud computing takes place. The IoT cloud is directly connected to remote servers,
user mobile phones, computers, mobile phone towers, etc. The IoT and machine learning
tasks require a large amount of data processing and memory requirements. Therefore, the
IoT cloud server is designed as a high processing, high-performance computer with huge
storage capacity. However, the WSN end nodes have small computing capabilities with
limited processing, small storage and finite non-rechargeable battery power supply.
The WSN-IoT end nodes based on the IEEE 802.15.4 standard have the maximum
data rate of 250 kbps only. In WSN-IoT, the end nodes are powered by two AA-size batteries (1.5 volts, 1000 mAh), and the gateway is connected to the mains power supply.
Furthermore, if the WSN-IoT nodes are powered by renewable energy harvesting power
supplies [7], then machine learning algorithms can also be utilized to predict the future
available energy in IoT-WSNs. In the battery management system, machine learning techniques can be used for tracking maximum power point technique (MPPT) algorithms [8,9].
As these WSN sensor nodes generate a lot of sensor data, therefore, machine learning
algorithms can also be applied to them for data analysis, data prediction and other suitable tasks.
Electronics 2021, 10, 1012 | 4 of 22 |
Furthermore, if the WSN-IoT nodes are powered by renewable energy harvesting power
supplies [7], then machine learning algorithms can also be utilized to predict the future
available energy in IoT-WSNs. In the battery management system, machine learning techniques can be used for tracking maximum power point technique (MPPT) algorithms [8,9].
As these WSN sensor nodes generate a lot of sensor data, therefore, machine learning algorithms can also be applied to them for data analysis, data prediction and other suitable
tasks.
Figure 1. WSN-IoT using machine learning in a smart city.
In smart cities, the WSN-IoT networks contain the connectivity technologies/protocols as shown in Table 2. Table 2 shows IoT communication technologies such as Bluetooth
[10], based on IEEE 802.15.1 standards [11], RFID [12], IEEE 802.16 [13], ZigBee [14] based
on IEEE 802.15.4 [15], Wi-Fi [16], based on IEEE 802.11 [17], LoRa-WAN [18] based on
IEEE 802.11 series [19], 4G/5G cellular networks [20], based on WiMAX standard IEEE
802.16e [21] and 5G based on IEEE 1941 [22,23], respectively.
At the WSN-IoT node device level, the machine learning algorithms can be applied
from the cloud for its autonomous operation. The IoT device sends the sensor data to the
cloud server. From the IoT cloud, the user can monitor and control the application using
a mobile phone, laptop or desktop PC and personal digital assistant. Currently, many
popular cloud service companies provide free, but the limited amount of sensor data to
be stored in their cloud storage. For example, Microsoft Azure IoT, Amazon web service
Figure 1. WSN-IoT using machine learning in a smart city.
In smart cities, the WSN-IoT networks contain the connectivity technologies/protocols
as shown in Table 2. Table 2 shows IoT communication technologies such as Bluetooth [10],
based on IEEE 802.15.1 standards [11], RFID [12], IEEE 802.16 [13], ZigBee [14] based
on IEEE 802.15.4 [15], Wi-Fi [16], based on IEEE 802.11 [17], LoRa-WAN [18] based on
IEEE 802.11 series [19], 4G/5G cellular networks [20], based on WiMAX standard IEEE
802.16e [21] and 5G based on IEEE 1941 [22,23], respectively.
At the WSN-IoT node device level, the machine learning algorithms can be applied
from the cloud for its autonomous operation. The IoT device sends the sensor data to the
cloud server. From the IoT cloud, the user can monitor and control the application using
a mobile phone, laptop or desktop PC and personal digital assistant. Currently, many
popular cloud service companies provide free, but the limited amount of sensor data to
be stored in their cloud storage. For example, Microsoft Azure IoT, Amazon web service
(AWS), Google cloud platform, Cisco IoT cloud connect, IBM Watson IoT and Thing speak
IoT by Mathworks Incorporation, USA. Table 3 shows open system interconnect (OSI)
model layer data communication network protocols of an upper higher level separately.
Some very popular higher-level IoT protocols are message query telemetry transport
(MQTT) protocol [24], advanced message queuing protocol (AMQP) [25], constrained
application protocol (CoAP) [26] and data distribution service (DDS) protocol [27]. These
IoT protocols are based on the IEEE P1451-99 [28] standard for harmonization of internet
of things (IoT) devices and systems. In smart city IoT applications, these protocols are
used with TCP, UDP and cloud-based services. In WSN, a smart transducer interface
Electronics 2021, 10, 1012 5 of 22
protocol [29] is used for sensor management. It is based on an IEEE standard called the
P21451 interoperability interface standard [30].
Table 2. WSN-IoT technologies for smart cities.
S. No. IoT Technologies Standards IEEE Power/Energy Consumption Data Rate Frequency Band Distance Typical
Range
Smart City
Applications
Services
1 Bluetooth Low
Energy (BLE) [10]
IEEE 802.15.1
[11] Lowest Medium 24 Mbps 2.4 GHz Small (<5 m) Smart Home Automation, Smart Grids
2
Radio Frequency
Identification
(RFID) [12]
IEEE 802.15
[13] Low 500 kbps Small 915 MHz 10 m
RFID Fast-Tags,
Company
Gates
Entry/Exit
3 ZigBee [14] IEEE 802.15.4
[15] Low (250 kbps) Small 2.4 GHz 100 m Measurement Temperature
4 Wi-Fi [16] IEEE 802.11
[17] High 100 Mbps 2.4 GHz 1 km
Laptop/Mobile
Phone, Internet
Service
5
Long Ranged Wide
Area Network
(LoRaWAN) [18]
IEEE 802.11 ah
[19] Low 50 kbps
868 MHz
(Europe),
15 MHz (America)
923 MHz (Asia)
10 km
Connecting
Low Power
devices in
WAN
6
Cellular Mobile
Communication
(4G/5G) [20]
IEEE 802.16e
WiMax (4G)
[19]
IEEE 1914 New
Radio (5G)
[21–23]
High 4G-100 Mbps,
5G-1 Gbps 450 MHz–6 GHz 100 km
Remote
monitoring
and control
using Smart
Phones
Table 3. Higher-level communication protocols in WSN-IoT.
S. No. Communication Protocols IEEE Standard Remarks
1. Message Query Telemetry Transport (MQTT)
protocol [24] IEEE P1451-99 [28] Works with TCP for Data Security, Load Balancing
2. Advanced Message Queuing Protocol
(AMQP) [25] IEEE P1451-99 [28] Works with TCP for Smart Electronics Gadgets, QoS
3. Constrained Application Protocol
(CoAP) [26] IEEE P1451-99 [28] For Cloud Services
4. Data Distribution Service (DDS) protocol [27] IEEE P1451-99 [28]
Works with UDP for Data
Delivery, Machine to Machine
Communication
5. Smart Transducer Interface protocol [29] IEEE P21451 [30]
interoperability interfaces
Sensor Connectivity,
interoperable communication
3. Preliminaries in Machine Learning for WSN-IoT
Machine learning is the field of artificial intelligence (AI) that provides systems the
ability to automatically learn and improve from previous experience without being explicitly programmed. It aims to develop new computer programs, which can access data and
use it to learn for themselves. Machine learning (ML) for WSNs means learning sensor
nodes and networks from their past experiences and making predictions based on them.
The main application of machine learning is at the IoT cloud for data analysis, device
management, network management, network security and authentication services. At the
user end, intelligent control techniques can be developed, in which human interaction is
not required for example driverless cars, driverless trains, etc.
Electronics 2021, 10, 1012 | 6 of 22 |
From the machine learning point of view, the data flow in WSN-IoT is shown in
Figure 2. Here, the following are the steps for data flow: (1) sensor data acquisition, (2) data
communication between end node to the gateway node, (3) data aggregation at the gateway,
(4) data ingestion, storage and retrieval at the cloud, (5) data analysis, (6) sensor nodes
connectivity (7) and data security tasks. In simple words, the ML techniques can be applied
in WSN-IoT for localization, coverage, connectivity problems, MAC and routing layer
issues, data aggregation, fault detection, event monitoring, energy harvesting, QoS and
network security issues. Figure 3 shows a general flowchart for the machine learning,
machine testing and WSN action process in the WSN-IoT scenario.
y to automatically learn and improve fr previous experience without being explicitly programmed. It aims to develop new computer programs, which can access data
and use it to learn for themselves. Machine learning (ML) for WSNs means learning sensor
nodes and networks from their past experiences and making predictions based on them.
The main application of machine learning is at the IoT cloud for data analysis, device
management, network management, network security and authentication services. At the
user end, intelligent control techniques can be developed, in which human interaction is
not required for example driverless cars, driverless trains, etc.
From the machine learning point of view, the data flow in WSN-IoT is shown in Figure 2. Here, the following are the steps for data flow: (1) sensor data acquisition, (2) data
communication between end node to the gateway node, (3) data aggregation at the gateway, (4) data ingestion, storage and retrieval at the cloud, (5) data analysis, (6) sensor
nodes connectivity (7) and data security tasks. In simple words, the ML techniques can be
applied in WSN-IoT for localization, coverage, connectivity problems, MAC and routing
layer issues, data aggregation, fault detection, event monitoring, energy harvesting, QoS
and network security issues. Figure 3 shows a general flowchart for the machine learning,
machine testing and WSN action process in the WSN-IoT scenario.
Figure 2. Data flow in a typical WSN-IoT application.
Figure 2. Data flow in a typical WSN-IoT application.
Electronics 2021, 10, x FOR PEER REVIEW 7 of 24
Figure 3. Process flow-chart of machine learning in WSN-IoT.
3.1. Training Process
Here, first of all, data is acquired from a particular application. The features are extracted from this raw data. For example, if the data is image data then the colors, pixels,
brightness and contrast of all images database are extracted. Then the features are classified according to the requirement of the machine learning process. Now some training
Figure 3. Process flow-chart of machine learning in WSN-IoT.
Electronics 2021, 10, 1012 7 of 22
3.1. Training Process
Here, first of all, data is acquired from a particular application. The features are
extracted from this raw data. For example, if the data is image data then the colors,
pixels, brightness and contrast of all images database are extracted. Then the features are
classified according to the requirement of the machine learning process. Now some training
examples are applied to the basic initial algorithms for their learning or improvement.
Thus, algorithms are trained and optimized according to the data patterns.
3.2. Testing Process
Now the next step is to deploy this trained WSN in any real-life application. In real life,
the unknown data is taken as input and the features are extracted from it. These extracted
features are applied to an already trained algorithm. The output of the trained algorithm is
classified as data predictions.
3.3. WSN Actions
Finally, based on predicted output data the necessary actions by the WSN are decided.
4. Open Research Problems in WSN-IoT Which Can Be Solved by Machine
Learning Techniques
The following are the currently open research issues in WSN-IoT, which can be solved
by ML techniques.
4.1. IoT Node Localization
In a WSN scenario, the current location identification of a sensor node is called node
localization. In mobile WSN nodes, path planning is a very important step. Node localization is considered a classification problem because all the nodes are divided (classified)
into range-based and range-free nodes. Several ML algorithms like, SVM, K-NN and
RL-based techniques (Q-learning, SARSA) are used in WSN-IoT for node localization as a
classification problem [31].
4.2. IoT Node Coverage and Connectivity
In a WSN scenario, the sensing coverage is the field of interest (FOI), in which at least
one sensor node covers all the points. Therefore, the optimal placement of sensor nodes is
a design issue. To maximize the WSN lifetime, the connectivity should be proper between
the neighbor nodes [32].
4.3. Routing Layer Issues
The processing for sending the data packets from one node to another via intermediate
nodes is called routing. In the routing process, long routing tables are maintained by the
gateway nodes, which consists of the source and destination address of all the packets
in the network. In WSN, the sensed data is sent towards the main gateway node by the
end nodes. If the routing path is very long then unnecessary energy is wasted in a WSN
network. Therefore, smart routing algorithms need to be designed carefully to find the
optimal routes between end node and gateway nodes. Several machine learning techniques
such as decision tree, random forest, ANN, SVM and Bayesian learning are used to find
the optimal path in WSNs [33].
4.4. MAC Layer Issues
The MAC layer controls the medium accessing technique in WSN. The sensor MAC
(SMAC) protocol is generally used in WSN. Reinforcement learning (RL) based algorithms
are used for MAC protocol design in WSN. The RL-MAC techniques control the sleep,
wake, transmission and reception in sensor networks [34].
Electronics 2021, 10, 1012 8 of 22
4.5. Sensor Data Aggregation
In a smart city, thousands of small sensor nodes are deployed to measure the same
physical quantity, e.g., temperature, humidity, light, carbon dioxide (CO2) gases, etc.
Several sensors may report the same information to the gateway. This large amount of data
is difficult to handle by the gateway. Therefore, sensor data aggregation is important in
WSNs for smart city applications. Data aggregation means collecting and summarizing
useful information from multiple sources. In this process, the data redundancy and data
accuracy are improved. Data aggregation saves the power consumption of WSN nodes and
hence improves the network lifetime also. Machine learning is useful for data aggregation.
The cluster aggregates the data from the cluster head and transmits it to the base station. ML
techniques based on artificial neural networks (ANN) and quality (Q)-learning algorithms
are useful for data aggregation tasks in WSN-IoT [35].
4.6. Event Monitoring and Target Detection
In a smart city application, the WSNs are deployed for event monitoring and target
detection such as intrusion detection and traffic monitoring. In WSN, node failure, target
recovery and tracking latency from sensing nodes are required. Various ML techniques
like Bayesian, Q learning and genetic algorithms are used for event monitoring and target
tracking in WSNs. Applying, ML techniques in WSNs can be useful to detect an event or
target from the complex image sensor data [36].
4.7. Energy Harvesting
Energy harvesting is the process of extracting environmental energy from the sun,
wind, tides, radio waves, etc., and converts it into the corresponding electrical energy. The
broad objective of energy harvesting is to save our limited available fossil fuels (coal, oil
and gases). However, in the smart city application, energy harvesting can also be used
for achieving maximum network lifetime in rechargeable battery-based WSN-IoT nodes.
Furthermore, the ML techniques are used in energy harvesting WSN-IoT for future available
energy prediction tasks. The ML algorithms like regression technique and reinforcement
learning techniques (Q-learning) are suitable for energy harvesting applications. Generally,
solar energy, radio frequency (RF) waves and wind energy are used with rechargeable
battery-based WSNs. Harvested energy prediction, battery power management are the
tasks that can be optimized by using the ML algorithms in traditional WSN-IoT [37].
4.8. Node Query Processing
In WSNs, the end nodes, cluster heads and gateway nodes perform various types
of queries such as sensor data aggregation, routing paths, synchronization and control
operations, packet delivery with each other, etc. The k-nearest neighborhood (k-NN) based
ML techniques are used for sensor data queries in WSN.
Table 4 shows some WSN-IoT research issues with ML-based solutions [38].
Table 4. WSN-IoT research issue with ML-based solution.
S. No. WSN-IoT Research Issue Machine Learning
Technique Solution/Remarks
1 IoT Node Localization [31] K-NN, Reinforcement
Learning (RL) Efficient Distance Estimation, Range Estimation
2 IoT Node Coverage and
Connectivity [32]
Decision trees, ANN,
Evolutionary Computation
Classification of Connected and Failed Nodes in
the sensor network, Identification nodes with
poor and good connectivity
3 Routing Layer Issues [33] Decision Tree, Random Forest Prediction of optimal routing path depending
upon data traffic.
Electronics 2021, 10, 1012 9 of 22
Table 4. Cont.
S. No. WSN-IoT Research Issue Machine Learning
Technique Solution/Remarks
4 MAC Layer Issues [34] SVM, Decision Tree, ANN Efficient channel assignment
5 Sensor data aggregation [35] k-means, SVM, Reinforcement Decide optimal cluster head in WSN nodes,
Dynamic configuration of WSN nodes
6 Event Monitoring and Target
Detection [36]
PCA, Deep Learning,
Evolutionary Computing,
Bayesian Learning
Efficient event monitoring and multiple target
tracking
7 Energy Harvesting [37] SVM, Deep Learning,
Evolutionary Computing
To predict the amount of battery energy required
to maximize network lifetime, Prediction of
energy harvesting availability in the future.
8 Node Query processing [38] k-NN Node Beacon sending, Handshake for data transfer
5. Literature Survey of Machine Learning in WSN-IoT
Our literature survey of machine learning algorithms for WSN-IoT is shown in
Figure 4. Our literature survey is divided into the following categories:
1. Supervised Learning,
2. Unsupervised learning,
3. Reinforcement learning.
Electronics 2021, 10, x FOR PEER REVIEW 10 of 24
5. Literature Survey of Machine Learning in WSN-IoT
Our literature survey of machine learning algorithms for WSN-IoT is shown in Figure
4. Our literature survey is divided into the following categories:
1. Supervised Learning,
2. Unsupervised learning,
3. Reinforcement learning.
Figure 4. Literature survey of ML algorithms for WSN-IoT.
5.1. Literature Survey of Supervised Machine Learning for WSN–IoT
In supervisor learning, data are labeled. In other words, we provide an input data
variable (x) to the system. The system predicts output data (y) depending upon the type
of input and system function. The objective of supervised learning is to approximate the
mapping function so that when a new unknown input data is applied then, the output (y)
Figure 4. Literature survey of ML algorithms for WSN-IoT.
Electronics 2021, 10, 1012 10 of 22
5.1. Literature Survey of Supervised Machine Learning for WSN–IoT
In supervisor learning, data are labeled. In other words, we provide an input data
variable (x) to the system. The system predicts output data (y) depending upon the type
of input and system function. The objective of supervised learning is to approximate the
mapping function so that when a new unknown input data is applied then, the output (y)
can be predicted [39,40].
y = f (x) (1)
In this section, we will discuss various supervised learning algorithm, which can be
applied in WSN-IoT applications. The supervised learning algorithms are used in WSN for
target tracking, localization of Nodes, event monitoring, data security, fault detection, etc.
There are two types of supervisor learning as regression and classification.
5.1.1. Regression
In regression, the output variable (y) has some continuous numerical value like
rupees, height, weight, etc. Regression is applied to solve various issues in WSNs such as
localization, connectivity problem, data aggregation and energy harvesting [41].
5.1.2. Classification
In classification, the output variable(y) is a category of objects like the type of colors
(e.g., red or yellow), type of diseases (e.g., fever or fracture), etc. There are the following
types of classification problems as k-NN, decision tree, ANN, Bayesian learning, etc [42].
(A). K-nearest neighborhood (k-NN) [43]: This is an instance-based supervised learning algorithm. Here, all training instances are stored in a master database. When a new
instance query (xq) arrives then this new query is compared with the stored database and
classified results are derived. In the k-NN algorithm the distance between each data points
is calculated by using the Euclidian distance formula
d(q, p) = q(q1 – p1)2 + (q2 – p2)2 + . . . + (qn – pn)2
Or
d(q, p) = si∑=n1(qi – pi)2 (2)
where q and p are data points and d is the distance between them. In [44] data streaming in
IoT using the k-NN algorithm is proposed. The KNN algorithm is also used for the early
detection of agriculture pests, diseases, sensor node failure and fault detection issues [45].
(B). Decision tree (DT) [46]: In the DT algorithm, the main task is to calculate the
attribute of the root node from each level. This process is called attribute selection. There
are two methods for attribute selection as information gain and Gini index. The average
amount of information is called entropy and is given as
Entropy = –
n∑
i=1
pi ∗ log(pi) (3)
Gini index is a metric to measure how often a randomly chosen element would be
incorrectly identified.
Gini Index = 1 –
n∑
i=1
p2i (4)
where pi is the probability of occurrence of an ith event, n is the number of training examples.
It is a classification method for predicting labels of data by iterating the input data through
a learning tree. During this process, the feature properties are compared relative to decision
conditions to reach a specific category. In WSNs, decision tree (DT) algorithms like ID3
are used to identify the link reliability, mean time to failure (MTTF) and mean time to
repair (MTTR). Figure 5 shows an example of the DT algorithm, in which the decisions
Electronics 2021, 10, 1012 11 of 22
are taken by a WSN node system for different conditions. Here, if the 1st condition of
WSN node battery voltage is greater than 2.7 volts (i.e., Vbattery > 2.7 volts) is not true, then
all decision flows towards the left-hand side of the tree. On the left-hand side, the 2nd
condition to be checked is supply availability. On the other hand, if the 1st condition (i.e.,
Vbattery > 2.7 volts) is true, then all decisions flow towards the right-hand side of the tree.
Electronics 2021, 10, x FOR PEER REVIEW 12 of 24
Figure 5. Decision tree (DT) algorithm flow at a WSN-IoT end node.
(C). Artificial neural networks (ANNs) [47–49]: ANN is inspired by the human brain
architecture learning mechanism. The basic unit of AAN is perceptron, which is equivalent to a neuron in the human brain as shown in Figure 6. Backpropagation is most the
common learning algorithm in ANN. An activation function is any step function, a cosine
function or a sigmoid function, etc. The error (