# A Two-Stage Automatic Container Code Recognition Method Considering Environmental Interference
## 4 Experiment
### Experimental Localization of Container Numbers  
The input image size is set to (416, 416, 3), with a ratio of 1:9 for the validation set and training set. Predicted boxes with an Intersection Over Union (\(\mathit{IoU}\)) greater than 0.4 with the ground truth boxes are retained, and image distortion adjustment is not performed. The batch size for image processing is set to 8 images per iteration, with a base learning rate of 0.001. Training is terminated when the learning rate remains below 1e-6 for 10 epochs. First, we compare the model parameters and detection speed of C-YOLO v4 and YOLOv4, as shown in Table 4. YOLOv4 has 39 MB parameters, while C-YOLO v4 only has 13.6 MB parameters, reducing it by approximately 78%. In this paper, the detection accuracy of the proposed C-YOLOv4 model is also verified by P-R curve and \(F_{1}\) curve, and the results are shown in Figure 6. Compared with the single recall and precision, the \(F_{1}\) value can be a more comprehensive measure of the model performance. From the P-R curve, it can be seen that the precision of the model \begin{table}
\begin{tabular}{l l l} \hline \hline
**Model** & **Number of Parameters** & **Model Size** \\ \hline YOLOv4 & 64,363,101 & 39 MB \\ C-YOLOv4 (Ours) & 14,265,246 & 13.6 MB \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Number of model parameters and real-time computation speed. has been kept around 1 during the recall from 0 to 0.9, which indicates that C-YOLOv4 is very accurate in predicting the positive samples. And the \(F_{1}\) value, after removing the two threshold poles of 0 and 1, is basically above 0.95, which proves that the model's detection effect is very stable. In summary, the number of C-YOLOv4 parameters is reduced, and the detection speed is substantially increased, but the detection accuracy of the model is not negatively affected. Figure 7 shows some cases of successfully localized and segmented box number regions using C-YOLOv4. Figure 6: Analysis of C-YOLOv4 model results. (**a**) P-R; (**b**) \(F_{1}\). Figure 7: Cargo number areas successfully localized by C-YOLO. In this paper, YOLOv3, YOLOv4, YOLOv5s, and C-YOLOv4 are also selected for the comparison of accuracy (Accuracy) and speed (FPS) for the localization of box number region, and the results are shown in Table 5.  
As can be seen from Table 5, YOLOv3 has the lowest accuracy of 94.50%, while YOLOv5s also has an accuracy of 98.43%, which is slightly lower than YOLOv4's 98.81%, because it sacrifices some of the accuracy for improving the recognition speed; C-YOLO's model has the highest accuracy of 99.76%, which is 1.06% higher than YOLOv4. In addition, YOLOv3 has the slowest recognition speed of 23.5 ms a frame, and YOLOv5s recognition speed is higher than YOLOv4, but still slower than C-YOLO's 17.6 ms a frame. In summary, C-YOLO achieves an excellent balance in recognition accuracy and recognition speed. The box number region localization accuracies of YOLOv3, YOLOv4, and YOLOv5s are lower than that of C-YOLOv4 because we have collected a large number of box number images in our dataset that are tilted, with missing characters or with contaminated box number regions, whereas YOLOv3, YOLOv4, and YOLOv5s are not able to adapt to these complexities, and they often suffer from omissions and have poor localization results, and our proposed C-YOLOv4, for the box number recognition task, optimizes loss function, multi-scale recognition, and other modules and can always locate the box number region accurately. Some comparison results are shown in Figures 8-10. In terms of localization effect, C-YOLOv4 can accurately locate the area where the box number is located in the image when facing the problems of oil contamination, serious tilting of the box, and blocking of the box number area, while YOLOv3, YOLOv4, and YOLOv5s are sometimes missing in the edge portion, and YOLOv3 and YOLOv5s are more serious, with poorer localization accuracy.