# A Two-Stage Automatic Container Code Recognition Method Considering Environmental Interference
## 4 Experiment
### Experiment of Box Number Character Recognition  
Before the box number character recognition experiment, we recreated the dataset and manually localized and segmented the box number region in the self-constructed dataset; the effect is similar to the segmented box number region image in Section 4.3, but the manual localization and segmentation is more accurate, which can avoid the failure of character recognition due to localization errors. We use Labelme as an annotation tool to annotate the box number characters, and the annotated image is shown in Figure 11, where rectangular boxes of different colors represent different English letters or numbers. Figure 10: Box number area partially obscured with unclear characters. Figure 9: Schematic diagram of the recognition effect of severe tilt in the box number area. In addition, because the English part of the container box number characters in the self-built dataset are mainly two kinds of TBBU and TBGU, in order to ensure that the model recognizes other English characters to improve the generalizability, we also cut down the images of other parts of the characters on the containers, which are used for model training, and some of the images are shown in Figure 12.  
The image downsampling multiplicity is set to 16, and the ratio of validation set to training set is 1:9. The image batch size is 8 images each time, the base learning rate is set to 0.0001, and the training is finished when the learning rate is less than \(1\times\)\(10^{-6}\) in all 10 rounds. Firstly, the number of model parameters and recognition speed of DeepLabv3+ and C-DeepLabv3+ are compared, and the results are shown in Table 6. The number of parameters of DeepLabv3+ is 39.3 MB while the number of parameters of C-DeepLabv3+ is only 2.63 MB, which is reduced by about 95%. Figure 11: Image of container number after labeling. Figure 12: Other categories of characters on containers considered in the dataset. We choose MPA to evaluate the accuracy of C-DeepLabv3+ in character recognition. Since the target of box number character recognition is 0-9 and A-Z with 36 categories, we obtained the recognition results of 36 characters in total, as shown in Figure 13, and the mean value of its MPA is 99.22%, which shows that the overall recognition accuracy of C-DeepLabv3+ is very high. More specifically, although recognizing \"0\", \"1\", \"6\", \"8\", \"B\", \"I\", \"7\", \"O\", \"Q\", \"U\", \"V\", and other similarly shaped characters has lower MPA values, the MPA index for each character is still above 97%. In this paper, Segnet, PSPNet, DeepLabv3+, and C- DeepLabv3+ are also selected for the comparison of mean pixel classification accuracy (MPA) and recognition rate (FPS), and the results are shown in Table 7.  
C-DeepLabv3+ has the highest MPA and recognition speed, which are 2.51% and 24% higher than Deeplabv3+, respectively, while Segnet has the lowest MPA of 91.23%, which cannot satisfy the requirement of the accuracy of the box number character recognition, and the Segnet network has a complex structure while the model has a slow recognition speed of only 6.3 images per second. Taken together, the C-DeepLabv3+ network has the best character recognition effect. C-DeepLabv3+ integrates MobileNetv3 as its core architecture, which confers a substantially increased recognition speed over Segnet, PSPNet, and DeepLabv3+. Additionally, the model augments the Atrous Spatial Pyramid Pooling (ASPP) module and the decoder to enhance the accuracy of box number character recognition, achieving the highest accuracy reported. The methodology outlined in Table 1 was adhered to for comprehensive box number recognition. The localization outcomes from C-YOLOv4, processed by OpenCV, were \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Number of Model Parameters** & **Model Size** \\ \hline DeepLabv3+ & 41,253,330 & 39.3 MB \\ C- DeepLabv3+ (Ours) & 2,758,597 & 2.63 MB \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of model performance.