# Scene Text Detection Using Attention with Depthwise Separable Convolutions
## 3 Proposed Methodology
### The Network Design--**MobileTDNet**  
The proposed detector (**MobileTDNet**) is designed to accurately detect scene text segments in complex shapes, different scales and styles, and multiple orientations. In addition, the detector network should be computationally lightweight and efficient. The MobileNet architecture-based convolutional neural models use optimized convolution operations in the network design [19], where the layer-wise convolution operations are separated as multiplication and addition operation on the depth dimension of feature maps. MobileNets have been shown to be highly effective and efficient in many vision problems. Therefore, the proposed scene detector is designed on the MobileNet model as the backbone. Figure 1 presents the illustration of the proposed scene text detector network. The network consists of three major branches: feature extraction, feature merging, and output layers. The feature extraction branch generates convolutional feature maps of multiple spatial resolutions. The branch is designed by the stacking of convolutional blocks, as shown in Figure 1. Each convolutional block consists of a convolution layer with a \(3\times 3\) mask followed by another convolution layer with a \(1\times 1\) mask. The first convolution layer in the block is designed with depthwise separable convolution operation. The subsequent convolution layer with a \(1\times 1\) mask reduces the number of channels in the generated feature map. The MobileNet base is extended by drawing out convolutional features at multiple scales. These intermediate features capture text shape and scale complexities with varying degrees of detail. The following five intermediate feature maps--\(F^{\frac{1}{2}}\), \(F^{\frac{1}{4}}\), \(F^{\frac{1}{8}}\), \(F^{\frac{1}{16}}\) and \(F^{\frac{1}{22}}\) in **MobileTDNet** are drawn out at \(\frac{1}{2}\), \(\frac{1}{4}\), \(\frac{1}{8}\), \(\frac{1}{16}\) and \(\frac{1}{32}\)th scale of the input resolution. The last fully connected layer from the MobileNet base is removed, and we subsequently process the feature map \(F^{OUT}\) with intermediate feature maps extracted above in the hierarchy. For strengthening the extracted features, text attention blocks are incorporated at three steps in the feature extraction branch, as illustrated in Figure 1. The details of attention blocks are discussed later in Section 3.3. In the feature merging branch, the \(F^{OUT}\) is recursively combined with \(F^{i}\in\{F^{\frac{1}{2}},F^{\frac{1}{4}},F^{\frac{1}{8}},F^{\frac{1}{16}},F^{ \frac{1}{22}}\}\) through the skip connections. A skip connection is defined by two inputs, the intermediate feature map \(F^{i}\) and the output from the Upscale block, which processes the skip connection output from the previous level. Figure 1 shows the Upscale block design consisting of a two-dimensional upsample layer based on bilinear interpolation, which is followed by a convolutional layer for data smoothening. The channel dimension of the output feature map is reduced with a convolution filter with a \(1\times 1\) mask to align with the second merge input to skip connections. The convolutional layer outputs in the detector are processed through batch normalization and ReLU activation. The network is designed with two output layers generating the following predictions at one-half of the input resolution: (i) text/non-text semantic map, and (ii) text bounding box regression at each position. The network predictions are processed through a novel text aware non-maximal suppression method to generate the final prediction. The output layers are described below. * First output layer: 2 nd order tensor \((out_{1})\) of size \(\frac{\mathbb{S}_{1}}{2}\times\frac{\mathbb{S}_{2}}{2}\) having single channel output, assuming the input size as \(S_{1}\times S_{2}\). The \((out_{1})\) corresponds to the text/non-text segmentation map generated at one-half the resolution of the input. The tensor values represent text confidence scores at each position.