You are on page 1of 9

A Decision Support System Using ANFIS

Mamun Al Imran (ID: 17701072), University of Chittagong March 9, 2023

Introduction
Neuro-Fuzzy systems are showing significant promise to many researchers in computer science.
ANFIS is one of the first inference systems where neural network and fuzzy inference technology
have been fused together.
In this report, we discussed a decision support system implemented using ANFIS.

What is ANFIS?
ANFIS stands for Adaptive Neuro-Fuzzy Inference System or Adaptive Network-based Fuzzy
Inference System. It was introduced in a paper in 1993.
It uses a Takagi-Sugeno approach for inferencing results. Generally, There are 5 layers in ANFIS.
But, when the input layer is considered, it becomes a 6-layered model. In this case, the second
layer is called the fuzzification layer. Layer 3 is referred to as the rule antecedent layer where the
rule firing strengths are computed. Rule strengths are normalized in layer 4. Layer 5 is the rule
consequent layer where each normalized firing strength for a corresponding rule is multiplied
by the calculated function value for that particular rule. Layer 6 computes the final result by
summing all the outputs of the previous layer. That is why this layer is called the rule inference
layer. Figure 1 shows the architecture of ANFIS.

The Problem
We were to design a decision support system that uses ANFIS to diagnose Sepsis in the ICU.
The system should have four fuzzy variables: PaO2, Base_Access, Thrombocytes, and Creati-
nine. Using the given membership function ranges and terms, we were to implement the fuzzy
inference process by drawing the membership functions and measuring output.

System Architecture
Figure 2 shows the architecture of our decision support system.

CSE M272: Advanced Neuro-Fuzzy Systems Page 1 / 9


Figure 1: The ANFIS Architecture

Layer 1
Layer 1 is the input layer. As inputs for the system we used the following values given in the
assignment.

P aO2 =3
Base_Access = 12
T hrombocytes = 22
Creatinine = 27

Layer 2
In Layer 2 fuzzification is performed.

CSE M272: Advanced Neuro-Fuzzy Systems Page 2 / 9


Figure 2: The Architecture of Our Decision Support System for Sepsis Diagnosis in ICU

Triangular Membership Function


A triangular membership function can be computed using the following formula,
z−a c−z
µT LV (z; a, b, c) = max(min( , ), 0)
b−a c−b
where T LV is any triangular linguistic value, a, b and c are premise parameters for it and z is a
crisp value.

Figure 3: A Triangular Membership Function

CSE M272: Advanced Neuro-Fuzzy Systems Page 3 / 9


Fuzzification of PaO2
1

0.8

Membership Value
0.6

0.4

0.2 low
high
0
0 5 10
PaO2 Level

In the assignment, we are given, alow = 0, blow = 0, clow = 5, ahigh = 0, bhigh = 5, chigh = 10
and P aO2 = 3
Therefore,

3−0 5−3 2
µlow (3) = max(min( , ), 0) = max(min(∞, ), 0)
0−0 5−0 5
= max(.4, 0) = .4
3 − 0 10 − 3 3 7
µhigh (3) = max(min( , ), 0) = max(min( , ), 0)
5 − 0 10 − 5 5 5
= max(.6, 0) = .6

Fuzzification of Base_Access
1

0.8
Membership Value

0.6

0.4

0.2 normal
abnormal
0
5 10 15 20
Base_Access Value

In the assignment, we are given, anormal = 5, bnormal = 10, cnormal = 15, aabnormal = 10,
babnormal = 10, cabnormal = 20 and Base_Access = 12

CSE M272: Advanced Neuro-Fuzzy Systems Page 4 / 9


Therefore,
12 − 5 15 − 12 7 3
µnormal (12) = max(min( , ), 0) = max(min( , ), 0)
10 − 5 15 − 10 5 5
= max(.6, 0) = .6
12 − 10 20 − 12 8
µabnormal (12) = max(min( , ), 0) = max(min(∞, ), 0)
10 − 10 20 − 10 10
= max(.8, 0) = .8

Fuzzification of Thrombocytes
1

0.8
Membership Value

0.6

0.4

0.2 low
high
0
10 15 20 25 30
Thrombocytes Level

In the assignment, we are given, alow = 10, blow = 15, clow = 25, ahigh = 15, bhigh = 20, chigh
= 30 and T hrombocytes = 22
Therefore,
22 − 10 25 − 22 12 3
µlow (22) = max(min( , ), 0) = max(min( , ), 0)
15 − 10 25 − 15 5 10
= max(.3, 0) = .3
22 − 15 30 − 22 7 8
µhigh (22) = max(min( , ), 0) = max(min( , ), 0)
20 − 15 30 − 20 5 10
= max(.8, 0) = .8

CSE M272: Advanced Neuro-Fuzzy Systems Page 5 / 9


Fuzzification of Creatinine
1

0.8

Membership Value
0.6

0.4
low
0.2 medium
high
0
20 25 30 35 40
Creatinine Level

In the assignment, we are given, alow = 20, blow = 25, clow = 30


amedium = 25, bmedium = 30, cmedium = 35
ahigh = 30, bhigh = 35, chigh = 40 and
Creatinine = 27
Therefore,

27 − 20 30 − 27 7 3
µlow (27) = max(min( , ), 0) = max(min( , ), 0)
25 − 20 30 − 25 5 5
= max(.6, 0) = .6
27 − 25 35 − 27 2 8
µmedium (27) = max(min( , ), 0) = max(min( , ), 0)
30 − 25 35 − 30 5 5
= max(.4, 0) = .4
27 − 30 40 − 27 −3 13
µhigh (27) = max(min( , ), 0) = max(min( , ), 0)
35 − 30 40 − 35 5 5
= max(−.6, 0) = 0

Layer 3
The firing strengths or weights can be computed using the following formula,

wi = µLVx (x) × µLVy (y), i = 1, 2, ...

where LVx and LVy are linguistic values of x and y respectively.


The first rule given in the assignment is,

If PaO2 is low and Base_Access is normal and Thrombocytes is low and Creatinine is
high then Sepsis is high

CSE M272: Advanced Neuro-Fuzzy Systems Page 6 / 9


The second rule given in the assignment is,

If PaO2 is low and Base_Access is normal and Thrombocytes is high and Creatinine is
low then Sepsis is low

For rule 1,

w1 =µlow (P aO2) × µnormal (Base_Access) × µlow (T hrombocytes)


× µhigh (Creatinine) = 0.4 × 0.6 × 0.3 × 0 = 0

Similarly, for rule 2,

w2 =µlow (P aO2) × µnormal (Base_Access) × µhigh (T hrombocytes)


× µlow (Creatinine) = 0.4 × 0.6 × 0.8 × 0.6 = 0.1152

Layer 4
The normalized weights can be calculated using the formula,
wi
wi = , i = 1, 2, ...
w1 + w2 + ...
In our system,
0
w1 = =0
0 + 0.1152
Similarly,
0.1152
w2 = = 0.1152
0 + 0.1152

Layer 5
We use the following formula in this layer

wi fi = wi × (pi x + qi y + ri )

where, pi , qi and ri are consequent parameters for rule i = 1, 2, ...


In the formula above there are only 2 input variables. For this reason, only 2 coefficients have
been used. But we can have more than 2 inputs in real-world scenarios. Actually, we have to
use an equal number of coefficients as the number of inputs. Therefore, we have used 4
coefficients for our 4 inputs.
Let,
p1 = 0.05, q1 = 0.01, r1 = 0.1, s1 = 0.09, t1 = 0.06
p2 = 0.02, q2 = 0.04, r2 = 0.3, s2 = 0.1 and t2 = 0.04
For rule 1,

CSE M272: Advanced Neuro-Fuzzy Systems Page 7 / 9


f1 = p1 P aO2 + q1 Base_Access + r1 T hrombocytes + s1 Creatinine + t1 =
0.05 × 3 + 0.01 × 12 + 0.1 × 22 + 0.09 × 27 + 0.06 = 4.96
Similarly,
for rule 2,
f2 = p2 P aO2 + q2 Base_Access + r2 T hrombocytes + s2 Creatinine + t2 =
0.02 × 3 + 0.4 × 12 + 0.3 × 22 + 0.1 × 27 + 0.04 = 14.2
Now,
for rule 1,
w1 f1 = 0 × 4.96 = 0 and
for rule 2,
w2 f2 = 0.1152 × 14.2 = 1.63584

Layer 6
The formula for calculating the output is as follows,
P
w i fi
wi fi = Pi
X
O=
i i wi

Therefore,

O = w 1 f1 + w 2 f2
= 0 + 1.63584 = 1.63584

Conclusion
ANFIS is a brilliant scientific discovery. We hope that this assignment will benefit us in getting
a good grasp on neuro-fuzzy systems.

CSE M272: Advanced Neuro-Fuzzy Systems Page 8 / 9


Figure 4: Propagation of Data through the Different Layers of Our Decision Support System

CSE M272: Advanced Neuro-Fuzzy Systems Page 9 / 9

You might also like