# Compact and Accurate Scene Text Detector
## 3 Proposed Method
### Balanced Decoder  
The balanced decoder considers the four feature matrices (e.g., \(F_{5}\), \(F_{4}\), \(F_{3}\), and \(F_{2}\)) delivered from the backbone, as shown in Figure 2. The decoder has three stages and the four matrices are injected in to different stages of the decoder through skip connections; for example, \(F_{5}\) and \(F_{4}\) are passed to the first (bottom) stage while \(F_{2}\) is injected in to the third stage (top) stage. Through the three stages, the four feature matrices are converted into a set of candidate word boxes with confidence scores, where the confidence score means how likely the corresponding area contains text. Each candidate word box is represented using a rotated box (RBOX) geometry that consists of four coordinates of a word box and a rotation angle; thus RBOX geometry is a five-dimensional vector (i.e., \(c=5\)). Every candidate word box has a confidence score (Score map) that is represented by a scalar value (i.e., \(c=1\)). Figure 3: Structure of an IRB, which consists of three steps: expansion, depth-wise resolution, and projection. Here \(t\) represents an expansion factor, and \(c\) indicates the number of channels. The \(W\) and \(H\) are the width and height of the feature map, respectively. Figure 2: Structure of the proposed CAST. The five stages on the left represent MobileNetV2, while the center box is the balanced decoder. With the inverted residual block (IRB), and IRB* is a special case without any expansion. Convolutions of kernel size 3x3 are denoted by \(Conv\). Here \(c\) indicates the number of channels, and OS represents the output stride. The four feature matrices are of different scales; for example, \(F_{5}\) and \(F_{2}\) are of the smallest dimension and the largest dimension, respectively. The three stages of the decoder are meant to deal with such different scales. In the first stage, due to the large number of channels (1280) of \(F_{5}\), IRB\({}^{*}\) does not have an expansion step. It delivers 128 channels to the next IRB, which finds patterns of the smallest dimension from \(F_{5}\) and \(F_{4}\). Together with the patterns found during the first stage, a smaller feature matrix \(F_{3}\) is injected in to the second stage. To modulate at a bigger scale compared to the first stage, the second stage consists of an IRB and a standard convolutional layer. Finally, the last stage generates candidate word boxes based on the smallest feature matrix \(F_{2}\) and the found patterns. Note that an IRB is adopted only in the first and second stages. The reason is that the feature matrix \(F_{2}\) is the largest among the four feature matrices, so adding on IRB to the last stage may result in a huge computational complexity (e.g., FLOPS). That is, adding the IRB to the last stage will make the last stage much more complex than the other stages, and such imbalance between stages may hinder finding appropriate candidates for word boxes. Because our goal is to achieve efficiency without loss of effectiveness, we do not use the IRB in the last stage so that the three stages are balanced in terms of computational complexity. One may argue that using an IRB in the decoder may have a little impact. In Figure 4, two decoders (a) and (b) are used, EAST [12] and CRAFT [2], respectively. They both have a stack of standard convolutional layers without employing an IRB. These decoders may achieve sufficient effectiveness (e.g., F1 score), but will probably be less efficient. The IRB is known to be not only compact, but also as effective as standard convolutions, so we adopt the IRB for designing the balanced decoder. However, applying this approach everywhere will not always be appropriate. For example, the two decoders (c) and (d) in Figure 4 have similar structures to (a) and (b), respectively, but have the IRB in all stages.