## 4 Results and Discussion
### Pruning of the Transferred YOLOv5s Model  
The transferred YOLOv5s model only increased in accuracy but did not improve in complexity, size, or computing power dependency, which determine its running speed. To achieve the fast identification of the surface defects, as can be seen in Figure 6a, we adopted a network pruning approach based on channel removal after calculating the \(L_{2}\) norm. Taking the output channels corresponding to all convolutional kernels with the 3 \(\times\) 3 \(\times\) 32 size in the second layer of the transferred YOLOv5s network as an example, a  
Figure 5: Transfer learning effects: (**a**) the [EMAIL_ADDRESS] result for different combinations of freezing and fine-tuning; (**b**) the training loss result for different combinations of freezing and fine-tuning; (**c**) the visualization difference of the output of the last CSP1-X in the backbone network between the un-frozen and un-tuned YOLOv5s model and the transferred YOLOv5s model; (**d**) results of the surface defect identification based on the transferred and un-transferred YOLOv5s. total of 64 output channels were available in these layers. For the convenience of observation, the 3 \(\times\) 3 \(\times\) 32 values of each output channel were accumulated in a 3 \(\times\) 3 matrix to form a 3 \(\times\) 3 visualization of this channel, as shown in Figure 6b. According to Equation (6), each channel can obtain an \(L_{2}\) norm value corresponding to itself. As depicted in Figure 6c, these norm values reorder all channels in descending order. Of them, 75%, corresponding to the smaller norm values, were considered redundant channels that need to be removed. By rounding, a total of 48 channels were deleted from this layer. We found that the deleted channels did not contain significant feature information, or even not at all. Except for the input and output layers in the YOLOv5s network, this sort of channel removal was performed for every layer, thereby creating a pruned model. By pruning 75% of the channels, the transferred YOLOv5s model was significantly reduced. The performance of the transferred YOLOv5s model before and after the network pruning is shown in Figure 6d. After the channel removal, TNNP, FLOPS, MS, and AITC were decreased by 93.505%, 88.337%, 92.943%, and 9.839%, respectively. Such results offered greater possibilities for rapid identification and easy deployment. However, there was an unacceptable degradation in accuracy; for instance, mAP and \(A_{D}\) dropped by 98.990% and 100% in the validating set of our dataset, respectively. It was strongly necessary to recover the accuracy after pruning. The most convenient way to improve the accuracy of a changed model is to retrain it. After retraining on the same training set in our dataset, as also shown in Figure 6d, the mAP and \(A_{D}\) of the pruned model in the validating set were significantly regained by 98.950% and 99.521%, respectively, and were rather close to the accuracy level of the un-pruned model. This implies that retraining offers a tremendous contribution to accuracy recovery and that pruned channels do not have a serious impact on accuracy. Nevertheless, the retraining could not fully restore the accuracy. Especially in the case of \(A_{D}\), which requires a strict performance of 100%, this constituted an unacceptable loss. In addition, to justify the amount of pruning, we selected different pruning rates in 5% steps between 60% and 85% to form six models: 60%, 65%, 70%, 75%, 80%, and 85%. The changes in \(A_{D}\) and MS, corresponding to the validating set, reflect the effect of the pruning rate on the model performance. The optimal pruning rate needed to make \(A_{D}\) as large as possible and MS as small as possible. However, a decrease in MS is bound to cause an inevitable reduction in \(A_{D}\).