Introduction

Fuzzy expert systems have been used extensively in several fields of applications [110] for modeling linguistic notions of real world objects and making decisions by methods of inference much akin to the human rational process. However, the accuracy in decision making depends on the shape of fuzzy sets. The authors in their previous work [11] has already demonstrated that the shape of the fuzzy sets directly influence the accuracy of decision making in a fuzzy expert system applied for medical diagnostic applications. Hence, accurately determining the shape of the fuzzy sets, in spite of intra-expert and inter-expert variability [1], is essential for the development of a medical diagnostic system that closely mimics the human decision making process.

Modeling the variation in decision making was investigated in a conventional type-1 fuzzy expert system (FES) developed in earlier work by Garibaldi [12] which is able to assess the health of infants immediately after birth by analysis of the biochemical status of blood taken from an infant’s umbilical cord (umbilical acid–base analysis). Preliminary investigations for determining variation in the results of fuzzy inferencing that can be obtained through variation of membership function parameters were presented in [1315]. Garibaldi et al. have also explored the use of type-2 fuzzy sets to model the variability in decision making in [1].

However, to the best of our knowledge, no index of accuracy has been determined that can be used to estimate the accuracy in decision making process in a type 2 fuzzy expert system based on error estimations over type 2 fuzzy sets. In the current work, an index of accuracy has been proposed and determined analytically and is shown to be a measure of accuracy of the system. Moreover, it has been ascertained that there exists only one rule in the rule base whose associated mapping for the ith linguistic variable maps to the same value as the maximum value of the membership function for the ith linguistic variable. Based on the accuracy estimations applied over a set of inputs, optimal type-1 fuzzy sets have been determined assuming normal distribution of type-1 membership function values in type-2 fuzzy sets. In doing so, Mendel’s type reduction procedure [16] has been assumed. The improvement in decision making accuracy has been successfully verified in a medical diagnostic decision making system for renal diagnostic applications. Based on the accuracy estimations applied over a set of pathophysiological parameters, viz. body mass index, glucose, urea, creatinine, systolic and diastolic blood pressure, type-1 fuzzy sets of these parameters have been determined. To assess the practicality of this model, the type-1 fuzzy sets determined in the current work have been used to develop an FPGA based smart fuzzy processor using the same principle as described in [11]. The developed processor is tested with real patient data to determine the accuracy of diagnosis.

The paper is organized as follows. “Notion of type II fuzzy sets” gives a notion of type-2 fuzzy sets. “Mathematical modeling of fuzzy expert diagnostic system” discusses the mathematical modeling of the fuzzy expert diagnostic system. “Estimation of error in diagnosis by analytical approach” focuses on estimation of error in medical diagnosis by an analytical approach. It has also been proven that there exists only one rule in the rule base whose associated mapping for the ith linguistic variable maps to the same value as the maximum value of the membership function for the ith linguistic variable. “Application of accuracy estimations in a smart agent based medical diagnostic decision making system” focuses on the applications of accuracy estimations in a smart agent based medical diagnostic system. “Fuzzification of patient data on type 2 fuzzy sets” describes the fuzzification of patient data. The determination of optimized type-1 fuzzy sets from the analysis of type 2 fuzzy sets has been discussed in “Determination of appropriate type I fuzzy sets from analysis of type II fuzzy sets and application in FPGA” and applied in FPGA. Finally, Bayesian analysis has been performed on the population of patients under study in “Bayesian analysis”, using the processor implemented with optimum type-1 fuzzy sets determined in “Determination of appropriate type I fuzzy sets from analysis of type II fuzzy sets and application in FPGA”.

Notion of type II fuzzy sets

Fuzzy systems typically employ type-1 fuzzy sets, in which the degree of membership of any element in the set is represented by a number in the range [0,1]. The assignment of a single precise number in [0,1] means that there is no “fuzziness” in a type-1 fuzzy set. The notion of type-2 fuzzy sets was introduced by Zadeh [17], as an extension of type-1 fuzzy sets, in which an additional dimension is introduced that represents the uncertainty in the degrees of membership. In effect, the membership of any element in the original fuzzy set (the primary membership) is itself a fuzzy set (the secondary membership). Mizumoto and Tanaka studied the fuzzy set theoretic operations of type-2 fuzzy sets and properties of membership degrees of such sets [18]; they examined type-2 fuzzy sets under the operations of algebraic product and algebraic sum [19]. Dubois and Prade introduced a formula for the composition of type-2 relations as an extension of the type-1 sup-star composition for the minimum t-norm [20]. Hisdal studied rules and interval sets for higher-than-type-1 fuzzy logic [21]. Karnik and Mendel obtained algorithms for performing union, intersection, and complement for type-2 fuzzy sets, and developed the concept of the centroid of a type-2 fuzzy set [22]. Karnik et al. presented a general formula for the extended sup-star composition of type-2 relations [16]. Liang and Mendel developed the theory for different kinds of fuzzifiers for interval type-2 FESs [23]. Mendel and John have developed a simple method to derive union, intersection and complement of type-2 fuzzy sets without having to use Zadeh’s extension principle [24].

In the present paper, type-2 membership degrees have been incorporated to represent inter and intra expert variability in decision making processes. For any fuzzy set involved with the FES, we thus have associated with it not a single membership function but two, namely f 1 and f 2 with f 2(x) ≥ f 1(x) ∀x in region of support of the fuzzy set. Thus for any point in the universe of discourse the membership value is the interval [f 1(x), f 2(x)]. As a result, the output fuzzy sets will also be of the interval type. We can interpret them to represent the upper and lower limits of the experts’ opinion regarding the output, as we had done in the case of inputs.

However, patients always prefer several experts to arrive at a unanimous decision regarding their health. So it is desirable that in the outputs of the FES, the two membership functions be as close to each other as possible. In the current work, type I fuzzy sets have been ascertained from type 2 output fuzzy sets using Mendel’s type reduction procedure. For ascertaining the type I fuzzy sets, we assume that the type I fuzzy sets are normally distributed in the type II fuzzy sets.

Mathematical modeling of fuzzy expert diagnostic system

To mathematically model the FES, a host of symbols and representations are introduced. The universes of discourse for the inputs is labeled as X1, X2,…., Xm. The universe Xi has Ni linguistic variables described on it to qualify the input, for 1<=i<=m. In our particular case of medical diagnosis problem, Ni is taken to be equal to 3. Any fuzzy variable in the FES is identified by 2 indexes: one to specify its underlying universe and the other to indicate its index within that universe. We shall consider the notation L(i,j) to denote the jth linguistic variable in Xi. The output universe is Y, with variable y.

A typical rule in the rule base contains m antecedents, connected by the AND construct, followed by m′ consequents. The jth antecedent is xj is α, where α denotes some linguistic variable in Xj. Thus associated with each rule is a mapping σ such that σ(i) denote the index of the linguistic variable of Xi mentioned in the rule. Thus the rule takes the form

$$ IF({x_{1}}\,is\,L(1,\sigma (1), \ldots, {x_{i}}\,is\,L(I,\sigma (i)), \ldots, {x_{m}}\,is\,L(m,\sigma (m)))\,THEN\,y\,is\,Y\prime, $$

where Y′ is a variable in the output universe of discourse Y. We call σ the associated mapping of the rule.

Let the output, defined on universe Y, have k linguistic variables. Our FES effectively decomposes it into k classes, in each class the rules have as a consequent a particular fuzzy output variable. The FES applies the rules of conjunction and disjunction to each class separately to form fuzzy outputs for the k variables; when the question of decision making comes, the FES returns the linguistic term whose corresponding output has the maximum area under it.

Considering a particular class, let the fuzzy output variable in question be Y. Let us suppose it has n rules. The associated mappings of these rules are denoted as σ1, σ2,…, σn. Thus if Y′ is the output then we have, by virtue of Mamdani’s method of inference [25],

$$ {\mu_{{z\prime }}}(y) = \mathop{{\max }}\limits_{{i = 1}}^n (\min ({\mu_z}(y),\mathop{{\min }}\limits_{{j = 1}}^m {\mu_{{L(j,{\sigma_i}(j))}}}({x_j}))) $$
(1)

Let ∃ n intervals I1, I2,….., In, where Ik = [lk,uk] for 1<=k<=n. Then using extension principle [26] we obtain:

$$ \mathop{{\min }}\limits_k [{l_k},{u_k}] = [\mathop{{\min }}\limits_k {l_k},\mathop{{\min }}\limits_k {u_k}] $$
(2)

and

$$ \mathop{{\max }}\limits_k [{l_k},{u_k}] = [\mathop{{\max }}\limits_k {l_k},\mathop{{\max }}\limits_k {u_k}] $$
(3)

Let \( \mathop{{\min }}\limits_k {l_k} = {l_c} \) and \( \mathop{{\max }}\limits_k {u_k} = {u_c} \)for some \( 1 \leqslant c \leqslant n \). Then the length of \( \mathop{{\min }}\limits_k {I_k} \leqslant {u_c} - {l_c} \).

Let \( {L_0} = \mathop{{\max }}\limits_{{i = 1}}^n \mathop{{\min }}\limits_{{j = 1}}^m {\mu_{{L(j,{\sigma_i}(j))}}}({x_j}) \). Then we have

$$ {\mu_{{{Z^{\prime }}}}}(y) = {\mu_Z}(y) \Leftrightarrow {\mu_Z}(y) < {L_0} $$
(4)

Thus, the output is uniquely determined by the parameter L 0 .

The fuzzy output set is seen to be completely determined by L 0 , thus a statistical study of L 0 will yield measures of accuracy/inaccuracy of the FES’s output.

We seek to obtain an appropriate type-I membership function whose membership values are bonded by the underlying type-II membership function. If for any point x in the universe of discourse the membership value of the type-II set is the interval [f 1(x), f 2(x)], the membership functions will have an upper as well as a lower boundary, namely f1 and f2 with f 2(x) ≥ f 1(x) for ∀x in region of support of the fuzzy set.

Estimation of error in diagnosis by analytical approach

Figure 1(a) depicts the left edge and right type 2 fuzzy sets that models the intra-expert and inter-expert variability embodied in a typical diagnosis process.

Fig. 1
figure 1

a Left edge and right edge type II fuzzy sets. b Middle edge type II fuzzy sets

Let us define \( g(x) = {f_2}(x) - {f_1}(x) \). Let E(L 0 ) be the area between the two membership boundaries of the output for a given value of L 0 . Let f be a type-I membership function lying between f 1 and f 2 , obviously the deviation of f from any expert’s opinion is less than or equal to g(x). Let us define \( e(l) = g({f^{{ - 1}}}(l)) \).

Thus \( {\hbox{E(}}{{\hbox{L}}_{{0}}}{)} = \int\limits_{{x = 0}}^{{{f^{{ - 1}}}({L_0})}} {g(x)dx + (c + w - {f^{{ - 1}}}({L_0})g} ({f^{{ - 1}}}({L_0})) \) for left and right edge fuzzy sets and \( {\hbox{E(}}{{\hbox{L}}_{{0}}}{)} = 2 \times \{ \int\limits_{{x = 0}}^{{{f^{{ - 1}}}({L_0})}} {g(x)dx + (c + w - {f^{{ - 1}}}({L_0})} g({f^{{ - 1}}}({L_0}))\} \) for middle edge fuzzy sets (assuming the fuzzy sets to be bilaterally symmetrical as shown in Fig. 1(b)).

Applying, change of variable l = f(x), we get,

$$ {\hbox{E(}}{{\hbox{L}}_{{0}}}{)} = n \times \{ \int\limits_{{x = 0}}^{{{L_0}}} {g(x)dx + (c + w - {f^{{ - 1}}}({L_0})} g({f^{{ - 1}}}({L_0}))\} $$
(5)

[n = 1 or 2 depending on whether the fuzzy set whose membership function μ represents right/left or middle fuzzy set respectively.]

$$ \begin{array}{*{20}{c}} { \Leftrightarrow {\hbox{E(}}{{\hbox{L}}_{{0}}}{)} = n \times \{ \int\limits_{{x = 0}}^{{{L_0}}} {e(l)d({f^{{ - 1}}}(l)) + (c + w - {f^{{ - 1}}}({L_0})} )g({f^{{ - 1}}}({L_0}))\} } \\{ \Leftrightarrow {\hbox{E(}}{{\hbox{L}}_{{0}}}{)} = n \times \{ \int\limits_{{x = 0}}^{{{L_0}}} {e(l){f^{{ - 1}}}^{\prime }(l)dl + (c + w - {f^{{ - 1}}}({L_0})} )e({L_0})\} } \\\end{array} $$
(6)

For maximum accuracy, E(L0) has to be minimum. Differentiating both sides of Eq. 6 we get,

$$ \begin{array}{*{20}{c}} {\frac{{{\text{dE(}}{{\text{L}}_{{0}}}{)}}}{{{\hbox{d}}{{\hbox{L}}_{{0}}}}} = e({L_0}){f^{{ - 1}}}^{\prime }({L_0}) + (c + w - {f^{{ - 1}}}({L_0}))\frac{{d(e({L_0})}}{{d{L_0}}} - e({L_0}){f^{{ - 1}}}^{\prime }({L_0})} \hfill \\{ \Leftrightarrow \frac{{{\text{dE(}}{{\text{L}}_{{0}}}{)}}}{{{\hbox{d}}{{\hbox{L}}_{{0}}}}} = (c + w - {f^{{ - 1}}}({L_0}))\frac{{d(e({L_0})}}{{d{L_0}}}} \hfill \\\end{array} $$
(7)

From (7), we find that E(l) is a decreasing function for almost its entire domain [E′(l) = 0 for a very small value of l, to be explained later]. E(l) is however the spread in the output that we were aiming to minimize, so we arrive at an equivalent problem of designing our FES such that a large value for L 0 arises on ‘most’ occasions.

The expectation of L 0 indicates the accuracy of the FES. A higher value of L 0 means a lesser value of E(l) as shown above. Thus it means lesser ambiguity in output. Thus higher the value of L 0 , more is the accuracy.

Let P(l) denote the probability that L will attain value l. So expected value of L 0 is \( \left\langle {{L_0}} \right\rangle = \int {lP(l)dl} \), under proper limits. An expression for P(l) will now be established.

The m input variables are in reality, pseudo-random. At least in medical diagnosis, this is true, as the inputs are health parameters among which there always exists a correlation. An important implication is that all possible configurations of input are not practically realizable, and those that do, do not form an equiprobable space. However for the purpose of computing P(l) we shall consider them to be random independent variables, so all m-tuples of inputs are equiprobable. We will call a particular m-tuple a feasible input if and only if it is practically realizable. Now, as mentioned earlier, with each rule there is associated a unique mapping σ. However \( \exists \;\prod\limits_{{i = 1}}^m {{N_i}} \) distinct σ s, which in all practical applications, turns out to be a huge number. The number of rules in the rule-base usually varies from 150 to 200. Thus a majority of the σ s are excluded. The rule base is divisible into k classes as explained earlier, and corresponding to each rule, ∃ L 0, which also denotes the height of the output fuzzy set of that class. Thus, the rule base should be so chosen such that for ∀ feasible input, L 0 assumes a substantial value in at least one of the output sets.

Let us consider a an input m-tuple (x1, x2, …., xm). Let us consider the ith input xi (1≤i≤m), it can have non-zero membership in at most two of the fuzzy sets defined on the ith input. Let us call the greater of them up i and the lesser of them low i [if it has nonzero-membership in only one fuzzy set, then up i = the non-zero membership value, low i  = 0]. Further, let us label the index of the fuzzy set in which xi has membership value up i as \( inde{x_{{u{p_i}}}} \), similarly let us define \( inde{x_{{u{p_i}}}} \). Thus, we get,

$$ {\mu_{{L(i,inde{x_{{u{p_i}}}})}}}({x_i}) = u{p_i} $$
(8.1)
$$ {\mu_{{L(i,inde{x_{{lo{w_i}}}})}}}({x_i}) = lo{w_i} $$
(8.2)

\( \forall 1 \leqslant i \leqslant m \).

We now state and prove the following theorem.

Theorem 1

There exists only one rule in the rule base of type II fuzzy expert system with associated mapping σ such that \( \sigma (i) = inde{x_{{u{p_i}}}} \).

Proof

If possible, let us assume that this rule does not exist. Therefore ∀rules with associated mapping σ \( \exists k,1 \leqslant k \leqslant m \) such that σ(k)≠ \( inde{x_{{u{p_k}}}} \). Now, from Eq. 8.2, \( {\mu_{{L(k,inde{x_{{lo{w_k}}}})}}}({x_k}) = lo{w_k} \). The values of x 1 , x 2 , …., x m can be changed slightly such that the tuple (x 1 , x 2 , …., x m ) still remains feasible. Hence, \( \forall 1 \leqslant i \leqslant m \), we change x i to the right or left such that the value in \( inde{x_{{lo{w_i}}}} \to 0 \). Therefore, \( {\mu_{{L(k,inde{x_{{lo{w_k}}}})}}}({x_k}) = lo{w_k} \to 0 \). This is true for any k. Thus for any rule the value of L 0 → 0. This violates the basic assumption in the design of rule base that, the rule base should be so chosen such that for ∀ feasible input, L 0 assumes a substantial value in at least one of the output sets. Thus there exists only one rule in the rule base with associated mapping σ such that \( \sigma (i) = inde{x_{{u{p_i}}}} \).

This rule will be marked as Max-Rule.

From the above proof, we can state the following corollary:

Corollary 1

The final output of the fuzzy expert diagnostic system depends only upon the values of up i. and \( {L_0} = \min \{ u{p_i}|1 \leqslant i \leqslant m\} \) .

We can now determine an expression for P(l).

$$ P({L_0} = l) = \sum\limits_{{i = 1}}^m {\{ P(u{p_i} = l) \times \prod\limits_{\begin{subarray}{l} j = 1 \\ j \ne i \end{subarray} }^m {P(u{p_j} \geqslant l)\} } } $$
(9)

We are thus interested in the membership function values [l i , 1] for the ith universe. Let \( {f_i}:[0,{w_i}] \to [{l_i},1] \), where w i is the length of the edge between kernel and point of intersection with neighboring edge. Let \( {P_i}(l) = P({f_i}({x_i}) \geqslant l) \).

Thus,

$$ {P_i}(l) = 1 - \frac{{{f_i}^{{ - 1}}(l)}}{{ \frac{{|{X_i}|}}{{{N_i}}} }} \cdot $$
(10)

Therefore,

$$ P({f_i}({x_i}) = l) = - {P_i}^{\prime }(l) = \frac{{{f_i}^{{ - 1\prime}} (l)}}{{ \frac{{|{X_i}|}}{{{N_i}}} }}. $$
(11)

But, \( P(u{p_i} = l) = P({f_i}({x_i}) = l) \) and \( P(u{p_j} \geqslant l) = {P_i}(l) \).

$$ \Rightarrow P({L_0} = l) = \sum\limits_{{i = 1}}^m {( - {P_i}\prime (l)\prod\limits_{{j = 1,j \ne i}}^m {{P_j}(j))} } $$
(12)

Let us denote the probability that L 0 ≥ l by P(l). Then, \( P(l) = \prod\limits_{{i = 1}}^m {{P_i}(l)} \).

$$ \Rightarrow P(l) = P({L_0} = l) = \sum\limits_{{i = 1}}^m {( - {P_i}'(l)\prod\limits_{{j = 1,j \ne i}}^m {{P_j}(j))} } $$
(13)

Thus expectation of

$$ {L_0} = \left\langle {{L_0}} \right\rangle = \int\limits_{{l = 0}}^1 {lP(l)dl} \int\limits_{{l = {l_i}}}^1 {(l(\sum\limits_{{i = 1}}^m {( - {P_i}'(l)\prod\limits_{{j = 1,j \ne i}}^m {{P_j}(j))} } )dl} $$
(14)

This has been used as the index of accuracy in the fuzzy expert diagnostic system. Since the fuzzy sets that were used for expert system modeling were arbitrary fuzzy sets only, therefore, Eq. 14 may be used for determining the index of accuracy in any fuzzy expert diagnostic system without restricting to any particular application or a class of applications.

Application of accuracy estimations in a smart agent based medical diagnostic decision making system

Figure 2 shows the functional architecture of a diagnostic system comprising of a smart agent.

Fig. 2
figure 2

Functional architecture of the smart agent based medical diagnostic system

Here, the smart agent is represented through a fuzzy system. The details of modeling of the smart agent have been given in [27]. Since data from the patient are nothing but physiological measures, they are subjected to noise and uncertainty. The data from the patient such as height or weight data cannot always be trusted as they are subjected to the quality and accuracy of measuring units and the skill of the technician. Moreover, based on a single data, it would be highly uncertain to make an accurate decision about the future physiological state of the patient [28]. Expert systems, even if designed with utmost care suffers from the problem of mismatch of decisions with physicians [1]. Even, there is a conflict between the decisions given by individual physicians at different instants of time [1]. Therefore, in order to develop a medical diagnostic decision making system that can closely replicate a human physician, a mathematical model of human decision making process and the uncertainty associated with the decision making process has to be developed. To model the human decision making process, the notion of type 2 fuzzy systems has been introduced. In the current work, the example of renal diagnosis of patients has been taken up. For renal diagnosis, body mass index (B.M.I.), glucose, urea, creatinine, systolic and diastolic blood pressure are considered as pathophysiological parameters.

Fuzzification of patient data on type 2 fuzzy sets

The patient data has been fuzzified with the objective of transformation of periodic measures into likelihoods that the Body Mass Index (B.M.I.), blood glucose, urea, creatinine, systolic and diastolic blood pressure of the patient is high, low or moderate. Each pathophysiological parameter is represented by three sigmoid fuzzy sets for low, moderate and high values of pathophysiological parameters. Left edge fuzzy sets (decreasing sigmoid) represented by:

$$ {\mu_L}{(x)_U} = \max \left( {\frac{1}{{1 + {e^{{ \frac{{(x - ({c_1} + {\Delta_1}))}}{{{w_1}}} }}}}},\frac{1}{{1 + {e^{{ \frac{{(x - ({c_1} - {\Delta_1}))}}{{{w_1}}} }}}}}} \right) $$
(15)

and

$$ {\mu_L}{(x)_L} = \min \left( {\frac{1}{{1 + {e^{{ \frac{{(x - ({c_1} + {\Delta_1}))}}{{{w_1}}} }}}}},\frac{1}{{1 + {e^{{ \frac{{(x - ({c_1} - {\Delta_1}))}}{{{w_1}}} }}}}}} \right) $$
(16)

Right edge fuzzy sets (increasing sigmoids) represented by:

$$ {\mu_H}{(x)_U} = \max \left( {\frac{1}{{1 + {e^{{ \frac{{\left( {\left( {{c_2} + {\Delta_2}} \right) - x} \right)}}{{{w_2}}} }}}}},\frac{1}{{1 + {e^{{ \frac{{\left( {\left( {{c_2} + {\Delta_2}} \right) - x} \right)}}{{{w_2}}} }}}}}} \right) $$
(17)

and

$$ {\mu_H}{(x)_L} = \min \left( {\frac{1}{{1 + {e^{{ \frac{{(({c_2} + \Delta ) - x)}}{{{w_2}}} }}}}},\frac{1}{{1 + {e^{{ \frac{{(({c_2} - \Delta ) - x)}}{{{w_2}}} }}}}}} \right) $$
(18)

Middle edge fuzzy sets represented by:

$$ {\mu_M}{(x)_U} = \max \left( {\frac{1}{{1 + {e^{{ \frac{{(x - ({c_3} + {\Delta_3}))}}{{{w_3}}} }}}}} \cdot \frac{1}{{1 + {e^{{ \frac{{(({c_4} + {\Delta_4}) - x)}}{{{w_4}}} }}}}},\frac{1}{{1 + {e^{{ \frac{{(x - ({c_3} - {\Delta_3}))}}{{{w_3}}} }}}}} \cdot \frac{1}{{1 + {e^{{ \frac{{(({c_4} - {\Delta_4}) - x)}}{{{w_4}}} }}}}}} \right) $$
(19)

and

$$ {\mu_M}{(x)_L} = \min \left( {\frac{1}{{1 + {e^{{ \frac{{(x - ({c_3} + {\Delta_3}))}}{{{w_3}}} }}}}} \cdot \frac{1}{{1 + {e^{{ \frac{{(({c_4} + {\Delta_4}) - x)}}{{{w_4}}} }}}}},\frac{1}{{1 + {e^{{ \frac{{(x - ({c_3} - {\Delta_3}))}}{{{w_3}}} }}}}} \cdot \frac{1}{{1 + {e^{{ \frac{{(({c_4} - {\Delta_4}) - x)}}{{{w_4}}} }}}}}} \right) $$
(20)

Where, ci’s are the centers of the sigmoids, Δ i ’s are the width of boundaries of the membership functions representing the range of membership function values and wi’s are arbitrary values, which determine width of the sigmoid (i = 1,2,3,4).

Figure 3 shows the type II fuzzy sets for B.M.I. The range of values of the membership functions of low (left edge), moderate (middle edge) and high (right edge) fuzzy sets fall within the limits prescribed by Eqs. 15 to 20.

Fig. 3
figure 3

Type II fuzzy sets for B.M.I.

Similarly, we can get fuzzy sets for the other five pathophysiological parameters. In each fuzzy set, the upper blue edge corresponds to the upper limit of membership value. The lower boundary of the grey edge corresponds to the lower limit of the membership function value in the universe of discourse of the inputs.

The rule base contains rules for approximate reasons in medical diagnosis. Typical rules take the form [17]:

  1. R1

    If (Body Mass Index is High) and (Glucose is High) and (Urea is High) and (Creatinine is High) and (Systolic Blood Pressure is High) and (Diastolic Blood Pressure is High) then the (Renal condition of Patient is severe)

  2. R2

    If (Body Mass Index is High) or (Glucose is High) or (Urea is High) or (Creatinine is High) or (Systolic Blood Pressure is High) or (Diastolic Blood Pressure is High) then the (Renal condition of Patient is moderately critical)

  3. R3

    If (Glucose is High at time Ti) and (Glucose is Low at time Tj) and (Ti ≠ Tj) then the (Patient can be suggested to go for Glycosylated Haemoglobin)

  4. R4

    If (Body Mass Index is Moderate) or (Glucose is Moderate) or (Urea is Moderate) or (Creatinine is Moderate) or (Systolic Blood Pressure is Moderate) or (Diastolic Blood Pressure is Moderate) then the (Renal condition of Patient is normal)

Determination of appropriate type I fuzzy sets from analysis of type II fuzzy sets and application in FPGA

It is essential to determine the appropriate values of c i , Δ i and w i , i = 1,2,3,4. To do so the B.M.I., glucose, urea, creatinine, systolic and diastolic blood pressure data of 80 patients has been separately analyzed to determine the accuracy value <L 0>. The data of a sample patient of age 42 years and height 5.0 ft taken at 10 days interval is provided in Table 1.

Table 1 Result of a sample patient of age 42 years height of patient: 5.0 ft

The height data has been given as an input to the system. The weight data has been provided at 10 days interval of time. Using the height and weight data, the B.M.I. is computed at 10 days interval of time. The other data are directly provided as input to the system. The values of c i , Δ i and w i , are varied heuristically and the values of <L 0> is computed for different cases using Eq. 14. Table 2 shows the results for B.M.I. data. From Table 2, we can determine the optimum values of different parameters of type II fuzzy sets, viz. c i , Δ i and w i , i = 1, 2, 3, 4 for which the values of <L 0> for B.M.I. data is maximum. Similar tables are computed for glucose, urea, creatinine, systolic and diastolic blood pressure data and shown as Tables 3, 4, 5, 6 and 7. Similar analyses have been done for glucose, urea, creatinine, systolic and diastolic blood pressure. The maximum value of <L 0> is shown in bold in each case. As discussed in “Estimation of error in diagnosis by analytical approach”, the maximum value of <L0> corresponds to maximum accuracy. Based on the maximum values of <L 0>, we can determine the parameters of the type-1 fuzzy sets, viz. c i , Δ i and w i , i = 1, 2, 3, 4 for which the medical diagnostic decision making will possibly be the most accurate.

Table 2 Analysis of fuzzy sets for B.M.I data
Table 3 Analysis of fuzzy sets for glucose data
Table 4 Analysis of fuzzy sets for urea data
Table 5 Analysis of fuzzy sets for creatinine data
Table 6 Analysis of fuzzy sets for systolic blood pressure data
Table 7 Analysis of fuzzy sets for diastolic blood pressure data

The appropriate values of c i , Δ i and w i , i = 1, 2, 3, 4 obtained for the six pathophysiological parameters are shown in Table 8.

Table 8 Appropriate values of parameters of fuzzy sets of pathophysiological parameters determined

For determining the optimized type-1 fuzzy sets, we assume that the type-1 membership function values within the type-2 fuzzy sets assume a normal distribution (which lets us to accurately define the edge within the range), which is reasonably correct [22]. The optimal type-1 fuzzy sets are determined from their type-2 counterparts using Mendel’s type reduction procedure [16].

Using the optimum values of c i , Δ i and w i , i = 1, 2, 3, 4, the fuzzy processor has been implemented on a field programmable gate array (FPGA) chip using the procedure described in [11]. For piecewise linear approximation of fuzzy sets, each sigmoid edge of fuzzy sets are approximated by eight linear segments between the two extremes of membership function values. The resource utilization summary of the processor on the FPGA chip is given in Table 9.

Table 9 Resource utilization summary

The picture of the experimental set up is shown in Fig. 4.

Fig. 4
figure 4

Picture of the experimental set up

The heart of the instrument comprises of an Altera EP1C6Q240C8 FPGA chip which handles computation of the system which is interfaced in parallel with a CMOS flash memory for storing patient data. The system accepts inputs through push button switches and produces output through LED 7 segment displays. There are two LEDs that indicate whether the condition of the patient is moderately critical or severely critical. The FPGA receives its configuration information from a EPCS1 configuration PROM chip. The whole system receives its clock signals from a piezoelectric oscillator.

The binary data entered through push button switch array have been converted into real numbers for computation using conversion-weights stored in a ROM. Using these parameter values, the corresponding membership function values μl, μm, and μh are computed. μl, μm and μh refers to the membership of a pathological parameter value in the ‘low’, ‘moderate’ and ‘high’ fuzzy set respectively. Based on these membership function values, the possibilities the values of the different physiological parameters will be low, moderate or high has been computed by the system. The maximum of these three possibilities at any instant of time suggests the probable next physiological state of the patient. The output therapeutic decision has been displayed on LED 7-segment display. The 7 segment displays indicate the possibilities of low, moderate and high values of the different pathological parameters at the next physiological state of the patient. Since, there are four seven segment displays for output in the final system, and there is only one port available for display, hence a four bit output called SCAN (0 to 3) is used. Actually the different bit lines of the SCAN are connected to cathodes of different common cathode LED 7 segment displays so as to select the 7 segment LED in time shared mode. The display codes corresponding to the 7-segment display has been stored in a ROM. The system can be reset at any point in time by a reset input which has been implemented using a push button switch. Two LEDs connected in the common anode mode indicate whether the condition of the patient is moderately critical (MC) or severely critical (SC). The whole system is provided with a battery back-up.

The FPGA based fuzzy processor has been implemented for medical diagnostic applications. The proposed system could have also been implemented using software. But the main disadvantage of the software solution is that a powerful computer is to be used to run the software for achieving reasonable speed and accuracy. However, employing a powerful computer would be too costly a solution and would require a steady supply of electricity in rural sectors. The enormity of the cost could impede the implementation of the smart diagnostic system in the rural health care centres in the third world countries. The main reason for a hardware based implementation is the need for an inexpensive portable diagnostic system. The main disadvantage of an ASIC based hardware is the high development cost and the low reconfigurability it allows for. The FPGA solution ensures that new changes in the proposed diagnostic algorithm can be mapped onto the hardware without having to make costly changes.

Bayesian analysis

Bayesian analysis has been carried out on the population under study to estimate the reliability of the system. In order to estimate the reliability of diagnosis, the definitions of statistical terms used in [29] have been used. As follows from the application of Bayes’ theorem, the predictive value of any diagnostic test is influenced by the prevalence among the tested population, and by the sensitivity and specificity of the test [30]. In our particular case, the total population under study was 80.

Let a be the number of patients where the diagnostic test yields a positive result and the patient really has a disease, b be the number of patients where the diagnostic test yields a positive result and the patient does not have a disease, c be the number of patients where the diagnostic test yields a negative result and the patient really has a disease and d be the number of patients where the diagnostic test yields a negative result and the patient does not have a disease.

Hence, \( \left( {a + b + c + d} \right) = {8}0 \).

Using the appropriate values of c i , Δ i and w i , i = 1, 2, 3, 4 for which the values of <L 0> are maximum, we get for the population under study, a = 24, b = 1, c = 0, d = 55.

Therefore

$$ {\hbox{Prevalence}}\,{\hbox{of}}\,{\hbox{disease}},\,P = \frac{{{\text{(a }} + {\text{ c) }}}}{{{\hbox{(a}} + {\hbox{b}} + {\hbox{c}} + {\hbox{d)}}}} = 0.3 $$
$$ {\hbox{Sensitivity}}\,{\hbox{of}}\,{\hbox{diagnosis}},\,Se = \frac{a}{{(a + c)}} = 1.0000 $$
$$ {\hbox{Specificity}}\,{\hbox{of}}\,{\hbox{diagnosis}},\,Sp = \frac{d}{{(b + d)}} = 0.9821 $$
$$ {\hbox{False}}\,{\hbox{positive}}\,{\hbox{rate}} = 1 - Sp = \frac{b}{{(b + d)}} = 0.0179 $$
$$ {\hbox{False}}\,{\hbox{negative}}\,{\hbox{rate}} = {1}--Se = \frac{c}{{(a + c)}} = 0.0000 $$
$$ {\hbox{Accuracy}}\,{\hbox{of}}\,{\hbox{diagnosis}} = \frac{{(a + d)}}{{(a + b + c + d)}} \times 100\% = 98.75\% $$

Compared to our earlier work in [11] where using sigmoid fuzzy sets of pathophysiological parameters, a diagnostic accuracy of 97.5% has been obtained, the present work further optimizes the sigmoid fuzzy sets to yield a diagnostic accuracy of 98.75%.

Conclusion

The current work aims at mathematically modeling the human decision making process using type 2 fuzzy sets. An index of accuracy has been determined analytically and statistically. Moreover, it has been ascertained that there exists only one rule in the rule base whose associated mapping for the ith linguistic variable maps to the same value as the maximum value of the membership function for the ith linguistic variable. Based on the accuracy estimations applied over a set of inputs, optimal type-1 fuzzy sets have been determined assuming normal distribution of type-1 membership function values in type-2 fuzzy sets. Using the accuracy estimations, most appropriate type-1 fuzzy sets of pathophysiological parameters for medical diagnosis have been determined. Based on the accuracy estimations applied over a set of pathophysiological parameters, viz. body mass index, glucose, urea, creatinine, systolic and diastolic blood pressure, appropriate type-1 fuzzy sets of these parameters have been determined. Using the type-1 fuzzy sets, a fuzzy processor has been prototyped on an FPGA. The processor has been tested for renal diagnostic applications and has been found to give diagnostic decisions with an accuracy of up to 98.75%.