## 2 Model Building
### The Decoding Module: CTC  
Connectionist temporal classification (CTC) [19] is a kind of output layer. It has two main functions. One is to calculate the loss, the other is to decode the output of RNN. CTC introduces an identifier \"blank\" (\(\Phi\)) to indicate that there is no character predicted at that position, thus achieving the purpose of occupancy and alignment. The \"blank\" can only  
Figure 4: The chain structures of two typical recurrent neural networks. The arrow represents passing a complete vector, and the yellow box represents the neural network layer; Purple circles represent point-by-point operations; A merge line means that two inputs are in series, and a forked line means that content is sent to different locations.  
repeat or go to the next non-empty sequence. With the introduction of \"blank\", the model does not need to struggle with which label should be aligned to a certain time step, and all paths conforming to the CTC topology are a legal alignment path, and the purpose of network training is to find the optimal path.  
Using \(N\) to denote all possible output characters in the recognition task, the total character set of the reading string recognition task can be expressed as:  
\[N^{\prime}=N\cup\{\Phi\}, \tag{8}\]  
Taking the digital instrument reading string recognition in this paper as an example, \(N\) contains 10 numbers and \"E\", \"-\", \", a total of 13 characters, while there are 14 characters in \(N^{\prime}\).  
For the predicted sequence \(Y=\left\{y_{1},\ldots,y_{j},\ldots,y_{T}\right\}\) output from the sequence modeling module, each \(y_{j}\) of predictions corresponds to a character in \(N^{\prime}\), then there is a total of \(\left|N^{\prime}\right|^{T}\) prediction sequences, so the probability of each possible path (sequence) \(\pi\) is:  
\[p(\pi|Y)=\prod_{t=1}^{T}p(\pi_{t},t|Y), \tag{9}\]  
where \(\pi_{t}\) is the label in path \(\pi\) at time step \(t\).  
After removing the repeated labels and blanks of the sequence \(\pi\), the final predicted string is obtained, and this mapping process can be expressed as a many-to-one function \(\Omega(\pi)\). For example, the sequences \(\pi_{a}=\)\"\(00\Phi EE\Phi 555\Phi\Phi\Phi\)\" and \(\pi_{b}=\)\"\(00\Phi\Phi EE\Phi\Phi 55\Phi\Phi 88\)\" all satisfy \"\(\Omega(\pi_{a})=\Omega(\pi_{b})=0E58\)\". Assuming that the corresponding label is denoted as \(Z\) over \(N\), a conditional probability is defined as the sum of probabilities of all \(\pi\), which are mapped by \(\Omega(\pi)\) onto \(Z\):  
\[p(Z|Y)=\sum_{\pi:\Omega(\pi)=Z}p(\pi|Y), \tag{10}\]  
Generally, for a given sequence \(Z\), there are a huge number of possible paths. Direct computation of the summation in Equation (10) will cost too much time, thus, we choose the forward-backward algorithm described in [32] to calculate it in a reasonable time.  
In the inference phase, the sequence \(Z*\) defined in Equation (10) with the highest probability is chosen as the prediction. However, it is extremely difficult to find the optimal solution precisely. In this paper, we choose the Greedy Algorithm adopted in [33] to approximate the result:  
\[Z*\approx\Omega(\text{argmax}_{\pi}p(\pi|Y)), \tag{11}\]  
At each time step \(t\), we just choose the most probable label, and obtain the final prediction output after \(\Omega(\pi)\) mapping.