Fuzzy Logic & Machine Learning - PPT
Fuzzy Logic & Machine Learning - PPT
tizhoosh.uwaterloo.ca :: tizhoosh@uwaterloo.ca
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Overview
u Fuzzy Logic
u Machine Learning
u Fuzzy Logic and Machine Learning
u A Critical Review
Fuzzy Logic
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Source: https://en.wikipedia.org/wiki/Three-valued_logic
Bertrand Russell
Vagueness
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Vagueness
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Max Black
Vagueness: An exercise in logical analysis, 1937
Vagueness
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Yesterday Today
Will tomorrow rain? It is raining!
But what is the rain intensity?
Drizzle, light, moderate, heavy, extreme?
Event occurs
William Faulkner
A Rose for Emily
Set Theory
Logic
Measure Theory
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
#1 if x∈A
Characteristic function f A (x ) = "
!0 if x∉A
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
A = {(x , µ A (x )) x ∈ X }
A = ∫ µ A (x )/ x
X
Aclassic = {3, 4, 5}
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
threshold thresholds
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Intersection
µ A∩ B ( x) = min (µ A ( x), µ B ( x) ) ∀x ∈ X
A∩ A ≠ ∅
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Union
µ A∪ B ( x) = max(µ A ( x), µ B ( x) ) ∀x ∈ X
A∪ A ≠ X
Source: H.R.Tizhoosh, Fuzzy Bildverarbeitung, Springer, 1998
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Complement
µ A ( x) = 1 − µ A ( x) ∀x ∈ X
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
T-Norm
Boundary T(0, 0) =0 , T(a, 1) = T(1, a) = a
Monotonicity a<=c & b<= d -> T(a, b)<=T(c, d)
Commutativity T(a, b) = T(b, a)
Associativity T(a, T(b, c)) = T(T(a, b), c)
Example:
1
" %
Yager (
w
1 − min $1, (1 − a ) + (1 − b)
$#
w
)
w
'
'&
w ∈ (0, ∞ )
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
T-CoNorm (S-Norm)
Boundary S(1, 1) =1 , S(a, 0) = S(0, a) = a
Monotonicity a<=c & b<=d -> S(a,b)<= S(c, d)
Commutativity S(a, b) = S(b, a)
Associativity S(a, S(b,c)) = S(S(a,b), c)
Example:
1
Yager ! $
(
min #1, a w + b w ) w
& w ∈ (0, ∞ )
" %
Dubois & Prade a + b − ab − min(a, b,1 − α )
α ∈ (0,1)
max(1 − a,1 − b, α )
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Hypercube Presentation
fuzzy set with one member fuzzy set with two members
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Memberships
Membership as similarity
Generating MFs
Membership as probability 1. Subjective:
Membership as intensity
intuition, expertise, knowledge
Membership as approximation 2. Automatic:
Membership as compatibility
Clustering, Neural nets, Genetic Algorithms
Membership as possibility
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Memberships
Fuzzy Sets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
z =β
∑ z ⋅ µ (z )
z =α
Z crisp = z =β
∑ µ (z )
z =α
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Controller
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Clustering
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Clustering
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
# c & N
Fuzzy
C-‐Means M fc = $U µik ∈ [0,1]; ∑µik = 1; 0 < ∑ µik < N '
% i=1 k=1 (
1.
Initialization
N
m
∑(µik ) xk
2.
Class
Centers vi = k=1
N
m
∑(µik ) 1
k=1
µik =
3.
Update
Membership
2
C!d $ m−1
4. Condition U t −U t−1 ≤ ε
Fuzzy Clustering
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
FCM
With 2 features
Fuzzy Clustering
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Linguistic Variables
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Linguistic Variables
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Zadeh
Linguistic Variables
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
(x , T(x), U , G , M )
Semantic rules
Variable name
Universe of discourse
Linguistic Variables
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Word Average
always 99
very often 88
ususally 85
often 78
relatively often 65
balanced 50
from time to time 20
(Simpson, 1944)
sometimes 20
not usually 10
seldom 10
very seldom 6
almost never 3
never 0
Linguistic Hedges
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Linguistic Hedges
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
µvery A = CON(A)
µ more A = (A)1.25
µ less A = (A)0.75
Linguistic Hedges
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Logic
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Logic
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
1+4=5
‘about 1’ + ‘approximately 4’ = ?
Fuzzy Arithmetic
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Extension Principle
Fuzzy Arithmetic
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
~
Fuzzy Set A = &% -+ x, µ ~ (x )*( x ∈ X , µ ~ (x )∈ [0,1] #"
$, A ) A !
~ '! / , $!
Fuzzy Set A = & -- (x , u ), µ ~ (x , u )** x ∈ X, u ∈ J x ⊆ [0,1] #
~ A
Type II !% . ~ + !"
Classical Set
Fuzzy Set
u Mid 1970s – late 1980s: Booming of fuzzy applications in Japan and Europe
Fuzzy Boom
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Learning
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Reasoning
Equivalent ANFIS
Fuzzy Learning
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Subspace
Fuzzy Learning
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Evolution
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Evolution
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Fuzzy Evolution
Machine Learning
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Smart Search
Source: http://earthxxii.deviantart.com/art/Etnogenez-Birth-of-Artificial-Intelligence-402715744
https://wall.alphacoders.com/by_sub_category.php?id=205999
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Source: https://www.youtube.com/watch?v=4pnQd6jnCWk
PCA
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Source: http://scikit-learn.org/
PCA
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Turing Test
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
w1
x1
w2
x2
Σ f y
wn
xn
Perceptron
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Output layer
Input layer
SOM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
winning
neuron
neighborhood
SOM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
f Σ f Σ
f Σ f Σ f Σ
f Σ f Σ
BackProp
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Decision Trees
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Decision Trees
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Decision Trees
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
SVM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
The optimal
hyperplane
Optimal hyperplane
as linear
combination of
support vectors
SVM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Labelled
training data
Linearly
separable
Or
rewritten
The optimal
hyperplane
Distance
between two
classes
SVM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Feature Space
Input Space
SVM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Main idea:
Boosting
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Boosting
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Given:
Initialize
For
Train weak learner with Dt
Get weak hypothesis and its error:
Set
Update
Boosting
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Random Forests
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Forest
Random Forests
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Idea:
Neural networks can learn difficult recognition tasks if designed
with more hidden layers
(i.e., more than 5 hidden layers)
Challenge:
Training of deep networks was until recently practically
impossible
Deep Nets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
convolution
max pooling fully connected
Deep Nets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Deep Nets
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Query
Images
Deep Nets
Fuzzy Logic &
Machine Learning
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
u A new method called PCA-TF is proposed that allows performing PCA on data sets of
trapezoidal (or triangular) fuzzy numbers, that may contain also real numbers and
intervals.
u A group of orthogonal axes is found that permits the projection of the maximum
variance of a real numbers’ matrix, where each number represents a trapezoidal fuzzy
number.
u The initial matrix of fuzzy numbers is projected to these axes by means of fuzzy
numbers arithmetic, which yields Principal Components and they are also fuzzy numbers.
u Based on these components it is possible to produce graphs of the individuals in two-
dimensional plane.
u It is also possible to evaluate the shape of the ordered pairs of fuzzy numbers and
visualize the membership function for each point on the z axis over the two-dimensional
xy plane.
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
u A support vector machine (SVM) learns the decision surface from two distinct
classes of the input points.
u A fuzzy membership is applied to each input point
u The SVMs are reformulated such that different input points can make different
contributions to the learning of decision surface.
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
u The use of Receiver Operating Characteristic (ROC) Curve and the area under
the ROC Curve (AUC) has been used as a measure of the performance of
machine learning algorithms.
u A SVM classifier fusion model using genetic fuzzy system.
u Genetic algorithms are applied to tune the optimal fuzzy membership
functions.
u The performance of SVM classifiers are evaluated by their AUCs.
u AUC-based genetic fuzzy SVM fusion model produces not only better AUC but
also better accuracy than individual SVM classifiers.
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
0.5
better
0.0
u Fuzzy support vector machines (FSVMs) and the extraction of fuzzy rules from
SVMs.
u An FSVM is identical to a special type of SVM.
u Categorization and analysis of existing approaches to obtain fuzzy rules from
SVMs.
u Questioning the sense of extracting fuzzy rules from SVs:
• Simpler methods that output prototypical points (e.g., clustering approaches) can
used.
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
RBM
parameters as fuzzy numbers
FRBM
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
A Critical Review
A Critical Review
A Critical Review
u “Fuzzification” of ML methods can be questioned:
u The intellectual challenge is typically not very high (scientific contribution
most likely not very deep)
u Increased flexibility through fuzzification could also be achieved by passing to
a more flexible non-fuzzy model class (e.g., using SVMs with Gaussian instead
of linear kernels)
u More flexibility may be a disadvantage (i.e., risk of overfitting)
u Increased computational complexity
u In some cases, the link to fuzzy sets and fuzzy logic appears to be somewhat
artificial (member-ship functions are used as a weighting function)
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Modeling:
u We need a suitable formalization of the problem
u Often overlooked in machine learning
u Fuzzy logic has much to offer in this regard
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Non-Inductive Inference:
u Transfer learning: Taking advantage of what has been learned in one domain
while learning in another domain
u Knowledge transfer: largely similarity-based or analogical
u Fuzzy inference can support that kind of formal reasoning
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
General Rule
Induction Deduction
Observation Prediction
Specific Instance
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Induction Deduction
Uncertainty:
u Uncertainty is everywhere
u Fuzzy framework can contribute to representation and handling of uncertainty
u Possibility theory for uncertainty formalisms, such as belief functions, and
imprecise probabilities, can be used for this purpose
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Possibility Theory
Possibility Theory
Ω Reference Set
A⊆Ω Event
g (∅ ) = 0, g (Ω ) = 1
Impossible event Sure event
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Possibility Theory
A ⊆ B ⇒ g (A)≤ g (B )
Possibility Theory
Consider the confidence measure concerning disjunctions:
Possibility Theory
Consider the confidence measure concerning conjunctions:
Possibility Theory
∀A, Π (A) = 1 − N (A )
Contradictory events:
Possibility Theory
Possibility
Π (A ∪ B ) = max(Π (A)+ Π (B ))
Necessity
N (A ∩ B ) = min (N (A)+ N (B ))
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Possibility Theory
∀ω , ∑ p(ω )= 1
ω∈Ω
∃ω , π (ω ) = 1
WCCI 2016 :: Tutorial by H.R.Tizhoosh, KIMIA Lab, University of Waterloo :: http://tizhoosh.uwaterloo.ca/
Possibility Theory
Possibility Theory
Total Ignorance