Optimal Boxes: Boosting End-to-End Scene Text Recognition by Adjusting Annotated Bounding Boxes via Reinforcement Learning

Jingqun Tang, Wenming Qian, Luchuan Song, Xiena Dong, Lan Li, Xiang Bai

Introduction

In the field of Scene Text Recognition (STR), the standard pipeline typically follows a two-stage process: detection (locating the text) and recognition (transcribing the characters). For years, the prevailing assumption has been that the "perfect" ground truth for training these models is a tight bounding box—a human-annotated rectangle or quadrangle that fits snugly around the visible text.

However, this research identifies a significant "compatibility gap" between human visual intuition and the internal requirements of deep learning models. A box that looks perfect to a human eye may inadvertently clip a crucial pixel of a character or include distracting background noise that triggers a misclassification. This paper introduces Box Adjuster, a reinforcement learning (RL) framework designed to automatically refine these bounding boxes to maximize recognition performance.

The Problem: The Tight Box Fallacy

The authors argue that human-annotated tight boxes are not necessarily optimal for neural network recognizers. Even a minor 1-2 pixel error can render a word unrecoverable for a recognition model. This issue is exacerbated during domain adaptation—for instance, when a model is trained on synthetic data and tested on real-world images. In these scenarios, the "ideal" box shape for the model shifts due to differences in noise, lighting, and font rendering. The central question of this work is: Are tight bounding boxes actually the most suitable for recognition tasks? The evidence suggests they are not.

The Box Adjuster Framework

To bridge this compatibility gap, the authors propose Box Adjuster, which utilizes a Deep Q-Network (BoxDQN) to iteratively refine text boundaries.

1. The RL Agent and Action Space

The agent observes a text crop and its surrounding context. Using a Feature Fusion Module (FFM), it combines image features from both the foreground and the background with the current box coordinates. The agent operates within a 16-action space, allowing it to move any of the four vertices of a quadrangle in four directions (up, down, left, right) by one pixel at a time.

2. Reward Function: Recognition Confidence

Unlike standard object detection models that use Intersection over Union (IoU) as a metric, Box Adjuster is driven by Recognition Confidence. If an adjustment leads a pre-trained recognizer (such as CRNN or RARE) to be more confident in its prediction, the agent receives a positive reward. This ensures the box is optimized specifically for the model's ability to read the text.

3. Zero-Cost Inference

One of the most practical aspects of Box Adjuster is that it functions as a preprocessing step. It is used to optimize training labels or refine pseudo-labels in unsupervised settings. Once a detection or spotting model is trained on these "optimal boxes," the Box Adjuster is no longer required. Consequently, the performance gains are achieved with zero additional computational overhead during inference.

Experimental Evaluation

The researchers evaluated Box Adjuster across several rigorous benchmarks, including ICDAR 2013, 2015, 2019 (ReCTS and MLT), and TotalText for curved text.

Key Findings

  • End-to-End Performance: The method consistently outperformed state-of-the-art (SOTA) text spotters, achieving an average improvement of 2.0% F-Score. For example, ABCNet’s performance on the MLT19 dataset improved from 56.2% to 59.5%.
  • Domain Adaptation: The gains were most significant in synthetic-to-real adaptation scenarios, where Box Adjuster yielded an average 4.6% F-Score improvement. By refining noisy pseudo-labels on real data, the agent effectively reduced the distribution mismatch between domains.
  • Contextual Awareness: By providing the agent with a background view four times larger than the initial box, the system can "zoom out" to recover characters that were accidentally cropped out by human annotators.
  • Iterative Refinement: Experiments showed that 20 iterations of box adjustment provided the optimal balance between label quality and computational resource consumption during the training phase.

Conclusion and Future Work

Box Adjuster demonstrates that "model-centric" labels are superior to "human-centric" labels for deep learning tasks. By allowing an RL agent to discover the optimal boundaries for recognition, the researchers have provided a path to significantly boost OCR accuracy without increasing inference latency.

While the current framework handles quadrangles and Bezier curves (using 8 control points), future work will focus on more complex, highly irregular text shapes. Additionally, the authors aim to reduce the dependency on the specific biases of the pre-trained recognizer used to provide the RL reward, ensuring the optimized boxes are robust across various model architectures.

Summary updated

BibTeX
@inproceedings{tang2022optimal,
  author = {Jingqun Tang and Wenming Qian and Luchuan Song and Xiena Dong and Lan Li and Xiang Bai},
  title = {{Optimal Boxes: Boosting End-to-End Scene Text Recognition by Adjusting Annotated Bounding Boxes via Reinforcement Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19815-1\_14},
}
Figure