# Time-Series Prediction of Failures in an Industrial Assembly Line Using Artificial Learning
## 4 Results and Discussion
### Discussion
Closed-loop prediction is useful for long-term forecasting or when real-time inputs are unavailable. Open-loopprediction is preferred for short-term forecasts. Closed-loop prediction enables sequential predictions using the model's prior outputs, offering flexibility for long-term scenarios but increasing the risk of accumulated error. Open-loop prediction is faster and more stable, whereas closed-loop prediction, while more flexible, may suffer from reduced accuracy due to error accumulation. Overfitting results in poor performance on new data. This typically arises from small datasets, overly complex models, or lack of regularisation. Solutions include gathering more data, applying L1 or L2 regularisation, adjusting learning rates and momentum, using dropout, simplifying the model, and implementing early-stopping. These approaches enhance the model's generalisation capability and yield a balanced performance. Overfitting can be identified by monitoring performance (error convergence) curves during training. These curves allow one to track model behaviour and observe whether the loss is decreasing. Similar training and validation losses indicate good generalisation, while flattening curves suggest that learning has completed. A continued decrease in training error concurrent with an increasing or destabilising validation error signifies overfitting. In such cases, training should be stopped. The error convergence of the NAR network curve is shown in Figure 15. As can be observed, all error curves approach zero. Up to 10 iterations, all curves (training, validation, and test) converge steadily toward zero error. Beyond 10 iterations, however, the situation changes. While the training error continues to decrease, the validation error begins to rise during the next 6 iterations, indicating that the optimal number of iterations is 10. Training beyond this point risks overfitting and a loss of stability. Since the Levenberg-Marquardt algorithm is based on gradient descent, the decrease in gradient and increase in \(mu\) in Figure 16 are expected outcomes. The increase in validation error beyond the 10 th iteration (green curve in Figure 15) and failure of further validation are more clearly visible in Figure 16c. During optimisation, the gradient should decrease as the model approaches the target, and it should reach zero at the exact minimum or maximum point. From this perspective, the gradient reduction shown in Figure 16a is a sign that the training algorithm is approaching an optimal value. Another indicator is the \(mu\) value; its increase suggests proximity to optimality. In Figure 16b, the \(mu\) curve consistently rises, further indicating successful training. The final indicator is the validation status shown in Figure 16c. At the end of each iteration, the model's accuracy is assessed. Validation is expected to succeed. As shown, validation is successfully performed for the first 10 iterations, but fails consecutively in the following 6, indicating increasing error. This confirms that the best training outcome is achieved within 10 iterations, and continuing beyond that results in overfitting. If validation fails six times in a row, the model reverts to the state at the sixth successful validation to ensure the best model is retained. Figure 15: MSE error convergence plot and determination of the optimal number of iterations. GRU and NAR emerge as the most balanced models, combining low residuals and minimal variance, which shows their suitability for tasks requiring precision and stability. The results underscore the importance of aligning model choice with task requirements. In the aspect of precision versus speed, GRU is good at accuracy while NAR or MLP is good at computing efficiency. However, LSTM and GRU require substantial computational resources and extended training times. This limitation is particularly relevant when considering real-time applications. ANFIS and CNN-RNN show intermediate performance, with room for improvement in handling outliers and complex patterns.