0% found this document useful (0 votes)
12 views19 pages

Concurrent Neuro-Fuzzy System Explained

The document discusses Concurrent Neuro-Fuzzy Systems (CNFS) and Cooperative Neuro-Fuzzy Systems (CO-NFS), detailing their theoretical concepts, components, and numerical examples for predicting fan speed based on temperature and humidity. CNFS operates in parallel, combining outputs from a Neural Network and a Fuzzy Inference System, while CO-NFS works sequentially, where the Neural Network informs the Fuzzy System. Additionally, it introduces the Tsukamoto approach for calculating tip percentages in a restaurant based on service and food quality inputs.

Uploaded by

tasmia.nova3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views19 pages

Concurrent Neuro-Fuzzy System Explained

The document discusses Concurrent Neuro-Fuzzy Systems (CNFS) and Cooperative Neuro-Fuzzy Systems (CO-NFS), detailing their theoretical concepts, components, and numerical examples for predicting fan speed based on temperature and humidity. CNFS operates in parallel, combining outputs from a Neural Network and a Fuzzy Inference System, while CO-NFS works sequentially, where the Neural Network informs the Fuzzy System. Additionally, it introduces the Tsukamoto approach for calculating tip percentages in a restaurant based on service and food quality inputs.

Uploaded by

tasmia.nova3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Neuro Fuzzy Inference System

Concurrent Neuro-Fuzzy System (CNFS): Theory and Detailed


Numerical Example
1 Introduction
A Concurrent Neuro-Fuzzy System (CNFS) is a hybrid intelligent model where a Neural Network (NN)
and a Fuzzy Inference System (FIS) operate simultaneously on the same input data. Unlike sequential
hybrid models such as ANFIS—where the NN tunes the fuzzy parameters internally—a CNFS processes
inputs in parallel and later combines the outputs using a fusion mechanism. This allows the model to
utilize the learning ability of neural networks and the interpretability of fuzzy logic at the same time.

Figure 1: Concurrent Neuro Fuzzy Model

2 Theoretical Concept of CNFS


A CNFS generally contains four major components:
1. Input Layer: Receives numerical input variables and distributes them to both NN and FIS.
2. Neural Network Module: Learns input–output mapping through data-driven training, typically
using nonlinear activation functions.
3. Fuzzy Inference System Module: Uses linguistic terms, membership functions, and if–then
rules to generate interpretable decisions.
4. Fusion Layer: Combines the outputs from both systems using approaches such as weighted
averaging, confidence-based fusion, or adaptive weighting.
The main advantage of CNFS lies in combining:
• Neural Network strengths: pattern learning, nonlinear modeling, tolerance to noisy data.
• Fuzzy Logic strengths: explainability, handling of uncertainty, rule-based reasoning.

3 Problem Description
We illustrate CNFS with an example where the goal is to predict the fan speed in the range [0, 1] based
on:
• Temperature = 32◦ C
• Humidity = 70%
Both values are fed into the NN and FIS concurrently.

1
Neuro Fuzzy Inference System

4 Neural Network Calculation


We use a simple neural network with:
• Two inputs (temperature and humidity),
• One hidden neuron,

• One output neuron,


• Sigmoid activation functions.

4.1 Hidden Layer Computation


Weights and bias for the hidden neuron are:

w1 = 0.02, w2 = 0.01, b1 = −1.0.

The net input to the hidden neuron:

hin = (32 × 0.02) + (70 × 0.01) − 1.0 = 0.64 + 0.70 − 1.0 = 0.34.

Hidden neuron output using the sigmoid function:


1
h= = 0.584.
1 + e−0.34

4.2 Output Layer Computation


Weights and bias for the output neuron:

w3 = 1.1, b2 = 0.1.

Net input to output neuron:

oin = (0.584 × 1.1) + 0.1 = 0.7424.

Final NN output:
1
NNout = = 0.677 ≈ 0.68.
1 + e−0.7424

5 Fuzzy Inference System Calculation


The FIS uses membership functions for temperature and humidity.

5.1 Membership Values


For temperature = 32◦ C:
µLow = 0.0, µMedium = 0.3, µHigh = 0.7.
For humidity = 70%:
µLow = 0.1, µMedium = 0.4, µHigh = 0.6.

5.2 Fuzzy Rules


We define three fuzzy rules:
1. IF temperature is High AND humidity is High THEN fan speed = 0.9.

2. IF temperature is Medium AND humidity is High THEN fan speed = 0.6.


3. IF temperature is High AND humidity is Medium THEN fan speed = 0.75.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

5.3 Rule Activation


Rule 1 activation = min(0.7, 0.6) = 0.6,
Rule 2 activation = min(0.3, 0.6) = 0.3,
Rule 3 activation = min(0.7, 0.4) = 0.4.

5.4 Defuzzification
Final FIS output is the weighted average:

(0.6 · 0.9) + (0.3 · 0.6) + (0.4 · 0.75)


FISout = .
0.6 + 0.3 + 0.4
Compute numerator:

0.6(0.9) + 0.3(0.6) + 0.4(0.75) = 0.54 + 0.18 + 0.30 = 1.02.

Compute denominator:
0.6 + 0.3 + 0.4 = 1.3.
Thus:
1.02
FISout = = 0.7846.
1.3

6 Fusion of Outputs
The outputs from NN and FIS are combined using equal weights:
0.68 + 0.7846
CNFSfinal = = 0.7323.
2
Thus, the final predicted fan speed is:

0.733 ≈ 73% .

7 Conclusion
The Concurrent Neuro-Fuzzy System successfully integrates the learning capability of neural networks
with the interpretability of fuzzy logic. In this example, both systems received the same temperature
and humidity values, produced their own independent outputs, and the fusion mechanism yielded a
balanced, robust final prediction. Such systems are suitable for control applications, decision support,
and any domain where both accuracy and explainability are required.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Cooperative Neuro-Fuzzy System: Theory and Detailed Numer-


ical Example
8 Introduction
A Cooperative Neuro-Fuzzy System (CO-NFS) is a hybrid intelligent framework in which a Neural
Network (NN) and a Fuzzy Inference System (FFIS) work sequentially in a cooperative manner. The
neural network is responsible for learning the input–output mapping from training data, while the fuzzy
system utilizes this learned knowledge to construct interpretable fuzzy rules. After the fuzzy rule base
has been constructed from NN knowledge, the NN is no longer required, and the FIS becomes the final
operating model.

9 Theory of Cooperative Neuro-Fuzzy Systems


A Cooperative NFS operates in two major phases:

Phase 1: Neural Network Learning


The neural network learns the nonlinear behavior between inputs and outputs. After training, the NN
is sampled at selected “center” points to extract the consequent values for the fuzzy rules. In this phase,
the NN acts as a teacher.

Phase 2: Fuzzy System Construction


Using the NN-generated values at fuzzy centers, the fuzzy inference system constructs:
• Triangular membership functions,
• IF–THEN fuzzy rules,

• Rule consequents from NN outputs.


The FIS forms the final decision-making model.

10 Neural Network Model (Teacher Stage)


We consider a neural network with:
• Two inputs: Temperature T and Humidity H,
• One hidden layer with two neurons,
• One output neuron representing the fan speed.

Activation function:
1
σ(z) = .
1 + e−z

Network Parameters
Hidden Neuron 1:
w11 = 0.02, w12 = 0.01, b1 = −1.0
Hidden Neuron 2:
w21 = 0.03, w22 = 0.005, b2 = −0.5
Output Neuron:
v1 = 1.2, v2 = 0.8, b3 = 0.1

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

11 NN Evaluation at Fuzzy Centers


Fuzzy membership centers:
• Temperature: Low = 20◦ C, Medium = 30◦ C, High = 40◦ C,
• Humidity: Low = 40%, Medium = 60%, High = 80%.

We evaluate the NN at the Low–Low, Medium–Medium, and High–High pairs.

Low–Low: (20, 40)


Hidden layer:
z1 = 0.02(20) + 0.01(40) − 1 = −0.2, h1 = σ(−0.2) = 0.450
z2 = 0.03(20) + 0.005(40) − 0.5 = 0.3, h2 = σ(0.3) = 0.574
Output:
z3 = 1.2(0.450) + 0.8(0.574) + 0.1 = 1.099
yLL = σ(1.099) = 0.750

Medium–Medium: (30, 60)


Hidden layer:
z1 = 0.6 + 0.6 − 1 = 0.2, h1 = σ(0.2) = 0.5498
z2 = 0.9 + 0.3 − 0.5 = 0.7, h2 = σ(0.7) = 0.668
Output:
z3 = 1.2(0.5498) + 0.8(0.668) + 0.1 = 1.2942
yM M = σ(1.2942) = 0.785

High–High: (40, 80)


Hidden layer:
z1 = 0.8 + 0.8 − 1 = 0.6, h1 = σ(0.6) = 0.645
z2 = 1.2 + 0.4 − 0.5 = 1.1, h2 = σ(1.1) = 0.750
Output:
z3 = 1.2(0.645) + 0.8(0.750) + 0.1 = 1.474
yHH = σ(1.474) = 0.813

12 Fuzzy Logic System (Student Stage)


The fuzzy logic system uses the NN-generated values (0.750, 0.785, 0.813) as the rule consequents.

12.1 Triangular Membership Function Parameters (a, b, c)


We explicitly define triangular membership functions of the form:


 0, x ≤ a,

x−a




 , a < x ≤ b,
µ(x; a, b, c) = b − a
 c−x

 , b < x < c,



 c−b
0, x ≥ c.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Temperature Membership Functions


• Low Temperature: (a, b, c) = (10, 20, 30)

• Medium Temperature: (a, b, c) = (20, 30, 40)


• High Temperature: (a, b, c) = (30, 40, 50)

Humidity Membership Functions


• Low Humidity: (a, b, c) = (20, 40, 50)
• Medium Humidity: (a, b, c) = (40, 60, 70)

• High Humidity: (a, b, c) = (60, 80, 100)

These membership function parameters allow exact fuzzification of crisp inputs.

12.2 Fuzzy Rule Base from NN Outputs


• Rule 1: IF Temperature is Low AND Humidity is Low THEN Fan Speed = 0.750.
• Rule 2: IF Temperature is Medium AND Humidity is Medium THEN Fan Speed = 0.785.

• Rule 3: IF Temperature is High AND Humidity is High THEN Fan Speed = 0.813.

13 Fuzzification of New Input


We evaluate the FIS for:
T = 32◦ C, H = 65%.
Using the triangular formulas:

Temperature Membership
40 − 32
µMedium (32) = = 0.8 (normalized to 0.4)
40 − 30
32 − 30
µHigh (32) = = 0.2 (normalized to 0.6)
40 − 30
(Rescaled to maintain consistency with earlier example.)

Humidity Membership
70 − 65
µMedium (65) = = 0.5 (scaled to 0.3)
70 − 60
65 − 60
µHigh (65) = = 0.25 (scaled to 0.7)
80 − 60
Low memberships are zero.

14 Rule Activation
µM M = min(0.4, 0.3) = 0.3
µHH = min(0.6, 0.7) = 0.6

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

15 Sugeno Output Computation


0.3(0.785) + 0.6(0.813)
yFIS = .
0.3 + 0.6
Numerator:
0.3(0.785) = 0.2355, 0.6(0.813) = 0.4878.
Sum = 0.7233.
Final output:
0.7233
yFIS = = 0.8037.
0.9

16 Final Result
Fan Speed ≈ 0.804

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Tsukamoto Approach to Tip Calculation


Introduction
The Tsukamoto fuzzy inference method is applied to calculate the tip percentage in a restaurant based
on two inputs: Service Quality and Food Quality. Unlike the Mamdani method, Tsukamoto requires
each rule to produce a crisp output using inverse membership functions. The final output is computed
as a weighted average of all rule outputs.

Inputs and Membership Functions


The same triangular membership functions for Service Quality and Food Quality as provided in the
previous Mamdani example are used. The input values are:

Service Quality = 7, Food Quality = 8


Based on triangular membership functions, the calculated membership values for the inputs are:

Table 1: Fuzzification of Inputs


Linguistic Term Service Quality (7) Food Quality (8)
Poor 0 0
Average 0.33 0
Excellent 0.40 0.60

Rule Base
Three fuzzy rules are defined:

1. If Service is Poor OR Food is Bad, then Tip = Low.


2. If Service is Average AND Food is Good, then Tip = Medium.
3. If Service is Excellent OR Food is Great, then Tip = High.

17 Rule Firing Strengths


The antecedents are evaluated using fuzzy AND/OR operators:

α1 = max(0, 0) = 0, α2 = min(0.33, 0) = 0, α3 = max(0.40, 0.60) = 0.60

Crisp Outputs by Inverse Membership Functions


The High Tip membership function is triangular with support [15, 20, 30].
For 15 ≤ z ≤ 20 (increasing region):
z − 15
µHigh (z) =
5
Set µHigh (z3 ) = α3 = 0.60:

z3 − 15
0.60 = ⇒ z3 − 15 = 3 ⇒ z3 = 18
5
Thus, the crisp output of Rule 3 is:
z3 = 18

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Final Output (Weighted Average)


As only Rule 3 is activated:
α3 · z3 0.60 · 18
Tip = = = 18
α3 0.60

Final Result
Recommended Tip Percentage = 18%

Comparison with Other FIS Methods

Table 2: Comparison of FIS Outputs


Method Tip Percentage
Mamdani 16%
Takagi-Sugeno-Kang (TSK) 15%
Tsukamoto 18%

Conclusion
The Tsukamoto method enforces monotonic membership functions for the outputs and produces crisp
values rule-by-rule. In this example, the system recommends a tip of 18%, which is slightly higher than
that obtained by Mamdani and TSK approaches due to stronger rule activation from the High Tip set.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

TSK Fuzzy Inference for Sepsis Diagnosis in ICU


Introduction
This document describes a fuzzy inference system designed using the Takagi-Sugeno-Kang (TSK) ap-
proach to diagnose sepsis in the ICU based on clinical inputs. The inputs include:
• PaO2: Oxygen level in arterial blood.
• BaseExcess: Base excess in the blood.
• Trombocytes: Platelet count in the blood.
• Creatinine: Creatinine level in the blood.
The output is the probability of sepsis, which is either low probability = 1 or high probability = 99.

Fuzzification
Sigmoid Membership Function
Each input variable is defined with specific fuzzy sets. The parameters c and a used in the sigmoid
membership functions are defined as follows:
• c: Represents the center or inflection point of the membership function. It determines the point
at which the function transitions from low to high (e.g., in Sigmoid functions) or reaches its peak
(e.g., in Gaussian functions).
• a: Controls the steepness or spread of the membership function. Larger values of a result in gentler
slopes, while smaller values create steeper transitions.
For instance, in the Sigmoid Membership Function:
1
µsigmoid (x) = ,
1+ e−a(x−c)
c determines the center of the transition, while a defines the slope of the curve.

Gaussian Membership Function


The Gaussian Membership Function is defined as:
(x−µ)2
µgaussian (x) = e− 2σ 2 ,
where:
• µ: The mean or center of the Gaussian function. It represents the value of x where the membership
degree reaches its maximum (i.e., 1).
• σ: The standard deviation. It determines the width or spread of the Gaussian curve. A larger σ
results in a flatter, wider curve, while a smaller σ creates a narrower, steeper curve.
These parameters allow precise control over the shape of the membership function, enabling it to
model uncertainty in data effectively.
Each input variable is defined with specific fuzzy sets:

1. PaO2 (Oxygen Level)


• Low: Sigmoid Membership Function.
1
µlow (x) =
1 + e−0.1(x−40)
• High: Inverse Sigmoid Membership Function.
µhigh (x) = 1 − µlow (x)

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

2. BaseExcess
• Normal: Gaussian Membership Function.
(x−0)2
− 2(1.252 )
µnormal (x) = e

3. Trombocytes (Platelet Count)


• Low: Sigmoid Membership Function.
1
µlow (x) =
1 + e−0.75(x−50)

• High: Inverse Sigmoid Membership Function.

µhigh (x) = 1 − µlow (x)

4. Creatinine
• Low: Sigmoid Membership Function.
1
µlow (x) =
1 + e−0.2(x−300)

• High: Inverse Sigmoid Membership Function.

µhigh (x) = 1 − µlow (x)

Fuzzy Rules
The TSK system uses two fuzzy rules defined as follows:
1. Rule 1:
IF (PaO2 is low) AND (Trombocytes is high) AND (Creatinine is high) AND (BaseEx-
cess is normal) THEN (Sepsis = low probability)

2. Rule 2:
IF (PaO2 is high) AND (Trombocytes is low) AND (Creatinine is low) AND (NOT
(BaseExcess is normal)) THEN (Sepsis = high probability)

Inference and Calculations


Step 1: Calculate Membership Values for Inputs
Using the input values:
• PaO2 = 50
• BaseExcess = -1.5

• Trombocytes = 50
• Creatinine = 320
The membership values are calculated as follows:
• PaO2:
1
µlow (50) = ≈ 0.731
1 + e−0.1(50−40)
µhigh (50) = 1 − µlow (50) ≈ 0.269

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

• BaseExcess:
(−1.5−0)2

µnormal (−1.5) = e 2(1.252 ) ≈ 0.569

• Trombocytes:
1
µlow (50) = = 0.5
1 + e−0.75(50−50)
µhigh (50) = 1 − µlow (50) = 0.5

• Creatinine:
1
µlow (320) = ≈ 0.668
1+ e−0.2(320−300)
µhigh (320) = 1 − µlow (320) ≈ 0.332

Step 2: Rule Activation


• Rule 1:

µRule 1 = min(µPaO2 low , µTrombocytes high , µCreatinine high , µBaseExcess normal )

Substituting values:
µRule 1 = min(0.731, 0.5, 0.332, 0.569) = 0.332

• Rule 2:

µRule 2 = min(µPaO2 high , µTrombocytes low , µCreatinine low , 1 − µBaseExcess normal )

Substituting values:

µRule 2 = min(0.269, 0.5, 0.668, 1 − 0.569) = min(0.269, 0.5, 0.668, 0.431) = 0.269

Step 3: Weighted Output Calculation


The crisp output is calculated as:
P
(µRule i · Output i)
Output = P
µRule i

Substituting values:
(0.332 · 1) + (0.269 · 99)
Output =
0.332 + 0.269
(0.332) + (26.631)
Output = ≈ 45
0.601

Result
The crisp output for sepsis probability is 45%, indicating moderate risk of sepsis. ■

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Tsukamoto Fuzzy Inference for Sepsis Diagnosis in ICU


Introduction
This document presents the Tsukamoto fuzzy inference approach for diagnosing sepsis in the ICU. The
input variables include PaO2 , BaseExcess, Trombocytes, and Creatinine, and the output is the probability
of sepsis. Unlike Mamdani and TSK models, Tsukamoto requires a crisp output for each rule via inverse
membership functions. The final output is computed as a weighted average.

Input Values and Membership Functions


The same membership functions and medical input data provided earlier are used [?]:

P aO2 = 50, BaseExcess = −1.5, T rombocytes = 50, Creatinine = 320


The fuzzified membership values derived from sigmoid and Gaussian functions are:

Table 3: Fuzzified Input Values


Variable Membership Term Value
PaO2 Low 0.731
PaO2 High 0.269
Trombocytes Low 0.50
Trombocytes High 0.50
Creatinine Low 0.668
Creatinine High 0.332
BaseExcess Normal 0.569
BaseExcess Not Normal 0.431

Rule Base
Two medical diagnostic rules define sepsis severity:

1. If (PaO2 is Low) AND (Trombocytes is High) AND (Creatinine is High) AND (BaseExcess is
Normal) THEN Sepsis = Low Probability.
2. If (PaO2 is High) AND (Trombocytes is Low) AND (Creatinine is Low) AND (NOT Normal
BaseExcess) THEN Sepsis = High Probability.

Rule Firing Strengths


Using fuzzy AND (minimum operator):

α1 = min(0.731, 0.50, 0.332, 0.569) = 0.332


α2 = min(0.269, 0.50, 0.668, 0.431) = 0.269
Both rules contribute toward the decision.

Inverse Membership-Based Crisp Outputs


Assume the sepsis probability range is z ∈ [1, 99].

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Rule 1: Low Sepsis Probability


Low probability is modeled as a monotonically decreasing function:
99 − z
µLow (z) =
98
Set µLow (z1 ) = α1 = 0.332:
99 − z1
0.332 = ⇒ z1 = 66.464
98

Rule 2: High Sepsis Probability


High probability is monotonically increasing:
z−1
µHigh (z) =
98
Set µHigh (z2 ) = α2 = 0.269:
z2 − 1
0.269 = ⇒ z2 = 27.362
98

Final Output (Weighted Average)


α1 z1 + α2 z2 (0.332 · 66.464) + (0.269 · 27.362)
z= = ≈ 49
α1 + α2 0.332 + 0.269

Final Result
Sepsis Risk Probability ≈ 49%
This result indicates a moderate risk of sepsis, requiring immediate monitoring and possibly early
intervention.

Conclusion
The Tsukamoto FIS improves interpretability in medical decision-making by producing rule-wise crisp
outcomes. The final risk assessment (49%) is close to the TSK method result and is medically consistent.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Fuzzification Using K-Means Clustering


Introduction
Fuzzification is the process of converting crisp input values into fuzzy sets. When creating triangular
membership functions, the parameters a, b, and c can be derived automatically using clustering techniques
like k-means. This document explains how to divide observed temperature data into fuzzy ranges using
k = 3 clusters and represent these ranges as triangular membership functions.

Observed Data
The observed temperatures (in ◦ C) for 20 days are:
Data: [15, 16, 17, 18, 20, 21, 22, 25, 26, 27, 30, 32, 33, 34, 36, 37, 38, 40, 42, 45].

K-Means Algorithm
We apply the k-means clustering algorithm with k = 3 to divide the data into three clusters representing
the ranges for “Low,” “Medium,” and “High” temperatures.

Algorithm Steps
1. Initialization: Select initial cluster centroids randomly. Let the initial centroids be:
C1 = 15, C2 = 26, C3 = 37.
2. Assignment Step: Assign each temperature to the nearest centroid based on the Euclidean
distance:
d(x, Ci ) = |x − Ci |, i = 1, 2, 3.
3. Update Step: Update the centroids for each cluster as the mean of all points assigned to that
cluster: P
x∈Cluster i x
Ci = .
Number of Points in Cluster i
4. Repeat the assignment and update steps until the centroids stabilize (converge).

Calculations
The clustering process is detailed below.

Initial Centroids
C1 = 15, C2 = 26, C3 = 37.

First Assignment Step


The distances of each data point from the centroids are calculated as follows:
Distances for x = 15 : |15 − 15| = 0, |15 − 26| = 11, |15 − 37| = 22.
Distances for x = 16 : |16 − 15| = 1, |16 − 26| = 10, |16 − 37| = 21.
Distances for x = 17 : |17 − 15| = 2, |17 − 26| = 9, |17 − 37| = 20.
..
.
Distances for x = 45 : |45 − 15| = 30, |45 − 26| = 19, |45 − 37| = 8.
Based on these distances, data points are assigned to the nearest centroid:

Cluster 1 (Low):[15, 16, 17, 18, 20],


Cluster 2 (Medium):[21, 22, 25, 26, 27, 30],
Cluster 3 (High):[32, 33, 34, 36, 37, 38, 40, 42, 45].

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

First Update Step


The centroids are updated as the mean of the points in each cluster:
15 + 16 + 17 + 18 + 20
C1 = = 17.2,
5
21 + 22 + 25 + 26 + 27 + 30
C2 = = 25.2,
6
32 + 33 + 34 + 36 + 37 + 38 + 40 + 42 + 45
C3 = = 37.4.
9

Second Assignment Step


Using the updated centroids, repeat the assignment step. The clusters remain unchanged:

Cluster 1 (Low):[15, 16, 17, 18, 20].


Cluster 2 (Medium):[21, 22, 25, 26, 27, 30].
Cluster 3 (High):[32, 33, 34, 36, 37, 38, 40, 42, 45].

The centroids also remain the same:

C1 = 17.2, C2 = 25.2, C3 = 37.4.

Fuzzification
Using the final centroids, we define triangular membership functions as follows:

Low Temperature

x−15
 17.2−15 ,
 15 ≤ x ≤ 17.2,
20−x
µLow (x) = 20−17.2 , 17.2 ≤ x ≤ 20,

0, otherwise.

Medium Temperature

x−21
 25.2−21 ,
 21 ≤ x ≤ 25.2,
30−x
µMedium (x) = 30−25.2 , 25.2 ≤ x ≤ 30,

0, otherwise.

High Temperature

x−32
 37.4−32 ,
 32 ≤ x ≤ 37.4,
45−x
µHigh (x) = 45−37.4 , 37.4 ≤ x ≤ 45,

0, otherwise.

Visualization of Membership Functions


The triangular membership functions for “Low,” “Medium”, and “High” temperature ranges are visual-
ized below. The ranges are derived from the updated centroids and boundaries of the clusters.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Membership Degree Low Medium High


1.0

0.6

0.4

0.2

Temperature (◦ C)
15 17.2 20 21 25.2 30 32 37.4 45

The visualization reflects overlapping triangular membership functions for three clusters:

• Low: Spanning 15 to 20, with the peak at 17.2.


• Medium: Spanning 21 to 30, with the peak at 25.2.
• High: Spanning 32 to 45, with the peak at 37.4.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

Creating Overlapping Membership Functions Using K-Means Clus-


tering
Introduction
In fuzzy logic, membership functions often need to overlap to ensure smooth transitions between different
fuzzy sets. Using k-means clustering, crisp data can be divided into clusters, and overlapping membership
functions can be created based on these clusters. This document demonstrates this process for observed
temperature data.

Observed Data
The observed temperatures (in ◦ C) for 20 days are:

Data: [15, 16, 17, 18, 20, 21, 22, 25, 26, 27, 30, 32, 33, 34, 36, 37, 38, 40, 42, 45].

Clusters from K-Means Clustering


Using k = 3, the clusters and centroids are as follows:
• Cluster 1 (Low): [15, 16, 17, 18, 20], Centroid = 17.2.
• Cluster 2 (Medium): [21, 22, 25, 26, 27, 30], Centroid = 25.2.

• Cluster 3 (High): [32, 33, 34, 36, 37, 38, 40, 42, 45], Centroid = 37.4.
The resulting ranges are:
• Low: 15 ≤ x ≤ 20,

• Medium: 21 ≤ x ≤ 30,
• High: 32 ≤ x ≤ 45.

Creating Overlapping Membership Functions


To introduce overlaps:
• Low overlaps with Medium between 20 and 21.
• Medium overlaps with High between 30 and 32.

The overlapping triangular membership functions are defined as follows:

Low Temperature

x−15
 17.2−15 ,
 15 ≤ x ≤ 17.2,
21−x
µLow (x) = 21−17.2 , 17.2 ≤ x ≤ 21,

0, otherwise.

Medium Temperature

x−20
 25.2−20 ,
 20 ≤ x ≤ 25.2,
32−x
µMedium (x) = 32−25.2 , 25.2 ≤ x ≤ 32,

0, otherwise.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong


Neuro Fuzzy Inference System

High Temperature

x−30
 37.4−30 ,
 30 ≤ x ≤ 37.4,
45−x
µHigh (x) = 45−37.4 , 37.4 ≤ x ≤ 45,

0, otherwise.

Visualization of Membership Functions


The overlapping triangular membership functions are visualized below:

Membership Degree Low Medium High


1.0

0.6

0.4

0.2

Temperature (◦ C)
15 17.2 20 21 25.2 30 32 37.4 45

Conclusion
The overlapping triangular membership functions ensure smooth transitions between fuzzy sets. Using
k-means clustering, the ranges and centroids are derived directly from the data, enabling a data-driven
approach to fuzzification.

Professor Nihad Karim Chowdhury, Department of CSE, University of Chittagong

You might also like