{"notes":[{"id":"text-recognition/seed","category":"text-recognition","legacyPath":"text-recognition/2005-seed","legacySlug":"2005-seed","legacyPaths":[],"title":"SEED","subtitle":"The Seed of Language","author":"Z. Yuan","paperDate":"2020-05-22","publishedOn":"2024-11-09","paperTitle":"SEED: Semantics Enhanced Encoder-Decoder Framework for Scene Text Recognition","paperUrl":"https://arxiv.org/abs/2005.10977","bibliography":{"title":"SEED: Semantics Enhanced Encoder-Decoder Framework for Scene Text Recognition","authors":["Zhi Qiao","Yu Zhou","Dongbao Yang","Yucan Zhou","Weiping Wang"],"url":"https://arxiv.org/abs/2005.10977","pdfUrl":"https://arxiv.org/pdf/2005.10977","codeUrl":null,"preprint":{"id":"2005.10977","submittedOn":"2020-05-22","url":"https://arxiv.org/abs/2005.10977"},"publication":{"venue":"CVPR","year":2020,"kind":"conference","url":"https://arxiv.org/abs/2005.10977"},"citation":"@misc{textrecognitionseed2020,\n  title = {{SEED: Semantics Enhanced Encoder-Decoder Framework for Scene Text Recognition}},\n  author = {Zhi Qiao and Yu Zhou and Dongbao Yang and Yucan Zhou and Weiping Wang},\n  year = {2020},\n  eprint = {2005.10977},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2005.10977}\n}\n","citationPath":"/content/papers/citations/text-recognition/seed.e2689e3c957c.bib"},"thumbnail":{"src":"/content/papers/assets/8592487550270e392307478d6a0274ab54b2ab602f077b32b5bc63cfbeec32a0.jpg","width":964,"height":736},"locale":"en","path":"/content/papers/en/text-recognition/seed.ca3ae1a0a780.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"pre-trained-language-model","text":"Pre-trained Language Model","depth":3},{"id":"loss-function","text":"Loss Function","depth":3},{"id":"implementation-details","text":"Implementation Details","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"comparison-with-recent-methods","text":"Comparison with Recent Methods","depth":3},{"id":"visualization-of-results","text":"Visualization of Results","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"text-recognition/abinet","relation":"comparison","topic":"Using linguistic context in text recognition"}]},{"id":"text-recognition/abinet","category":"text-recognition","legacyPath":"text-recognition/2103-abinet","legacySlug":"2103-abinet","legacyPaths":[],"title":"ABINet","subtitle":"Thinking more!","author":"Z. Yuan","paperDate":"2021-03-11","publishedOn":"2024-11-04","paperTitle":"Read Like Humans: Autonomous, Bidirectional and Iterative Language Modeling for Scene Text Recognition","paperUrl":"https://arxiv.org/abs/2103.06495","bibliography":{"title":"Read Like Humans: Autonomous, Bidirectional and Iterative Language Modeling for Scene Text Recognition","authors":["Shancheng Fang","Hongtao Xie","Yuxin Wang","Zhendong Mao","Yongdong Zhang"],"url":"https://arxiv.org/abs/2103.06495","pdfUrl":"https://arxiv.org/pdf/2103.06495","codeUrl":null,"preprint":{"id":"2103.06495","submittedOn":"2021-03-11","url":"https://arxiv.org/abs/2103.06495"},"publication":{"venue":"CVPR","year":2021,"kind":"conference","url":"https://arxiv.org/abs/2103.06495"},"citation":"@misc{textrecognitionabinet2021,\n  title = {{Read Like Humans: Autonomous, Bidirectional and Iterative Language Modeling for Scene Text Recognition}},\n  author = {Shancheng Fang and Hongtao Xie and Yuxin Wang and Zhendong Mao and Yongdong Zhang},\n  year = {2021},\n  eprint = {2103.06495},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2103.06495}\n}\n","citationPath":"/content/papers/citations/text-recognition/abinet.73bc0bb60d4e.bib"},"thumbnail":{"src":"/content/papers/assets/dd3f71609a9aed29caa0b237880c58e2582197f57faa202b18ed16033f22d0b0.jpg","width":1706,"height":694},"locale":"en","path":"/content/papers/en/text-recognition/abinet.90f599e77ebf.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"visual-model","text":"Visual Model","depth":3},{"id":"language-model","text":"Language Model","depth":3},{"id":"implementation-details","text":"Implementation Details","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"comparison-with-other-methods","text":"Comparison with Other Methods","depth":3},{"id":"ablation-study---visual-model","text":"Ablation Study - Visual Model","depth":3},{"id":"ablation-study---language-model","text":"Ablation Study - Language Model","depth":3},{"id":"ablation-study---bidirectional-strategy","text":"Ablation Study - Bidirectional Strategy","depth":3},{"id":"visualization-analysis","text":"Visualization Analysis","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"text-recognition/seed","relation":"comparison","topic":"Using linguistic context in text recognition"}]}],"text":"It seems that models relying solely on visual features have hit a performance plateau.\n\nSo, is there a way to incorporate more linguistic information into the process?\n\n## Problem Definition\n\nInspired by advancements in NLP, many Scene Text Recognition (STR) studies have begun to adopt attention mechanisms to tackle challenges.\n\nFor regular text, encoder-decoder architectures typically use convolutional neural networks (CNNs) and recurrent neural networks (RNNs) with attention mechanisms to predict characters step by step. For irregular text, multi-directional encoding and 2D attention methods are applied.\n\nSo...\n\nSince STR models already borrow from NLP frameworks, why not take it a step further?\n\nThe \"language\" aspect in language models is actually a valuable clue.\n\nThe authors introduce extra semantic information as a global reference to help the decoder. This was an early exploration of how language and visual information might work together in scene text recognition.\n\n## Solution\n\n### Model Architecture\n\n\n\n![SE-ASTER pipeline with TPS rectification, ResNet and BiLSTM encoder, semantic module and Att-GRU decoder](/content/papers/assets/8592487550270e392307478d6a0274ab54b2ab602f077b32b5bc63cfbeec32a0.jpg \"Paper Figure 3; source: arXiv:2005.10977v1\")\n\n\n\nBuilding on ASTER, the authors propose the \"Semantics-Enhanced ASTER (SE-ASTER)\" method, as illustrated above.\n\n- [**[18.06] ASTER: An Attentional Scene Text Recognizer with Flexible Rectification**](https://ieeexplore.ieee.org/document/8395027)\n\nSE-ASTER consists of four main modules:\n\n1. **Rectification Module**: For correcting irregular text images;\n2. **Encoder**: For extracting rich visual features;\n3. **Semantic Module**: For predicting semantic information from visual features;\n4. **Decoder**: For producing the final recognition result.\n\nInitially, the input image passes through the Rectification Module, where shallow CNN layers predict control points, and the image is rectified using Thin-plate Splines (TPS).\n\n\n> [!TIP]\n> \n> For more on TPS rectification, refer to our previous article:\n> \n> - [**[16.03] RARE: Fully-Automatic Rectification**](/blog/papers/text-recognition/rare)\n\n\nThe rectified image is then fed into the Encoder, which generates visual features. The Encoder comprises a 45-layer ResNet CNN and a BiLSTM with 256 hidden units, producing a feature sequence $h = (h_1, \\dots, h_L)$ with dimensions $L \\times C$, where $L$ represents the width of the last CNN feature map and $C$ is the feature dimension.\n\nThe output feature sequence $h$ serves two purposes:\n\n- Provides input for the Semantic Module to predict semantic information;\n- Serves as input to the Decoder.\n\nTo predict semantic information, the feature sequence is flattened into a one-dimensional feature vector $I$ with dimension $K = L \\times C$.\n\nSemantic information $S$ is then calculated using two linear layers with a nonlinear activation between them:\n\n$$\nS = W_2\\sigma(W_1I + b_1) + b_2\n$$\n\nwhere $W_1, W_2, b_1, b_2$ are trainable weights, and $\\sigma$ is the ReLU activation function. The semantic information is supervised with pre-trained word embeddings from a FastText model.\n\n\n> [!TIP]\n> \n> The authors experimented with using the final hidden state $h_L$ of the BiLSTM in the encoder for semantic information prediction, but it yielded subpar results. They theorize that a broader feature context is needed for semantic prediction, making the encoder's output more suitable.\n\n\n### Pre-trained Language Model\n\nThe authors use pretrained FastText word vectors for semantic supervision. FastText here is a skip-gram word-embedding model, not an autoregressive text generator.\n\n- [**[16.07] Enriching Word Vectors with Subword Information**](https://arxiv.org/abs/1607.04606)\n\nAssume that $T = \\{w_{i-l}, \\dots, w_{i+l}\\}$ is a context window centered on $w_i$, where $l$ is the window radius. In the skip-gram model, a word $w_i$ is represented by an embedding vector $v_i$ and is input to a simple feed-forward neural network with the objective of predicting the context:\n\n$$\nC_i = \\{w_{i-l}, \\dots, w_{i-1}, w_{i+1}, \\dots, w_{i+l}\\}\n$$\n\nDuring training, the embedding vector $v_i$ is optimized such that each word's final embedding vector closely matches that of semantically similar words. FastText further embeds subwords and uses them to form the final embedding of word $w_i$.\n\nFor example, with subword lengths from 2 to 4, \"where\" yields wh, he, er, re, whe, her, ere, wher, and here. This simplified example omits word-boundary markers, which FastText also uses when forming character n-grams. A word is represented using its subword vectors together with its own word vector.\n\nFastText can construct a vector for an out-of-vocabulary word from its learned subwords.\n\n\n> [!TIP]\n> \n> Why not use RoBERTa or BERT instead in 2020?\n\n\n---\n\nDuring training, FastText word embeddings supervise the semantic information $S$ predicted from the image. At inference, predicted $S$ passes through a linear transformation to initialize the decoder GRU's hidden state; the ground-truth transcription is not available then. This step matters: in the ablation, word-embedding supervision alone brings no clear improvement.\n\n### Loss Function\n\nDuring training, the authors apply supervision signals to both the Semantic Module and Decoder, enabling SE-ASTER to train end-to-end.\n\nThe loss function is defined as:\n\n$$\nL = L_{\\text{rec}} + \\lambda L_{\\text{sem}}\n$$\n\nwhere $L_{\\text{rec}}$ is the standard cross-entropy loss, measuring the difference between the predicted probabilities and the ground truth labels.\n\n$L_{\\text{sem}}$ is the cosine embedding loss for semantic information:\n\n$$\nL_{\\text{sem}} = 1 - \\cos(S, \\text{em})\n$$\n\nwhere $S$ is the predicted semantic information, and $\\text{em}$ is the embedding of the transcription label from the pre-trained FastText model, aiming to maximize similarity between predicted semantic information and the FastText embeddings of the target words.\n\n$\\lambda$ is a balancing hyperparameter, set to 1.\n\n\n> [!TIP]\n> \n> The authors chose a simple cosine loss instead of contrastive loss here to speed up training.\n\n\n### Implementation Details\n\nThe pre-trained FastText model used is the official version, trained on Common Crawl and Wikipedia datasets. SE-ASTER’s recognition output contains 97 symbols, including numbers, uppercase and lowercase letters, 32 punctuation marks, end-of-sequence, padding, and unknown symbols.\n\nInput images are resized to 64 × 256 without preserving the aspect ratio. The ADADELTA algorithm optimizes the objective function.\n\nThe recognition network has no additional pretraining or data augmentation; its FastText supervision is still pretrained. The recognition network is trained on SynthText and Synth90K datasets for 6 epochs with a batch size of 512. The initial learning rate is set to 1.0, decaying to 0.1 in the 4th epoch and 0.01 in the 5th epoch. Training is conducted on an NVIDIA M40 GPU.\n\nFor inference, image sizes match those in training. Beam search is applied in GRU decoding, retaining the top \\( k = 5 \\) candidates by cumulative score in all experiments.\n\n## Discussion\n\n### Comparison with Recent Methods\n\n\n\n![SE-ASTER accuracy versus ASTER and prior methods across six lexicon-free benchmarks](/content/papers/assets/26ddc4950326fc1cadf0f5dfdc39577e48c700d5a966bcd4d9599a48481a8896.jpg \"Paper Table 5; source: arXiv:2005.10977v1\")\n\n\n\nThe authors compared their proposed method with previous state-of-the-art techniques across several benchmark datasets, as shown in the table above.\n\nWithout using lexicons and with only word-level annotations, SE-ASTER achieved the top result on 2 of the 6 benchmark datasets and the second-best result on 3 others. Notably, the proposed method demonstrated excellent performance on low-quality datasets, such as IC15 and SVTP.\n\nAgainst the **previously published ASTER results**, SE-ASTER rises from **76.1% to 80.0%** on IC15, or **3.9 percentage points**, and from **78.5% to 81.4%** on SVTP, or **2.9 points**. Against the **authors' retrained ASTER baseline**, the gains are **1.6** and **2.3 percentage points**, respectively. Even with a weaker backbone and without character-level annotations, SE-ASTER also exceeds ScRN by **0.6 percentage points** on SVTP and **1.3 points** on IC15; the training conditions differ between methods.\n\n### Visualization of Results\n\n\n\n![Recognition examples comparing SAR with SE-SAR and ASTER with SE-ASTER on degraded word images](/content/papers/assets/a555375e1d250b0cb305aa00a2ab0b71ee6291f3ae37fa83e4051bd051956bba.jpg \"Paper Figure 4; source: arXiv:2005.10977v1\")\n\n\n\nThe authors visualized results on some low-quality images, including examples with blurring or occlusion, as shown in the figure above.\n\nIn these low-quality examples, SE-ASTER corrects some of ASTER's wrong characters. The authors suggest that semantic information gives the decoder a global feature that makes it less vulnerable to image interference.\n\n\n> [!TIP]\n> \n> In the figure above, SE-SAR applies the same semantic-enhanced idea to the SAR architecture. In paper Table 4, SE-SAR outperforms SAR on IC15, SVT, and SVTP, while IC13 falls slightly from 91.0% to 90.9%. For more on SAR, refer to our previous article:\n> \n> - [**[18.11] SAR: 2D Attention Maps**](/blog/papers/text-recognition/sar)\n\n\n## Conclusion\n\nBringing a language model into STR opened a new line of thought. SE-ASTER performed well on several benchmarks and showed robustness to low-quality images.\n\nIn later STR research, using language models became a major trend. Whatever side effects they might introduce, this was still a new direction worth exploring at the time.\n","imageSizes":{"/content/papers/assets/8592487550270e392307478d6a0274ab54b2ab602f077b32b5bc63cfbeec32a0.jpg":{"width":964,"height":736},"/content/papers/assets/26ddc4950326fc1cadf0f5dfdc39577e48c700d5a966bcd4d9599a48481a8896.jpg":{"width":1224,"height":888},"/content/papers/assets/a555375e1d250b0cb305aa00a2ab0b71ee6291f3ae37fa83e4051bd051956bba.jpg":{"width":992,"height":1072}}}
