# Time-Series Prediction of Failures in an Industrial Assembly Line Using Artificial Learning
## 3 Materials and Methods
### Modelling Using ANFIS  
ANFIS has a hybrid architecture that combines fuzzy logic with artificial neural networks, leveraging the strengths of both approaches. It comprises five fundamental layers that process input data to produce a crisp output, with each layer performing a distinct function. In the fuzzification layer, input variables are transformed into fuzzy sets, and each input is assigned appropriate fuzzy values through predefined membership functions (MFs). This transformation allows the system to effectively handle uncertainty. In the multiplication layer, the antecedent parts of the fuzzy rules are combined, and the firing strength of each rule is computed. When the \"AND\" operator is used, the outputs of the membership functions are multiplied to determine the weight of the corresponding rule. The normalisation layer normalises each rule's weight by dividing it by the total weight, thereby calculating the relative importance of each rule. The defuzzification layer converts the fuzzy outputs into crisp values using specific mathematical techniques, most commonly the weighted average method. Finally, the aggregation layer combines the outputs of all rules to generate the final system output. This multilayer structure enables ANFIS to successfully model complex nonlinear systems by integrating ANN's learning capability with fuzzy logic's interpretability, making it a powerful tool for prediction and modelling. Figure 9 illustrates the topology of the ANFIS network used. The architecture and parameters of each layer are presented in Table 4.  
In ANFIS, during training, MFs for the input variables are defined, and their clusters are updated to gain learning ability. MF determines which fuzzy sets an input value belongs to. An MF can take various forms, such as triangular, trapezoidal, Gaussian, bell-shaped, \begin{table}
\begin{tabular}{l l l} \hline \hline
**Layer** & **Configuration** & **Parameters** \\ \hline Output variable & Time-series data & _Configuration_ \\ Input variable(s) & 3 lag(s) of output & _Configuration\({}_{t-1}\)_, _Configuration\({}_{t-2}\)_, _Configuration\({}_{t-3}\)_ \\ Batch size & \(-\) & 80\% (modelling), 20\% (forecasting); normalised \\  & & Input MF: Gauss; clusters: 10 for each input \\ Fuzzification and data clustering & FCM & Partition matrix exponent, \(m=1.5\) \\  & & Initial step size: 0.01; step size decrement rate: 0.9; \\  & & step size increase rate: 1.1 \\ Defuzzification & Output MF & Zero-order Sugeno and first-order Sugeno \\ Decision-making & AND & \(-\) \\ Optimisation method & Hybrid & \(-\) \\ Epochs & Iterations per epoch = 1 & 10, 50, and 100 epochs \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hyper-parameters of the ANFIS network. Figure 9: The ANFIS structure used. and sigmoid. These functions enable the modelling of uncertain data in fuzzy logic systems. A generalised fuzzy rule using the \"AND\" operator is given in Equation (12). Rule-\(n^{th}\) :  
\[If(in_{1}=A_{i})\wedge(in_{2}=B_{j})\wedge\ldots\wedge(in_{\ldots}=C_{k})\;then \;f_{n}=f(in_{1},\;in_{2},\ldots,in_{\ldots}) \tag{12}\]  
where \(\wedge\) is the \"AND\" operator. \(in_{1},in_{2},\ldots\) are input sequences. \(n=1,2,\ldots\) is the rule number. The cluster counts for each input variable are \(i,j,k=1,2,\ldots\) in the fuzzification layer. The input variables' linguistic expressions are \(A,\;B,\;\ldots,C\) which correspond to each cluster. In the defuzzification layer, each node's output is shown via \(f_{n}\). If it is a constant, then ANFIS is called a zero-order Sugeno model, while it becomes a first-order Sugeno model if it is a first-degree polynomial like \(f_{n}=p_{n}\;*\;in_{1}+q_{n}\;*\;in_{2}+\ldots+r_{n}\;*\;in_{\ldots}+s_{n}\) where \(p_{n},\;q_{n},\;r_{n}\), and \(s_{n}\) are the parameters determined in the output layer via regression. As a rule, parameters in the \"\(If^{\prime}\)\" clause are called antecedents, while those in the \"_then_\" clause are called consequents.