New Methodology to Approximate Type-Reduction Based on a Continuous Root-Finding Karnik Mendel Algorithm

: Interval Type-2 fuzzy systems allow the possibility of considering uncertainty in models based on fuzzy systems, and enable an increase of robustness in solutions to applications, but also increase the complexity of the fuzzy system design. Several attempts have been previously proposed to reduce the computational cost of the type-reduction stage, as this process requires a lot of computing time because it is basically a numerical approximation based on sampling, and the computational cost is proportional to the number of samples, but also the error is inversely proportional to the number of samples. Several works have focused on reducing the computational cost of type-reduction by developing strategies to reduce the number of operations. The ﬁrst type-reduction method was proposed by Karnik and Mendel (KM), and then was followed by its enhanced version called EKM. Then continuous versions were called CKM and CEKM, and there were variations of this and also other types of variations that eliminate the type-reduction process reducing the computational cost to a Type-1 defuzziﬁcation, such as the Nie-Tan versions and similar enhancements. In this work we analyzed and proposed a variant of CEKM by viewing this process as solving a root-ﬁnding problem, in this way taking advantage of existing numerical methods to solve the type-reduction problem, the main objective being eliminating the type-reduction process and also providing a continuous solution of the defuzziﬁcation.


Introduction
Nowadays, Type-1 and Type-2 fuzzy logic have demonstrated many advantages with respect to classical modeling methods, for example, their robustness, and design without a plant mathematical model.These advantages allow a relatively easy implementation in specific applications, for example, [1,2] provide a review of control applications, [3] is an overview of pattern recognition and classification, [4][5][6] details hardware implementations of fuzzy systems, image processing [7], and many other applications as mentioned in [8].However, the implementation of these algorithms usually requires a higher computational cost with respect to their classical counter parts.
The computational cost of Interval Type-2 fuzzy logic was increased with respect to Type-1 fuzzy logic, of course achieving better results, but at the expense of having a higher computational cost.The implementation of Interval Type-2 fuzzy inference systems (FISs) requires around double the computational cost than Type-1 fuzzy inference systems, but could be even higher because the complexity of the centroid calculation increases in IT2 FISs, and the process to obtain the centroid of IT2 FIS is called type-reduction [9].
Algorithms 2017, 10, 77; doi:10.3390/a10030077www.mdpi.com/journal/algorithms The original type-reduction method was proposed by Karnik and Mendel in [10] and was called the Karnik-Mendel Algorithm (KM), and based on this method many variations have emerged, like the Enhanced Karnik-Mendel (EKM) [11], Continuous Karnik-Mendel (CKM), and Continuous Enhanced Karnik-Mendel (CEKM).These variations of the KM type reductions were proposed in order to reduce the type-reduction computational cost; and this is because in an IT2 FIS the process that requires the highest computational cost is in fact the type reduction.
The goal of decreasing the type-reduction computational cost have been considered by several researchers, for example, in [12] the need for sorting is eliminated, in [13] a linear approximation of KM type reduction was realized, in [14] a polynomial regression for type reduction is realized, [15] introduces the Nie-Tan type reduction as an alternative to reduce the computational cost of this process by eliminating the type-reduction process, and [16] provides an study of several type-reduction alternatives focused on computational cost reduction.
The contribution of the present work is a proposed new CEKM type-reduction approximation and also providing a methodology for its implementation.This method is based on CEKM as root-finding problem, which was proposed by Liu and Mendel in [17].This method for type reduction is based on two proposed equations that allow approximation of the output points through numerical methods, like Newton Raphson [18].The objective is to provide a solution of type-reduction/defuzzification problem that eliminates the iterations and sampling requirements.In addition, we compare this approximation method with respect to the classical type-reductions approaches and propose in which context is recommendable to use our approach.
The organization of the present work is as follows: Section 2 introduces the concepts of Interval Type-2 fuzzy inference systems, then Section 3 is focused on the type-reduction process, Section 4 presents the fundamentals of the proposed approximation of type reduction, Section 5 introduces the proposed methodology to realize the type-reduction approximation, Sections 6 and 7 outline two applications of our proposed methodology and their corresponding results, and finally Section 8 contains the conclusion and future work.

Interval Type 2 Fuzzy Inference Systems
Type-1 fuzzy logic was proposed as a vagueness model of human language [19], by considering continuous membership degrees between 0 and 1 related with concepts or attributes in order to make decisions.Now, the emergence of Interval Type-2 fuzzy logic provides not only a vagueness model but also an uncertainty model [20,21], in this way increasing the systems' robustness and improving their performance.
Interval Type-2 fuzzy membership functions are defined by two Type-1 membership functions, called upper membership function and lower membership function, and the area between these membership functions is called the footprint of uncertainty.A graphical illustration of these concepts can be appreciated in Figure 1 and it is mathematically defined in Equation (1).The implementation of Interval Type-2 fuzzy logic concepts require also to extend the special T-norm and S-norm operations to the join and meet operations [22], and the fuzzy inference system is modified as illustrated in Figure 2. The main difference resides in the defuzzification; this process is very interesting because in Type-1 fuzzy inference systems it is realized by the centroid method, but in an IT2 FIS the process for defuzzification is realized by a new process called type-reduction.This process is significantly more complex than defuzzification and is explained in Section 3.

Type-Reduction Algorithms
Currently, there exist different algorithms in order to obtain the centroid of the IT2 MFs [9], and the most-used type-reduction methods are inspired in the Karnik Mendel algorithm.This algorithm is summarized in Table 1.
Initialize w i as: Compute: Find the switch point k where Find the switch point k where Set Compute: If y == y then stop, set y l = y and L = k, if not go to step 8.If y == y then stop, set y r = y and R = k if not go to step 8.

8
Set y = y and go to step 3. Set y = y and go to step 3.
The main goal of this algorithm is to find the critical points that define the combination of upper and lower membership functions, and these points are called the switch points.

Continuous Karnik-Mendel Algorithm as a Root-Finding Problem
In [17] a CKM that extends the KM type-reduction algorithm in a continuous form, as shown Equations ( 2) and (3), is presented.
Starting with Equations ( 2) and ( 3) is possible to express the type-reduction process as a root-finding problem [18].In this regard, Liu and Mendel proposed Equations ( 4) and (5).
Thanks to this proposal it is possible to use root-finding numerical methods, for example Newton-Raphson, and now the problem can be expressed as follows (Equations ( 6) and ( 7)). ) However, the mathematical development for obtaining an analytical solution still represents a challenge for the implementation.This is because in real applications, the upper and lower membership functions for type-reduction are composed functions, which results on an inference system with many factors that add complexity to the functions.

Proposed CEKM Approximation and Methodology
In order to reduce the type-reduction computational cost, we propose a methodology for type-reduction approximation.First, we propose that the first iteration of the Newton Raphson method, expressed in Equations ( 6) and (7), is a good enough type-reduction approximation and this can be expressed in Equations ( 8) and (9).
where ξ l 0 and ξ r 0 respectively are based on the EKM initialization explained by Liu et al. in [23], and these are expressed in Equation (10).
This type-reduction approximation proposed in Equations ( 14) and (15) shows several advantages with respect to classical type reduction, such as KM or EKM, and some examples of these advantages is that the approximation does not require discretization, and this is because it is an analytical solution, another advantage is that it is easy to implement in limited platforms, for example, in hardware applications.
However, this approximation is not possible without a mathematical definition of the ϕ(ξ) and ψ(ξ) functions, and these functions are defined by intervals.The mathematical approach for the ϕ(ξ) and ψ(ξ) functions is very complex because they depend on the composition operation for all consequent membership functions and rule-firing forces.
In order to outline a methodology, a mathematical development is presented that allows describing Equations ( 4) and ( 5) by using intervals.
Considering Equations ( 11) and ( 12) based on the concept of integration by parts To simplify, we propose the A and V upper and lower functions that compose the ϕ(ξ) and ψ(ξ) functions expressed in Equations ( 11) and (12).The functions A and V are expressed in Equation (13).
where ξ l and ξ r are the initial switch points, computed with Equation (10), and is necessary to identify the intervals where there points are located, and these are denoted in Equation ( 14) as b l , b l , b r , and b r .Now, based on Equation ( 14), we propose a methodology to obtain the functions by intervals and finally be able to use Equations ( 8) and ( 9) to obtain the analytical CEKM approximation.This methodology is summarized in Table 2.
Following this proposed methodology, the final results are two equations in function of the firing force and the initial centroids, remembering that these initial centroids are static and are computed by the CEKM criteria.
The resultant equations are non-iterative and do not depend on sampling, and this is the reason of the computational cost reduction.
The approximate CEKM implementation success depends on the mathematical approach to Equations ( 11) and (12), remembering that in an FIS, these equations will be dynamic by the variation of the system inputs.
To obtain Equations ( 11) and ( 12) it is necessary before to obtain the fuzzy set B, expressed in Equation ( 15), and this fuzzy set is the result of the composition operation.This means the implication of each rule-firing force with their respective output fuzzy set (Equation ( 16)), and the aggregation of all implications (Equation ( 16)).
B r (θ r , x) = θ r µ g (x) (15) where θ r represents the rule firing force, µ g (x) represents the membership degree with respect to the corresponding output fuzzy set, and the implication is realized by the T-norm operation.
On the other hand, the aggregation is realized by the S-Norm operation.
Step Action Define rules partial knowledge of the system.
Determinate the interval of each partial knowledge * Note: Considerate some interval can be composed. 3 Compute the intersection of the intervals obtained in step 2.
The interceptions are determinate as the combination of the number of consequent membership functions.* Note: Several interceptions can contain empty domains.

4
Realize the integration of each interval, evaluating the defined integral the results are obtained in firing force's function.

5
Found elements A and V.

6
Found ξ l 0 and ξ r 0 and b l and b u .
The selection of the operations for implication and aggregation is very important; the most-used composition is the Mamdani implication, Max as the S-Norm, and Min as the T-Norm.
We propose to use the probor-prod composition, and this is because it is necessary to mathematically define these operations.
Figure 3 shows four different composition operations and their corresponding centroids.This Type-1 MF used for this example has three Triangular MFs.The centroids of these composition alternatives are a slightly different; however, the restriction on the proposed methodology is the use of the Probor-Prod composition, because this composition is mathematically more approachable.

Water Level Control in a Tank
The water level control in a tank, illustrated in Figure 4, is a classical benchmark control problem and has been considered as a study case to improve the performance of FLC controllers and to compare FLC T1 and FLC T2, and other works with this plant can be found in [24,25].The main formulation of this plant is expressed in Equation (17).
The output fuzzy set contains five MFs that are distributed without intersections as illustrated in Figure 5.

•
Step 1 Define the partial knowledge of the system; and this can be expressed in Equations ( 18)-( 22).

•
Step 3 In this case study, step 3 is not necessary because the MFs do not have intersections.

•
Step 4 Tables 4 and 5 report the integrals of the upper and lower MFs.
b l is in an empty interval between 4 and 5, and b u is the 7th interval.
In order to evaluate the proposed approximate CEKM type reductions, in this section, the proposed method is compared based on their computational cost, reliability with respect to the original method contrasted with other alternatives to reduce computational cost, and the control performance with respect to KM type reduction.

• Control surface comparison and execution time
The control surface represents the behavior of a controller, and is because of this reason that it is a very useful way to compare the proposed type-reduction approximation with respect to a classical type reduction, and Figure 6 illustrates both control surfaces.In Table 8, four type-reduction methods are compared by the absolute average errors with respect to a KM type reduction with ten thousand samples.The type-reduction methods that are compared are the KM, EKM, NT and the proposed approximate CEKM.The experiments are realized by changing the number of samples of the type-reduction methods to observe their behavior in execution time and error, but remembering that the approximate CEKM type reduction is not iterative and does not requires sampling.
Figures 7 and 8 illustrate the results reported 100 in Table 8, and as we can observe, the proposed approximate CEKM has the largest error (although note high), but is considerably faster.

Performance comparison
On the other hand, we evaluate the performance of the KM algorithm with ten thousand samples Table 9, reports the results of the control performance and execution time in a simulation, and this performance is reported with the IAE, ITAE and RMSE control metrics.

• Performance comparison
On the other hand, we evaluate the performance of the KM algorithm with ten thousand samples.Table 9, reports the results of the control performance and execution time in a simulation, and this performance is reported with the IAE, ITAE and RMSE control metrics.In these experiments we can observe that the IT2 FLC with EKM TR obtains better performance results with respect to the same controller with approximated CEKM TR, however, the proposed alternative reduces the execution time of the IT2 FLC by 60%, which is good for real world problems.

Edge Detection
As another case study we are presenting image edge detection with IT2 fuzzy systems.Edge detection is a recent area of application with great results for IT2 fuzzy logic, and for example the works in [26][27][28].
The IT2 FIS can be used to find if a pixel is or not an edge, and is necessary to consider the pixel's neighborhood as shown in Figure 9.In these experiments we can observe that the IT2 FLC with EKM TR obtains better performance results with respect to the same controller with approximated CEKM TR, however, the proposed alternative reduces the execution time of the IT2 FLC by 60%, which is good for real world problems.

Edge Detection
As another case study we are presenting image edge detection with IT2 fuzzy systems.Edge detection is a recent area of application with great results for IT2 fuzzy logic, and for example the works in [26][27][28].
The IT2 FIS can be used to find if a pixel is or not an edge, and is necessary to consider the pixel's neighborhood as shown in Figure 9.In these experiments we can observe that the IT2 FLC with EKM TR obtains better performance results with respect to the same controller with approximated CEKM TR, however, the proposed alternative reduces the execution time of the IT2 FLC by 60%, which is good for real world problems.

Edge Detection
As another case study we are presenting image edge detection with IT2 fuzzy systems.Edge detection is a recent area of application with great results for IT2 fuzzy logic, and for example the works in [26][27][28].
The IT2 FIS can be used to find if a pixel is or not an edge, and is necessary to consider the pixel's neighborhood as shown in Figure 9.This is because the pixel's gradient is obtained as shown in Equation ( 28), this strategy, using the gradients is used for example in [6] and produces a good result.
The gradients are approximated in this case as the differences in absolute values and these are the inputs to the IT2 FIS, the values are from 0 to 255, and the fuzzy sets can be found in Figure 10.The MFs distribution for the fuzzy sets are the same for each input, and are parameterized as proposed in [6] allowing adaptation to different contexts.
The proposed fuzzy sets are formed by two type-2 fuzzy membership functions as is shown in Figure 11.As can be observed, the output fuzzy set is a composed function.

•
Step 1 Equations ( 29) and ( 30) define the partial knowledge of the system. • Step 2 Defines the output membership functions intervals, and these domains are reported in Table 10.

Upper MFs Lower MFs
Interval Partial Knowledge Interval Partial Knowledge • Step 3 In this case, study, step 3 is not necessary because the MFs do not have intersections.

•
Step 4 Tables 11 and 12 show the integral of each interval for the output MFs.
Table 11.A and V.

Interval Partial Knowledge
Table 12.A and V.

•
Step 5 Equation (31) expresses ξ l 0 and ξ r 0 and b l and b u

•
Step 6 Tables 13 and 14 contain the elements A and V of upper and lower partial knowledge intervals.
Table 13.A and V.

Partial Knowledge
Table 14.A and V.

Interval Partial Knowledge First Integral
Second Integral
And Equations ( 34) and (35) express the derivatives of these functions.
Finally, we can define the approximate system outputs, and these equations are functions of the firing forces, and this eliminates the need to discretize and realize an iterative type reduction.

• Experiments
To evaluate the approximate CEKM Type Reduction, it is proposed to realize the edge detection based on the image illustrated in Figure 12, where the original image can be found and the corresponding obtained edges.It is proposed to add Gaussian noise to the original image to test the performance of IT2 FLC in noisy environments, which in this case is a Gaussian noise with a variance of 0.1, and the illustration of these image plus noise can be appreciated in Figure 13.Table 15 reports the results obtained by the edge detection of the image illustrated in Figure 13, the results are presented with a widely accepted performance metric known as Figure of Merit of Pratt (FOM) [29], and are compared with respect to the classical KM type reduction with ten thousand samples.The FOM of both edge detectors is very similar, the percentage of equal pixels is 93.93%, however, the main results are in the execution time, with a reduction of 45% in the execution time and a competitive performance, and in this form the approximate CEKM Type Reduction shows an improvement with respect to EKM Type Reduction.
In order to compare the proposed approximate type reduction with respect to other improved type-reduction algorithms, these algorithms are also considered as alternatives to reduce the execution time of the process.The results are reported on Table 16.Figures 14 and 15 illustrate, in a graphical way, the results reported on Table 16.

Conclusions
As a conclusion we have evaluated the proposed approximate CEKM type-reduction method with respect to the classical type-reduction algorithms and we can summarize the advantages and disadvantages in Table 17.

Conclusions
As a conclusion we have evaluated the proposed approximate CEKM type-reduction method with respect to the classical type-reduction algorithms and we can summarize the advantages and disadvantages in Table 17.
The proposed approximation is faster than other approximations, such as the NT Method.This is because it provides a continuous approximation of the output, which means that it not only eliminates the type-reduction process, but also reduces the defuzzification method to a polynomial, and on the other hand presents slightly higher error with respect to the theoretical model and other approximations.Based on the presented comparison we can state that the proposed algorithm is not recommended for:

•
Applications where the error is a critical requirement.

•
Applications that require adapting the IT2 FIS online.
We recommend the implementation of this approximate CEKM type-reduction algorithm in: • Applications that require a high processing rate.

•
Image processing applications that need calculation in real problems.

•
Applications that execute the IT2 FIS as sub process.Some examples of applications where the proposed approximation recommended is the use of fuzzy systems to make the parameters to be adaptive for a metaheuristic algorithm to optimize systems or mathematical functions [30][31][32][33][34].This is because if, for example, the optimization takes one month, with the proposed approximation we can realize the same task in about two weeks, allowing to accelerate achieving the results of the research.

Figure 3 .
Figure 3. Different types of composition operators.

Figure 7 .
Figure 7. Execution time comparison of the type-reduction algorithms.

Figure 7 .
Figure 7. Execution time comparison of the type-reduction algorithms.

Figure 8 .
Figure 8.Average error comparison of the type-reduction algorithms.

Figure 8 .
Figure 8.Average error comparison of the type-reduction algorithms.

Figure 9 .
Figure 9. Neighborhood of a particular pixel.

Figure 10 .
Figure 10.Fuzzy sets of the gradients.

Figure 12 .
Figure 12.Test image and their edges detected.

Figure 15 .
Figure 15.FOM comparison for different type-reduction methods.

Figure 15 .
Figure 15.FOM comparison for different type-reduction methods.

Table 6 .
A and V.

Table 15 .
Edge detection comparison with respect to classical KM type reduction.

Table 16 .
Edge detection comparison by variating the type-reduction method.

Table 17 .
Advantages and Disadvantages of the Approximate CEKM method.

Table 17 .
Advantages and Disadvantages of the Approximate CEKM method.