## 3 Materials and Methods  
### Preact ResNet Model's Description  
During the process of selecting an appropriate model for solving the task, we examined models that have shown strong performance in classification tasks across popular datasets with similar image characteristics, such as CIFAR-10, CIFAR-100, and ImageNet. As shown in ref. [15], among the existing modern architectures, the most promising for the task of handwritten character recognition is ResNet because of its efficiency in handling small images while maintaining strong feature extraction capabilities. Its residual connections help to mitigate vanishing gradients, ensuring stable training, even with a large number of classes. Additionally, its relatively lightweight architecture balances computational efficiency and accuracy, making it practical for large-scale classification tasks. Thus, we implemented a Preact ResNet-18 architecture (Table 1). \begin{table}
\begin{tabular}{c c c} \hline
**Layer\_Name** & **Output\_Size** & **Convolution** \\ \hline conv1 & 32 \(\times\) 32 & 7 \(\times\) 7, 64, stride 2 \\ maxpool & 16 \(\times\) 16 & 3 \(\times\) 3 maxpool, stride 2 \\ layer1\_x & 16 \(\times\) 16 & 3 \(\times\) 3, 64 \\  & & \(\times\)2 \\ layer2\_x & 8 \(\times\) 8 & 3 \(\times\) 3, 128 \\  & & \(\times\)2 \\ layer3\_x & 4 \(\times\) 4 & 3 \(\times\) 3, 256 \\  & & 3 \(\times\) 3, 256 \\  & & \(\times\)2 \\ layer4\_x & 2 \(\times\) 2 & 3 \(\times\) 3, 512 \\  & & 3 \(\times\) 3, 512 \\  & & \(\times\)2 \\ FC & \(1\times 1\) & average pool, N classes fc \\ \hline FLOPs & & \(1.8\times 10^{9}\) \\ \hline \end{tabular}
\end{table} 
Table 1: Architecture for ResNet-18. Building residual blocks are shown in brackets. In residual layers, downsampling is performed by layer2_1, layer3_1, and layer4_1, with a stride of 2. ResNets (deep residual networks) are composed of numerous stacked \"residual units\", also known as \"residual blocks\". These blocks can be expressed in the following general form [16]:  
\[y_{i}=h(x_{i})+F(x_{i},W_{i}), \tag{1}\]  
\[x_{i+1}=f(y_{i}), \tag{2}\]  
where \(x_{i}\)--the input of the ith residual block; \(x_{i+1}\)--the output of the ith residual block; \(F\)--the residual function; \(h\)--the identity function; \(W_{i}=\left\{W_{i,k}|_{1\leq k\leq K}\right\}\)--the set of weights and biases for the residual block (K--the number of layers in the residual block); \(f\)--the operation after element-wise addition (usually an activation function). The success of deep residual networks lies in their depth, as indicated by their name. The ResNet family includes several architectures beyond ResNet-18, such as ResNet-34, ResNet-50, ResNet-101, ResNet-152, and ResNet-1001. The primary difference among these variants is the number of residual blocks per layer. Additionally, the architectures of ResNet-50's and deeper residual blocks differ slightly from that of ResNet-18, as illustrated in Table 2.  
Equations (1) and (2) represent the original residual block's structure. However, using this structure as-is can lead to overfitting and the vanishing gradient problem [17] in very deep neural networks. To mitigate these issues, we can apply identity mappings [18] to \(h(x)\) and \(f(x)\), resulting in \(h(x_{i})=x_{i}\) and \(x_{i+1}=y_{i}\). This leads us to the following [18]:  
\[x_{i+1}=x_{i}+F(x_{i},W_{i}). \tag{3}\]  
In addition, \(h(x_{i})\
eq x_{i}\) is utilized within residual blocks to reduce feature map sizes and increase dimensions, but in this case, only three such blocks are used, limiting their exponential impact. Recursively, \((x_{i+2}=x_{i+1}+F(x_{i+1},W_{i+1})=x_{i}+F(x_{i},W_{i})+F(x_{i+1},W_{i+1}),\)\(etc. )\), leading to the following [18]:  
\[x_{I}=x_{i}+\sum_{j=i}^{l-1}F\big{(}x_{j},W_{j}\big{)} \tag{4}\]  
Equation (4) reveals several beneficial properties. First, for any deeper block (\(I\)), its feature (\(x_{I}\)) can be expressed as the feature (\(x_{i}\)) of any shallower block (\(i\)) plus a residual function in the form of \(\sum_{j=i}^{l-1}F\).