## 2 Materials and Methods
### Model  
The proposed two-step algorithm uses an Hourglass type network structure in both steps. The standard structure was modified to increase calculation speed by replacing two standard Hourglass blocks [5] with a single block that has more convolutional layers and filters. This resulted in a 40% reduction in the network size and a doubling of the speed. General network structure is presented in Figure 3.  
For images that are less than 1000 \(\times\) 1000, a universal size of 256 \(\times\) 256 was used to balance model speed and precision. Additionally, the inner block structure of the Hourglass network was modified to increase speed by using Resnet blocks, as shown in Figure 4a. The network structure for precise license plate identification is the same, but the input data is 128 \(\times\) 128 \(\times\) 3 and the output data is 32 \(\times\) 32 \(\times\) 9 (Figure 4b). The structures of the merge and residual blocks are given in Figures 5a and 5b, respectively. The steps for the merge block are as follows: 8 \(\times\) 8 \(\times\) 16 input \(\lnot\) Bilinear  
Figure 4: CNN structure for license plate number detection. The structure is identical, but the input and output differ: (**a**) structure of the first network for preliminary number detection; (**b**) structure of the second network for precise number detection. Figure 3: Hourglass structure used in candidate license plate detection and precise license plate detection. Upsample 16 \(\times\) 16 \(\times\) 16 \(\times\) 16 \(\cdot\) Conv 1 \(\times\) 1 with BatchNorm (no activation and filters matching previous output block with matching scale, for example, 32 filters) \(\sim\) 16 \(\times\) 16 \(\times\) 32 concat with previous block, which is 16 \(\times\) 16 \(\times\) 32 \(\sim\) 16 \(\times\) 16 \(\times\) 64 \(\cdot\)\(\cdot\) apply batch normalization \(\cdot\)\(\cdot\)\(\cdot\) output 16 \(\times\) 16 \(\times\) 64. Then residual blocks are used, like 3\(\times\) and merge (known as Upscale) block is applied again, which results in 32 \(\times\) 32 \(\times\) 64 output. Residual block steps: input \(\cdot\)\(\cdot\)\(\cdot\) Conv 1 \(\times\) 1 with output filters \(\times\) 0.5 and bias, BatchNorm and LeakyRelu 0.01 \(\cdot\)\(\cdot\) Conv 3 \(\times\) 3 output filters matching input filters with bias, BatchNorm, LeakyRelu 0.01 \(\cdot\)\(\cdot\) Conv 1 \(\times\) 1 with output filters equal to filters (this conv expands again), no batchnorm and no activation \(\cdot\)\(\cdot\) Add no activation. This paper is based on the CenterNet object detection method [33], in which each type of object is considered as a separate class N, and each class has 5 elements: the center point, the axis x difference coordinates, the axis y difference coordinates, the object height, and the object width. In this approach, a Gaussian distribution is applied to the feature map, which depends on the object's size. The main formulas are given in Equations (2)-(5):  
\[c_{x}=\frac{x_{min}+x_{max}}{2}, \tag{2}\]  
\[c_{y}=\frac{y_{min}+y_{max}}{2}, \tag{3}\]  
\[Y_{xy}=exp\left(\frac{-\left(x-c_{x}\right)^{2}+\left(y-c_{y}\right)^{2}}{2 \sigma^{2}}\right), \tag{4}\]  
\[ \begin{cases}Offx_{xy}=c_{x}-x,Offy_{xy}=c_{y}-y,whenY_{xy}>0,\\ W_{xy}=x_{max}-x_{min},H_{xy}=y_{max}-y_{min},whenY_{xy}>0,\end{cases}  \tag{5}\]  
where \(c_{x}\) and \(c_{y}\) are the center of each object, \(\sigma\) is the standard deviation, and \(Y_{xy}\) is a Gaussian distribution. Coordinates of the upper left point (\(x_{min},y_{min}\)) and lower right point (\(x_{max},y_{max}\)) are used to calculate the center coordinates of each object (\(c_{x},c_{y}\)), as given in (2), (3). \(Offx_{xy}\) is the distance from the current pixel center point to the object's upper left x point; \(Offy_{xy}\) is the distance from the object's current pixel point to the object's upper left y point; \(W_{xy}\) and \(W_{xy}\) are width and height, respectively, as given in (5). Data is decoded and predicted height and width are then used to obtain the upper and lower left points of the license plate.