⑵ loss curve
A good model should not only have high accuracy but also good generalization ability. Poor generalization ability of the model leads to overfitting. The model’s mAP is plotted as shown in Figure 9(b). It is proved that precision of the model has been improved.
The model parameters are adjusted to improve the model’s generalization ability while improving the model’s accuracy. The model’s loss curves as shown in Figure 9(a) are drawn. By visualizing the channel feature graph, the content of each channel is represented by binary images to judge the performance of the convolution kernel. The training process of the model is divided into three stages, namely, the stage of substantial decline, the stage of small decline and the stage of keeping convergence. In the stage of substantial decline, the learning rate drops by gradient, and then the loss curve changes to the stage of slight decline. When learning reaches a certain stage, the loss curve region is stable and begins to converge. Figure 9(a1) shows the loss curve of Faster RCNN. The model is iterated for 150 times. As the number of iterations increases, the loss curve decreases continuously until it becomes stable and convergent. The feature maps of A1, B1 and C1 correspond to the stage of substantial decline, the stage of small decline and the stage of keeping convergence respectively. Figure 9(a2) shows the loss curves of the RetinaNet model with 300 iterations. A2, B2 and C2 feature maps correspond to the stage of substantial decline, the stage of small decline and the stage of keeping convergence respectively.
The improved RetinaNet model is used to predict the validation set of the surface defect dataset. Precision and recall values are obtained. P-R curve is drawn, as shown in Figure 10. The horizontal axis of the P-R curve is recall and the vertical axis is precision. Under a certain threshold value, the model determines that the results greater than the threshold value are positive samples, and those less than the threshold value are negative samples. The points on the curve represent the recall rate and accuracy rate corresponding to the returned results. The origin represents the precision and recall of the model when the threshold is maximum. Models with high Precision and low Recall are not able to complete some tasks requiring precise positioning. Models with low Precision and high Recall are characterized by low model recognition rate.