Back to paper library
AAAI 2019Text recognitionPaper notes

CA-FCN

A New Dimension

Original paper

Scene Text Recognition from Two-Dimensional Perspective

Paper authors

Minghui Liao · Jian Zhang · Zhaoyi Wan …

Show all 8 authors

Minghui Liao · Jian Zhang · Zhaoyi Wan · Fengming Xie · Jiajun Liang · Pengyuan Lyu · Cong Yao · Xiang Bai

Publication
AAAI 2019Conference
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@inproceedings{textrecognitioncafcn2019,
  title = {{Scene Text Recognition from Two-Dimensional Perspective}},
  author = {Minghui Liao and Jian Zhang and Zhaoyi Wan and Fengming Xie and Jiajun Liang and Pengyuan Lyu and Cong Yao and Xiang Bai},
  year = {2019},
  booktitle = {AAAI},
  url = {https://doi.org/10.1609/aaai.v33i01.33018714},
  doi = {10.1609/aaai.v33i01.33018714}
}
On this page

For several years, CRNN and the improvements that followed had dominated scene text recognition. Finding a new direction was not easy.

The authors of this paper chose to set previous approaches aside and rethink the problem from a two-dimensional perspective.

Problem Definition

Previous works, such as CRNN, typically transform input images into one-dimensional sequential data. This approach works well for regular text but encounters difficulties with highly curved text.

As shown in the image above, in (a), we see an image containing highly curved text. When this image is compressed into one-dimensional sequential data, we observe that each sequence introduces significant background noise due to the curved text. This background noise can interfere with text recognition.

Furthermore, due to the curved nature of the text, each sequence (column) may cover multiple characters simultaneously. This forces the model to extract the correct character from overlapping features, which is a difficult task.

The authors argue that compressing images into one-dimensional sequential data is not well-suited for recognizing highly curved text. Therefore, they proposed a new approach:

  • Keep the image in its two-dimensional form and recognize text directly within this 2D space.

That extra dimension brings another benefit: we no longer need to model the text as a temporal sequence inside the recognition network. We can build the recognizer entirely with convolutions; the later word-formation module still has to order its character regions.

Problem Solving

Model Architecture

The authors propose the model architecture shown above.

Using an FCN (Fully Convolutional Network), the authors turn text recognition into a pixel-wise classification problem. The output map assigns each position to one of the predefined character categories or background.

In the "blue" block in the image above, VGG is used as the backbone network, from which feature maps at 1/2, 1/4, and 1/8 scales are extracted.

Moving upwards through the blue block, these feature maps are used to predict the text region map. Each resolution corresponds to a prediction, and these predictions are supervised during training.

Once the predictions are obtained, they form the text region attention map. This map is multiplied with the original feature map to obtain the weighted text region features.

The weighting formula is as follows:

Fo=Fi⊗(1+A)F_o = F_i \otimes (1 + A)

Where FoF_o is the weighted feature map, FiF_i is the original feature map, and AA is the text region attention map.

These feature maps are progressively upsampled and finally output as a text feature map with CC channels, where CC includes the predefined character categories and background.

Training Data Design

The process of creating the training data involves several steps. The authors first prepare training data with character-level annotations, and then use these annotations to create binary text region maps, as shown in (b) above.

Let b=(xmin,ymin,xmax,ymax)b = (x_{min}, y_{min}, x_{max}, y_{max}) represent the original bounding box of the text, defined as the smallest axis-aligned rectangle covering the text.

The actual text region annotation g=(xming,yming,xmaxg,ymaxg)g = (x^g_{min}, y^g_{min}, x^g_{max}, y^g_{max}) can be calculated as:

w=xmax−xminw = x_{max} - x_{min} h=ymax−yminh = y_{max} - y_{min} xming=xmin+xmax−w×r2x^g_{min} = \frac{x_{min} + x_{max} - w \times r}{2} yming=ymin+ymax−h×r2y^g_{min} = \frac{y_{min} + y_{max} - h \times r}{2} xmaxg=xmin+xmax+w×r2x^g_{max} = \frac{x_{min} + x_{max} + w \times r}{2} ymaxg=ymin+ymax+h×r2y^g_{max} = \frac{y_{min} + y_{max} + h \times r}{2}

Where rr is the scaling factor for the text region.

The reason for shrinking the text region is to reduce the likelihood of overlapping regions between adjacent characters, simplifying the task of forming distinct text regions.

In practice, the authors set rr to 0.5 for the attention supervision and 0.25 for the final output supervision.

Loss Function

The overall loss is a weighted combination of the character prediction loss LpL_p and the character attention loss LaL_a:

L=Lp+α∑s=25LasL = L_p + \alpha \sum_{s=2}^{5} L^s_a

Where ss represents the stage index, and α\alpha is empirically set to 1.0.

The final output of CA-FCN has a shape of H/2×W/2×CH/2 \times W/2 \times C, where HH and WW are the height and width of the input image, and CC is the number of character categories (including background).

Let Xi,j,cX_{i,j,c} represent an element in the output map, where i∈{1,...,H/2}i \in \{1, ..., H/2\}, j∈{1,...,W/2}j \in \{1, ..., W/2\}, and c∈{0,1,...,C−1}c \in \{0, 1, ..., C-1\}; and Yi,j∈{0,1,...,C−1}Y_{i,j} \in \{0, 1, ..., C-1\} represents the corresponding label.

The prediction loss can be computed as:

Lp=−4H×W∑i=1H/2∑j=1W/2Wi,j(∑c=0C−1(Yi,j==c)log⁡(eXi,j,c∑k=0C−1eXi,j,k)),L_p = - \frac{4}{H \times W} \sum_{i=1}^{H/2} \sum_{j=1}^{W/2} W_{i,j} \left( \sum_{c=0}^{C-1} (Y_{i,j} == c) \log\left(\frac{e^{X_{i,j,c}}}{\sum_{k=0}^{C-1} e^{X_{i,j,k}}}\right) \right),

Where Wi,jW_{i,j} is the weight assigned to each pixel.

Let N=H/2×W/2N = H/2 \times W/2 and NnegN_{neg} be the number of background pixels. The weight is calculated as:

Wi,j={NnegN−NnegIf Yi,j>0,1OtherwiseW_{i,j} = \begin{cases} \frac{N_{neg}}{N - N_{neg}} & \text{If} \ Y_{i,j} > 0, \\ 1 & \text{Otherwise} \end{cases}

The character attention loss is a binary cross-entropy loss, where all character labels are treated as 1 and background labels are treated as 0:

Las=−4Hs×Ws∑i=1Hs/2∑j=1Ws/2(∑c=01(Yi,j==c)log⁡(eXi,j,c∑k=01eXi,j,k)),L^s_a = - \frac{4}{H_s \times W_s} \sum_{i=1}^{H_s/2} \sum_{j=1}^{W_s/2} \left( \sum_{c=0}^{1} (Y_{i,j} == c) \log\left(\frac{e^{X_{i,j,c}}}{\sum_{k=0}^{1} e^{X_{i,j,k}}}\right) \right),

Where HsH_s and WsW_s are the height and width of the feature map at stage ss.

Word Formation Module

The word formation module converts the precise 2D character map predicted by CA-FCN into a character sequence.

  • First, the predicted character map is converted into a binary map, extracting the corresponding character regions based on a threshold.
  • Next, the average value of each region is calculated across the CC categories, and the region is assigned to the category with the highest average value.
  • Finally, these regions are arranged from left to right to form a word.

This approach can generate both the word and the position of each character.

The word formation module assumes that words are generally arranged from left to right, but this may not always be applicable. If necessary, a learnable component can be inserted into CA-FCN to handle more complex cases.

The word formation module is simple yet effective, with only one hyperparameter (the threshold for forming the binary map), which was set to 240/255 in all experiments.

Evaluation Metrics

The authors used five commonly used benchmarks for scene text recognition to evaluate their model's performance:

  1. ICDAR 2003 (IC03)

    • The test set contains 251 scene images with annotated text bounding boxes.
    • To ensure fair comparison with previous work, images containing non-alphanumeric characters or fewer than three characters are typically ignored. After filtering, 860 cropped text images are used as the test set.
    • Each test image is provided with a lexicon of 50 words. Additionally, a full lexicon is created by combining all test image lexicons for evaluation.
  2. ICDAR 2013 (IC13)

    • The dataset inherits and corrects some IC03 data and originally contains 1,015 cropped text images. For this evaluation, the authors also remove samples with non-alphanumeric characters or fewer than three characters.
    • Unlike IC03, IC13 does not provide lexicons, so evaluations are conducted without lexicon assistance (no-lexicon setting).
  3. IIIT 5K-Word (IIIT5k)

    • The test set contains 3,000 cropped text images collected from the internet, covering varied fonts and backgrounds.
    • Each image is accompanied by two lexicons: one with 50 words (small lexicon) and one with 1,000 words (large lexicon) for lexicon-assisted evaluation.
  4. Street View Text (SVT)

    • The test set consists of 249 scene images from Google Street View, from which 647 cropped text images are extracted.
    • Each text image is provided with a 50-word lexicon for lexicon-assisted evaluation.
  5. CUTE

    • The test set contains 288 images, with many curved text images. No lexicon is provided for this dataset.

Training Strategy

CA-FCN can accept variable-sized images because it is fully convolutional. Usable dimensions still depend on downsampling, implementation constraints, and available memory.

The authors adopted multi-scale training to enhance model robustness, with input images randomly adjusted to:

  • 32×12832 \times 128
  • 48×19248 \times 192
  • 64×25664 \times 256

In addition, data augmentation techniques were applied during training, including random rotation, hue, brightness, contrast, and blurring adjustments. The rotation angle ranged between [−15∘,15∘][-15^\circ, 15^\circ].

Other parameters include:

  • The Adam optimizer was used for training, with an initial learning rate of 10−410^{-4}.
  • The learning rate was reduced to 10−510^{-5} in the 3rd epoch and to 10−610^{-6} in the 4th epoch.
  • The model was trained for 5 epochs in total.
  • The number of character categories was set to 38, including 26 letters, 10 digits, 1 special character (representing non-alphanumeric characters), and 1 background class.

During testing, the images were resized to a fixed height of 64 (Ht=64H_t = 64), and the width (WtW_t) was calculated as follows:

Wt={W×HtHIf W/H>4,256OtherwiseW_t = \begin{cases} W \times \frac{H_t}{H} & \text{If} \ W/H > 4, \\ 256 & \text{Otherwise} \end{cases}

Where HH and WW are the original height and width of the image.

Discussion

Comparison with Other Methods

CA-FCN reaches the highest accuracy in the table for some benchmark columns and training conditions.

  • On IIIT without a lexicon, the base model's 92.0% exceeds the previous table high of 88.3% by 3.7 percentage points.
  • On the irregular-text CUTE set, the base model's 78.1% exceeds the previous 76.8% by 1.3 percentage points. The 79.9% model fine-tuned on extra synthetic data gives the 3.1 percentage-point difference.
  • Results on SVT and IC13 are competitive, but the model does not lead every no-lexicon column.

To compare with (Cheng et al., 2017) under similar training data, the authors generated 4 million additional synthetic images using SynthText's method and Synth90k's lexicon. After fine-tuning, "Ours+data" reaches 86.4% on SVT without a lexicon, above Cheng et al.'s 85.9% but below Bai et al.'s 87.5% in the same column.

(Bai et al., 2018) also performs well on regular text. CA-FCN scores higher in the table's three IIIT columns and the SVT 50-word column, but lower in SVT without a lexicon and in IC13. The table gives no CUTE result for Bai et al., so it cannot support a direct comparison there.

Visualization Results

The authors provide visualization results from the CA-FCN model, as shown above, applied to the IIIT and CUTE80 datasets.

Conclusion

CA-FCN addresses the text recognition problem using a two-dimensional approach. By performing character classification at each pixel, the algorithm effectively recognizes both regular and irregular text.

The experiments show strong results on both regular and irregular text datasets, with the comparison conditions described above.