**4. Adaptive neuro-fuzzy inference system (ANFIS)**

As is well known, the fuzzy logic system has some limitations, such as the need to determine the rule base, which is usually solved by referring to expert knowledge. It is obvious that the membership functions required for the formation of fuzzy sets must be determined. ANFIS allows you to use data sets to determine the rule base and membership functions for this purpose [22–25]. The ANFIS system employs two approaches: NNs and FL, if these two systems are merged, they may obtain a successful outcome that involves either fuzzy intelligence or neural network analytical abilities. The ANFIS structure, like that of other fuzzy systems, is divided into two parts: introductory and concluding, which have been connected by a set of rules. ANFIS training includes determining the parameters associated with these parts and using an optimization algorithm. During training, ANFIS makes use of the existing input– output data pairs. And after that, IF-THEN fuzzy rules are created to determine how these parts are related to one another (Jang 1993).

#### **4.1 ANFIS architecture**

ANFIS structure is formed of nodes and the bonds that link them. Because some or all of the nodes have influence over the end nodes, it is adaptive. An algorithm is applied to discover the relationship between input and output nodes. We can see 5 different layers in the ANFIS network structure, denoting that it is a multi-layer network. The structure has 2 inputs and one output, as well as four membership functions and two rules. The layer structure of ANFIS is explained below in accordance with the ANFIS structure shown in **Figure 2**.

The input values are obtained by the first layer, which defines the membership functions that apply to them. The "fuzzification layer" is also called. This layer's outputs are the inputs' fuzzy membership grades, which are determined using the following equations:

$$O\_{1,i} = \mu\_{A\_i}(\mathbf{x}), i = \mathbf{1}, \mathbf{2} \tag{1}$$

**Figure 2.** *ANFIS general structure in five layers.*

$$O\_{1,i} = \mu\_{B\_i}(\mathcal{y}), i = \mathbf{3, 4} \tag{2}$$

Where *x* and *y* are the node's inputs, and *Ai* and *Bi* are the verbal marks linked with this node function. *μAi* ð Þ *x* and *μBi* ð Þ*y* can be assigned any fuzzy membership function. Due to function, the 2nd layer is called the rule layer because it multiplies the input signal values into each node and determines the rule firing strength. This layer employs fuzzy operators to fuzzify the inputs, and also the AND operator. The output of the 2nd Layer is as follows:

$$O\_{2,i} = \alpha\_i = \mu\_{A\_i}(\mathfrak{x}) \* \mu\_{B\_i}(\mathfrak{y}), i = 1, 2 \tag{3}$$

The third layer's role is to normalize the computed firing strengths by dividing each value by the total firing strength, and it is referred to as the normalization layer, the output of Layer 3 *ω<sup>i</sup>* is as follows:

$$O\_{3,i} = \overline{o}\_{i} = \frac{o\_i}{o\_1 + o\_2}, i = 1, 2 \tag{4}$$

The fourth layer will receive the normalized input values combined with the result parameter set and is called as defuzzification layer.

$$O\_{4,i} = \overline{a}j\_{\,i} = \overline{a}\_i(p\_{\,i}\mathbf{x} + q\_{\,i}\mathbf{y} + r\_i), i = 1,2\tag{5}$$

Where *pi* , *qi* , and *ri* are the consequent parameters.

In the network's final layer, a single fixed node labeled ANFIS calculates the total output as the cumulative of all input variables. The model's overall output is given by

$$O\_{5,i} = \sum\_{i} \overline{a\_i} f\_i = \frac{\sum\_{i} a\_i f\_i}{\sum\_{i} a\_i}, i = 1, 2 \tag{6}$$

During the training process, the best values of MF such as (Triangular.—Trapezoidal.—Piecewise linear.—Gaussian.—Singleton) and subsequent parameters for

*Artificial Intelligence Approaches for Studying the* pp *Interactions at High Energy… DOI: http://dx.doi.org/10.5772/intechopen.111552*

ANFIS model experiences are noted as a training data set and training algorithms, see **Figure 3**. The ANFIS model was trained to utilize backpropagation and hybrid algorithms. The backpropagation algorithm calculates output errors for each layer and uses them to update layer parameters. The hybrid training algorithm is so named because it employs two gradient descent and least-squares optimization techniques.

ANFIS was created using MATLAB software, and various membership functions were used to train it. To achieve the optimal membership function parameters, the ANFIS approach's inputs are fuzzified with membership functions and trained using training data measured under normal and abnormal conditions.

#### **4.2 The proposed hybrid ANFIS modeling**

The present work proposed a hybrid model combined of ANN and FL (called ANFIS model). This model optimize *D* mesons ratios production cross-section (*D*þ*=D*0, *D*<sup>∗</sup> <sup>þ</sup>*=D*0, *D*<sup>þ</sup> *<sup>s</sup> =D*<sup>0</sup>*and D*<sup>þ</sup> *<sup>s</sup> =D*þ) and differential production cross section of prompt *D*0, *D*þ, *D*<sup>∗</sup> <sup>þ</sup>, *D*<sup>þ</sup> *<sup>s</sup>* mesons as a function of Transverse momentum distribution (*PT*) in pp. collisions at different the total center of mass energy, ffiffi *s* p = 5.02 and 7 TeV [26, 27]. Eight ANFIS models are designed to achieve this goal using MATLAB ANFIS editor. ANFIS (1–4) models simulate and predict Ratios of *D*—meson *D*þ*=D*0, *D*<sup>∗</sup> <sup>þ</sup>*=D*0, *D*<sup>þ</sup> *<sup>s</sup> =D*<sup>0</sup> *and D*<sup>þ</sup> *<sup>s</sup> =D*<sup>þ</sup> respectively. The inputs of these models are Transverse momentum distribution (*PT*) and ffiffi *s* p , while the output is Ratios of *D* meson. ANFIS (5–8) models simulate differential production cross section of prompt *D*0, *D*þ, *D*<sup>∗</sup> <sup>þ</sup>, *D*<sup>þ</sup> *<sup>s</sup>* mesons respectively. The inputs of these models are Transverse momentum distribution (*PT*) and ffiffi *s* p , while the output is differential production cross section of prompt *D*0, *D*þ, *D*<sup>∗</sup> <sup>þ</sup>, *D*<sup>þ</sup> *<sup>s</sup>* mesons. The data collected from experiments are divided into two sets, namely, training set and testing set. The training set is used to train the ANFIS hybrid model. The testing data set is used to confirm the accuracy of the proposed model. It ensures that the relationship between inputs and outputs, based on the training and test sets are real. The data set is divided into two groups, 70% for training and 30% for testing. As a neural network, ANFIS must also be taught over a predetermined number of training cycles (epochs). **Figure 4** displays a flowchart of the ANFIS. To determine the ideal architecture parameters, the ANFIS model was run using experimental data. Different training epoch counts were used in several simulations to test how closely the check error (the difference between the output of the ANFIS and the validation data) and training error (the difference between the output of the ANFIS and the training data) were

**Figure 3.** *Membership functions.*

related (so that ANFIS would have generalization capability). The root mean squared error (RMSE) and coefficient of correlation (*R*<sup>2</sup> ), both of which are provided in Eqs. (7) and (8) respectively, are statistical measures that are used to evaluate error.

$$\text{RMSE} = \sqrt{\frac{\sum\_{i=1}^{n} \left(Opre\_i - Oexp\_i\right)^2}{n}} \tag{7}$$

$$R^2 = 1 - \left(\frac{\sum\_{i} \left(Opre\_i - Oexp\_i\right)^2}{\sum\_{i} \left(Opre\_i\right)^2}\right) \tag{8}$$

The predicted and experimental outputs are represented by *Oprei* and *Oexpi* , respectively, and *n* is the number of paired input/output pairs.
