Chapter 3 Artificial Intelligent: Industry 4.0 in Mechanical Engineering
Chapter 3 Artificial Intelligent: Industry 4.0 in Mechanical Engineering
0 in Mechanical Engineering
Content
1. Machine learning.
2. Applications.
Machine learning
Industry 4.0 in Mechanical Engineering
Machine learning
Industry 4.0 in Mechanical Engineering
Artificial Intelligent
Supervised learning is a type of machine learning in which an
algorithm is trained on a labeled dataset to learn a mapping function
that can predict an output value given an input.
The labeled dataset used for supervised learning consists of input-
output pairs, where each input has an associated correct output.
During training, the algorithm receives the inputs and tries to predict
the corresponding outputs.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Learning Associations
In the case of retail—for example, a supermarket Chain—one
application of machine learning is basket analysis, which is finding
associations between Products bought by customers: If people who
buy X typically also buy Y, and if there is a customer who buys X and
does not buy Y, he or she is a potential Y customer. Once we find such
customers, we can target them for cross-selling.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Learning Associations
In finding an association rule, we are interested in learning a
conditional probability of the form P(Y\X) where Y is the product we
would like to condition on X, which is the product or the set of Products
which we know that the customer has already purchased.
Let us say, going over our data, we calculate that P(chips\beer) = 0.7.
Then, we can define the rule: 70 percent of customers who buy beer
also buy chips.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Classification
In credit scoring (Hand 1998), the bank
calculates the risk given the amount of credit
and the information about the customer.
This is an example of a classification
problem where there are two classes: low-
risk and high-risk customers. The information
about a customer makes up the input to the
classifier whose task is to assign the input to
one of the two classes.
https://www.youtube.com/watch?v=OahkL4e3hlo
Machine learning
Industry 4.0 in Mechanical Engineering
Classification
Example of a training dataset where each
circle corresponds to one data instance with
input values in the corresponding axes and
its sign indicates the class. For simplicity,
only two customer attributes, income and
savings, are taken as input and the two
classes are low-risk (V) and high-risk. An
example discriminant that separates the
two types of examples is also shown
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Regression https://www.youtube.com/watch?v=CtsRRUddV2s
Let us say we want to have a system that can predict the price of a used
car. Inputs are the car attributes—brand, year, engine capacity, milage,
and other information—that we believe affect a car’s worth. The output is
the price of the car. Such problems where the output is a number are
regression problems.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Regression
Let X denote the car attributes and Y be the price of the car. Again
surveying the past transactions, we can collect a training data and the
machine learning program fits a function to this data to learn Y as a
function of X.
In cases where the linear model is too restrictive, One can use for
example a quadratic
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Regression
The minimum of the sum of squares is found by setting the gradient to zero
and since the gradient equations
become
form y = mx + b, where y and x are variables, m is the slope, and b is the y-
intercept
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Regression
A training dataset of used cars and the
function fitted. For simplicity, milage is
taken as the only input attribute and a
linear model is used.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Decision Trees
A decision tree is a flowchart-like model that contains conditional control
statements, comprising decisions and their probable consequences. The
output relates to the labelling of unforeseen data.
In the tree representation, the leaf nodes correspond to class labels, and
the internal nodes represent the attributes. A decision tree can be used to
solve problems with discrete attributes as well as Boolean functions.
Some of the notable decision tree algorithms are ID3 and CART.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Decision Trees
A decision tree is a flowchart-like model that contains conditional control
statements, comprising decisions and their probable consequences. The
output relates to the labelling of unforeseen data.
In the tree representation, the leaf nodes correspond to class labels, and
the internal nodes represent the attributes. A decision tree can be used to
solve problems with discrete attributes as well as Boolean functions.
Some of the notable decision tree algorithms are ID3 and CART.
https://www.youtube.com/watch?v=ZVR2Way4nwQ
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Decision Trees
Supervised learning
Decision Trees
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Decision Trees
For this dataset, the entropy is 0.94.
This can be calculated by finding the
proportion of days where “Play Tennis” is
“Yes”, which is 9/14, and the proportion
of days where “Play Tennis” is “No”,
which is 5/14.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Decision Trees
Entropy of outlook is smallest
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Random forest
Random forest is a commonly-used machine learning algorithm
trademarked by Leo Breiman and Adele Cutler, which combines the
output of multiple decision trees to reach a single result. Its ease of use
and flexibility have fueled its adoption, as it handles both classification
and regression problems.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Random forest
Machine learning
Industry 4.0 in Mechanical Engineering
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.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Neural Networks
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Neural Networks
https://www.youtube.com/watch?v=giid0-Oj_FY
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Neural Networks
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Neural Networks
Hàm ReLU
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Neural Networks
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Support Vector Machines
The algorithm of supervised learning in ML, SVM is highly popular
amongst the supervised learning models as it can be used for
classification or regression. Implementation of the model works well with
high-dimensional spaces, but it can also be used effectively with small
data sets. SVM can also classify new observations efficiently when the
algorithm is trained on a data set. SVM performs this by creating singular
or multiple hyperplanes to separate the data set between the two classes.
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
Support Vector Machines
https://www.youtube.com/watch?v=RnapcMi9lqA
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
K-nearest neighbors
Machine learning
Industry 4.0 in Mechanical Engineering
Supervised learning
K-nearest neighbors
https://www.youtube.com/watch?v=0p0o5cmgLdE
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
Unsupervised learning is a machine learning technique in which models
are not supervised using training dataset. Instead, models itself find the
hidden patterns and insights from the given data. It can be compared to
learning which takes place in the human brain while learning new things.
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
Unsupervised learning is a machine learning technique in which models
are not supervised using training dataset. Instead, models itself find the
hidden patterns and insights from the given data. It can be compared to
learning which takes place in the human brain while learning new things.
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
Advantages of Unsupervised Learning
Unsupervised learning is used for more complex tasks as compared to supervised learning because,
in unsupervised learning, we don't have labeled input data.
Unsupervised learning is preferable as it is easy to get unlabeled data in comparison to labeled data.
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
K-means clustering
K-means clustering is a method of vector quantization, originally from
signal processing, that aims to partition n observations into k clusters in
which each observation belongs to the cluster with the nearest mean
(cluster centers or cluster centroid), serving as a prototype of the cluster.
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
https://www.youtube.com/watch?v=R2e3Ls9H_fc
K-means clustering
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
K-means clustering
In statistics, the k-nearest neighbors algorithm (k-NN) is a non-
parametric supervised learning method first developed by Evelyn Fix and
Joseph Hodges in 1951 and later expanded by Thomas Cover. It is used
for classification and regression. In both cases, the input consists of the k
closest training examples in a data set. The output depends on whether
k-NN is used for classification or regression
Machine learning
Industry 4.0 in Mechanical Engineering
Un-Supervised learning
K-means clustering
Example of k-NN classification. The test
sample (green dot) should be classified
either to blue squares or to red triangles. If k
= 3 (solid line circle) it is assigned to the red
triangles because there are 2 triangles and
only 1 square inside the inner circle. If k = 5
(dashed line circle) it is assigned to the blue
squares (3 squares vs. 2 triangles inside the
outer circle).
Machine learning
Industry 4.0 in Mechanical Engineering
Reinforcement learning
Reinforcement Learning is a feedback-based Machine learning technique
in which an agent learns to behave in an environment by performing the
actions and seeing the results of actions.
In Reinforcement Learning, the agent learns automatically using
feedbacks without any labeled data.
Since there is no labeled data, so the agent is bound to learn by its
experience only
Machine learning
Industry 4.0 in Mechanical Engineering
Reinforcement learning
Reinforcement learning is a type of machine learning method where an
intelligent agent (computer program) interacts with the environment and
learns to act within that.
https://www.simplilearn.com/tutorials/machine-learning-tutorial/reinforcement-learning
Machine learning
Industry 4.0 in Mechanical Engineering
Reinforcement learning
S = the State or Observation
A = the Action the agent takes
R = the Reward from taking an Action
t = the time step
= the Learning Rate
ƛ = the discount factor which causes rewards to lose their value over time
so more immediate rewards are valued more highly
Machine learning
Industry 4.0 in Mechanical Engineering
Reinforcement learning
Reinforcement learning
Machine learning
Industry 4.0 in Mechanical Engineering
Reinforcement learning
Machine learning