## 2 Proposed ARRS
### Character Recognition
#### 2.4.2 Recognition of Printed Characters through YOLOv4-s  
The YOLOv4 model is used for object detection on images in computer vision. The object type must be identified, and the locations of these objects must be marked. The YOLOv4 model performs object recognition through OCR rather than using traditional character recognition; this thus improves the robustness of the recognition system. The YOLOv4 model is an instant and high-precision target detection system with 161 network layers. It applies a \(1\times 1\) convolution operation, which reduces the number of calculations required and increases operational speed. Figure 5 displays the network architecture of the YOLOv4 model. This model uses a cross-stage partial network (CSPNet) to reduce the duplication of gradient information and applies spatial pyramid pooling to separate the features of upper and lower layers. In addition, it applies a path aggregation network and feature pyramid network (FPN) to facilitate the transmission of low-level features to the top networks. Nevertheless, to reduce downsampling and enhance the recognition of small objects, the YOLOv4 model requires modification. Accordingly, the present study developed the YOLOv4-s model, a modified version that was realized by using k-means clustering to optimize the anchor parameters of YOLOv4 and by optimizing the backbone architecture of YOLOv4 to ensure small-object recognition. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer** & **Filter** & **Kernel Size** \\ \hline Convolution Layer1 & 96 & \(11\times 11\) \\ Max Pooling Layer1 & & \(3\times 3\) \\ Convolution Layer2 & 256 & \(5\times 5\) \\ Max Pooling Layer2 & & \(3\times 3\) \\ Convolution Layer3 & 384 & \(3\times 3\) \\ Convolution Layer4 & 384 & \(3\times 3\) \\ Convolution Layer5 & 256 & \(3\times 3\) \\ Max Poling Layer3 & & \\ Flatten Layer1 & & \\ Full Connected Layer1 & 4096 & \\ Full Connected Layer2 & 4096 & \\ Full Connected Layer3 & 10 & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameter settings of AlexNet. Figure 5: Architecture diagram of traditional YOLOv4. Anchor Parameter Optimization Using K-Means Clustering  
In the target detection model, the target is \"framed\" at a possible position by the preset border and then adjusted according to these preset borders. The YOLOv4 model uses an anchor box to generate borders at different positions of the image. The regional features corresponding to these borders are extracted and used for the regression of border positions. Figure 6 illustrates a real object determined using the anchor box; the blue box represents the real object, and the black box represents the anchor box. The real object is detected using the anchor box through the following formula:  
\[ \begin{array}{l}b_{x}=\sigma(t_{x})+c_{x}\\ b_{y}=\sigma(t_{y})+c_{y}\\ b_{w}=p_{w}e^{t_{w}}\\ b_{h}=p_{h}e^{t_{h}}\end{array}  \tag{6}\]  
where \(b_{x}\), \(b_{y}\) are the x, y center coordinates of box, \(b_{w}\), \(b_{h}\) width and height of the box, \(t_{x}\), \(t_{y}\), \(t_{w}\), and \(t_{h}\) represent the network outputs, \(c_{x}\) and \(c_{y}\) are the top-left coordinates of the grid, \(p_{w}\) and \(p_{h}\) represent the width and height of the anchor box, respectively, and \(c_{x}/c_{y}\) represents the distance between a cell and the top-left corner of the object. To ensure that the anchor box is close to the ground-truth box and reduce the deviation of the prediction network, the model uses k-means clustering to identify the most suitable \(p_{w}\) and \(p_{h}\) values. In general, k-means clustering is used in data mining. In this method, n points are divided into k clusters such that each point belongs to the nearest cluster center. The steps for calculating the appropriate anchor box through k-means clustering are outlined as follows:  
Step 1. The width and height of the box are normalized. When a cluster analysis is executed on multiple boxes, the width and height of the box are used as features.