# Scene Text Recognition That Eliminates Background and Character Noise Interference
## 3 Proposed Framework
### Scene Text Recognition Model  
The structure of the scene text recognition model, which removes character and background noise interference, is depicted in Figure 8 below. By combining a multilayer character feature fusion module with a high-level character feature extraction module, the ENBC network reconstructs the scene picture while improving the character shape features and removing background and character noise. After the image has been rebuilt, it is fed through the recognition enhancement module, which uses the ResNet network to handle noise and distortion in the input data and successfully extract character image features at various scales. The transformer is then used as a decoder to generate a rough text prediction. In order to extract character image characteristics at various scales, the rebuilt picture is sent into the ResNet network. The ResNet feature map is split into two branches: an overall representation extractor with six bottlenecks, average pooling, and a holistic representation extractor with a fully connected layer that handles noise and distortion in the input data, and a \(1\times 1\) convolutional layer that converts the 2D feature map's dimension from to [1024] for input to the 2D attention. The output channel and kernel size are indicated by the letters \"Conv\", which stand for convolutional layer. The convolutional layer's step size and padding are both set to \"1\". After that, the reconstructed picture is sent through the mask self-attention mechanism, 2D attention module, and point-by-point feed-forward layer decoding section using transformer as the decoder. The point-by-point feedforward layer is applied to each decoding location, and the mask self-attention mechanism is utilized to simulate the relationships between various characters inside the output word. Layer normalization is the step that comes after additive operations and residual concatenation in each of the aforementioned three layers. Figure 8: Structure of scene text recognition model eliminating background and character’s own noise interference. According to Figure 8, the recognition improvement module embeds the previously created characters at each decoding step into a d/2-dimensional vector, which is then further summed with the encoding of the current location. This process is known as positional encoding and embedding. Here is the formula for position encoding. \[PT(t,i)=\left\{ \begin{array}{l}\sin(t/10,000^{j/(d/2)})\\ \cos(t/10,000^{(i-1)/(d/2)})\end{array} \right. \tag{9}\]  
where the position is represented by \(t\), the dimension by \(i\in\{1,\ldots,(d/2)\}\), and the position encoding by \(PT\). During training, they are combined into an overall representation in which real characters are concurrently inserted and right-shifted. The decoder's two-dimensional attention mechanism and the masked self-attention mechanism both rely on the multi-headed dot product attention formulation [57]. A query \(q\in R^{d}\) and a set of \(d\) dimensional vectors of key-value pairs \(\left\{(x_{i},y_{i})\right\}_{i=1,2,\ldots,M}\) (where M is the number of key-value pairs) are given to scaled dot product attention, which then computes a weighted sum of the output values. Each value's weight is determined by scaling the dot product of the query and its corresponding key. This is the formulation for the scaled dot product mentioning. \[Attention(Q,K,V)=\sum_{i=1}^{M}\alpha_{i}y_{i}\in R^{d} \tag{10}\]  
\[\alpha=softmax(\frac{\langle q,x_{1}\rangle}{\sqrt{d}},\frac{\langle q,x_{2} \rangle}{\sqrt{d}},\ldots,\frac{\langle q,x_{M}\rangle}{\sqrt{d}}) \tag{11}\]  
where the attention weight is \(\alpha\), and among them, \(X=[x_{1},x_{2},\ldots,x_{M}]\) and \(Y=[y_{1},y_{2},\ldots,y_{M}]\). We can get the formula if there is a set of queries \(Q=[q_{1},q_{2},\ldots,q_{M^{\prime}}]\) (there are \(M^{\prime}\) inquiries total).