## 4 Results and Discussion
### Model Performance Evaluation  
An extensive analysis of the LSTM autoencoder algorithm's performance in stuck pipe detection was executed on multiple metrics: reconstruction error analysis, confusion matrix analysis, and receiver operating characteristic curve (ROC curve). The results are shown below (including graphs) and will serve as a basis for discussion and insight. Figure 6 illustrates the loss curves for the training and validation datasets up to 200 epochs, which provide important information about model learning. The training and validation losses gradually and consistently decrease to low, constant values. This indicates that the model can learn what normal operational patterns look like from the data. Please retain the numbers as your numbers. This sharp decrease in loss from epochs 0 to 25 shows that the model is quickly learning the normal patterns. After that, the loss tends to stabilize, and only minor adjustments are needed, indicating the strength of the model with respect to unseen data. Figure 7 shows the reconstruction errors for different data samples. Normal cases exhibit lower reconstruction errors, while stuck cases show significantly higher errors, enabling clear separation between the two classes. Reconstruction errors help us distinguish between normal and stuck states; normal data points have reconstruction errors nearer to zero, whereas stuck cases present high errors, making them easily identifiable. This creates a clear separation, which is essential for generating class labels for specific instances to detect stuck events effectively. Figure 8 shows the distribution of reconstruction errors with a fixed threshold line at T = 0.3. This threshold is important, because it clearly separates normal and stuck data points. The data are almost linearly separable, with very marginal overlap, as illustrated in the figure. Although there are some false positives and false negatives, they are few and far between. By fine-tuning the threshold, the accuracy and precision of the classification accuracy can be improved, subsequently improving the model's performance. Figure 6: Model loss. Figure 9 graphs the confusion matrix of the classification performance of the suggested LSTM autoencoder method. It plainly shows the ratios of the true classes and the forecast classes, providing valuable insights on how well the model is in capturing normal cases vs. stuck cases. The wrongly classified instances are those data points that fall below the diagonal line. This graph is necessary for evaluating the overall performance of the model and looking for potential areas of improvement in which the classifier is failing. In addition to the confusion matrix, several key performance metrics further evaluate the model's effectiveness. The accuracy of the model reached 99.06%, which demonstrates its strong ability to classify stuck and normal cases correctly. The precision for detecting stuck events was 97.12%, ensuring a low false positive rate. The recall stood at 91.34%, indicating the model's effectiveness in capturing actual stuck cases. Finally, the F1-score, a balance between precision and recall, was 94.15%, reinforcing the robustness of the proposed approach in minimizing both false positives and false negatives. Figure 8: Errors for the threshold. Figure 7: Error plot for different classes. Two \"Stuck\" cases were correctly identified, while 11,687 normal cases were correctly predicted. However, 33 normal instances were incorrectly predicted as \"Stuck\", and 110 stuck cases were misclassified as \"Normal\". These results show that the model is highly effective in distinguishing between the classes, with very few false positives and false negatives. This accuracy indicates the method's effectiveness in real-world scenarios, which helps to minimize classification errors. The receiver operating characteristic (ROC) curve is displayed in Figure 10. The text illustrates the model's ability to differentiate between stuck and normal cases.