# Intelligent Framework Design for Quality Control in Industry 4.0
## 4 Results and Discussion  
The models' results include accuracy, loss, F1 score, precision, and recall. In Figure 7, the accuracy plot of the training and validation data are displayed for the variable load model. Training accuracy is an indicator of how well the model is performing for the training data, and validation accuracy provides the generalization efficiency and performance of the model of unseen data. It is evident that the model reaches convergence at the 36 th epoch with the training and validation accuracies of 98.8% and 98.7%, respectively. Convergence in machine learning refers to a point in the model training where further training does not significantly improve the accuracy and reduce the loss of the model. Very fast convergence may lead to the overfitting problem. Smooth convergence is an indicator of model stability and generalization for unseen data. The accuracy plot shown provides better stability, and it is evident that the model is computationally efficient. In Figure 8, the confusion matrix for the variable load model is depicted. As mentioned earlier, 20% of the data is used for test purposes. About 15,000 samples are used for testing per class. The confusion matrix shows how well each fault is classified. Fault types related to each class are mentioned in the plot caption. The model demonstrates strong performance across all fault conditions, except for class 2, class 8, and class_12, corresponding to the eccentricity fault at 80 Nm, root crack fault at 80 Nm, and chipped tooth fault at 80 Nm. In class_2, out of 15,066 samples, 13,982 samples are correctly identified, and 14,736 samples are correctly identified in class_8. The model classifies faults in class_2 and class_8 with accuracies of 92.8% and 97.6%, respectively. For class_12, the model can identify 9992 samples correctly out of 15,033 samples; the accuracy for this fault class is 67%. It is evident from Figure 4 that the aforementioned three fault patterns are inherently more complex and hard to distinguish from other faults. Also, the features of these faults overlap \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer (Type)** & **Output Shape** & **Number of Parameters** \\ \hline conv2d (Conv2D) & (None, 75, 75, 64) & 640 \\ MaxPooling2 & (None, 37, 37, 64) & 0 \\ conv2d\_1 (Conv2D) & (None, 19, 19, 32) & 18,464 \\ max\_pooling2d\_1 & (None, 9, 9, 32) & 0 \\ flatten (Flatten) & (None, 2592) & 0 \\ dense (Dense) & (None, 1) & 2593 \\ \hline \hline \end{tabular}  
* Total parameters: 21,697 (84.75 KB). Trainable parameters: 21,697 (84.75 KB). Non-trainable parameters: 0 (0.00 Bytes).  
\end{table} 
Table 5: CNN structure for post-production quality control. Figure 7: Training and validation accuracy of variable load model. the other fault patterns; that is why it becomes difficult for the model to perform better for these classes, and it also results in low accuracies in these three classes. The overall accuracy of the model on the test data is 96.44%, with test data loss of 0.0825. Additionally, the F1 score, precision, and recall stand at 96%, 96%, and 97%, respectively. The results of the machine vision-based post-production quality control system are provided in terms of accuracy, precision, recall, and loss. Accuracy and confusion matrixes are plotted in Figures 9 and 10, respectively. The model is trained for 30 epochs with a batch size of 32. It can be seen in Figure 8 that the model converges at epoch 26, giving training and validation accuracy of 98.72% and 98.69%, respectively. The training and validation losses are 0.0440 and 0.0447, respectively. The test accuracy is 96.56%. Figure 10 plots the confusion matrix for the model. The test samples are 400 images per class. Class_0 in the confusion matrix refers to bad products, and class_1 refers to good product classes. The model successfully identifies 384 out of 400 samples of good products, while it identifies 392 out of 400 bad samples. The test accuracies for both classes are 96% and 98%, respectively.