# Periodic Surface Defect Detection in Steel Plates Based on Deep Learning
## 4 Experiments  
This study used the pre-training model of the VGG16 network provided by Keras without the final fully connected layer. This model, which has tuned network weights, is able to reduce the training time and improve the classification accuracy. We fine-tuned the weights based on this model.  
Original real samples (1615 pieces) or amplified samples (15,000 pieces) were used as training sets. During the training, we set the learning rate = \(1\times 10^{-6}\) and the epoch = 20. Twenty percent (20%) of the real samples (323 pieces) were used as the test set. The accuracy of the test set was used for a comparison, where the accuracy of the test set here is defined as: for a given test set, the ratio of the number of samples that were correctly recognized by the classifier to the total number of samples.  
Table 1 shows the recognition accuracy of roll marks with VGG16, VGG16 + LSTM, and VGG16 + LSTM + Attention.  
Table 1 shows that sample amplification obviously improves the recognition accuracy of all algorithms. However, even without sample amplification, both the VGG16 + LSTM algorithm and the improved VGG16 + LSTM + Attention algorithm significantly improved the recognition accuracy.  
The recognition rate of the VGG16 + LSTM algorithm is higher than that of the VGG16 algorithm. VGG16 does not perform well because its inputted image is required to be inputted in the size of (244, 244), and some information is lost after the image is compressed. The information on periodic defects is more easily lost during compression due to its low number of appearances, so it is not suitable for periodic defect detection. The VGG16 + LSTM algorithm performs better because LSTM can remember the periodic defect information of the previous time and forget the information without a periodic defect of the current time, which recognizes periodic defects more effectively.  
The recognition rate of VGG16 + LSTM + Attention is higher than that of VGG16 + LSTM. The reason for this is that the LSTM mixes the important information inputted at all previous times into the hidden layer state (memory module) at the last timestep. In contrast, the attention mechanism makes clearer that information at which time step is important (the image contains a defect), and provides the corresponding weight according to the degree of importance (the level of similarity between the inputted information at the current time and the hidden-layer state at the last time), which allows the network to better focus on the time when the defect image is input than the time when the background image is input, so that prevents the network from forgetting the defect feature because of the passage of a long period of time.  
Next, the trained model is used to detect a real defect. The model performs well on roll marks with little scales. Figure 13 shows the original image of well-recognized roll marks. The roll marks appear periodically and have little scales. This algorithm recognizes them well.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **VGG16** & **VGG16 + LSTM** & **VGG16 + LSTM + Attention** \\ \hline Recognition accuracy & 71.1\% & 81.9\% & 86.2\% \\ \hline Recognition accuracy & 62.4\% & 73.5\% & 78.1\% \\ with original samples & & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison of VGG16, VGG16 + LSTM, and VGG16 + LSTM + Attention.  
Figure 13: Well-recognized roll marks.  
When a strong scale appears on the plates, its strong interference results in a low recognition rate. Figure 14 below shows the unrecognized roll marks.