## 2 Materials and Methods
### Implementation of the LSTM-AM Network for Anomaly Detection in Time Series  
Anomaly detection in one-dimensional time series signals is a critical task across various domains, from machine diagnostics to health monitoring, as it enables the identification of unusual patterns that may signal failures, errors, or other critical events. Given the sequential nature and temporal dependencies inherent in 1D signals, such as those from strain gauges, specialized analytical methods are essential. Anomaly detection models broadly fall into statistical, traditional machine learning, and deep learning categories. Statistical methods compare current data points against a statistical model of normal behavior. While simple to implement, they often struggle with complex, high-dimensional, or noisy data, and are less adept at detecting subtle or non-linear anomalies. Traditional machine learning approaches, such as Isolation Forest, One-Class SVM (OCSVM), and K-Nearest Neighbors (KNN), learn normal data behavior to identify significant deviations. These can be effective for lower-dimensional data and may handle some class imbalance, but their performance can be hampered by noise or irrelevant features, and they often require manual feature engineering. Deep learning methods, with their multi-layered architectures, excel at processing high-dimensional and unstructured data, automatically learning complex patterns and temporal dependencies. Autoencoders (AE/VAE) are trained on normal data to reconstruct it, with high reconstruction error indicating an anomaly. Generative Adversarial Networks (GANs) can model normal data distributions, detecting anomalies when a discriminator easily distinguishes a sample as fake; however, they face challenges like training instability and \"mode collapse\". Diffusion Models, a newer generative approach, learn normal data distributions through iterative denoising, offering high stability and complex distribution modeling, though inference speed can be a concern. Recurrent Neural Networks (RNNs) and Long Short-Term Memories (LSTMs) are inherently suited for sequential data,  
Figure 4: Simulation of conveyor belt damages: (**a**) scaled system response to local damage at various locations, (**b**) signal recorded by the strain gauge. capturing long-term temporal dependencies, and identifying anomalies as deviations from learned normal patterns. Long Short-Term Memory (LSTM) networks are well suited for analyzing sequential data, such as time series, as they can capture long-term dependencies. Anomaly detection using LSTM relies on modeling normal signal behavior. Once trained on non-anomalous data, the network can identify deviations from typical patterns [25]. LSTM networks incorporate specialized memory cells capable of storing information over long periods, making them more effective in capturing long-term dependencies compared to traditional RNNs. Due to their architecture, LSTM networks are also less susceptible to the vanishing gradient problem, which often occurs in neural networks trained on long sequences [26; 27; 28]. The attention mechanism (AM) significantly boosts LSTM performance on long time series by dynamically assigning weights to various segments of the input sequence throughout processing [29; 30]. In traditional LSTM models, information from distant parts of a sequence may diminish as the sequence is processed. The attention mechanism allows the model to focus on relevant information, even if it is far from the current moment in the sequence. The LSTM model processes an input sequence and generates a query vector (Q), representing the current processing state. For each element in the input sequence, the model calculates a key (K) and a value (V). The key represents the importance of a given element in the context of the query. The value contains information about that element. The model computes weights, which determine how relevant each input element is to the current processing state.