# Time-Series Prediction of Failures in an Industrial Assembly Line Using Artificial Learning
## 3 Materials and Methods
### Modelling Using the CNN-RNN Hybrid Network  
CNN-RNN hybrid networks integrate convolutional neural networks with recurrent neural networks to learn both spatial and temporal dependencies in sequential data. In this hybrid architecture, CNN layers are responsible for learning spatial features from the input and extracting specific patterns. The filters and biases of the convolutional layers are optimised to detect relevant features within the data. The RNN layers, on the other hand, capture temporal dependencies by processing the sequential features derived from the CNN, thereby evaluating their temporal context. In such architectures, gated units such as LSTM or GRU are typically employed, and their weights and biases are optimised to enable the effective learning of long-term dependencies. Additionally, the network incorporates regularisation techniques such as dropout and batch normalisation, which contribute to an improved generalisation performance. The weights between layers are generally optimised using gradient descent algorithms and updated based on performance metrics evaluated on the validation set. This multilayer structure of the CNN-RNN hybrid network enables efficient modelling of both spatial and temporal relationships. Figure 8 presents its topology. In CNN-RNN hybrid networks, hyper-parameters such as the dilation factor, pool size, and stride are tuned to optimise the learning performance and generalisation capability of the model. The _dilation factor_ controls the spacing between filter elements during the convolution process and allows for the construction of large receptive fields. Its optimal value depends on the scale of the dataset. The _pool size_ refers to the size of the region considered during pooling operations and is optimised to reduce spatial dimensions while minimising information loss. The selection of pool size is typically made through empirical methods or cross-validation techniques. The _stride_ parameter defines the step size of the filter movement across the data, affecting both computational cost and output size. The optimal stride value is determined based on model performance criteria, available computational resources, and the requirements of the target application. Each layer in the CNN architecture fulfils a specific function within the deep learning model. The _sequence input layer_ allows for the proper ingestion of sequential data into the network, preserving temporal or ordering information. The _sequence folding layer_ transforms the sequential input into a two-dimensional format, enabling convolutional layers to operate on the data. The _convolution2D layer_ extracts spatial features from the input,  
Figure 8: The CNN-RNN structure used. such as edges, textures, or other local patterns. The _batch normalisation layer_ normalises intermediate outputs to accelerate training and mitigate overfitting. The _ELU (Exponential Linear Unit) layer_ serves as a nonlinear activation function and improves performance in deeper networks by smoothing gradient flow in negative input regions. The _average pooling2D layer_ reduces the spatial dimensions and creates a more condensed representation of the features. The _sequence unfolding layer_ restores the sequential structure by converting the two-dimensional representation back to a temporal format, thus preserving the time-dependent nature of the data. The _flatten layer_ reshapes multi-dimensional input into a single-dimensional vector, typically used as input for fully connected layers. Working in concert, these layers form an effective model for learning complex structures in sequential data. Architecture and hyper-parameters of each layer are detailed in Table 3.  
In this study, two bidirectional long short-term memory (BILSTM) layers are implemented as the RNN framework. While BILSTM was initially conceptualised in 2005 [30], its hybrid configuration was formally introduced in 2017 [31]. The BILSTM structure comprises two distinct LSTM layers, configured with 64 and 16 hidden units here, respectively.