1. Artificial Intelligence for Robotics
Unit 1: Introduction to AI Techniques
Dr. Padmakar J. Pawar
Professor and Head
Department of Robotics and Automation
K. K. Wagh Institute of Engineering Education and Research, Nasik
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
1
2. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
2
Outline:
1. Search algorithms
2. Heuristics and Metaheuristics
3. Handling uncertainties : Fuzzy logic
4. Probabilistic methods for uncertain reasoning
5. Learning methods: Statistical
6. Learning methods : Soft computing - Neural networks
4. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
4
• Systematic exploration – uninformed search algorithms explore the search space systematically, either by
expanding all children of a node (e.g. BFS) or by exploring as deep as possible in a single path before
backtracking (e.g. DFS).
• No heuristics – uninformed search algorithms do not use additional information, such as heuristics or cost
estimates, to guide the search process.
• Blind search – uninformed search algorithms do not consider the cost of reaching the goal or the likelihood of
finding a solution, leading to a blind search process.
• Simple to implement – uninformed search algorithms are often simple to implement and understand, making
them a good starting point for more complex algorithms.
• Inefficient in complex problems – uninformed search algorithms can be inefficient in complex problems with
large search spaces, leading to an exponential increase in the number of states explored.
• Example: Breadth first search (BFS), Depth search first (DFS), branch and bound etc.
Uninformed search algorithms:
6. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
6
• Use of Heuristics – informed search algorithms use heuristics, or additional information, to guide the search process
and prioritize which nodes to expand.
• More efficient – informed search algorithms are designed to be more efficient than uninformed search algorithms,
such as breadth-first search or depth-first search, by avoiding the exploration of unlikely paths and focusing on more
promising ones.
• Goal-directed – informed search algorithms are goal-directed, meaning that they are designed to find a solution to a
specific problem.
• Cost-based – informed search algorithms often use cost-based estimates to evaluate nodes, such as the estimated cost
to reach the goal or the cost of a particular path.
• Prioritization – informed search algorithms prioritize which nodes to expand based on the additional information
available, often leading to more efficient problem-solving.
• Optimality – informed search algorithms may guarantee an optimal solution if the heuristics used are admissible
(never overestimating the actual cost) and consistent (the estimated cost is a lower bound on the actual cost).
• Example: A*, Hill climbing, Best first search
Informed search algorithms:
7. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
7
Best First Search (Greedy algorithm)
0 1 3 2 8 9
Applications:
• Path finding-
Navigation system in robotics
• Machine learning
To find most promising path
• Optimization:
To determine best state of
process
8. 3/17/2024 8
Heuristics and Meta-heuristics
Optimizatin Techniques
Traditional Techniques
(Mathematical Optimization)
Non-Traditional Techniques
Non linear programming
Integer programming
Geometric programming
Quadratic programming
Evolutionary Computations Non-gradient
probabilistic
1.Simulated annealing
2.Tabu search
Genetic
algorithm
Particle swarm
optimization
Ant colony optimization
Artificial bee colony
algorithm
Evolve in
genetics
Evolve in
social
behavior
Memetic
algorithm
Linear programming
Method of feasible
direction
9. 3/17/2024 9
Need of meta-heuristics
•Traditional techniques do not fare well over a broad spectrum of problem
domains.
•Traditional techniques are not suitable for solving multi-modal problems
as they tend to obtain a local optimal solution.
•Traditional techniques are not ideal for solving multi-objective
optimization problems and problems involving large number of
constraints.
11. Optimization of USM process
)
/
(
1
963
.
4 3
25
.
0
75
.
0
75
.
0
75
.
0
75
.
0
25
.
0
1 s
mm
f
d
C
A
F
K
A
Z v
m
av
v
s
fw
usm
t
Objective function:
Maximize MRR:
0
.
0
)
(
)
1
(
7
.
1154
0
.
1
5
.
0
m
ax
5
.
0
av
m
v
s
a
fw
t
C
d
A
F
R
A
11
At = 20 mm2, σfw =6900 MPa, Kusm = 0.1mm-1, (Ra)max = 0.8 m, = 0.246.
Constraint:
3/17/2024
12. Variables and their bounds:
•Amplitude of vibration: 0.005 Av 0.1 (mm)
•Frequency of vibration: 10000 fv 40000 (Hz)
•Mean diameter of abrasive grain : 0.007 dm 0.15 (mm)
• Volumetric concentration of abrasive particles in slurry: 0.05 Cav 0.5
static feed force: 4.5 Fs 45 (N)
3/17/2024 12
13. 3/17/2024 13
Genetic Algorithm
Genetic algorithm is the first evolutionary optimization technique introduced by Holand
J. (1975), which is based on Darwinian principle of the ‘survival of fittest’ and the natural
process of evolution through reproduction.
• How Genetic Algorithm differs from traditional optimization techniques?
1. GA work with a coding of the parameter set, not the parameters themselves.
2. GA search from a population of points and not a single point.
3. GA use information of fitness function and not derivatives or other auxiliary
knowledge
14. 3/17/2024 14
4. GA use probabilistic transitions rules and not deterministic rules.
5. It is very likely that the expected GA solution will be global solution.
Genetic Algorithm
20. Fuzzy Control : Limitations of traditional control modes
• While applying traditional control, one needs to know about the model and the objective
function formulated in precise terms. This makes it very difficult to apply in many cases.
This makes the P, PI, PID controller costlier.
• The drawbacks associated every control action puts limitations on their capability to
cover a huge range of operating conditions.
• Customization is relatively difficult
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
20
21. R
P
Q
2
x
Q
P =h
R
h
x
2
dt
dh
A
R
h
x .
1
dt
dh
AR
h
Rx
1
A h
x1
x2
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
Transfer function of a process (P(s))
21
22. dt
dh
AR
h
Rx
1
1
. Rx
h
R
A dt
dh
)
(
)
(
)
(
. 1 s
Rx
s
h
s
Rsh
A
)
(
)
(
)
1
.
( 1 s
Rx
s
h
Rs
A
)
1
.
(
)
(
)
(
1
Rs
A
R
s
x
s
h
A h
x1
x2
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
22
23. What is Fuzzy Logic?
Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning.
The approach of fuzzy logic imitates the way of decision making in humans that involves
all intermediate possibilities between digital values YES and NO.
The conventional logic block that a computer can understand takes precise input and
produces a definite output as TRUE or FALSE, which is equivalent to human’s YES or
NO.
The inventor of fuzzy logic, Zadeh (1965), observed that unlike computers, the human
decision making includes a range of possibilities between YES and NO, such as
CERTAINLY YES, POSSIBLY YES, CANNOT SAY, POSSIBLY NO, CERTAILY NO
etc.
Fuzzy logic is thus a tool which converts imprecise information (usually a human
character) to a precise information or crisp value (usually a machine characteristic).
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
23
24. Components of Fuzzy Logic:
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
24
25. What is membership?
A fuzzy set is distinct from a crisp set in that it allows its elements to have a degree of
membership.
The core of a fuzzy set is its membership function: a surface or line that defines the
relationship between a value in the set’s domain and its degree of membership.
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
25
26. Types of membership functions:
a) Triangular membership function:
c
x
c
x
b
b
c
x
c
b
x
a
a
b
a
x
a
x
c
b
a
X
,
0
),
/(
)
(
),
/(
)
(
,
0
)
,
,
,
(
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
26
29. X1
X2
A
h
Continuous process control using Fuzzy Logic
Flow rate X1 is to be controlled to maintain constant
fluid level h
X1 depend on (i) Deviation of fluid level (DFL) from
maximum fluid level L and (ii) Difference in flow rates
(X) = X1 - X2
Membership function for DFL [Low, Moderate, High]
Membership function for X [Negative, Average,
Positive]
Membership function for response X1 :
[Open more, Open Less, Average, Close less, Close
More].
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
29
30. Low (10) Moderate (50) High (80)
10 30 40 60 70 80
The triangular membership function () for DFL
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
30
31. -6 -4 -2 2 4 6
Highly Negative
(-6 lpm) Low (0 lpm) Highly
Positive(6 lpm)
The triangular membership function () for X
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
31
33. If DFL is LOW and X is HIGHLY NEGATIVE then CLOSE VERY LITTLE
If DFL is LOW and X is LOW then CLOSE LITTLE
If DFL is LOW and X is HIGHLY POSITIVE then CLOSE LARGE
If DFL is MODERATE and X is HIGHLY NEGATIVE then OPEN LITTLE
If DFL is MODERATE and X is LOW then CLOSE VERY LITTLE
If DFL is MODERATE and X is HIGHLY POSITIVE then CLOSE LARGE
If DFL is HIGH and X is HIGHLY NEGATIVE then OPEN LARGE
If DFL is HIGH and X is LOW then OPEN LITTLE
If DFL is HIGH and X is HIGHLY POSITIVE then CLOSE VERY LITTLE
Fuzzy Rules
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
33
34. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
34
Now at any given point of time, deviation in fluid level (DFL) is 64 and difference in flow rate
( X) is -3.6, what will be the controller output?
35. The fuzzy set operations
Union:
AUB = Max (A, B)
The Union operation in Fuzzy set theory is the equivalent of the OR operation in
Boolean algebra.
Intersection:
AB = Min (A, B)
The Intersection operation in Fuzzy set theory is the equivalent of
the AND operation in Boolean algebra.
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
35
36. Complement:
A
A
1
The Complement operation in Fuzzy set theory is the equivalent of
the NOT operation in Boolean algebra.
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
36
39. Center of Sums Method:
De-fuzzification methods
Center of gravity Method:
Center of Area / Bisector of Area Method:
Weighted Average Method:
Maxima Method:
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
39
40. OPEN LARGE: Hatch Area = 0.672
OPEN LITTLE: Hatch Area = 1.312
CLOSE VERY LITTLE: Hatch Area = 0.703
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
40
41. The crisp score of X1:
𝑋1 𝑣𝑎𝑙𝑢𝑒 =
0.703 × 0.5 + 1.312 × 4 + 0.672 × 10
0.703 + 1.312 + 0672
= 4.58
Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
41
42. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
42
Bayesian Network
Subject Well
Studied
Question paper
is Easy
Success in Exam
Placement Higher studies
T 0.6
F 0.4
T 0.4
F 0.6
SWS QPE P(SE=T) P(SE=F)
T T 0.94 0.06
T F 0.90 0.10
F T 0.60 0.40
F F 0.20 0.80
SE P(P=T) P(P=F)
T 0.75 0.25
F 0.02 0.98
SE P(HS=T) P(HS=F)
T 0.91 0.09
F 0.05 0.95
43. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
43
Calculate the probability that the student get both placement as well as admission to higher studies, get
success in exam, but subject was not studied well and question paper was not easy..
P(P, HS, SE, ¬SWS, ¬QPE) = P (P|SE) *P (HS|SE)*P (SE|¬SWS ^ ¬QPE) *P (¬SWS) *P (¬QPE)
= 0.75 × 0.91 × 0.20 × 0.4 × 0.6
= 0.032
44. 44
Pollution
(POL)
Smoking (SM)
Lung Cancer (LC)
Constipation (C)
Short breathing
(SB)
T 0.3
F 0.7
T 0.6
F 0.4
POL SM P(LC=T) P(LC=F)
T T 0.85 0.15
T F 0.71 0.29
F T 0.75 0.25
F F 0.10 0.90
LC P(C=T) P(C=F)
T 0.55 0.45
F 0.32 0.68
LC P(SB=T) P(SB=F)
T 0.63 0.37
F 0.25 0.75
46. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
46
A hidden Markov model consists of five important components:
• Initial probability distribution:
• One or more hidden states
• Transition probability distribution:
• A sequence of observations
• Emission probabilities:
48. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
48
Parameters Supervised machine learning Unsupervised machine learning
Input Data Algorithms are trained using labelled data. Algorithms are used against data that is not labeled
Computational Complexity Simpler method Computationally complex
Accuracy Highly accurate Less accurate
No. of classes No. of classes is known No. of classes is not known
Data Analysis Uses offline analysis Uses real-time analysis of data
Algorithms used
Linear and Logistics regression, Random forest,
Support Vector Machine, Neural Network, etc.
K-Means clustering, Hierarchical clustering,
A priori algorithm, etc.
Output Desired output is given. Desired output is not given.
Training data Use training data to infer model. No training data is used.
Complex model
It is not possible to learn larger and more complex
models than with supervised learning.
It is possible to learn larger and more complex
models with unsupervised learning.
Model We can test our model. We can not test our model.
Called as Supervised learning is also called classification. Unsupervised learning is also called clustering.
Example Example: Optical character recognition. Example: Find a face in an image.
50. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
50
Supervised Learning: Classification
51. •An artificial neural network is a computational model based on the how brain solves
certain kinds of problems.
• The human brain can be described as a biological neural network—an interconnected web
of neurons transmitting elaborate patterns of electrical signals. Dendrites receive input
signals and, based on those inputs, fire an output signal via an axon.
•The most common application of neural networks in computing today is to perform one of
these “easy-for-a-human, difficult-for-a-machine” tasks, often referred to as pattern
recognition.
Neural network: Definition
52.
53. One of the key elements of a neural network is its ability to learn. A neural network is
not just a complex system, but a complex adaptive system, meaning it can change its
internal structure based on the information flowing through it. Typically, this is achieved
through the adjusting of weights. In ANN diagram, each line represents a connection
between two neurons and indicates the pathway for the flow of information. Each
connection has a weight, a number that controls the signal between the two neurons. If
the network generates a “good” output, there is no need to adjust the weights. However,
if the network generates a “poor” output—an error, then the system adapts, altering the
weights in order to improve subsequent results.
56. The Backwards Pass
Output Layer
Consider w5. We want to know how much a change in w5 affects
the total error.
2
1
1
1
5
1
5
)
arg
(
2
1
output
et
t
E
out
E
net
out
w
net
w
E
Total
o
Total
o
o
o
Total
57. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
57
Supervised Learning: Neural Network
58. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
58
Un-Supervised Learning: Clustering
Classification
Yellow / Blue
Clustering
59. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
59
Un-Supervised Learning: Principal Component Analysis
60. Artificial Intelligence for Robotics: Dr. P. J. Pawar, KKWIEER,
Nashik
60
[30-70] [2-9] [10-35]
x1 x2 x3
1 36 8 26
2 67 9 32
3 34 3 35
4 69 4 23
5 34 2 27
6 49 8 25
7 53 6 11
8 66 9 18
9 62 5 23
10 54 3 20
Quanity of alloying element (gm)
Type
of
alloy
steel
Unsupervised Learning: Clustering