# Fuzzy Neural Networks--A Review with Case Study
## 3 The Selected Fuzzy Networks
### ANFIS Fuzzy Network  
ANFIS [79] Adaptive Neuro-Fuzzy Interface System is a fuzzy neural inference system. It uses the following assumptions in its operation:  
* the vector \(x_{p}\) is mapped to the scalar \(y_{p}\) according to the following formula: \[x_{p}\in R^{N}\to y_{p}\in R^{l}\] (11) where \(p=1,\ldots,P;P\)--number of benchmarks;
* The entrance space is divided into K subspaces;
* [PERSON]'s fuzzy inference rule is used;
* To calculate the weights, the product rule is used;
* A weighted average of the individual rules is used to calculate the output value;
* A hybrid method is used for learning. The input space is partitioned to determine the individual zones for which fuzzy inference rules are defined. The Sugeno inference model mentioned above works according to the following rule:  
\[if\ (x_{1}\ \textit{is}\ A_{1}\ \textit{AND}\ x_{2}\ \textit{is}\ A_{2}\ \textit{AND}\ldots\textit{AND}\ x_{N}\ \textit{is}\ A_{N}),\ \textit{then}\ y=f(x_{1},x_{2},\ldots,x_{N}). \tag{12}\]  
Which, in vector notation, can be written as follows  
\[if\ (x\ \textit{is}\ A),\ \textit{then}\ y=f(x) \tag{13}\]  
where \(f(x)=f(x_{1},x_{2},\ldots,x_{N})\) is a non-fuzzy function. It means that the input variable x must satisfy specific conditions defined by the fuzzy set A and once these conditions are met, the output is calculated using function \(f\), linking the inputs to the output through a deterministic relationship. In the classical approach, the most common form of the function \(f(x)\) is a first-order polynomial:  
\[y_{k}=f(x)=a_{k}+\sum_{i=1}^{N}b_{i}^{k}x_{i} \tag{14}\]  
in which the coefficients \(a_{k}\), \(b_{i}^{k}\) are numerical weights that are selected during the learning process. In this case, the assumption is made that the function \(f(x)\) is a zero-order polynomial:  
\[y_{k}=f(x)=a_{k} \tag{15}\]  
The \(w_{k}\) weights are calculated based on the product rule, which corresponds to the division of the input space:  
\[w_{k}=\prod_{i}\mu_{A_{i}^{k}}(\mathrm{x}) \tag{16}\]  
According to assumptions, the output of the system is determined by a weighted average formula of the individual rules. After assigning the appropriate weighting \(w_{k}\) for each rule, an output signal is then obtained according to the following formula:  
\[y=\frac{\sum_{k=1}^{K}w_{k}y_{k}}{\sum_{k=1}^{K}w_{k}} \tag{17}\]  
Parameters for ANFIS are calculated using a hybrid learning approach. It operates in such a way that the parameters of the conclusion are calculated 'forward' using the least squares method, while the parameters of the premise (assignment function) are calculated 'backward' using the backward error propagation method. Figure 2 shows a scheme of ANFIS for an equal division of the two-dimensional entrance space. Figure 2: The scheme of fuzzy ANFIS with rectangular division of the two-dimensional input space [79]. Several implementations of ANFIS networks can be found online, including a solution with ready-to-use code for recognizing the Iris dataset. ANFIS network code is available in both R and Python (version 3.11.13). On GitHub, there is a solution [80] that implements Iris dataset recognition. The use of ANFIS networks differs from deep networks in only one aspect of the code: the definition of membership functions. In the code, this appears as follows: make_gauss_mfs(1, [-5, 0.08, 1.67]), setting a Gaussian-type function with parameters that may vary depending on the analyzed example. This requires some expert knowledge from the network researcher. Figure 3 presents an example distribution of membership functions observed during the conducted studies. The plot shows the membership functions for an input variable in an Adaptive Neuro-Fuzzy Inference System (ANFIS) applied to classify flowers based on the Iris dataset. The horizontal axis represents the values of the input variable (e.g., septal length, septal width, petal length, or petal width), while the vertical axis represents the membership levels, indicating the degree of activation of fuzzy rules for a given input value.