# Using Hybrid LSTM Neural Networks to Detect Anomalies in the Fiber Tube Manufacturing Process
## 3 Results and Discussion  
The training process of the hybrid LSTM network was conducted independently in each of the submodules \(LSTM^{Ch_{(8,16,32)}}\). Subsequently, for the frozen weight sets \(W^{Ch_{(8,16,32)}}\), a convergent learning process of the aggregating module was carried out using the Anomalies labeler block (see Figure 6). The course of this process and the achieved degree of model fit for the entire LSTM network are shown in Figure 9. The proportion of the training set split into training and testing sets was set at 70% and 30%, respectively. The obtained model fit coefficient \(R^{2}>0.85\) demonstrates the high efficiency of the model on the tested data set. RLM production line Root Mean Squared Error: 0.475 F-statistic vs. constant model: 6.62 \(\times\) 10\({}^{3}\), p-value = 0 R = 1.0000 0.9442 0.9442 1.0000 Obtained Pearson correlation coefficients: 0.9442 Obtained R2 determination coefficient: 0.892 \begin{table}
\begin{tabular}{c c} \hline
**Name** & **Data** \\ \hline Production line & RLM \\ \hline Session measurement dates & Start time & End time \\  & 1 June 2021 & 1 December 2023 \\ \hline Total measurement time & 688,896 [s], \(\sim\)191 [h] \\ \hline Number of measurement points & 232 \\ \hline Size of the moving window & 256 [s] \\ \hline Window shift step & 5 \\ \hline Number of samples in the learning set & 2691 \\ \hline Training set size & 70\% \\ \hline Test set size & 30\% \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Training data set information. Figure 9: Pearson coefficient (**a**) and Confusion matrix (**b**). To evaluate the effectiveness of anomaly detection, a detailed experimental study was conducted using identical data sets, with models: Random Forest, SVM, and a simple RNN as benchmarks. The performance of each of these models was evaluated using standard metrics, including Precision, Recall, F-1 Score, and \(R^{2}\), which allow an objective assessment of the quality of anomaly detection and prediction [42]. Detailed results are shown in Table 7.  
The obtained results show that LSTM significantly outperforms other models, particularly in the context of detecting complex temporal and sequential dependencies. The Precision and Recall metrics for LSTM exceed 0.94 and 0.96, respectively, while the F1-score is >0.91, indicating a balance between the model's accuracy and sensitivity. To thoroughly evaluate the effectiveness of the proposed model, a detailed performance analysis for individual classes was conducted using Precision, Recall, and F1-score metrics. The results, presented in Table 8, reveal that Proper achieved the highest Precision (0.9414) and Recall (0.9695), indicating an excellent fit of the model to this class. In contrast, the lowest Precision (0.6647) and Recall (0.7513) values were observed for Anomaly 4, highlighting some challenges for the model in detecting anomalies in this class. The experimental results confirm that the proposed hybrid LSTM model outperforms other approaches in terms of anomaly detection effectiveness in production processes. The application of advanced deep learning methods represents a significant step toward improving anomaly detection quality in data with complex temporal structures, which is critically important in the context of industrial process monitoring. The resulting network model was implemented in the FIBRAIN industrial plant in a technological supervision system with the task of providing real-time support for RLM line operators during the production process. Figures 10 and 11 show examples of the monitoring view during: normal process operation and the occurrence of an anomaly threatening a defect in the final product, respectively. The bar graph represents the probability values of the current process signature belonging to one of the classes: Proper, Anomaly 1-4. For the operator's convenience, the values on this graph correspond to the output signals of the penultimate Softmax layer of the aggregating module.