## 2 Related Work  
Different ML techniques can be applied for AD, and the most significant can be summarized as follows:* Recurrent Neural Network (RNN): This is an artificial neural network (ANN) that recognizes patterns in sequences of data such as those from sensors [40]. As an example, in [41], the authors proposed OC4 Seq, a multi-scale one-class RNN used to capture different levels of sequential patterns simultaneously and to embed the discrete event sequences into latent spaces, where anomalies can be detected.
* Autoencoder Neural Networks (AE): These are a specific type of neural network that belongs to the class of generative models used in unsupervised learning. AEs are designed to efficiently compress input data into a lower-dimensional representation and then use that compressed information to reconstruct the original input. This process involves two main components: the encoder, which compresses the input data, and the decoder, which reconstructs the data from its compressed form. AEs are widely used for tasks such as dimensionality reduction, image denoising, and feature learning, improving the ability to capture the essential features of input data while eliminating noise and redundancy. The goal is to ensure that its latent space has good properties, which allows for the generation of new data [42]. An unsupervised AD approach is proposed in [43] where the authors introduce a sliding-window convolutional variational autoencoder (SWCVAE) which can automatically learn normal patterns from time series data in training and can detect AD in real time, both spatially and temporally, by dealing with multivariate time series data. In [44], to improve the identification of values within a dataset that vary greatly from the others, the outliers, the authors propose using stacked autoencoders to extract features and then an ensemble of probabilistic neural networks to conduct majority voting and find outliers.
* Generative Adversarial Network (GAN): Deep adversarial neural networks are composed of two networks competing with each other. This setup creates a challenging adversary for the model, namely a discriminative network that learns to discern whether a sample originates from the distribution of false data or from the model. In this particular class of algorithms, the training consists of only ordinary data. Anything that is not classified in this way is labeled as an anomaly [45]. A conditional GAN was proposed in [46], and it jointly learns the generation of high-dimensional image space and the inference of latent space. This model consists of two encoders, a decoder, and a discriminator. Bidirectional GAN (BiGAN) was developed in [47], and it learns an encoder E which simultaneously maps input samples x to a latent representation z. This avoids the computationally expensive step of recovering a latent representation at test time. BiGANs was proposed in [48] to learn this inverse mapping produce a feature representation. In addition to the GAN framework, an encoder was used to map data to a latent representation.  
AD is usually a difficult problem to solve. Most of the techniques in the literature are designed to address a specific application case of the general problem, e.g., related to the type of data input or model, the availability of labels for the training and testing data, or the types of anomalies. Furthermore, most of them require high computational efforts or resources and are too complex to be applied on different production lines. For these reasons, the focus of our work is on the DeepESN model as an alternative RNN model.