{"notes":[{"id":"text-detection/drrg","category":"text-detection","legacyPath":"text-detection/2003-drrg","legacySlug":"2003-drrg","legacyPaths":[],"title":"DRRG","subtitle":"A first look at GCN","author":"Z. Yuan","paperDate":"2020-03-17","publishedOn":"2024-12-08","paperTitle":"Deep Relational Reasoning Graph Network for Arbitrary Shape Text Detection","paperUrl":"https://arxiv.org/abs/2003.07493","bibliography":{"title":"Deep Relational Reasoning Graph Network for Arbitrary Shape Text Detection","authors":["Shi-Xue Zhang","Xiaobin Zhu","Jie-Bo Hou","Chang Liu","Chun Yang","Hongfa Wang","Xu-Cheng Yin"],"url":"https://arxiv.org/abs/2003.07493","pdfUrl":"https://arxiv.org/pdf/2003.07493","codeUrl":null,"preprint":{"id":"2003.07493","submittedOn":"2020-03-17","url":"https://arxiv.org/abs/2003.07493"},"publication":{"venue":"CVPR","year":2020,"kind":"conference","url":"https://arxiv.org/abs/2003.07493"},"citation":"@misc{textdetectiondrrg2020,\n  title = {{Deep Relational Reasoning Graph Network for Arbitrary Shape Text Detection}},\n  author = {Shi-Xue Zhang and Xiaobin Zhu and Jie-Bo Hou and Chang Liu and Chun Yang and Hongfa Wang and Xu-Cheng Yin},\n  year = {2020},\n  eprint = {2003.07493},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2003.07493}\n}\n","citationPath":"/content/papers/citations/text-detection/drrg.a689d577b87c.bib"},"thumbnail":{"src":"/content/papers/assets/7f65ed561e78695572f8751aacdcb0033cdc33d5926dec733cffa9363404f6dd.jpg","width":1602,"height":532},"locale":"en","path":"/content/papers/en/text-detection/drrg.7cd78f3e0ba0.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"feature-extraction","text":"Feature Extraction","depth":3},{"id":"text-component-definition","text":"Text Component Definition","depth":3},{"id":"text-component-prediction","text":"Text Component Prediction","depth":3},{"id":"loss-function-calculation","text":"Loss Function Calculation","depth":3},{"id":"generating-local-graphs","text":"Generating Local Graphs","depth":3},{"id":"filtering-redundant-samples","text":"Filtering Redundant Samples","depth":3},{"id":"graph-convolutional-network","text":"Graph Convolutional Network","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"ablation-study","text":"Ablation Study","depth":3},{"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-detection/craft","relation":"comparison","topic":"Grouping characters and text components"},{"id":"text-detection/textfusenet","relation":"comparison","topic":"Grouping characters and text components"}]},{"id":"text-detection/craft","category":"text-detection","legacyPath":"text-detection/1904-craft","legacySlug":"1904-craft","legacyPaths":[],"title":"CRAFT","subtitle":"The Craft of Text","author":"Z. Yuan","paperDate":"2019-04-03","publishedOn":"2024-09-14","paperTitle":"Character Region Awareness for Text Detection","paperUrl":"https://arxiv.org/abs/1904.01941","bibliography":{"title":"Character Region Awareness for Text Detection","authors":["Youngmin Baek","Bado Lee","Dongyoon Han","Sangdoo Yun","Hwalsuk Lee"],"url":"https://arxiv.org/abs/1904.01941","pdfUrl":"https://arxiv.org/pdf/1904.01941","codeUrl":null,"preprint":{"id":"1904.01941","submittedOn":"2019-04-03","url":"https://arxiv.org/abs/1904.01941"},"publication":{"venue":"CVPR","year":2019,"kind":"conference","url":"https://arxiv.org/abs/1904.01941"},"citation":"@misc{textdetectioncraft2019,\n  title = {{Character Region Awareness for Text Detection}},\n  author = {Youngmin Baek and Bado Lee and Dongyoon Han and Sangdoo Yun and Hwalsuk Lee},\n  year = {2019},\n  eprint = {1904.01941},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1904.01941}\n}\n","citationPath":"/content/papers/citations/text-detection/craft.9339a46a41c9.bib"},"thumbnail":{"src":"/content/papers/assets/23aa86e47496a2a8c7efbb29e374c0d0d4a2d9c85ff7ba25a14dbc2fb58d5007.jpg","width":2181,"height":2310},"locale":"en","path":"/content/papers/en/text-detection/craft.750c964a9e55.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution-approach","text":"Solution Approach","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"label-generation","text":"Label Generation","depth":3},{"id":"weak-supervision-learning","text":"Weak Supervision Learning","depth":3},{"id":"word-level-bounding-boxes","text":"Word-Level Bounding Boxes","depth":3},{"id":"curved-text-polygons","text":"Curved Text Polygons","depth":3},{"id":"training-datasets","text":"Training Datasets","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","text":"Visualization","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"text-detection/drrg","relation":"comparison","topic":"Grouping characters and text components"},{"id":"text-detection/textfusenet","relation":"comparison","topic":"Grouping characters and text components"}]},{"id":"text-detection/textfusenet","category":"text-detection","legacyPath":"text-detection/2009-textfusenet","legacySlug":"2009-textfusenet","legacyPaths":[],"title":"TextFuseNet","subtitle":"A Beautiful Fusion of Three Feature Types","author":"Z. Yuan","paperDate":"2020","publishedOn":"2024-09-14","paperTitle":"TextFuseNet: Scene Text Detection with Richer Fused Features","paperUrl":"https://doi.org/10.24963/ijcai.2020/72","bibliography":{"title":"TextFuseNet: Scene Text Detection with Richer Fused Features","authors":["Jian Ye","Zhe Chen","Juhua Liu","Bo Du"],"url":"https://doi.org/10.24963/ijcai.2020/72","pdfUrl":null,"codeUrl":null,"preprint":null,"publication":{"venue":"IJCAI","year":2020,"kind":"conference","url":"https://doi.org/10.24963/ijcai.2020/72"},"citation":"@inproceedings{textdetectiontextfusenet2020,\n  title = {{TextFuseNet: Scene Text Detection with Richer Fused Features}},\n  author = {Jian Ye and Zhe Chen and Juhua Liu and Bo Du},\n  year = {2020},\n  booktitle = {IJCAI},\n  url = {https://doi.org/10.24963/ijcai.2020/72},\n  doi = {10.24963/ijcai.2020/72}\n}\n","citationPath":"/content/papers/citations/text-detection/textfusenet.6d2f47c1b808.bib"},"thumbnail":{"src":"/content/papers/assets/81482c12e303bbecce9bb400023a1e451ee2a09ae67efe28b28454a083b54fc0.jpg","width":1722,"height":686},"locale":"en","path":"/content/papers/en/text-detection/textfusenet.db9137b0831d.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":"the-second-part-rpn--roialign","text":"The Second Part: RPN + RoIAlign","depth":3},{"id":"the-third-part-text-region-prediction-branch-semantic-segmentation-branch","text":"The Third Part: Text Region Prediction Branch (Semantic Segmentation Branch)","depth":3},{"id":"the-fourth-part-character-level-detection-branch-detection-branch","text":"The Fourth Part: Character-Level Detection Branch (Detection Branch)","depth":3},{"id":"the-fifth-part-character-level-segmentation-branch-mask-branch","text":"The Fifth Part: Character-Level Segmentation Branch (Mask Branch)","depth":3},{"id":"multi-path-feature-fusion","text":"Multi-Path Feature Fusion","depth":3},{"id":"weak-supervision-learning","text":"Weak Supervision Learning","depth":3},{"id":"training-datasets","text":"Training Datasets","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"ablation-study","text":"Ablation Study","depth":3},{"id":"comparison-with-other-methods","text":"Comparison with Other Methods","depth":3},{"id":"visualization","text":"Visualization","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"text-detection/craft","relation":"comparison","topic":"Grouping characters and text components"},{"id":"text-detection/drrg","relation":"comparison","topic":"Grouping characters and text components"}]}],"text":"Around 2020, Graph Convolutional Networks (GCN) became highly popular.\n\nAt a time when Transformer had not yet been widely applied to the image domain, GCN was an excellent choice, as it could handle irregular data and capture relationships between data points.\n\nGCNs had only just begun to attract attention in computer vision when Transformers started taking the spotlight. Still, a graph gives us a useful way to express relationships among text components.\n\n\n> [!TIP]\n> \n> If you're not familiar with Graph Convolutional Networks, you can check out our other article:\n> \n> - [**A Brief Introduction to Graph Convolutional Networks**](/blog/article/graph-convolutional-networks)\n\n\n## Defining the Problem\n\nWe have a new tool, so how could no one use it to tackle text detection? The authors put a GCN to work on grouping neighboring text components into complete instances. Their paper is among the early attempts to use graph reasoning for arbitrary-shape text detection.\n\nTherefore, the most difficult part of the entire paper is understanding what Graph Convolutional Networks are. If you've already mastered this concept, then this paper should pose no difficulty.\n\n## Solving the Problem\n\n### Model Architecture\n\n\n\n![model](/content/papers/assets/7f65ed561e78695572f8751aacdcb0033cdc33d5926dec733cffa9363404f6dd.jpg)\n\n\n\nThe entire model architecture consists of many components. We can break it down into a few parts:\n\n1. **Feature Extractor**: Uses VGG-16 as the backbone network and adds FPN (Feature Pyramid Network).\n2. **Text Component Definition**: Cuts the text instances into a series of ordered, near-rectangular fragments.\n3. **Text Component Prediction**: Uses convolution operations to predict the text components.\n4. **Loss Function Calculation**: Computes the loss between predicted results and ground truth labels.\n5. **Graph Convolutional Network**: Represents the relationships between text components as a graph and uses GCN for inference.\n\n### Feature Extraction\n\n\n\n![feature-extraction](/content/papers/assets/dc8171f5ae563e294715253d42ca430567f4273b93c4720cb4a569843d8fb84d.jpg)\n\n\n\nFirst, we need a feature extractor. Here, VGG-16 is used as the backbone network, with FPN (Feature Pyramid Network) added.\n\nThe paper calls this multiscale feature fusion an FPN. The diagram shows concatenation across stages, rather than the elementwise addition common in a standard FPN, so its fusion also has a U-Net-like feature.\n\n### Text Component Definition\n\n\n\n![text-component-prediction](/content/papers/assets/5cf4b14252cc9d002fc8b2a6e29ad8b41d474c50a4bec5fcff045d549ffbf24e.jpg)\n\n\n\n\n> [!TIP]\n> \n> Here, some terminology corresponds with the diagram above.\n\n\nIn this paper, the author cuts the complete text instance (such as a line or a word area) into a series of ordered, near-rectangular fragments.\n\nBy using these small fragments, the prediction can more finely describe the shape, size, and orientation of the text, ultimately reassembling the fragments to form the complete text.\n\nEach text component $D$ is represented by a set of geometric properties:\n\n$$\nD = (x, y, h, w, \\cos\\theta, \\sin\\theta)\n$$\n\n- $x, y$: The center coordinates of the component, i.e., the position of the text component in the image.\n- $h, w$: Represent the height and width of the component.\n- $\\cos\\theta, \\sin\\theta$: Used to represent the orientation of the text component.\n\nSince angles are periodic in mathematics, using $\\cos\\theta$ and $\\sin\\theta$ avoids the complexities of directly using angles, while ensuring smooth changes in direction.\n\n- **Definition of $h$**:\n\n  In the paper, the height $h$ of the text component is composed of the upper part $h_1$ and the lower part $h_2$.\n\n- **Relationship between width $w$ and height $h$**:\n\n  The width $w$ is obtained through a linear rule based on the height $h$.\n\n  In the experiment, a minimum width $w_{\\min}$ and maximum width $w_{\\max}$ are set. The rule is as follows:\n\n  $$\n  w_i =\n  \\begin{cases}\n  w_{\\min}, & h_i \\leq 2 \\cdot w_{\\min} \\\\\n  \\frac{h_i}{2}, & 2 \\cdot w_{\\min} < h_i < 2 \\cdot w_{\\max} \\\\\n  w_{\\max}, & h_i \\geq 2 \\cdot w_{\\max}\n  \\end{cases}\n  $$\n\n  The meaning is:\n\n  - When the component is short ($h_i$ is small), the width is fixed to a minimum value $w_{\\min}$ to avoid components being too narrow to recognize.\n  - When the component height is within a middle range, the width is proportional to the height ($w = h/2$) to maintain a reasonable aspect ratio.\n  - If the component height is too large, the width is locked to the maximum value $w_{\\max}$ to prevent excessive elongation.\n\n  In the experiment, the author set $w_{\\min} = 8$ and $w_{\\max} = 24$.\n\n---\n\nTo clearly define the orientation of the text (such as italic or horizontal) and to facilitate the extraction of the \"Text Center Region (TCR),\" the author uses the method of TextSnake.\n\n\n> [!TIP]\n> \n> If you're interested in the details of TextSnake, you can refer to our other article:\n> \n> - [**[18.07] TextSnake: A snake of text**](/blog/papers/text-detection/textsnake)\n\n\nThe steps are as follows:\n\n1. **Obtain the top and bottom point sequences**:\n\n   The text area is divided along its long side into a series of quadrilaterals (just like breaking a long line of text into smaller segments). As a result, we obtain two sets of points:\n\n   - $P_1 = \\{tp_0, tp_1, ..., tp_n\\}$: A sequence of points corresponding to the top line of the text.\n   - $P_2 = \\{bp_0, bp_1, ..., bp_n\\}$: A sequence of points corresponding to the bottom line of the text.\n\n   Here, $tp_i$ and $bp_i$ can be considered as the upper and lower boundary points of the same vertical cut.\n\n2. **Determine which is the top line and which is the bottom line**:\n\n   With $P_1$ and $P_2$, we need to know which set of points is the top and which is the bottom.\n\n   Thus, a set of vectors $V$ is defined:\n\n   $$\n   V = \\{ tp_0 - bp_0, tp_1 - bp_1, \\ldots, tp_n - bp_n \\}\n   $$\n\n   These vertical vectors are formed by subtracting each bottom-line point from its corresponding top-line point. We then compute\n\n   $$\n   p = \\sum_{i=0}^{n} \\sin(v_i)\n   $$\n\n   Here $v_i = tp_i-bp_i$. The notation $\\sin(v_i)$ abbreviates the sine of the vector’s direction angle, not a trigonometric operation on the vector itself. The top/bottom convention also depends on image coordinates. Following the paper’s convention, $p \\geq 0$ identifies $P_1$ as top and $P_2$ as bottom; otherwise their roles are reversed.\n\n   This method uses the direction of the vectors to determine the top and bottom lines, allowing us to identify the orientation of the text region and infer the text's tilt angle $\\theta$.\n\n3. **Obtain the Text Center Region (TCR)**:\n\n\n\n    ![tcr](/content/papers/assets/94b45f25075c5f8389629ad81a990f3b430354a65a8526ecd817f708afc69f50.jpg)\n\n\n\n   After determining the orientation of the text, the text region (Text Region, TR) is \"shrunk\" to obtain a smaller and more precise Text Center Region (TCR).\n\n   Looking closely at the image above, the method can be divided into three steps:\n\n   - Calculate the center line of the text, which is the line in the middle of the top and bottom lines.\n   - Shorten each end of the center line by $0.5w$ pixels to prevent overlap with adjacent text instances.\n   - Expand the center line in the vertical direction by $0.3h$, forming a thicker center band region, which is the desired TCR.\n\n   The existence of TCR helps the network focus more easily on the true core position of the text during subsequent predictions, and provides greater flexibility when distinguishing adjacent text (e.g., consecutive words in the same line).\n\n### Text Component Prediction\n\nWe already know the text components defined by the author, and next we use the feature maps processed through the Backbone and FPN to predict the text components. This is achieved through the following convolution operation to obtain the CR:\n\n$$\nCR = \\text{conv}_{1\\times1}(\\text{conv}_{3\\times3}(F_{\\text{share}}))\n$$\n\nThis means performing a $3\\times3$ convolution on the feature map first, followed by a $1\\times1$ convolution.\n\nThe final $CR$ tensor has dimensions of $(h \\times w \\times 8)$, where $h \\times w$ is the spatial size of the feature map, and the last dimension has 8 channels, which correspond to:\n\n- Four classification channels form **two binary softmax pairs**: TR/non-TR and TCR/non-TCR. They are not a single four-class distribution, since TCR lies inside TR.\n- Four regression channels predict $h_1$, $h_2$, $\\cos\\theta$, and $\\sin\\theta$.\n\nHere, the softmax operation is used to classify each pixel, separately deciding whether it belongs to the text region and whether it belongs to the text center region. Additionally, by normalizing $\\cos\\theta$ and $\\sin\\theta$ to ensure that $\\cos^2\\theta + \\sin^2\\theta = 1$, we maintain the validity of the orientation values.\n\nFinally, by setting a threshold and applying Non-Maximum Suppression (NMS) in local regions, redundant overlapping components can be removed, resulting in cleaner and more precise text component detection.\n\n### Loss Function Calculation\n\nThe overall detection loss $L_{\\text{det}}$ consists of two parts:\n\n$$\nL_{\\text{det}} = L_{\\text{cls}} + L_{\\text{reg}}\n$$\n\n- $L_{\\text{cls}}$: Classification loss, used to determine which pixels belong to the text region (TCR/TR) or the background.\n- $L_{\\text{reg}}$: Regression loss, used to accurately predict the geometric properties of the text, such as height and orientation.\n\n---\n\nThe classification loss $L_{\\text{cls}}$ is a cross-entropy loss.\n\nThe paper divides the entire text-related region into two areas:\n\n- **TR (Text Region)**: The entire text area, including the range between the upper and lower boundaries of the text.\n- **TCR (Text Center Region)**: The \"text center region\" obtained by shrinking/adjusting from the TR, used to more precisely locate the text's core position and avoid interference.\n\nIt is defined as:\n\n$$\nL_{\\text{cls}} = L_{\\text{tr}} + \\lambda_1 L_{\\text{tcrp}} + \\lambda_2 L_{\\text{tcrn}}\n$$\n\nThere are three sub-losses here:\n\n1. $L_{\\text{tr}}$:\n   Classification error for determining which pixels belong to the text region TR.\n\n2. $L_{\\text{tcrp}}$:\n   Calculated only for pixels inside TR, ensuring that in the true text region, TCR (the center of the text) is correctly distinguished.\n   In other words, $L_{\\text{tcrp}}$ specifically distinguishes pixels inside the \"text\" region as either \"text center region\" or \"non-center text region.\"\n\n3. $L_{\\text{tcrn}}$:\n   Calculated only for pixels outside the TR region, used to suppress the noise of TCR appearing in the background.\n   In brief, if TCR is incorrectly predicted in the background (areas without text), this loss is increased to force the network not to incorrectly label TCR in the background.\n\nTo stabilize training, the paper uses the OHEM (Online Hard Example Mining) method. OHEM selects difficult negative samples (pixels that do not belong to the text region) for loss computation, preventing an excess of easy-to-classify negative samples from affecting training. The ratio of negative to positive samples is set to 3:1.\n\nIn the experiment, hyperparameters are set to $\\lambda_1 = 1.0$ and $\\lambda_2 = 0.5$, which represent the weights of $L_{\\text{tcrp}}$ and $L_{\\text{tcrn}}$ in the overall classification loss.\n\n---\n\nRegression loss is used to teach the model to estimate text properties such as height and orientation accurately.\n\nHowever, since only the TCR provides clear height and orientation information (TCR is a region that precisely falls at the center of the text, allowing stable acquisition of text direction and height annotations), regression loss is only calculated within the TCR region.\n\nIt is defined as:\n\n$$\nL_{\\text{reg}} = L_{h} + \\beta(L_{\\sin} + L_{\\cos})\n$$\n\nThis includes three parts:\n\n1. **$L_h$: Height regression loss**\n\n   Used to measure the difference between the predicted and actual height.\n\n   Here, the height $h$ is composed of $h_1$ and $h_2$ (as previously defined, $h = h_1 + h_2$).\n\n   The loss is computed as:\n\n   $$\n   L_{h} = \\frac{1}{|\\Omega|} \\sum_{i \\in \\Omega} \\left( \\log(h + 1) \\sum_{k=0}^{2} \\text{smoothL1}\\left(\\frac{\\hat{h}_{ki}}{h_{ki}} - 1\\right) \\right)\n   $$\n\n   Where:\n\n   - $\\Omega$: The set of all positive samples in the TCR (pixels with corresponding annotations).\n   - $h_{ki}$: Ground-truth height-related parameters. The equation retains the paper’s $k=0,1,2$ notation, whose three indices are not fully explained. The released code sums the upper and lower height losses and comments out the logarithmic weight. Reproduction should distinguish the paper equation from that implementation.\n\n     ***\n\n\n> [!TIP]\n> \n> **Why is there a $\\log(h+1)$ weighting term?**\n> \n> Because for larger texts (higher heights), the impact of prediction errors may be more significant. By using $\\log(h+1)$, we give higher weight to larger text components, helping the model maintain accuracy across various text sizes.\n\n\n2. **$L_{\\sin}$ and $L_{\\cos}$: Direction regression loss**\n\n   Used to measure how accurately the predicted text direction (represented by $\\sin \\theta$ and $\\cos \\theta$) matches the actual direction:\n\n   $$\n   L_{\\sin} = \\text{smoothL1}(\\hat{\\sin\\theta} - \\sin\\theta)\n   $$\n\n   $$\n   L_{\\cos} = \\text{smoothL1}(\\hat{\\cos\\theta} - \\cos\\theta)\n   $$\n\n   Smooth L1 loss is used to reduce the impact of extreme errors, making the training more stable.\n\n3. **$\\beta$: A balancing factor**\n\n   Used to control the weight of the direction losses $L_{\\sin}$ and $L_{\\cos}$ within the overall $L_{\\text{reg}}$. The paper sets $\\beta = 1.0$.\n\n### Generating Local Graphs\n\n\n\n![local-graph](/content/papers/assets/5ee2bbbf773d0e1ecb94875a4f4b612bac823100d951bef82d8a3ea9194b690d.jpg)\n\n\n\nSince the author aims to use Graph Convolutional Networks (GCN) to solve the text detection problem in this paper, the relationships between text components need to be represented as a graph.\n\nIn an image, many text components may be detected, and generating a large graph structure for the entire image (i.e., fully connecting all nodes) would be highly inefficient.\n\nIn practice, each text component is only likely to have relationships with a few nearby components, so it is unnecessary to establish relationships with all components in the image. Therefore, the author chooses to create a \"local graph\" for each \"pivot\" text component, containing only a few neighboring components, avoiding the complexities of a global graph.\n\nA local graph is centered around a specific text component (called the \"pivot\") and considers only the neighboring components within a small region, forming a smaller graph structure. This limits the size of the graph and speeds up the subsequent relational inference process.\n\nTo create the local graph, the author refers to prior works (as listed below). From the detected text components, one component is selected as the \"pivot,\" and around this pivot, its neighboring nodes are found to form a local graph $G_p$. The neighboring nodes are divided into \"1-hop\" and \"2-hop\" ranges:\n\n- 1-hop neighbors: Starting from the pivot, up to 8 closest components (in terms of some similarity measure) are selected as first-order neighbors (i.e., the components closest to the pivot).\n- 2-hop neighbors: Select up to four neighbors **for each** 1-hop node, then remove duplicates when forming the local graph.\n\n\n> [!TIP]\n> \n> Reference: [**[19.03] Linkage Based Face Clustering via Graph Convolution Network**](https://arxiv.org/abs/1903.11306)\n\n\nBefore deduplication, this gives up to $1+8+8\\times4=41$ node candidates, including the pivot. This is much smaller than a fully connected graph over hundreds or thousands of image components.\n\nFinally, to decide which components are the closest neighbors of the pivot, a \"similarity\" or \"distance\" measure is required.\n\nIn the paper, the relative Euclidean distance is used to define the similarity:\n\n$$\nE_s = 1 - \\frac{D(p, v_i)}{\\max(H_m, W_m)}\n$$\n\n- $D(p, v_i)$ is the L2 Euclidean distance between the pivot $p$ and the node $v_i$ (the distance in image coordinate space).\n- $H_m$ and $W_m$ are the height and width of the entire image.\n\n### Filtering Redundant Samples\n\nDuring training, if the local graphs corresponding to different pivots selected from the same text instance are too similar (for example, selecting adjacent characters from the same line of text as pivots, leading to overlapping nodes in the local graphs), the model may keep learning \"easy samples,\" making the training inefficient.\n\nTo address this, the author proposes a filtering criterion:\n\n$$\nG_{\\text{iou}} = \\frac{|G_p \\cap G_q|}{|G_p \\cup G_q|} < \\xi\n$$\n\nWhere $G_p$ and $G_q$ are the two local graphs formed by different pivots within the same text instance $T$. The intersection ($\\cap$) and union ($\\cup$) of their 1-hop neighbor sets are computed to measure the \"overlap ratio\" between the two local graphs.\n\nIf the overlap ratio $G_{\\text{iou}}$ is too high (e.g., close to 1, indicating the two local graphs are nearly identical), the pivot is not used to avoid generating redundant, easy samples.\n\nIn the experiment, the author sets $\\xi = 0.75$, meaning that a pivot is only used if the overlap ratio is less than 0.75. This reduces redundant local graphs.\n\n### Graph Convolutional Network\n\nIn the previous steps, the author built multiple \"local graphs\" for each image, with each local graph containing a \"pivot node\" and its 1-hop and 2-hop neighboring nodes. These local graphs capture preliminary connection information between nodes, but they provide only rough estimates of relationships.\n\nTo make more in-depth inferences about the true connection probabilities between nodes—especially in determining the relationships between pivot nodes and their 1-hop neighbors—the author introduces the \"Graph Convolutional Network (GCN)\" model.\n\nThrough GCN, neighboring information can be aggregated layer by layer within the graph structure, allowing for higher-order relational reasoning.\n\n\n> [!TIP]\n> \n> All the prior setup is to introduce \"Graph Convolutional Networks\" here!\n\n\nA graph (denoted as $g(X, A)$) is typically represented as:\n\n- $X$: The node feature matrix, where each row represents the feature vector of a node.\n- $A$: The adjacency matrix, which describes the connectivity between nodes. If the $i$-th node is connected to the $j$-th node, then $A_{ij} = 1$; otherwise, it is 0 (or another weight).\n\nIn this case, we need to build the node feature matrix $X$ and the adjacency matrix $A$ for the local graph $G_p$ (the local graph centered around pivot $p$) and then input them into the graph convolution network for relational inference.\n\nThe node features consist of two main parts:\n\n1. **RROI Features (RROI features)**\n2. **Geometric Features (geometric features)**\n\nRRoI-Align (RRoI stands for Rotated Region of Interest, which is a RoI standard that considers rotated text boxes) is used to extract feature blocks for each text component from the image feature map. These feature vectors are denoted as $F_r$.\n\n\n> [!TIP]\n> \n> For details on RRoI-Align, refer to:\n> \n> - [**[17.03] Arbitrary-oriented scene text detection via rotation proposals**](https://arxiv.org/abs/1703.01086)\n\n\nThese features primarily come from the appearance information of the image. While they capture textures and shapes within the text region, they lack \"geometric properties\" (such as the position, scale, and orientation of the text component in the overall image).\n\nTherefore, to make the node features more comprehensive, the author directly uses Transformer’s positional encoding to embed the geometric information of the text components into a high-dimensional space:\n\n$$\n\\varepsilon_{2i}(z) = \\cos\\left(\\frac{z}{1000^{2i/C_{\\varepsilon}}}\\right), \\quad i \\in [0, C_{\\varepsilon}/2 - 1]\n$$\n\n$$\n\\varepsilon_{2i+1}(z) = \\sin\\left(\\frac{z}{1000^{2i/C_{\\varepsilon}}}\\right), \\quad i \\in [0, C_{\\varepsilon}/2 - 1]\n$$\n\nFor each text component, there are 6 geometric properties (e.g., $x, y, h, w, \\cos\\theta, \\sin\\theta$). Each property is transformed into $C_{\\varepsilon}$ dimensions using the above embedding, so the total dimensionality is $6 \\cdot C_{\\varepsilon}$, which is denoted as $F_g$.\n\nFinally, $F_r$ (RROI features) and $F_g$ (geometric features embeddings) are concatenated together to form the complete feature vector for the node, denoted as $x_q = [F_r; F_g]$. Before graph processing, subtract the pivot feature $x_p$ to obtain relative node features $x_q-x_p$.\n\n---\n\nAfter preparing the node features, the next step is to construct the adjacency matrix $A$.\n\nTo control the sparsity of the graph and the computation load, the author selects only the $u$ closest neighbors for each node, ensuring that each node does not connect to too many other nodes. If node $n_j$ is one of the $u$ nearest neighbors of node $n_i$, then $A_p(n_i, n_j) = 1$, otherwise it is 0. In the experiment, $u$ is set to 3.\n\nThe resulting adjacency matrix $A \\in \\mathbb{R}^{N \\times N}$ defines the topological structure of the local graph.\n\n---\n\nWith the node feature matrix $X$ and adjacency matrix $A$ in hand, the author stacks one layer of Batch Normalization and four graph convolution layers, each followed by a ReLU activation. The model is trained using softmax cross-entropy loss to predict the connection between 1-hop nodes and the pivot.\n\nDuring training, the backpropagation process only optimizes the classification error for the 1-hop nodes, as the key decision is whether the pivot is connected to its nearest neighbors. The 2-hop nodes provide supplementary information to allow the graph convolution to capture broader contextual features but are not directly optimized for 2-hop connections.\n\nDuring testing, the trained model is used to determine the connections between the pivot and its 1-hop neighbors, reconstructing the entire text instance. Let's take another look at the graph we discussed earlier:\n\n\n\n![architecture](/content/papers/assets/96fa95364af4e797311e2f2988cd28fed479477c19ca85791808b9b04b1f1db8.jpg)\n\n\n\nThe text-node features pass through the GCN, and a softmax gives the linkage probability between each 1-hop component and the pivot. At inference, the model builds a local graph in turn around each component, then uses breadth-first search (BFS) to merge linked components. Min-Path orders their centers, and joining the ordered top and bottom midpoints produces the final text boundary.\n\n## Discussion\n\n### Ablation Study\n\n\n\n![ablation](/content/papers/assets/acfc2e3d101ba3850355342429db2a017d34428d52a270cea46521a3bb1afa39.jpg)\n\n\n\nThe entire model architecture is quite complex, so let's directly examine the ablation study.\n\nTo reduce the impact of data differences on the experimental results, the author first uses SynthText as the pretraining dataset, then fine-tunes the model on Total-Text and CTW1500. For the MSRA-TD500 dataset, which includes both English and Chinese text, the author chose to use ICDAR2017-MLT for pretraining, followed by fine-tuning on MSRA-TD500.\n\nThe experimental results are shown in the table above. The baseline groups components by the intersection of text region and center region rather than by GCN-learned links. Adding relational reasoning improves Hmean (F-score) across all three datasets:\n\n- On Total-Text, Hmean improved by 1.83 percentage points.\n- On CTW1500, Hmean improved by 0.78 percentage points.\n- On MSRA-TD500, Hmean improved by 4.27 percentage points.\n\nThe gain is largest on MSRA-TD500, showing that relational reasoning helps on this long-text dataset under the reported training and evaluation conditions. The authors suggest that CTW1500's smaller gain may partly reflect annotation issues:\n\n- CTW1500 does not have a \"DO NOT CARE\" annotation standard, meaning some very small text or non-English text is not annotated. This causes interference during evaluation, as seen in the following example.\n- The text line annotations in this dataset can sometimes be quite messy, making it difficult for the model to align its predictions with the annotations.\n\n\n\n![comparison](/content/papers/assets/45ac0b4e6155eb3f447853ad6beeac3aef80acec48c8681c23b940de7b89afa3.jpg)\n\n\n\nDespite the smaller gain on CTW1500, all three ablations support a benefit from the relational reasoning network in these tested settings.\n\n\n> [!TIP]\n> \n> Isn’t the ablation study a bit lacking?\n> \n> We see that the entire GCN module has so many components, but in the ablation study, it is treated as a whole, without a more detailed analysis. This is somewhat regrettable.\n\n\n### Comparison with Other Methods\n\n\n\n![comparison](/content/papers/assets/be9ba4fd1cefbbdf497147f6ff6e6d84f3defb47d6de442de0b3c6de5c35b2e4.jpg)\n\n\n\nThe author used ICDAR2017-MLT as the pretraining dataset and fine-tuned the model on CTW1500 and Total-Text.\n\nAs shown in the table above, DRRG achieves an Hmean of 85.73% on Total-Text and 84.45% on CTW1500, above the other methods listed in these two columns. Compared with the listed TextSnake results, DRRG gains 8.85 percentage points on CTW1500 and 7.33 percentage points on Total-Text.\n\nOn MSRA-TD500, DRRG also achieves an Hmean of 85.08%, which outperforms other methods.\n\n### Visualization Results\n\n\n\n![visualization](/content/papers/assets/9b1e6f4e56183a4f0df338fb492884296e7a44e3809041b01cb3b97c2b17b18e.jpg)\n\n\n\nFor curved and irregular text, the author also achieved good results in the experiments.\n\nThe upper row shows how DRRG groups text components; the lower row shows the boundaries generated from those groups. These examples illustrate detections across different text shapes.\n\n## Conclusion\n\nThe innovation of this paper lies in the application of Graph Convolutional Networks (GCN) to structure the relationships between text components as a graph problem. By using GCN to deeply reason about the connections between nodes and edges, the true relational links are determined. This allows for effective integration and reorganization of these components in the post-processing step, ultimately forming complete text instances.\n\nIn the subsequent TextBPN architecture, we again see the use of Graph Convolutional Networks, further demonstrating their effectiveness in text detection tasks.\n\n\n> [!NOTE]\n> \n> In this paper, GCN is used to find the connections between text nodes, while another paper uses GCN to refine the coordinate predictions of text contours. Interested readers can refer to:\n> \n> - [**[21.07] TextBPN: Revisiting GCN**](/blog/papers/text-detection/textbpn)\n\n\n\n> [!TIP]\n> \n> Despite the complexity of model architectures, graph convolution is a very appealing research direction. It breaks away from traditional CNN architectures, bringing the reasoning power of graph problems into deep learning, opening up new possibilities for many applications.\n","imageSizes":{"/content/papers/assets/7f65ed561e78695572f8751aacdcb0033cdc33d5926dec733cffa9363404f6dd.jpg":{"width":1602,"height":532},"/content/papers/assets/dc8171f5ae563e294715253d42ca430567f4273b93c4720cb4a569843d8fb84d.jpg":{"width":890,"height":850},"/content/papers/assets/5cf4b14252cc9d002fc8b2a6e29ad8b41d474c50a4bec5fcff045d549ffbf24e.jpg":{"width":988,"height":714},"/content/papers/assets/94b45f25075c5f8389629ad81a990f3b430354a65a8526ecd817f708afc69f50.jpg":{"width":988,"height":338},"/content/papers/assets/5ee2bbbf773d0e1ecb94875a4f4b612bac823100d951bef82d8a3ea9194b690d.jpg":{"width":988,"height":756},"/content/papers/assets/96fa95364af4e797311e2f2988cd28fed479477c19ca85791808b9b04b1f1db8.jpg":{"width":616,"height":530},"/content/papers/assets/acfc2e3d101ba3850355342429db2a017d34428d52a270cea46521a3bb1afa39.jpg":{"width":980,"height":396},"/content/papers/assets/45ac0b4e6155eb3f447853ad6beeac3aef80acec48c8681c23b940de7b89afa3.jpg":{"width":1008,"height":632},"/content/papers/assets/be9ba4fd1cefbbdf497147f6ff6e6d84f3defb47d6de442de0b3c6de5c35b2e4.jpg":{"width":1648,"height":712},"/content/papers/assets/9b1e6f4e56183a4f0df338fb492884296e7a44e3809041b01cb3b97c2b17b18e.jpg":{"width":1738,"height":640}}}
