# Time-Series Prediction of Failures in an Industrial Assembly Line Using Artificial Learning
## 3 Materials and Methods
### Modelling Using ANFIS
First, the input variables in the fuzzification layer are mapped to fuzzy sets using appropriate MFs. For instance, the Gaussian membership function is given in Equation (13). \[\mu_{A_{i}}(x)=\exp\left(-\frac{(x-c_{i})^{2}}{2\sigma_{i}^{2}}\right) \tag{13}\]  
where \(\mu_{A_{i}}(x)\) denotes the degree to which input \((x)\) belongs to the \(i\)-th fuzzy set, where \(c_{i}\) is the center and \(\sigma_{i}\) is the standard deviation of the function. Gaussian, trapezoidal, bell-shaped functions, and triangular functions are well-known MFs. In the multiplication layer, each rule's firing strength is calculated by multiplying the membership degrees of the input variables. The method with the \"AND\" operator is the minimization operator, given in Equation (14). \[w_{i}=\min\bigl{(}\mu_{A_{i}}(x_{1}),\,\mu_{B_{i}}(x_{2})\bigr{)} \tag{14}\]  
The firing strength of each rule is normalised, in the normalisation layer, by the total firing strength as in Equation (15). \[\overline{w}_{i}=\frac{w_{i}}{\Sigma_{j}\omega_{j}} \tag{15}\]  
where \(\overline{w}_{i}\) is the normalised firing strength and \(w_{i}\) is the firing strength of the \(i\)-th rule. In the defuzzification layer, in a Takagi-Sugeno model, the output of each rule is either a constant or a linear combination of the input variables. A typical first-order Takagi-Sugeno model is represented by \(f_{n}=p_{n}*in_{1}+q_{n}*in_{2}+\ldots+r_{n}*in_{\ldots}+s_{n}\), where \(\{p_{n},\;q_{n},\ldots,r_{n},s_{n}\}\) are the consequents. In the defuzzification process, techniques like the weighted average or center of gravity are applied and optimised based on the error function. Finally, in the aggregation layer, the contributions of all rules are combined to produce the final output using a weighted average as in Equation (16). \[y=\sum_{i}\overline{w}_{i}f_{i} \tag{16}\]  
This formula determines the final system output by weighting each rule's output by its normalised firing strength. During the fuzzification stage, the clustering method, the number of clusters, and the type of MF are selected. These significantly affect model sensitivity. FISs provide a computational framework capable of performing logical inference under uncertainty and imprecise information. FIS design methods include rule-based approaches (e.g., Mamdani,Sugeno), data-clustering-based methods (e.g., fuzzy C-means, abbreviated to FCM), and learning techniques utilising genetic algorithms or artificial neural networks. The FCM method partitions data into fuzzy clusters by computing each data point's degree of membership to each cluster. The FCM algorithm initially selects cluster centres randomly and computes the membership degree \(u_{ij}\) of each data point using Equation (17). \[J=\sum_{i=\bot}^{N}\sum_{i=\bot}^{N}u_{ij}^{m}\mid\mid x_{i}-c_{j}\mid\mid^{2} \tag{17}\]  
Here, \(x_{i}\) is the data point, \(c_{j}\) is the cluster center, \(m\) is the fuzzification parameter, and \(u_{ij}\) is the membership degree. FCM iteratively updates membership functions and optimises cluster centres. In the decision-making stage, gradient descent or hybrid learning algorithms are used to establish fuzzy rules and their weights. For the output function, either linear or nonlinear models are used, typically selected to minimise an error metric on the training dataset. The number and type of membership functions (MFs), as well as the cluster size for FCM clustering, are optimised to avoid an overly complex rule-base that could lead to overfitting. A smaller number of MFs is selected to maintain generalisability, balancing training accuracy and model simplicity. These approaches enhance generalisation ability and reduce the risk of overfitting.