# Intelligent Framework Design for Quality Control in Industry 4.0
## 3 Materials and Methods
### Pre-Production Model Selection for Vibration Data  
The vibration data gathered constitute time series data; thus, the preference for the artificial neural network (ANN) over other deep learning models is justified for several reasons. To start, meticulously chosen ANN architecture has exhibited exceptional performance when dealing with time series classification problems by effectively capturing long-term dependencies in data [36]. Furthermore, ANN architecture utilizing Adam and RMSprop optimizers can effectively tackle the issue of a vanishing gradient [37]. The ANN's adaptability and versatility enable its use in a wide array of problems including natural language processing, time series analysis, and speech recognition [38]. LSTM, ARIMA, and CNNs can be used for time series data; however, they have got some inherent limitations. CNNs and ARIMA would need manual feature engineering as they are less efficient in learning the related features from raw data automatically; this reduces the need for manual feature engineering in ANN models [39]. ARIMA and exponential smoothing are sequential and they cannot leverage parallel processing like ANNs, which can be trained very quickly by parallel data processing; this is advantageous when dealing with very large data sets [40]. LSTM and RNNs are specifically designed for time series data, but they cannot be customized based on the needs of time series problems, when different activation functions are used in a model, or when multiple neural network architectures are combined for more complex data sets. CNNs have got limitations when dealing with long-term dependencies in time series data [41].  
The ANN architecture for the variable load model is detailed in Table 3. An 80% portion of the data is allocated for training, while the remaining 20% is designated for testing the model. The input shape is (720,000, 4), and the batch size is set at 64. To begin, the first layer in the ANN is a flattened layer, enabling the conversion of the data to a one-dimensional form. Following this, the second layer consists of a dense layer housing 64 neurons. This layer incorporates a level-1 regularizer with a regularization rate of 0.01 and utilizes the activation function. Subsequently, the third layer also comprises a dense layer featuring 32 neurons and adopting _relu_ as the activation function. Notably, a level-2 regularizer is implemented with a regularization parameter of 0.001 in the third layer. Finally, the last layer is dense and employs _softmax_ as the activation function. Table 3 provides the parameter count for each layer. An _Adam_ optimizer is employed for optimization, with a learning rate set at 0.001. The loss function utilized is _categorical cross-entropy_. The model undergoes training for 50 epochs and is subsequently assessed based on accuracy, loss, F1 score, precision, and recall. Subsequently, the results are presented in the following section.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \multicolumn{3}{c}{**Model: Sequential\_1**} \\ \hline
**Layer\_Type** & **Output\_Shape** & **Number of Parameters** \\ \hline flatten\_1 (Flatten) & (None, 4) & 0 \\ dense\_3 (Dense) & (None, 64) & 320 \\ dense\_4 (Dense) & (None, 32) & 2080 \\ dense\_5 (Dense) & (None, 12) & 396 \\ \hline \hline \end{tabular}  
* Total parameters: 2796 (10.92 KB). Trainable parameters: 2796 (10.92 KB). Non-trainable parameters: 0 (0.00 Bytes).  
\end{table}
Table 3: ANN model structure for the variable load (pre-production).