{"notes":[{"id":"text-recognition/cafcn","category":"text-recognition","legacyPath":"text-recognition/1809-cafcn","legacySlug":"1809-cafcn","legacyPaths":[],"title":"CA-FCN","subtitle":"A New Dimension","author":"Z. Yuan","paperDate":"2019","publishedOn":"2024-10-08","paperTitle":"Scene Text Recognition from Two-Dimensional Perspective","paperUrl":"https://doi.org/10.1609/aaai.v33i01.33018714","bibliography":{"title":"Scene Text Recognition from Two-Dimensional Perspective","authors":["Minghui Liao","Jian Zhang","Zhaoyi Wan","Fengming Xie","Jiajun Liang","Pengyuan Lyu","Cong Yao","Xiang Bai"],"url":"https://doi.org/10.1609/aaai.v33i01.33018714","pdfUrl":"https://cdn.aaai.org/ojs/4895/4895-13-7961-1-10-20190709.pdf","codeUrl":null,"preprint":null,"publication":{"venue":"AAAI","year":2019,"kind":"conference","url":"https://doi.org/10.1609/aaai.v33i01.33018714"},"citation":"@inproceedings{textrecognitioncafcn2019,\n  title = {{Scene Text Recognition from Two-Dimensional Perspective}},\n  author = {Minghui Liao and Jian Zhang and Zhaoyi Wan and Fengming Xie and Jiajun Liang and Pengyuan Lyu and Cong Yao and Xiang Bai},\n  year = {2019},\n  booktitle = {AAAI},\n  url = {https://doi.org/10.1609/aaai.v33i01.33018714},\n  doi = {10.1609/aaai.v33i01.33018714}\n}\n","citationPath":"/content/papers/citations/text-recognition/cafcn.a8c8518129cc.bib"},"thumbnail":{"src":"/content/papers/assets/99a3b40273c5c08f7babd3ecd3868990733a4fe28e7203dc62b9e9edcedf4a23.jpg","width":1538,"height":660},"locale":"en","path":"/content/papers/en/text-recognition/cafcn.d437fc96fe10.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"problem-solving","text":"Problem Solving","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"training-data-design","text":"Training Data Design","depth":3},{"id":"loss-function","text":"Loss Function","depth":3},{"id":"word-formation-module","text":"Word Formation Module","depth":3},{"id":"evaluation-metrics","text":"Evaluation Metrics","depth":3},{"id":"training-strategy","text":"Training Strategy","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"comparison-with-other-methods","text":"Comparison with Other Methods","depth":3},{"id":"visualization-results","text":"Visualization Results","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"text-recognition/siga","relation":"comparison","topic":"Spatial alignment and character features"}]},{"id":"text-recognition/siga","category":"text-recognition","legacyPath":"text-recognition/2203-siga","legacySlug":"2203-siga","legacyPaths":[],"title":"SIGA","subtitle":"Glyph Attention Mechanism","author":"Z. Yuan","paperDate":"2022-03-07","publishedOn":"2024-11-05","paperTitle":"Self-supervised Implicit Glyph Attention for Text Recognition","paperUrl":"https://arxiv.org/abs/2203.03382","bibliography":{"title":"Self-supervised Implicit Glyph Attention for Text Recognition","authors":["Tongkun Guan","Chaochen Gu","Jingzheng Tu","Xue Yang","Qi Feng","Yudi Zhao","Xiaokang Yang","Wei Shen"],"url":"https://arxiv.org/abs/2203.03382","pdfUrl":"https://arxiv.org/pdf/2203.03382","codeUrl":null,"preprint":{"id":"2203.03382","submittedOn":"2022-03-07","url":"https://arxiv.org/abs/2203.03382"},"publication":{"venue":"CVPR","year":2023,"kind":"conference","url":"https://arxiv.org/abs/2203.03382"},"citation":"@misc{textrecognitionsiga2022,\n  title = {{Self-supervised Implicit Glyph Attention for Text Recognition}},\n  author = {Tongkun Guan and Chaochen Gu and Jingzheng Tu and Xue Yang and Qi Feng and Yudi Zhao and Xiaokang Yang and Wei Shen},\n  year = {2022},\n  eprint = {2203.03382},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2203.03382}\n}\n","citationPath":"/content/papers/citations/text-recognition/siga.85fc075427f4.bib"},"thumbnail":{"src":"/content/papers/assets/6af857c0af5a608a4d77767c7b09be0f2d1fd86f4b24e328dae603b7d3bb9ab9.jpg","width":1660,"height":610},"locale":"en","path":"/content/papers/en/text-recognition/siga.a8437f124750.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":"backbone","text":"Backbone","depth":3},{"id":"glyph-pseudo-label-construction","text":"Glyph Pseudo-Label Construction","depth":3},{"id":"implicit-attention-alignment","text":"Implicit Attention Alignment","depth":3},{"id":"glyph-pseudo-label-construction-1","text":"Glyph Pseudo-Label Construction","depth":3},{"id":"glyph-attention-network-glan","text":"Glyph Attention Network (GLAN)","depth":3},{"id":"attention-based-character-fusion-module","text":"Attention-based Character Fusion Module","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"comparison-with-other-methods","text":"Comparison with Other Methods","depth":3},{"id":"visualization-analysis","text":"Visualization Analysis","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"text-recognition/cafcn","relation":"comparison","topic":"Spatial alignment and character features"}]}],"text":"For several years, CRNN and the improvements that followed had dominated scene text recognition. Finding a new direction was not easy.\n\nThe authors of this paper chose to set previous approaches aside and rethink the problem from a **two-dimensional perspective**.\n\n## Problem Definition\n\n![problem](/content/papers/assets/15474d5affbe24216d60bd06eaae8276460981aa1dda36b767a0819c3b3661f1.jpg)\n\nPrevious 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.\n\nAs 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.\n\nFurthermore, 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.\n\nThe 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:\n\n- **Keep the image in its two-dimensional form and recognize text directly within this 2D space**.\n\nThat 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.\n\n## Problem Solving\n\n### Model Architecture\n\n![model arch](/content/papers/assets/99a3b40273c5c08f7babd3ecd3868990733a4fe28e7203dc62b9e9edcedf4a23.jpg)\n\nThe authors propose the model architecture shown above.\n\nUsing 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.\n\nIn 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.\n\nMoving 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.\n\nOnce 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.\n\nThe weighting formula is as follows:\n\n$$\nF_o = F_i \\otimes (1 + A)\n$$\n\nWhere $F_o$ is the weighted feature map, $F_i$ is the original feature map, and $A$ is the text region attention map.\n\nThese feature maps are progressively upsampled and finally output as a text feature map with $C$ channels, where $C$ includes the predefined character categories and background.\n\n\n> [!TIP]\n> \n> In the diagram, the red lines show **deformable convolution** in stages 4 and 5, followed by a $3\\times1$ convolution. The authors expect this combination to capture text features more effectively.\n> \n> The figure below illustrates the difference: the left side shows the receptive field of standard convolution, and the right side shows the receptive field of deformable convolution. You can see that deformable convolution has a more flexible receptive field, allowing it to focus more precisely on text features.\n> \n> ![deformable](/content/papers/assets/2c48be750017e825579f296e266b0c29f1721528bc0b14df4f1e1d0220e068d7.jpg)\n\n\n### Training Data Design\n\n![data](/content/papers/assets/4f2d8ab031c3ca70289b56fe8a472598fd611eecf98f6739d4400db7185840d0.jpg)\n\nThe 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.\n\nLet $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.\n\nThe actual text region annotation $g = (x^g_{min}, y^g_{min}, x^g_{max}, y^g_{max})$ can be calculated as:\n\n$$\nw = x_{max} - x_{min}\n$$\n\n$$\nh = y_{max} - y_{min}\n$$\n\n$$\nx^g_{min} = \\frac{x_{min} + x_{max} - w \\times r}{2}\n$$\n\n$$\ny^g_{min} = \\frac{y_{min} + y_{max} - h \\times r}{2}\n$$\n\n$$\nx^g_{max} = \\frac{x_{min} + x_{max} + w \\times r}{2}\n$$\n\n$$\ny^g_{max} = \\frac{y_{min} + y_{max} + h \\times r}{2}\n$$\n\nWhere $r$ is the scaling factor for the text region.\n\nThe 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.\n\nIn practice, the authors set $r$ to 0.5 for the attention supervision and 0.25 for the final output supervision.\n\n### Loss Function\n\nThe overall loss is a weighted combination of the character prediction loss $L_p$ and the character attention loss $L_a$:\n\n$$\nL = L_p + \\alpha \\sum_{s=2}^{5} L^s_a\n$$\n\nWhere $s$ represents the stage index, and $\\alpha$ is empirically set to 1.0.\n\nThe final output of CA-FCN has a shape of $H/2 \\times W/2 \\times C$, where $H$ and $W$ are the height and width of the input image, and $C$ is the number of character categories (including background).\n\nLet $X_{i,j,c}$ represent an element in the output map, where $i \\in \\{1, ..., H/2\\}$, $j \\in \\{1, ..., W/2\\}$, and $c \\in \\{0, 1, ..., C-1\\}$; and $Y_{i,j} \\in \\{0, 1, ..., C-1\\}$ represents the corresponding label.\n\nThe prediction loss can be computed as:\n\n$$\nL_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),\n$$\n\nWhere $W_{i,j}$ is the weight assigned to each pixel.\n\nLet $N = H/2 \\times W/2$ and $N_{neg}$ be the number of background pixels. The weight is calculated as:\n\n$$\nW_{i,j} =\n\\begin{cases}\n\\frac{N_{neg}}{N - N_{neg}} & \\text{If} \\ Y_{i,j} > 0, \\\\\n1 & \\text{Otherwise}\n\\end{cases}\n$$\n\n---\n\nThe character attention loss is a binary cross-entropy loss, where all character labels are treated as 1 and background labels are treated as 0:\n\n$$\nL^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),\n$$\n\nWhere $H_s$ and $W_s$ are the height and width of the feature map at stage $s$.\n\n\n> [!TIP]\n> \n> The mathematical formulas above may seem daunting, but they are essentially just full representations of the Cross Entropy loss, applied to every pixel. The sums and averages ensure it is calculated across all pixels.\n> \n> An important detail is the distinction between foreground and background weights in $L_p$, which ensures the model focuses more on predicting text regions and is less distracted by the background.\n\n\n### Word Formation Module\n\n![word](/content/papers/assets/1f92865dc32f857645cf89c9337776ccb64b003d2a0f04d4d37aff2dfe35932f.jpg)\n\nThe word formation module converts the precise 2D character map predicted by CA-FCN into a character sequence.\n\n- First, the predicted character map is converted into a binary map, extracting the corresponding character regions based on a threshold.\n- Next, the average value of each region is calculated across the $C$ categories, and the region is assigned to the category with the highest average value.\n- Finally, these regions are arranged from left to right to form a word.\n\nThis approach can generate both the word and the position of each character.\n\nThe 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.\n\nThe 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.\n\n### Evaluation Metrics\n\nThe authors used five commonly used benchmarks for scene text recognition to evaluate their model's performance:\n\n1. **ICDAR 2003 (IC03)**\n\n   - The test set contains 251 scene images with annotated text bounding boxes.\n   - 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.\n   - 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.\n\n2. **ICDAR 2013 (IC13)**\n\n   - 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.\n   - Unlike IC03, IC13 does not provide lexicons, so evaluations are conducted without lexicon assistance (no-lexicon setting).\n\n3. **IIIT 5K-Word (IIIT5k)**\n\n   - The test set contains 3,000 cropped text images collected from the internet, covering varied fonts and backgrounds.\n   - 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.\n\n4. **Street View Text (SVT)**\n\n   - The test set consists of 249 scene images from Google Street View, from which 647 cropped text images are extracted.\n   - Each text image is provided with a 50-word lexicon for lexicon-assisted evaluation.\n\n5. **CUTE**\n\n   - The test set contains 288 images, with many curved text images. No lexicon is provided for this dataset.\n\n### Training Strategy\n\nCA-FCN can accept variable-sized images because it is fully convolutional. Usable dimensions still depend on downsampling, implementation constraints, and available memory.\n\nThe authors adopted multi-scale training to enhance model robustness, with input images randomly adjusted to:\n\n- $32 \\times 128$\n- $48 \\times 192$\n- $64 \\times 256$\n\nIn addition, data augmentation techniques were applied during training, including random rotation, hue, brightness, contrast, and blurring adjustments. The rotation angle ranged between $[-15^\\circ, 15^\\circ]$.\n\nOther parameters include:\n\n- The Adam optimizer was used for training, with an initial learning rate of $10^{-4}$.\n- The learning rate was reduced to $10^{-5}$ in the 3rd epoch and to $10^{-6}$ in the 4th epoch.\n- The model was trained for 5 epochs in total.\n- 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.\n\nDuring testing, the images were resized to a fixed height of 64 ($H_t = 64$), and the width ($W_t$) was calculated as follows:\n\n$$\nW_t =\n\\begin{cases}\nW \\times \\frac{H_t}{H} & \\text{If} \\ W/H > 4, \\\\\n256 & \\text{Otherwise}\n\\end{cases}\n$$\n\nWhere $H$ and $W$ are the original height and width of the image.\n\n## Discussion\n\n### Comparison with Other Methods\n\n![compare](/content/papers/assets/dbbff51750c14b1e4e3af8b2785d94c87ffc1b9e6655b6917bf76aff705bc596.jpg)\n\nCA-FCN reaches the highest accuracy in the table for some benchmark columns and training conditions.\n\n- On **IIIT** without a lexicon, the base model's 92.0% exceeds the previous table high of 88.3% by **3.7 percentage points**.\n- 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.\n- Results on **SVT** and **IC13** are competitive, but the model does not lead every no-lexicon column.\n\nTo 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.\n\n(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.\n\n\n> [!TIP]\n> \n> The comparison table only includes authors and years, which makes it harder to read. However, this has become a common practice in papers. Interested readers can refer to the original paper for more detailed tables.\n\n\n### Visualization Results\n\n![result](/content/papers/assets/2b82c99d856c082b8b00d7437c036f8c262423111e76cb14be4f297b63f3771f.jpg)\n\nThe authors provide visualization results from the CA-FCN model, as shown above, applied to the IIIT and CUTE80 datasets.\n\n## Conclusion\n\nCA-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.\n\nThe experiments show strong results on both regular and irregular text datasets, with the comparison conditions described above.\n\n\n> [!TIP]\n> \n> In practice, deploying this model for Chinese could be difficult. If the target character set approaches 100,000 classes, the final prediction branch would be very large.\n> \n> Training and inference could then demand substantial compute, so we would have to think carefully about using it.\n","imageSizes":{"/content/papers/assets/15474d5affbe24216d60bd06eaae8276460981aa1dda36b767a0819c3b3661f1.jpg":{"width":1168,"height":660},"/content/papers/assets/99a3b40273c5c08f7babd3ecd3868990733a4fe28e7203dc62b9e9edcedf4a23.jpg":{"width":1538,"height":660},"/content/papers/assets/2c48be750017e825579f296e266b0c29f1721528bc0b14df4f1e1d0220e068d7.jpg":{"width":840,"height":196},"/content/papers/assets/4f2d8ab031c3ca70289b56fe8a472598fd611eecf98f6739d4400db7185840d0.jpg":{"width":972,"height":240},"/content/papers/assets/1f92865dc32f857645cf89c9337776ccb64b003d2a0f04d4d37aff2dfe35932f.jpg":{"width":1624,"height":298},"/content/papers/assets/dbbff51750c14b1e4e3af8b2785d94c87ffc1b9e6655b6917bf76aff705bc596.jpg":{"width":1364,"height":818},"/content/papers/assets/2b82c99d856c082b8b00d7437c036f8c262423111e76cb14be4f297b63f3771f.jpg":{"width":1476,"height":594}}}
