IoT With Cloud Computing - Unit 2
IoT With Cloud Computing - Unit 2
PRUDHVI KIRAN P
Assistant Professor, CSE - IOT Dept.
R. V. R. & J. C. College of Engineering
UNIT - 2 [ 13 Periods ]
IoT Cloud Platforms
Microsoft Azure IoT, Amazon Webs Services IoT, IBM WATSON IoT, Google’s cloud
IoT.
Principles and foundation of Artificial intelligence for IoT
Machine Learning Paradigms for IoT - Supervised learning for IoT (Linear regression, Logistic
regression, SVM-Decision Tree, Naive’s bayes), Deep Learning for IoT, Neural Networks for
IoT.
IaaS
SENSORS APPLICATIONS
PaaS SaaS
Choosing across different platforms depends on both business and technical factors like, Scalability,
Reliability, Customization, Operations, Protocols, Hardware, User Cloud Knowledge, Support,
Architecture and Technology Stack, Security and Cost. Of course, Security and privacy is also the main
concern during the adoption of IoT Cloud Platforms.
Above mentioned are the various functional areas, that play important role in IoT space, which are
managed effectively, only with the IoT Cloud Platform. I.e. these are the things offered by cloud platforms.
CLOUD PLATFORMS IN OUR SYLLABUS
On Premise
ARTIFICIAL INTELLIGENCE
MACHINE LEARNING
DEEP LEARNING
SUPERVISED LEARNING
NEURAL NETWORKS
ARTIFICIAL INTELLIGENCE
Artificial intelligence is a machine’s ability to perform the cognitive functions (such as perceiving,
reasoning, learning, interacting with an environment, problem solving, and even exercising
creativity) like human minds.
Every day we probably interact with AI even if we don't realize it; by using Facial Detection and
Recognition, Text Editors or Autocorrect, Maps and Navigation, Search and Recommendation
Algorithms and many more.
MACHINE LEARNING
Machine learning is a branch of artificial intelligence (AI) and computer science which focuses on
the use of data and algorithms to imitate the way that humans learn, gradually improving its
accuracy.
Through the use of statistical methods, machine learning algorithms are trained to make
CLASSIFICATIONS/PREDICTIONS, and to uncover key insights in data. These insights subsequently
drive decision making within applications and businesses, ideally impacting key growth metrics.
Example ML Use cases - Image Recognition, Speech Recognition, Predict Traffic Patterns, Self-
Driving Cars, Catching Email Spam, Catching Malware, Virtual Personal Assistant, many more.
SUPERVISED LEARNING
Supervised learning is the type of machine learning in which machines are trained using well
"labelled" training data, and on basis of that data, machines predict the output.
Labelled data is raw data that has been assigned one or more labels to add context or meaning. In
machine learning and artificial intelligence, these labels often serve as a target for the model to
predict.
While unlabelled data consists of raw inputs with no designated outcome, labelled data is
precisely the opposite. Labelled data is carefully annotated with meaningful tags, or labels, that
classify the data's elements or outcomes.
In supervised learning, the training data provided to the machines work as the supervisor that
teaches the machines to predict the output correctly. It applies the same concept as a student
learns in the supervision of the teacher.
For Example; we have a facial recognition task. Unlabeled data would consist of a set of facial
images without any identification information. Conversely, labeled data in this scenario would
include the same facial images with corresponding identification tags, i.e., the name of the person
in each image. Thus, a machine learning model can learn to associate particular facial features with
specific individuals.
FUNCTIONAL REPRESENTATION OF MACHINE LEARNING (SUPERVISED LEARNING)
NEURAL NETWORKS
Neural networks, also known as artificial neural networks (ANNs) or simulated neural networks
(SNNs), are a subset of machine learning and are at the heart of deep learning algorithms. Their
name and structure are inspired by the human brain, mimicking the way that biological neurons
signal to one another.
Artificial neural networks (ANNs) are comprised of a node layers, containing an input layer, one or
more hidden layers, and an output layer. Each node, or artificial neuron, connects to another and
has an associated weight and threshold. If the output of any individual node is above the specified
threshold value, that node is activated, sending data to the next layer of the network. Otherwise,
no data is passed along to the next layer of the network.
Neural networks rely on training data to learn and improve their accuracy over time. However,
once these learning algorithms are fine-tuned for accuracy, they are powerful tools in computer
science and artificial intelligence, allowing us to classify and cluster data at a high velocity.
Neural networks can analyze human speech despite varying speech patterns, pitch, tone,
language, and accent (virtual assistants like Amazon Alexa and automatic transcription software),
Neural networks can track user activity to develop personalized recommendations, as they can
also analyze all user behavior and discover new products or services that interest a specific user.
INPUT ONE HIDDEN
LAYER LAYER
OUTPUT
LAYER
OUTPUT
LAYER
fundamentally, Classification is about predicting a label (discreet or fixed) and Regression is about
predicting a quantity (continuous or measurable).
Some of the major Supervised Machine Learning Algorithms include;
1. Linear Regression REGRESSION
2. Logistic Regression
3. Decision Tree CLASSIFICATION
4. SVM
5. Naive Bayes
1. Linear Regression
Linear regression is the simplest and most widely-used model for supervised learning with
continuous targets. Linear regression analysis is used to predict the value of a variable based on
the value of another variable (one or more). The variable you want to predict is called the
dependent variable. The variable you are using to predict the other variable's value is called the
independent variable.
Linear regression algorithm shows a linear relationship between a dependent (x) and one or more
independent (y) variables, hence called as linear regression. Since linear regression shows the
linear relationship, the value of dependent variable is changing according to the value of the
independent variable(s). For example, the number of hours would be the independent variable
and the money earned would be the dependent variable. The amount of money earned depends on
the number of hours worked.
Linear regression can be further divided into two types of the algorithms; Simple Linear Regression
(single independent variable is used) and Multiple Linear regression (more than one independent
variable is used).
The linear regression model provides a sloped straight line representing the relationship between
the variables. Below image/graph is the representation of linear regression;
For Example, The weight of the person is linearly related to their height. So, this shows a linear
relationship between the height and weight of the person. According to this, as we increase the
height, the weight of the person will also increase.
LINEAR REGRESSION IN IOT
• Predictive Maintenance
Linear regression can be used to predict the remaining useful life of machinery and equipment based
on historical sensor data. It can estimate when a machine is likely to fail.
• Energy Consumption Forecasting
IoT sensors in smart buildings can collect data on energy usage, temperature, and occupancy. Linear
regression models can help forecast future energy consumption, allowing for better energy
management and cost reduction.
• Environmental Monitoring
Linear regression can be applied to analyze IoT sensor data related to environmental factors such as air
quality, temperature, and humidity. This analysis can help predict pollution levels, weather patterns,
and environmental changes.
• Agricultural Yield Prediction
IoT devices in precision agriculture collect data on soil quality, weather conditions, and crop health.
Linear regression models can predict crop yields based on these data.
• Inventory Management
Linear regression can assist in inventory optimization by analyzing historical sales data from IoT-
connected point-of-sale systems. It can help businesses forecast demand and adjust their inventory
levels accordingly.
• Traffic Flow Prediction
IoT sensors in smart cities collect traffic data, such as vehicle speed, volume, and congestion. Linear
regression models can predict traffic flow and congestion patterns, allowing for better traffic
management and route planning.
• Retail Sales Forecasting
Linear regression can analyze IoT data from retail environments, including foot traffic, weather
conditions, and promotional activities, to forecast sales and optimize marketing strategies.
• Supply Chain Optimization
Linear regression can be used to analyze IoT data related to supply chain performance, including
shipping times, order volumes, and supplier performance. This analysis can optimize logistics and
inventory management.
• Quality Control
In manufacturing IoT applications, linear regression can be used to model relationships between
sensor data and product quality. It can help identify factors that contribute to defects and improve
quality control processes.
• Wearable Health Devices
Linear regression can be applied to data from wearable IoT devices, such as fitness trackers and health
monitors, to predict health-related outcomes like heart rate, blood pressure, or calorie expenditure.
Linear regression is well-suited for scenarios where there is a linear relationship between input
variables and the target variable. It provides a straightforward way to model and make predictions
based on historical data collected by IoT devices. However, in situations with nonlinear relationships,
Linear Regression is not suitable.
2. Logistic Regression
Logistic regression is a statistical method in supervised learning for predicting a binary outcome,
such as yes or no, based on a data set. Logistic regression is often used for classification and
predictive analytics.
Logistic regression estimates the probability of an event occurring, such as voted or didn’t vote,
based on a given dataset of independent variables. Since the outcome is a binary/probability, the
dependent variable is bounded between 0 and 1. I.e. logistic regression is only used when our
dependent variable is binary and on other hand, in linear regression the dependent variable is
continuous.
In Logistic regression, instead of fitting a
regression line, we fit an "S" shaped logistic
function, which predicts two maximum values (0
or 1).
The threshold value inlogistic regression is 0.5.
This means that by default, the model will predict
the class with the highest probability (1) when
the probability is greater than or equal to 0.5.
And it predicts lowest probability (0), when the
probability is less than 0.5.
Some popular examples of logistic regression include; predicting if an e-mail is spam or not spam
or if a tumor is malignant or not malignant.
LOGISTIC REGRESSION IN IOT
• Anomaly Detection
Logistic regression can be used to classify data from IoT sensors as either normal or anomalous. When
monitoring a system for anomalies, this can help detect unusual behavior or security breaches.
• Predictive Maintenance
In IoT-based predictive maintenance, logistic regression can classify equipment or machinery as either
healthy or in need of maintenance based on sensor data. This helps prioritize maintenance efforts.
• Quality Control
Logistic regression can classify products as either defective or non-defective based on sensor
measurements in manufacturing IoT applications, aiding in quality control processes.
• Fault Detection
In industrial IoT, logistic regression can classify devices or components as either faulty or functioning
correctly based on sensor data. This helps in quickly identifying and addressing issues.
• Healthcare Monitoring
Logistic regression models can classify patient health status as normal or critical based on data from
wearable IoT devices, allowing for early intervention in medical emergencies.
• Security
Logistic regression can be used to classify network traffic patterns as either normal or suspicious in IoT
security applications, aiding in intrusion detection and prevention.
• Environmental Monitoring
In IoT environmental monitoring systems, logistic regression can classify environmental conditions as
safe or potentially hazardous based on sensor data, triggering alerts or actions as needed.
• User Behaviour Analysis
Logistic regression can classify user behavior as legitimate or fraudulent based on patterns observed in
IoT data. This is valuable for applications like fraud detection in online transactions.
• Occupancy Detection
In smart building systems, logistic regression can classify rooms or areas as occupied or vacant based
on data from occupancy sensors, enabling energy-saving strategies.
• Predictive Agriculture
Logistic regression can classify soil conditions as suitable or unsuitable for planting based on sensor
data in precision agriculture, assisting in crop management decisions.
• Traffic Management
Logistic regression can classify traffic conditions as normal or congested based on data from IoT traffic
sensors, helping with real-time traffic management and route planning.
• Waste Management
In smart waste management systems, logistic regression can classify waste bins as full or empty based
on sensor data, optimizing waste collection routes.
Logistic regression is particularly useful when the problem at hand involves making binary decisions
or classifying data into two categories. However, for multi-class classification problems, Logistic
Regression is not suitable and other algorithms like decision trees, random forests, support vector
machines, or deep learning models might be more appropriate.
3. Decision Tree
Decision Tree is a Supervised learning technique that can be used for both classification and
Regression problems, but mostly it is preferred for solving Classification problems.
hey are easy to understand, interpret, and implement, making them an ideal choice for beginners
in the field of machine learning.
In a Decision tree, there are two nodes, which are the Decision Node and Leaf Node. Decision
nodes are used to make any decision and have multiple branches, whereas Leaf nodes are the
output of those decisions and do not contain any further branches. It uses a flowchart like a tree
structure to show the predictions that result from a series of feature-based splits.
Decision Trees are advantageous in IoT applications because they are relatively easy to interpret,
which can be important for making informed decisions. They can also handle both categorical and
numerical data, making them versatile for various IoT data types. However, for very complex and large
datasets, decision trees may not be used.
4. Support Vector Machine (SVM)
SVM is a powerful supervised algorithm that works best on smaller datasets but on complex ones.
Support Vector Machine, abbreviated as SVM can be used for both regression and classification
tasks, but generally, they work best in classification problems.
The goal of the SVM algorithm is to create the best line or decision boundary that can segregate n-
dimensional space into classes so that we can easily put the new data point in the correct category
in the future. This best decision boundary is called a hyperplane.
SVM chooses the extreme points/vectors that help in creating the hyperplane. These extreme cases
are called as support vectors, and hence algorithm is termed as Support Vector Machine. Consider
the below diagram in which there are two different categories that are classified using a decision
boundary or hyperplane. In this diagram, positive hyper plane and negative hyper plane are called
as support vectors.
Examples of the SVM include; Data classification, Facial detection & expression classification, Text
categorization & handwriting recognition and speech recognition.
SVM IN IOT
• Anomaly Detection
SVM can be used to detect anomalies in IoT sensor data. By training a SVM on historical data, you can
create a model that classifies data points as normal or anomalous.
• Predictive Maintenance
SVM can help in predicting equipment failures in IoT-based predictive maintenance systems. By
analyzing sensor data, the algorithm can identify conditions that often lead to failures, allowing for
timely maintenance.
• Quality Control
In manufacturing IoT applications, SVM can classify products as either defective or non-defective based
on sensor measurements, aiding in quality control processes.
• Fault Detection
SVM can be used to classify devices or components as faulty or functioning correctly based on sensor
data in industrial IoT, facilitating early detection and intervention.
• Healthcare Monitoring
SVM can classify patient health conditions as normal, at risk, or critical based on data from wearable
IoT devices, helping with medical decision-making.
• Security
SVM can be used for intrusion detection in IoT security systems. By analysing network traffic patterns,
the algorithm can identify suspicious behavior and trigger alerts.
• Environmental Monitoring
SVM can classify environmental conditions as safe or potentially hazardous based on sensor data in IoT
environmental monitoring systems, triggering warnings or taking appropriate actions.
• User Behavior Analysis
SVM can classify user behaviour in IoT applications as legitimate or fraudulent based on patterns
observed in data. This is valuable for fraud detection and security.
• Occupancy Detection
In smart building systems, SVM can classify rooms or areas as occupied or vacant based on data from
occupancy sensors, enabling energy-efficient management.
• Predictive Agriculture
SVM can classify soil conditions as suitable or unsuitable for planting based on sensor data in precision
agriculture, aiding in crop management decisions.
• Traffic Management
SVM can classify traffic conditions as normal, congested, or critical based on data from IoT traffic
sensors, helping with real-time traffic management and route planning.
• Waste Management
In smart waste management systems, SVM can classify waste bins as full, partially full, or empty based
on sensor data, optimizing waste collection routes.
SVM is a versatile algorithm and can be particularly effective when dealing with high-dimensional
data or when a clear margin of separation exists between classes. However, it may require careful
preprocessing of data and parameter tuning to achieve optimal results in specific IoT applications.
5. Naive Bayes
Naive Bayes algorithm is a supervised learning algorithm, which is based on Bayes theorem and
used for solving classification problems.
Naive Bayes is a probabilistic machine learning algorithm that is commonly used for classification
tasks. The simplest solutions are usually the most powerful ones, and Naïve Bayes is a good
example of that. It has been successfully used for many purposes, but it works particularly well
with natural language processing (NLP) problems (Text Classification).
Bayes’ Theorem is named after English statistician, Thomas Bayes. It is a very important theorem in
mathematics that is used to find the probability of an event, based on prior knowledge of conditions
that might be related to that event. Below is the Bayes formula;
probability of B occurring probability of A occurring
given evidence A has
already occurred
probability of A occurring
given evidence B has probability of B occurring
already occurred
Which tells us: how often A happens given that B happens, written P(A|B) also called posterior
probability, When we know: how often B happens given that A happens, written P(B|A) and how likely
A is on its own, written P(A) and how likely B is on its own, written P(B). In simpler terms, Bayes’
Theorem is a way of finding a probability when we know certain other probabilities.
Naive Bayes is a simple supervised machine learning algorithm that uses the Bayes’ theorem with
strong independence assumptions between the features to procure results. That means that the
algorithm just assumes that each input variable is independent. For example, if you use Naive
Bayes for sentiment analysis, given the sentence ‘I like Harry Potter’, the algorithm will look at the
individual words and not the full sentence.
In fact, in a sentence, words that stand next to each other influence the meaning of each other, and
the position of words in a sentence is also important. However, for the Naive Bayes algorithm,
phrases like ‘I like Harry Potter’, Harry Potter like I’, and ‘Potter I like Harry’ are the same.
Here are some of the common applications of Naive Bayes for real-life tasks;
Document classification; This algorithm can help you to determine to which category a given
document belongs. It can be used to classify texts into different languages, genres, or topics
(through the presence of keywords).
Spam filtering; Naive Bayes easily sorts out spam using keywords. For example, in spam, you can
see the word ‘gambling’ much more often than in regular mail. The algorithm must be trained to
recognize such probabilities and, then, it can efficiently apply them for spam filtering.
Sentiment analysis; Based on what emotions the words in a text express, Naive Bayes can calculate
the probability of it being positive or negative. For example, in customer reviews, ‘good’ or
‘inexpensive’ usually mean that the customer is satisfied.
Image classification; For personal and research purposes, it is easy to build a Naive Bayesian
classifier. It can be trained to recognize hand-written digits or put images into categories through
supervised machine learning.
NAIVE BAYES IN IOT
• Anomaly Detection
Naive Bayes can be used for anomaly detection in IoT sensor data. By modeling the normal behavior of
IoT devices, it can identify deviations from the expected patterns, indicating anomalies or security
breaches.
• Environmental Monitoring
In IoT environmental monitoring systems, Naive Bayes can classify environmental conditions as safe or
potentially hazardous based on sensor data, enabling timely responses to environmental changes or
pollution events.
• Quality Control
In manufacturing IoT applications, Naive Bayes can classify products as defective or non-defective
based on sensor measurements, assisting in quality control processes.
• Predictive Agriculture
Naive Bayes can classify soil conditions as suitable or unsuitable for planting based on sensor data in
precision agriculture, assisting in crop management decisions.
• Occupancy Detection
In smart buildings, Naive Bayes can classify rooms or areas as occupied or vacant based on data from
occupancy sensors, enabling energy-efficient management of lighting and HVAC systems.
• Healthcare Monitoring
Naive Bayes models can classify patient health conditions, such as normal, at risk, or critical, based on
data from wearable IoT devices, aiding in medical decision-making.
• User Behavior Analysis
Naive Bayes can classify user behavior in IoT applications as legitimate or fraudulent based on patterns
observed in data. This is essential for fraud detection and security.
• Waste Management
In smart waste management systems, Naive Bayes can classify waste bins as full, partially full, or empty
based on sensor data, optimizing waste collection routes.
• Predictive Maintenance
While not typically used for predictive maintenance, Naive Bayes can be applied to classify
maintenance-related decisions, such as whether a piece of equipment needs maintenance or not
based on historical data.
It's important to note that Naive Bayes has its limitations, particularly its assumption of feature
independence, which may not hold in all real-world scenarios. In situations where feature
independence doesn't hold, other machine learning algorithms like decision trees, random forests,
support vector machines, or deep learning models may be more appropriate. The choice of algorithm
should depend on the nature of the data and the specific requirements of the IoT application.
TECHNOLOGY WISE APPLICATIONS
ARTIFICIALELEMENTS-STRUCTURE
PROGRAM INTELLIGENCE (MACHINE LEARNING/SUPERVISED LEARNING) - IOT APPLICATIONS
• Predictive Maintenance
ML algorithms can analyze sensor data from IoT devices to predict when equipment or machinery is
likely to fail. This enables proactive maintenance, reducing downtime and saving costs for businesses.
• Anomaly Detection
ML models can identify unusual patterns or anomalies in sensor data, which can be indicative of
security breaches, equipment malfunctions, or other abnormal events in IoT networks.
• Energy Management
ML can optimize energy consumption in IoT systems by analyzing historical data and making real-time
adjustments to control heating, cooling, lighting, and other energy-consuming devices in a smart
building or industrial setting.
• Healthcare Monitoring
IoT devices like wearables and medical sensors can collect a vast amount of data. ML algorithms can
analyze this data to monitor patients' health conditions, detect anomalies, and alert healthcare
providers in case of emergencies.
• Smart Agriculture
ML helps optimize farming operations by analyzing data from IoT sensors on soil moisture, weather
conditions, and crop health to make decisions on irrigation, fertilization, and pest control.
• Traffic Management
ML can analyze data from traffic cameras, sensors, and GPS devices to optimize traffic flow, predict
congestion, and improve overall transportation efficiency in smart cities.
• Environmental Monitoring
IoT sensors can collect data on air quality, water quality, and other environmental factors. ML can
analyze this data to detect pollution, track changes over time, and provide early warnings for natural
disasters.
• Supply Chain Optimization
ML can optimize inventory management, logistics, and supply chain operations by analyzing IoT data
related to product movement, demand forecasting, and supply chain performance.
• Gesture and Voice Recognition
IoT devices like smart speakers and cameras can benefit from ML-based gesture and voice recognition
to enhance user interactions and control.
• Personalized User Experiences
ML algorithms can analyze user behavior data from IoT devices to offer personalized
recommendations, content, and services, enhancing the overall user experience.
• Security and Fraud Detection
ML can analyze data from IoT devices to detect security breaches, unauthorized access, and fraudulent
activities in real-time, improving overall system security.
• Industrial Automation
In manufacturing and industrial settings, ML can optimize production processes, quality control, and
equipment maintenance by analyzing data from IoT sensors and automation systems.
• Smart Grids
ML helps in managing electricity grids efficiently by analyzing data from IoT sensors to predict energy
demand, optimize distribution, and detect faults or power outages.
• Asset Tracking
ML can help track and manage assets, such as vehicles, equipment, or inventory, using IoT devices with
GPS and other sensors.
• Wildlife Conservation
IoT-based sensor networks combined with ML can be used for wildlife tracking, habitat monitoring, and
poaching detection to aid conservation efforts.
NEURAL NETWORKS & DEEP LEARNING - IOT APPLICATIONS
PROGRAM ELEMENTS-STRUCTURE
• Image and Video Analysis
Object Detection: Neural networks can identify and locate objects in images and videos captured by
IoT cameras. This is useful in applications like surveillance, automated inspection, and smart
transportation.
• Natural Language Processing (NLP)
1. Voice Recognition: Neural networks can be used for speech recognition in IoT devices like smart
speakers and voice assistants.
2. Language Translation: In IoT applications, neural networks can provide real-time translation
services for multilingual communication.
• Predictive Maintenance
Neural networks can analyze sensor data to detect anomalies in machinery, equipment, or
infrastructure. This aids in predicting and preventing failures.
• Sensor Data Fusion
Neural networks can fuse data from various IoT sensors, including temperature sensors,
accelerometers, and cameras, to gain a more comprehensive understanding of an environment or
system.
• Gesture Recognition
Neural networks can interpret gestures captured by IoT sensors like accelerometers or depth cameras.
This is valuable in applications like gaming, human-computer interaction, and virtual reality.
• Security and Anomaly Detection
Neural networks can identify suspicious patterns or behaviors in network traffic data from IoT devices,
helping to detect and prevent cyberattacks.
• Energy Optimization
Neural networks can optimize energy consumption by analyzing data from IoT devices and adjusting
settings for heating, cooling, lighting, and more in smart buildings.
• Healthcare Monitoring
Neural networks can analyze data from wearable IoT devices to monitor a person's health, detect
abnormal conditions, and provide timely alerts.
• Autonomous Vehicles
In autonomous vehicles and drones, neural networks are used for tasks like object detection, lane
detection, and path planning based on sensor inputs.
• Quality Control
In manufacturing, neural networks can inspect and classify products based on sensor data, ensuring
quality control and reducing defects.
• Environmental Monitoring
Neural networks can analyze data from environmental IoT sensors to monitor air and water quality,
identify pollution sources, and predict environmental changes.
• Precision Agriculture
Neural networks can process data from IoT sensors in agriculture to optimize irrigation, fertilization,
and crop management for increased yields and resource efficiency.
UNIT - 2 [ 13 Periods ]
IoT Cloud Platforms
Microsoft Azure IoT, Amazon Webs Services IoT, IBM WATSON IoT, Google’s cloud
IoT.
Principles and foundation of Artificial intelligence for IoT
Machine Learning Paradigms for IoT - Supervised learning for IoT (Linear regression, Logistic
regression, SVM-Decision Tree, Naive’s bayes), Deep Learning for IoT, Neural Networks for
IoT.
END OF UNIT 2