Optical character segmentation method and device based on deep learning

By introducing a multi-scale segmentation network, a self-attention mechanism, and an RFB module into the deep learning framework, the problem of inaccurate character detection in existing technologies is solved, and more accurate character segmentation results are achieved.

CN116597448BActive Publication Date: 2026-04-21GUANGZHOU UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU UNIVERSITY
Filing Date
2023-05-16
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing methods based on bounding box regression suffer from inaccurate bounding boxes when dealing with curved or dense text, making it difficult to achieve precise character detection.

Method used

We employ a deep learning-based optical character segmentation method, using the PyTorch framework to build a multi-scale segmentation network. This network combines self-attention and CBAM attention mechanisms, increases the receptive field through an improved RFB module, and performs feature fusion in the encoding and decoding parts to optimize the model's segmentation capabilities.

Benefits of technology

It improves the accuracy and robustness of character segmentation, better handles text detection in complex backgrounds, and enhances the segmentation effect on characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116597448B_ABST
    Figure CN116597448B_ABST
Patent Text Reader

Abstract

This invention discloses a deep learning-based optical character segmentation method and apparatus. The method includes: obtaining a training dataset and a debugging dataset; establishing a multi-scale segmentation network based on an attention mechanism using the PyTorch deep learning framework; training the multi-scale segmentation network using the training dataset and fine-tuning the trained multi-scale segmentation network using the debugging dataset; and evaluating the character segmentation results of the multi-scale segmentation network according to evaluation metrics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular to an optical character segmentation method and apparatus based on deep learning. Background Technology

[0002] Currently, OCR technology has broad application prospects in many fields, such as image search (text-assisted understanding of image information), autonomous driving (recognition of road signs and traffic signs), healthcare, education (such as automatic grading of papers and assignments), and also has great application potential in industries such as finance and insurance. Generally speaking, OCR can be divided into three steps: image preprocessing, text detection, and text recognition.

[0003] Generally, deep learning-based text detection methods can be divided into two categories: those based on object detection systems and those based on segmentation. Detection-based methods include CTPN, TextBoxes, and RRPN, but these bounding box regression methods lack detail when handling curved or dense text, and can lead to inaccurate bounding box regressions. Therefore, recent research on character detection has shifted from detection-based methods to segmentation-based methods, often combining text region segmentation with bounding box calibration. This is because text detection requires highly precise bounding boxes, and detection-based methods often only determine a single quadrilateral text box. Furthermore, later algorithms like NMS are not well-suited for processing dense text regions.

[0004] In recent years, with the rise of deep learning research, some researchers have introduced the idea of ​​segmentation using deep neural networks into character detection tasks, improving the performance of character detection. Among these, the CRAFT text detection algorithm can detect individual characters very well, whether in documents or books, or in natural scenes with diverse backgrounds. This algorithm is built on a U-shaped convolutional network, with the left side of the network used for encoding and the right side for decoding. It is somewhat similar to the structure of U-Net. Summary of the Invention

[0005] The purpose of this invention is to provide a deep learning-based optical character segmentation method and apparatus, which aims to solve the above-mentioned problems in the prior art.

[0006] This invention provides a deep learning-based optical character segmentation method, comprising:

[0007] Obtain the training dataset and the debug dataset;

[0008] Use the PyTorch deep learning framework to build a multi-scale segmentation network based on an attention mechanism;

[0009] The multi-scale segmentation network was trained using the training dataset and then fine-tuned using the debug dataset.

[0010] The character segmentation results of the multi-scale segmentation network are evaluated based on evaluation metrics.

[0011] This invention provides a deep learning-based optical character segmentation device, comprising:

[0012] The acquisition module is used to obtain the training dataset and the debug dataset;

[0013] Create a module to build a multi-scale segmentation network based on an attention mechanism using the PyTorch deep learning framework;

[0014] The training module is used to train the multi-scale segmentation network using the training dataset and to fine-tune the trained multi-scale segmentation network using the debug dataset.

[0015] The evaluation module is used to evaluate the character segmentation results of the multi-scale segmentation network based on evaluation metrics.

[0016] This invention employs a novel attention mechanism for text detection, enabling the network to learn spatial and channel weights. By assigning different weights to channels and space, it enhances important features and suppresses useless features. An improved RFB module is used to increase the network's receptive field. By fusing and merging the four feature maps from the decoding section, feature loss is reduced, thereby optimizing the model's segmentation ability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of a deep learning-based optical character segmentation method according to an embodiment of the present invention;

[0019] Figure 2 This is a schematic diagram of the character image segmentation convolutional network according to an embodiment of the present invention;

[0020] Figure 3 This is a schematic diagram of the self-attention mechanism structure according to an embodiment of the present invention;

[0021] Figure 4 This is a schematic diagram of the structure of the novel attention mechanism according to an embodiment of the present invention;

[0022] Figure 5 This is a schematic diagram of the RFB module structure according to an embodiment of the present invention;

[0023] Figure 6 This is a schematic diagram of the improved RFB module structure according to an embodiment of the present invention;

[0024] Figure 7 This is a schematic diagram of a deep learning-based optical character segmentation device according to an embodiment of the present invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.

[0026] Method Implementation Examples

[0027] According to embodiments of the present invention, a deep learning-based optical character segmentation method is provided. Figure 1 This is a flowchart of a deep learning-based optical character segmentation method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the deep learning-based optical character segmentation method according to an embodiment of the present invention specifically includes:

[0028] Step S101: Obtain the training dataset and the debug dataset; specifically, obtain the Synth800k dataset and use it as the training dataset, obtain the ICDAR2013 dataset and the ICDAR2017 dataset and use them as the debug dataset.

[0029] Step S102: A multi-scale segmentation network based on an attention mechanism is established using the PyTorch deep learning framework. Specifically, the self-attention mechanism and the CBAM attention mechanism are fused to obtain an attention mechanism for text detection. The attention mechanism is introduced into different encoding sub-modules of the multi-scale segmentation network. An improved RFB module is inserted between the encoding and decoding parts of the multi-scale segmentation network to increase the receptive field of the multi-scale segmentation network. The multi-scale segmentation network is set to multi-scale output, so that the features extracted at different levels are merged to improve semantic information. The multi-scale segmentation network has the ability to suppress background regions that are irrelevant to the segmentation task and has the ability to increase the weight of the target region, thereby achieving accurate character segmentation.

[0030] Specifically, an attention mechanism is introduced into different sub-modules of the VGG16_bn encoding on the left side of the original CRAFT network of the multi-scale segmentation network. The attention mechanism is a fusion of the self-attention mechanism and the CBAM attention mechanism: the self-attention mechanism obtains the correlation score between each word by multiplying the K and Q feature matrices obtained by 1×1 convolution, and then multiplies the score with matrix V after passing it through a softmax classifier to obtain the weight distribution of matrix V and obtain the correlation between each word. The two 1×1 convolution kernels of the K and Q branches are replaced with the channel and spatial attention modules in CBAM.

[0031] An RFB module is added between the encoding and decoding networks of the multi-scale segmentation network. After the output feature map of the previous layer enters the RFB module, the number of channels of the feature map is reduced by 1×1 convolution. Then, convolution kernels with sizes of 1×1, 1×3, 3×1 and 3×3 are used to obtain multi-scale features. Finally, dilated convolutions with dilation rates of 1, 3 and 5 are used to expand the receptive field of the network. Finally, the outputs of different convolution kernels are merged.

[0032] Multi-scale output is achieved through a multi-scale segmentation network. The three feature maps of the decoding module and the output feature map of the last layer are fused. Deconvolution is used to upsample the three feature maps by 2x, 4x and 8x respectively. Finally, a 1×1 convolution is used to reduce the dimensionality of the feature maps.

[0033] Step S103: Train the multi-scale segmentation network using the training dataset and fine-tune the trained multi-scale segmentation network using the debug dataset; specifically, perform 50K iterations on the Synth800k dataset, and then perform 25k iterations on the ICDAR2013 and ICDAR2017 datasets for fine-tuning. During fine-tuning, the Synth800k dataset is used at a ratio of 1:5.

[0034] Step S104: Evaluate the character segmentation results of the multi-scale segmentation network according to the evaluation index.

[0035] Specifically, based on Equations 1 to 3, the precision, recall, and weighted harmonic mean F-measure of the multi-scale segmentation network are evaluated:

[0036]

[0037] Wherein, TP represents the pixels of the target object correctly predicted in the segmented image, and FP represents the pixels of the target object incorrectly predicted in the segmented image;

[0038]

[0039] Where TP represents the pixels of the target object that are correctly predicted in the segmented image, and FN represents the pixels of the target object that are incorrectly predicted in the segmented image;

[0040]

[0041] Among them, It's the weight.

[0042] The technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0043] This invention uses the publicly available Synth800k dataset to train the model and fine-tunes it using the ICDAR2013 and ICDAR2017 datasets. The Synth800k dataset uses a character-level annotation method and consists of a large number of synthetic images from different natural scenes. The data is then fed into the designed model for training. After training, the model can be tested to achieve character segmentation.

[0044] To achieve the above objectives, the technical solution of this invention includes the following steps:

[0045] Step S1: Obtain the Synth800k, ICDAR2013, and ICDAR2017 datasets;

[0046] Step S2: Using the PyTorch deep learning framework, an attention-based multi-scale segmentation network is established. The attention mechanism proposed in this invention is inspired by the traditional attention mechanism and the CBAM attention mechanism. By fusing these two attention mechanisms, a novel attention mechanism for text detection is proposed, and attention mechanisms are introduced into different encoding sub-modules of the network. An improved RFB module is inserted between the encoding and decoding parts of the network to increase the receptive field of the network. In addition, the original single output of the network is changed to multi-scale output, which allows features extracted at different levels to be merged to improve semantic information. The proposed network has the ability to suppress background regions irrelevant to the segmentation task while increasing the weight of the target region, thereby improving the accuracy of character segmentation.

[0047] Step S3: First, perform 50K iterations on the Synth800k dataset, and then perform 25K iterations for fine-tuning on the ICDAR2013 and ICDAR2017 datasets.

[0048] Step S4: Test the model and comprehensively evaluate the character segmentation results based on the evaluation metrics.

[0049] In summary, this invention employs a novel attention mechanism for text detection, enabling the network to learn spatial and channel weights. By assigning different weights to channels and space, it enhances important features and suppresses useless features. This invention also utilizes an improved RFB module to increase the network's receptive field. Furthermore, by fusing and merging the four feature maps from the decoding layer, this invention reduces feature loss and optimizes the model's segmentation capabilities.

[0050] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0051] Step S1: Obtain the Synth800k, ICDAR2013, and ICDAR2017 datasets;

[0052] Step S2: Build this network using the PyTorch deep learning framework. The structure of the convolutional neural network proposed in this invention is as follows: Figure 2 As shown.

[0053] The network designed in this embodiment introduces an attention mechanism in different sub-modules of the VGG16_bn encoding on the left side of the original CRAFT network. This attention mechanism is a self-attention mechanism (e.g., Figure 3The combination of the self-attention mechanism (as shown) and the CBAM attention mechanism, where the K and Q feature matrices obtained by 1×1 convolution are multiplied to obtain the correlation score between each word, and the score is then multiplied by matrix V after passing through a softmax classifier to obtain the weight distribution of matrix V, thus obtaining the correlation between each word. Since all input vectors are considered, it can effectively learn the semantic information between contexts. However, it does not consider the positional and spatial information of the vectors. Because in actual text processing problems, words in different positions may have different properties, for example, verbs often appear less frequently at the beginning of a sentence. Therefore, this embodiment of the invention enhances the learning ability of the network by replacing the two 1×1 convolution kernels of the K and Q branches with the channel and spatial attention modules in CBAM, such as... Figure 4 As shown.

[0054] To address the issue of varying text sizes in different scenarios, this invention adds an RFB module between the encoding and decoding networks, as shown in the specific structure below. Figure 5 As shown in the diagram, after the previous layer's output feature map enters the RFB module, it first reduces the number of channels in the feature map using a 1×1 convolution. Then, it uses convolutional kernels of sizes 1×1, 1×3, 3×1, and 3×3 to obtain multi-scale features. Finally, it uses dilated convolutions with dilation rates of 1, 3, and 5 to expand the network's receptive field. The outputs of different convolutional kernels are then merged to complete feature fusion. Figure 6 As shown, this embodiment of the invention is inspired by InceptionV3, and decomposes an n×n convolutional layer in a module into a 1×n convolutional layer and an n×1 convolutional layer. Figure 6 As shown, the 3×3 convolution in the rightmost branch is replaced with a concatenation of a 3×1 convolution and a 1×3 convolution. This reduces the computational cost and increases the model's speed. Furthermore, adding a non-linear layer enhances the model's fitting ability. This asymmetric convolutional structure splitting is more effective than symmetric convolutional structure splitting in handling more and richer spatial features and increasing feature diversity, while reducing computational cost, which helps to clearly locate character positions and improve character segmentation accuracy.

[0055] During feature extraction, downsampling can lead to the loss of some character information. To address this issue, this invention proposes a multi-scale output approach, fusing the three feature maps from the decoding module with the output feature map from the final layer. To match size and channels, deconvolution is used to upsample the three feature maps by 2x, 4x, and 8x respectively. Finally, a 1×1 convolution is applied to reduce dimensionality and parameters. This approach not only preserves character information from different feature layers but also passes it to other layers for semantic aggregation, thereby enhancing the network's character segmentation accuracy.

[0056] Step S3: First, perform 50,000 iterations on the Synth800k dataset, then fine-tune on the ICDAR2013 and ICDAR2017 datasets, setting the number of iterations for fine-tuning to 25,000. During fine-tuning, the Synth800k dataset is also used at a 1:5 ratio to ensure that character regions are indeed separated.

[0057] Step S4: After the character model training is complete, the character segmentation results are evaluated according to evaluation metrics. These metrics include precision, recall, and the weighted harmonic mean (F-Measure). The formulas are as follows:

[0058]

[0059] TP represents the pixels of the target object that were correctly predicted in the segmented image, while FP represents the pixels of the target object that were incorrectly predicted in the segmented image.

[0060]

[0061] TP represents the pixels of the target object that were correctly predicted in the segmented image, while FN represents the pixels of the target object that were incorrectly predicted in the segmented image.

[0062]

[0063] in It's the weight.

[0064] In summary, this invention employs a novel attention mechanism for text detection, enabling the network to learn spatial and channel weights. By assigning different weights to channels and space, it enhances important features and suppresses useless features. An improved RFB module is used to increase the network's receptive field. By fusing and merging the four feature maps from the decoding section, feature loss is reduced, thereby optimizing the model's segmentation ability.

[0065] Device Examples

[0066] According to embodiments of the present invention, a deep learning-based optical character segmentation device is provided. Figure 7 This is a schematic diagram of a deep learning-based optical character segmentation device according to an embodiment of the present invention, as shown below. Figure 7 As shown, the deep learning-based optical character segmentation device according to an embodiment of the present invention specifically includes:

[0067] Acquisition module 70 is used to obtain the training dataset and the debugging dataset; specifically, acquisition module 70 is used for:

[0068] Obtain the Synth800k dataset and use it as the training dataset. Obtain the ICDAR2013 dataset and the ICDAR2017 dataset and use them as the debugging dataset.

[0069] Module 72 is used to build a multi-scale segmentation network based on an attention mechanism using the PyTorch deep learning framework; specifically, module 72 is used for:

[0070] A self-attention mechanism and a CBAM attention mechanism are fused to obtain an attention mechanism for text detection. The attention mechanism is introduced into different encoding sub-modules of the multi-scale segmentation network. An improved RFB module is inserted between the encoding and decoding parts of the multi-scale segmentation network to increase the receptive field of the multi-scale segmentation network. The multi-scale segmentation network is set to multi-scale output, so that features extracted at different levels are merged to improve semantic information. The multi-scale segmentation network has the ability to suppress background regions that are irrelevant to the segmentation task and has the ability to increase the weight of the target region, thereby achieving accurate character segmentation.

[0071] The establishment module 72 is specifically used for:

[0072] An attention mechanism is introduced into different sub-modules of the VGG16_bn encoding on the left side of the original CRAFT network in the multi-scale segmentation network. The attention mechanism is a fusion of the self-attention mechanism and the CBAM attention mechanism: the self-attention mechanism obtains the correlation score between each word by multiplying the K and Q feature matrices obtained by 1×1 convolution, and then multiplies the score with matrix V after passing it through a softmax classifier to obtain the weight distribution of matrix V and obtain the correlation between each word. The two 1×1 convolution kernels of the K and Q branches are replaced with the channel and spatial attention modules in CBAM.

[0073] An RFB module is added between the encoding and decoding networks of the multi-scale segmentation network. After the output feature map of the previous layer enters the RFB module, the number of channels of the feature map is reduced by 1×1 convolution. Then, convolution kernels with sizes of 1×1, 1×3, 3×1 and 3×3 are used to obtain multi-scale features. Finally, dilated convolutions with dilation rates of 1, 3 and 5 are used to expand the receptive field of the network. Finally, the outputs of different convolution kernels are merged.

[0074] Multi-scale output is achieved through a multi-scale segmentation network. The three feature maps of the decoding module and the output feature map of the last layer are fused. Deconvolution is used to upsample the three feature maps by 2x, 4x and 8x respectively. Finally, a 1×1 convolution is used to reduce the dimensionality of the feature maps.

[0075] Training module 74 is used to train the multi-scale segmentation network using a training dataset and to fine-tune the trained multi-scale segmentation network using a debug dataset; specifically, training module 74 is used for:

[0076] The fine-tuning was performed on the Synth800k dataset for 50,000 iterations, followed by 25,000 iterations on the ICDAR2013 and ICDAR2017 datasets. During the fine-tuning, the Synth800k dataset was used at a ratio of 1:5.

[0077] Evaluation module 76 is used to evaluate the character segmentation results of the multi-scale segmentation network according to evaluation metrics. Specifically, evaluation module 76 is used for:

[0078] Based on Equations 1 to 3, the precision, recall, and weighted harmonic mean F-measure of the multi-scale segmentation network are evaluated:

[0079]

[0080] Wherein, TP represents the pixels of the target object correctly predicted in the segmented image, and FP represents the pixels of the target object incorrectly predicted in the segmented image;

[0081]

[0082] Where TP represents the pixels of the target object that are correctly predicted in the segmented image, and FN represents the pixels of the target object that are incorrectly predicted in the segmented image;

[0083]

[0084] Among them, It's the weight.

[0085] The embodiments of the present invention are device embodiments corresponding to the above method embodiments. The specific operation of each module can be understood with reference to the description of the method embodiments, and will not be repeated here.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A deep learning-based optical character segmentation method, characterized in that, include: Obtain the training dataset and the debug dataset; Use the PyTorch deep learning framework to build a multi-scale segmentation network based on an attention mechanism; Specifically, it includes: By fusing self-attention and CBAM attention mechanisms, an attention mechanism for text detection is obtained. This attention mechanism is introduced into different encoding sub-modules of the multi-scale segmentation network. An improved RFB module is inserted between the encoding and decoding parts of the multi-scale segmentation network to increase its receptive field. The multi-scale segmentation network is set to output at multiple scales, allowing features extracted at different levels to be merged to improve semantic information. The multi-scale segmentation network has the ability to suppress background regions irrelevant to the segmentation task and increase the weight of the target region, thereby enabling accurate character segmentation. An attention mechanism is introduced into different sub-modules of the VGG16_bn encoding on the left side of the original CRAFT network in the multi-scale segmentation network. The attention mechanism is a fusion of the self-attention mechanism and the CBAM attention mechanism: the self-attention mechanism obtains the correlation score between each word by multiplying the K and Q feature matrices obtained by 1×1 convolution, and then multiplies the score with matrix V after passing it through a softmax classifier to obtain the weight distribution of matrix V and obtain the correlation between each word. The two 1×1 convolution kernels of the K and Q branches are replaced with the channel and spatial attention modules in CBAM. An RFB module is added between the encoding and decoding networks of the multi-scale segmentation network. After the output feature map of the previous layer enters the RFB module, the number of channels of the feature map is reduced by 1×1 convolution. Then, convolution kernels with sizes of 1×1, 1×3, 3×1 and 3×3 are used to obtain multi-scale features. Finally, dilated convolutions with dilation rates of 1, 3 and 5 are used to expand the receptive field of the network. Finally, the outputs of different convolution kernels are merged. Multi-scale output is achieved through a multi-scale segmentation network. The three feature maps of the decoding module and the output feature map of the last layer are fused. Deconvolution is used to upsample the three feature maps by 2x, 4x and 8x respectively. Finally, a 1×1 convolution is used to reduce the dimensionality of the feature maps. The multi-scale segmentation network was trained using the training dataset and then fine-tuned using the debug dataset. The character segmentation results of the multi-scale segmentation network are evaluated based on evaluation metrics.

2. The method according to claim 1, characterized in that, Obtaining the training and debugging datasets specifically includes: Obtain the Synth800k dataset and use it as the training dataset. Obtain the ICDAR2013 and ICDAR2017 datasets and use them as the debugging datasets.

3. The method according to claim 1, characterized in that, The process of training the multi-scale segmentation network using the training dataset and fine-tuning the trained multi-scale segmentation network using the debug dataset specifically includes: The dataset underwent 50,000 iterations on the Synth800k dataset, followed by 25,000 iterations on the ICDAR2013 and ICDAR2017 datasets for fine-tuning. During fine-tuning, the Synth800k dataset was used at a ratio of 1:

5.

4. The method according to claim 1, characterized in that, The evaluation of character segmentation results of multi-scale segmentation networks based on evaluation metrics specifically includes: Based on Equations 1 to 3, the precision, recall, and weighted harmonic mean F-measure of the multi-scale segmentation network are evaluated: Official 1; Wherein, TP represents the pixels of the target object correctly predicted in the segmented image, and FP represents the pixels of the target object incorrectly predicted in the segmented image; Official 2; Where TP represents the pixels of the target object that are correctly predicted in the segmented image, and FN represents the pixels of the target object that are incorrectly predicted in the segmented image; Official 3; in, It's the weight.

5. A deep learning-based optical character segmentation device, characterized in that, include: The acquisition module is used to obtain the training dataset and the debug dataset; A module is established to build a multi-scale segmentation network based on an attention mechanism using the PyTorch deep learning framework. Specifically, it integrates self-attention and CBAM attention mechanisms to obtain an attention mechanism for text detection, introduces the attention mechanism into different encoding sub-modules of the multi-scale segmentation network, inserts an improved RFB module between the encoding and decoding parts of the multi-scale segmentation network to increase the receptive field of the multi-scale segmentation network, sets the multi-scale segmentation network to multi-scale output, and merges features extracted at different levels to improve semantic information. The multi-scale segmentation network has the ability to suppress background regions irrelevant to the segmentation task and increase the weight of the target region, thereby accurately segmenting characters. An attention mechanism is introduced into different sub-modules of the VGG16_bn encoding on the left side of the original CRAFT network in the multi-scale segmentation network. The attention mechanism is a fusion of the self-attention mechanism and the CBAM attention mechanism: the self-attention mechanism obtains the correlation score between each word by multiplying the K and Q feature matrices obtained by 1×1 convolution, and then multiplies the score with matrix V after passing it through a softmax classifier to obtain the weight distribution of matrix V and obtain the correlation between each word. The two 1×1 convolution kernels of the K and Q branches are replaced with the channel and spatial attention modules in CBAM. An RFB module is added between the encoding and decoding networks of the multi-scale segmentation network. After the output feature map of the previous layer enters the RFB module, the number of channels of the feature map is reduced by 1×1 convolution. Then, convolution kernels with sizes of 1×1, 1×3, 3×1 and 3×3 are used to obtain multi-scale features. Finally, dilated convolutions with dilation rates of 1, 3 and 5 are used to expand the receptive field of the network. Finally, the outputs of different convolution kernels are merged. Multi-scale output is achieved through a multi-scale segmentation network. The three feature maps of the decoding module and the output feature map of the last layer are fused. Deconvolution is used to upsample the three feature maps by 2x, 4x and 8x respectively. Finally, a 1×1 convolution is used to reduce the dimensionality of the feature maps. The training module is used to train the multi-scale segmentation network using the training dataset and to fine-tune the trained multi-scale segmentation network using the debug dataset. The evaluation module is used to evaluate the character segmentation results of the multi-scale segmentation network based on evaluation metrics.

6. The apparatus according to claim 5, characterized in that, The acquisition module is specifically used for: Obtain the Synth800k dataset and use it as the training dataset. Obtain the ICDAR2013 and ICDAR2017 datasets and use them as the debugging datasets.

7. The apparatus according to claim 5, characterized in that, The training module is specifically used for: The fine-tuning was performed on the Synth800k dataset for 50,000 iterations, followed by 25,000 iterations on the ICDAR2013 and ICDAR2017 datasets. During the fine-tuning, the Synth800k dataset was used at a ratio of 1:

5. The evaluation module is specifically used for: Based on Equations 1 to 3, the precision, recall, and weighted harmonic mean F-measure of the multi-scale segmentation network are evaluated: Official 1; Wherein, TP represents the pixels of the target object correctly predicted in the segmented image, and FP represents the pixels of the target object incorrectly predicted in the segmented image; Official 2; Where TP represents the pixels of the target object that are correctly predicted in the segmented image, and FN represents the pixels of the target object that are incorrectly predicted in the segmented image; Official 3; in, It's the weight.

Citation Information

Patent Citations

  • Non-segmented character positioning and identification method based on deep learning

    CN107133616A

  • Remote sensing image cloud and cloud shadow fine segmentation detection method based on deep learning

    CN116052016A