Back to paper library
Paper notesarXiv 2020CVPR 2020

Vocabulary Reliance

Side Effects of Cramming Vocabulary

Original paper

On Vocabulary Reliance in Scene Text Recognition

Paper authors

Zhaoyi Wan · Jielei Zhang · Liang Zhang · Jiebo Luo · Cong Yao

Publication
CVPR 2020Conference
First submitted to arXiv
arXiv:2005.03959
Cite this paper · BibTeX

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

@misc{textrecognitionvocabularyreliance2020,
  title = {{On Vocabulary Reliance in Scene Text Recognition}},
  author = {Zhaoyi Wan and Jielei Zhang and Liang Zhang and Jiebo Luo and Cong Yao},
  year = {2020},
  eprint = {2005.03959},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.03959}
}
On this page

Scene text recognition scores climbed fast in the second half of the 2010s. The paper opens by noting that on IIIT-5k without a lexicon, accuracy rose from 78.2% to 96.0% in a very short time.

With scores that high, are the models really seeing the words clearly?

This paper, from Megvii, China University of Mining and Technology, and the University of Rochester, finds that the strongest models read “words seen during training” especially well and “unseen words” noticeably worse, and that the gap is unrelated to image quality. The authors call this phenomenon vocabulary reliance.

Defining the Problem

Four scene text images with recognition results: on the left, the blurry BEAUTY and everyday are read correctly; on the right, the clear UNIVERSITI is read as UNIVERSITY and QINGYUANLU as AINGYUANLU, with the wrong letters marked in red
Figure 1 from the paper, excerpted from page 1 of the v1 PDF. In-vocabulary words are on the left, out-of-vocabulary words on the right; red letters are recognition errors.

Start with these four images. The two on the left are very blurry, and the right half of BEAUTY is barely visible, yet the model reads both correctly. The two on the right are much clearer, and the model gets them wrong: UNIVERSITI on a sign becomes UNIVERSITY, and QINGYUANLU on a street sign becomes AINGYUANLU.

The recognizer in the figure is ASTER, one of the best-performing models of its time. The authors see its recurrent memory mechanism as a double-edged sword, one that can read back words it has seen even from damaged images but may misread words it has never seen even when the image is clear.

Are these isolated cases or a general pattern? Using the same ResNet-50 backbone and SynthText training data, the authors reimplemented four representative methods, then split the IIIT-5k test images into two groups by whether the word appears in the vocabulary:

MethodAllIn-vocabularyOut-of-vocabulary
CRNN86.891.168.7
FAN89.993.175.3
CA-FCN89.391.676.3
ASTER89.292.974.6

Table 1 from the paper: IIIT-5k accuracy (%).

All four methods lose roughly 15 to 22 percentage points on out-of-vocabulary words. From this, the authors conclude that vocabulary reliance is ubiquitous; only its degree varies.

Solving the Problem

To compare “degrees,” you first need an experimental framework that can separate the variables.

Breaking It into Four Stages

The authors follow the decomposition from What Is Wrong With Scene Text Recognition Model Comparisons? and split a recognition model into the four stages of transformation (TRAN), feature extraction (FEAT), context modeling (CNTX), and prediction (PRED).

The last two stages matter most for vocabulary reliance, so the first two are held fixed, with no transformation and ResNet-50 as the backbone throughout. For the last two, three prediction layers and three context modules can be combined:

  • Prediction layers:
    • Attention decoder (Atten.): outputs one character at a time, consulting the characters already output at every step.
    • CTC: each feature column outputs its own character; repeats are then merged and blanks removed.
    • Segmentation-based (Seg.): segments each character and reads the characters and their positions from the segmentation map, as in CA-FCN.
  • Context modules:
    • None.
    • Bidirectional LSTM (BLSTM): sweeps the feature sequence once left to right and once right to left.
    • Pyramid pooling (PPM): pools the feature map at several sizes, upsamples each back to the original size and concatenates them, adding global information over different ranges. Segmentation-based methods are incompatible with BLSTM, so they use PPM.

Three Training Sets with a Controlled Vocabulary

SynthText draws its vocabulary from a large text corpus of tens of thousands of words, which hides any vocabulary effect. The authors synthesize their own data instead.

They collect the ground-truth words of five test sets, IC13, IC15, SVT, SVTP, and CUTE, for a total of 3,172 unique words, and treat them as the “vocabulary.” IIIT-5k is left out of the collection and is split by whether each word is in this vocabulary: IIIT-I (1,354 images) and IIIT-O (1,646 images).

They then use the SynthText engine to generate three training sets of about 7 million images each:

  • LexiconSynth (LS): every word is drawn from the 3,172-word vocabulary.
  • RandomSynth (RS): fake words made of random characters, with the same length distribution as LS and letters, digits, and punctuation in a ratio of about 6:3:1.
  • MixedSynth (MS): LS and RS mixed at ratio rr, with r=0.5r=0.5 by default.

Each word is rendered in all caps, all lowercase, and with an initial capital, and has a 10% chance of added punctuation.

Four Metrics

With these three datasets, a model's different abilities can be measured separately:

  • OA (Observation Ability): accuracy on all test images when trained on RS. With no vocabulary to memorize, the score depends entirely on seeing.
  • VA (Vocabulary Learning Ability): accuracy on the five in-vocabulary test sets when trained on LS.
  • VG (Vocabulary Generalization): the model's gap between IIIT-I and IIIT-O when trained on LS, minus its gap when trained on RS.
  • HM: the harmonic mean of the three, used as an overall score.

VG is a clever design, so let's stop and work through it once. The IIIT-I and IIIT-O images may differ in difficulty for reasons that have nothing to do with vocabulary. A model trained on RS has never seen a real word, so its gap between the two groups can stand in for the difference in image difficulty itself:

VG=1−(Gap(LS)−Gap(RS))VG=1-\big(\mathrm{Gap}(LS)-\mathrm{Gap}(RS)\big)

Take the attention model without a context module. In Table 3, when trained on LS it scores 93.7% on IIIT-I and 61.0% on IIIT-O, a gap of 32.7 percentage points; when trained on RS, the gap is 9.8. Plugging them in gives 1−(0.327−0.098)=0.7711-(0.327-0.098)=0.771, which is the 77.1 in Table 5.

For CTC, also without a context module, the two gaps are 18.0 and 10.3, giving 1−(0.180−0.103)≈0.9231-(0.180-0.103)\approx0.923, so it generalizes much better.

Discussion

Mix In Random Strings, and Reliance Drops

The authors first verify the effect of the data. Mixing RS into LS at a given ratio raises the IIIT-5k accuracy of the attention model without a context module from 77.8% to 84.4%; past a ratio of about 0.5, it stops improving. Figure 4 also shows that once RS is mixed in, the probability that the model “answers with an in-vocabulary word” falls as well.

The vocabulary can't be removed entirely, though. The authors argue that a model still needs a sufficient share of real words to learn vocabulary knowledge that helps recognition.

Three Prediction Layers

Table: Excerpted from Table 5 of the paper. HM can be recomputed from the VA, VG, and OA in the same row as a check.
No.PredictionContextVAVGOAHM
①Atten.None85.777.169.676.9
③Atten.BLSTM87.079.169.878.0
④CTCNone77.892.465.877.1
⑥CTCBLSTM79.990.267.678.1
⑦Seg.None79.797.369.980.8

Three things can be read from the table:

  1. The attention decoder is the best at memorizing words, with the highest VA and the lowest VG. At every step it takes the characters it has already output as input, so it picks up the vocabulary naturally.
  2. The segmentation-based approach generalizes best, with a VG of 97.3, and its observation ability is about the same as the attention decoder's.
  3. CTC stands out at neither end. The authors say its performance is largely covered by the other two, and its observation ability is the weakest.

Context Modules Are Tied to the Prediction Layer

Whether a context module helps depends on what it is paired with.

The attention decoder already learns vocabulary on its own, so adding a context module changes little. CTC is a different story. With PPM, VA rises from 77.8 to 84.8, and BLSTM also helps (79.9). At the same time, VG falls from 92.4 to 89.5 and 90.2. The authors explain that CTC decoding itself lacks context modeling; the module in front of it fills that gap and brings vocabulary reliance along with it.

So the authors see a trade-off between VA and VG. An attention decoder with BLSTM suits applications whose test vocabulary mostly falls within the training range; when you need to read many words the model has never seen, choose a segmentation-based architecture like CA-FCN.

Letting Two Models Learn from Each Other

Finally, the authors propose a training method that aims to combine the attention decoder's vocabulary ability with the segmentation model's generalization.

The approach draws on knowledge distillation and deep mutual learning, training two models together from scratch and adding, on top of each one's own loss, a KL-divergence term that pulls their output distributions toward each other. The segmentation model relies more on visual features, so for the attention decoder its predictions act as a kind of extra visual regularization.

The effect is substantial. The attention decoder's VG rises from 77.1% to 93.6%, and its HM from 76.9 to 82.6. When trained on LS, its gap between in-vocabulary and out-of-vocabulary words is nearly halved, from 32.7 percentage points to 16.9.

What to Know When Reading This Paper

  1. All training data is synthetic. LS has a vocabulary of only 3,172 words, far smaller than in real applications. It is there to amplify the vocabulary effect, and its numbers can't be converted directly into error rates for ordinary models.
  2. The models are from 2020. Later recognizers mostly use larger pretrained language models, so the paper's group-level conclusions need to be re-verified.
  3. There is no real random-string test set. The authors note that accuracy on random strings could itself serve as a metric, but at the time no standard dataset combined real-image complexity with purely random labels, so they left it out.
  4. The tables contain small inconsistencies. Table 6 lists VA values for the same models that differ from Table 5 (for example, 83.2 versus 85.7 for ①), and the text's claim that PPM raises CTC's VA by 10.5% doesn't match Table 5's numbers either. Table 5's HM can be recomputed from VA, VG, and OA, so this note goes by Table 5.

Conclusion

This paper measured a problem that many people had sensed but nobody had quantified:

  1. Vocabulary reliance is ubiquitous. All four representative methods lose roughly 15 to 22 percentage points on words they have never seen.
  2. The prediction layer sets the degree of reliance. The attention decoder memorizes best and generalizes worst; segmentation generalizes best.
  3. Context modules bring vocabulary in, most visibly for CTC.
  4. Mixing in random strings or mutual learning reduces the reliance, without sacrificing much accuracy.

The most useful idea in the paper is that metric, which uses random strings to subtract out image difficulty. Six years later, recognizers have become vision-language models that generate whole pages, and a 2026 study that swapped document content for random letters saw the same thing, only at a much larger scale.