Complex scene text detection method based on deep learning

By introducing global context convolution module and ResNet50-TransGC network into text detection, the text detection problem in complex backgrounds is solved, and the accuracy and robustness of text detection is improved, especially in the face of variable text shapes and directions. Detection effect.

CN118968491AActive Publication Date: 2024-11-15SICHUAN JISU POWER TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411172626.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-11-15
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The prior art is difficult to distinguish between text and non-text areas in complex contexts, difficult to cope with variable text shapes and directions, and small text instances are difficult to detect.

Method used

Adopting complex scene text detection methods based on deep learning, including constructing global context convolution modules and ResNet50-TransGC networks, the model's utilization of context information and long-distance dependency construction is enhanced by introducing Transformer encoder and multi-layer global context convolution modules. Model ability.

Benefits of technology

Improve the accuracy and robustness of text detection, can better distinguish text and non-text areas in complex backgrounds, cope with variable text shapes and directions, enhance the detection accuracy of small text instances, and realize the complex scenarios Text accurate detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968491A_ABST
    Figure CN118968491A_ABST
Patent Text Reader

Abstract

The invention discloses a complex scene text detection method based on deep learning, and belongs to the technical field of specific computer models, and the method comprises the steps: obtaining a text detection data set; a GCCM module is constructed; constructing a multi-layer global context convolution module on the basis of two Comodule modules, three GCCM modules, a splitting unit and a Conca unit, constructing a ResNet50-TransGC network on the basis of a backbone network of a Mask R-CNN and the multi-layer global context convolution module, and training the ResNet50-TransGC network to convergence by using a text detection data set to obtain a text detection model; and S6, obtaining a to-be-recognized text image, performing target recognition by using the text detection model, and outputting a prediction textbox. According to the method, text and non-text areas in a complex background can be more easily distinguished, variable text shapes and directions can be dealt with, the detection precision of small text instances is improved, and the modeling capability for long-distance dependence is enhanced, so that accurate text detection in a complex scene is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a specific computing model, and in particular to a complex scene text detection method based on deep learning. Background Art

[0002] Intelligent text recognition technology refers to the process of automatically identifying text from an image containing text by a computer, which includes two parts: text detection and text recognition. This invention mainly studies text detection technology. There are many existing technical solutions for text detection technology, such as: 1. Traditional methods: Based on classic computer vision technologies such as edge detection, connected component analysis, and Hough transform, lines and boundaries in images are detected to locate text areas. However, traditional methods are not effective in complex backgrounds or lighting conditions, and have limited detection capabilities for non-standard fonts or handwriting.

[0003] 2. Morphological methods: Using mathematical morphological operations, such as dilation and erosion, to enhance text edges and remove noise, suitable for structured text detection. However, morphological methods are mainly suitable for structured text detection, and have poor detection effects on free-form or unstructured text.

[0004] 3. Deep learning-based methods: Use deep learning models such as convolutional neural networks (CNN), recurrent neural networks (RNN), and long short-term memory networks (LSTM). These models can learn features from a large amount of labeled data to detect text. CRNN (Convolutional Recurrent Neural Network) combines CNN and RNN for sequence modeling, such as text line detection and recognition. Object detection frameworks such as Mask R-CNN and Faster R-CNN take images with text as input, treat text as targets, and output images with target detection boxes. These methods can accurately locate and segment text in images. However, there are still defects: (1) It is difficult to accurately detect text detection in complex backgrounds: In complex backgrounds, text may be mixed with other graphic elements, making it difficult for the model to distinguish between text and non-text areas. (2) It is difficult to cope with variable text shapes and directions: Text may appear in a variety of shapes, such as curved, tilted, or irregularly arranged. (3) Small text may only occupy a small part of the image, so small text instances are often difficult to detect.

[0005] Transformer generally refers to Transformer encoder-decoder. It includes Transformer encoder and Transformer decoder. Transformer encoder is part of the Transformer architecture. It is composed of multiple identical layers. Each layer has two sublayers. The first sublayer is multi-head self-attention aggregation. Multi-head self-attention allows the model to focus on different positions of the input at the same time and process information in parallel from multiple angles, thereby enhancing the ability to model global dependencies. This mechanism enables the model to effectively distinguish and aggregate relevant information from different parts of the input sequence, even if the information is physically far apart. The second sublayer is a position-based feed-forward network. Its main component is a multi-layer perceptron (MLP). MLP consists of a series of fully connected layers to further process and transform feature representations to make them more abstract and complex. By introducing nonlinear transformations, MLP can learn higher-level feature combinations and provide the model with more powerful expression capabilities. In order to further improve the performance of the model, residual connections are embedded in each sublayer. Residual connections allow inputs to skip one or more layers and pass directly to subsequent layers, which helps alleviate the gradient vanishing / exploding problem and makes the network more stable when training deep structures. By combining multi-head attention and MLP, the Transformer self-attention structure not only strengthens the capture of different local information, but also deeply mines features through the self-attention mechanism. The self-attention mechanism allows the features of each position to interact with the features of all other positions in the sequence, thereby revealing the intrinsic correlation between features and promoting the comprehensive understanding and utilization of features.

[0006] ResNet50 is a commonly used deep convolutional neural network. It is structurally divided into five stages, named Stage 0, Stage 1, Stage 2, Stage 3, and Stage 4, which can be translated as Stage 0, Stage 1, Stage 2, Stage 3, and Stage 4. Stage 0 has a simple structure and contains only one convolution operation. The convolution kernel is 7×7 and the step size is 2. It can be regarded as input preprocessing. The structures of stages 1 to 4 are relatively similar and are composed of several Bottleneck blocks. For example, stage 1 contains 3 bottleneck blocks, and stages 2 to 4 include 4, 6, and 3 bottleneck blocks respectively. Bottleneck, referred to as BTNK, is a special type of residual module used to increase the depth of the network and reduce the amount of calculation. It is divided into two specific implementation methods, BINK1 and BINK2. BINK1 refers to a Bottleneck structure with different numbers of input and output channels, while BINK2 refers to a Bottleneck structure with the same number of input and output channels. BTNK2 has two variable parameters C and W, which are C and W in the input shape (C, W, W). Let the input of shape (C, W, W) be x, let the three convolution blocks on the left side of BTNK2 (and the related BN and RELU) be the function F(x), add the two together (F(x)+x) and then pass through a Reu activation function to get the output of BTNK2, which is still in the shape of (C, W, W). BTNK1 has four variable parameters C, W, C1 and S. Compared with BTNK2, BTNK1 has an additional convolution layer on the right, let it be the function G(x). BTNK1 corresponds to the case where the number of channels of input x and output F(x) are different. It is this added convolution layer that changes x to G(x), which plays a role in matching the difference in input and output dimensions (G(x) and F(x) have the same number of channels), and then the sum F(x)+G(x) can be performed. Stage 4 of ResNet50 consists of 1 BINK1 and 2 BINK2.

[0007] Mask R-CNN is a deep learning model for object detection and instance segmentation. It is an extension of Faster R-CNN. It mainly includes the backbone network (Backbone), region proposal network (RPN), Roni Head, classification and bounding box regression and segmentation branches.

[0008] ConvModule module: This module is commonly used in the target detection networks of the YOLOv5 series to the YOLOv8 series. This module contains three functions: convolution, normalization, and activation. Specifically, it consists of 1 layer of 3×3 Conv2d + BatchNorm + SiLU activation function. The conx2d function is an important function in the deep learning library TensorFlow, which is used to implement the convolution operation of the convolutional neural network (CNN). Its input parameters include the input matrix, filter (weight), step size, and padding method, and its output is generally the result after convolution. BatchNorm (Batch-Normalization) is a commonly used technique in deep learning that is used to accelerate the training of neural networks and improve the performance of the model. It normalizes the input in each hidden layer in the network, making the input distribution of each element more stable, which helps the convergence and training effect of the network. Summary of the invention

[0009] The purpose of the present invention is to provide a complex scene text detection method based on deep learning that solves the defects of difficulty in distinguishing text and non-text areas in complex backgrounds, difficulty in coping with variable text shapes and directions, and difficulty in detecting small text instances.

[0010] In order to achieve the above object, the technical solution adopted by the present invention is as follows: a complex scene text detection method based on deep learning, comprising the following steps; S1, obtaining a text detection data set, wherein the samples in the text detection data set are text images containing text box annotations; S2, construct a GCCM module, including a global average pooling layer, a first 1×1 convolutional layer, a 1×11 depthwise separable convolutional layer, a 11×1 depthwise separable convolutional layer, a second 1×1 convolutional layer and a sigmoid activation function layer connected from top to bottom; S3, construct a multi-layer global context convolution module, including 2 ConvModule modules, 3 GCCM modules, split unit and Concat unit. The 2 ConvModule modules are marked as ConvModule1 and ConvModule2, and the 3 GCCM modules are marked as GCCM1, GCCM2 and GCCM3 respectively. The feature F of the input multi-layer global context convolution module is split into the first feature after ConvModule1 and splitting unit , Second feature , The first global context feature is outputted sequentially through GCCM1, GCCM2, and GCCM3 , the second global context feature , the third global context feature , The fourth global context feature is obtained by GCCM2 and GCCM3 in sequence , the fifth global context feature ,and and Add together to get the sixth global context feature ; , and Concatenated by Concat unit to form concatenated features , and then output multi-layer global context features through ConvModule1 ; S4, construct a ResNet50-TransGC network; A Mask R-CNN network is selected, whose backbone network is Resnet50, wherein the stage 4 of the Resnet50 includes BINK1 and two BINK2s connected in sequence, BINK1 is replaced by a Transformer encoder, and the first BINK2 is replaced by a multi-layer global context convolution module, thereby obtaining a ResNet50-TransGC network; S5, train the ResNet50-TransGC network with the text detection dataset until convergence to obtain the text detection model; S6, obtain the text image to be recognized, use the text detection model to perform target recognition, and output the predicted text box.

[0011] Preferably, the text detection dataset includes the Total-Text dataset, the ICDAR 2015 dataset and the CTW1500 dataset.

[0012] Preferably, in the global context convolution module, if the input image size is C×W×H, C is the number of channels, W and H are the width and height of the input image respectively; Then the output size of the global average pooling layer is C×1×1; The output feature size of the first 1×1 convolutional layer is K1×1×1, where K1 is the number of output channels of the first 1×1 convolutional layer; The output feature size of the 1×11 depthwise separable convolutional layer is K2×W×H, where K2 is the number of output channels of the 1×11 depthwise separable convolutional layer; The output feature size of the 11×1 depthwise separable convolutional layer is K3×W×H, where K3 is the number of output channels of the 11×1 depthwise separable convolutional layer; The output feature size of the second 1×1 convolutional layer is K4×W×H, where K4 is the number of output channels of the second 1×1 convolutional layer; The sigmoid activation function layer is used to compress the numerical value of its input feature to the interval [0,1], and its output feature size is K4×W×H.

[0013] Preferably: K1=C, K2=C / 2, K3=C / 2, K4=C.

[0014] Compared with the prior art, the advantages of the present invention are: (1) The present invention introduces the Transformer encoder in stage 4 of the backbone network. The multi-head attention mechanism in the Transformer allows the model to view input data from different angles or feature spaces. The use of context is enhanced. This design allows the model to process sequences in parallel and dynamically assign attention weights, so that context information can be used instantly and comprehensively when processing tasks such as natural language. This is particularly useful for text detection because it can simultaneously consider multiple attributes of the text, such as font, size, direction, and layout, thereby improving the accuracy and robustness of detection.

[0015] (2) A GCCM module was designed. In the present invention, GCCM stands for Global Context Convolution Module in English and Global Context Convolution Module in Chinese. In this module, a global average pooling operation is first performed on the input image to map high-dimensional features to a low-dimensional space and retain the overall information of the image. Then, a 1×1 convolution layer is used to reduce the dimension and reduce the number of channels while keeping the input space size unchanged for subsequent operations. An 11×1 depthwise separable convolution is performed, which is an efficient convolution operation that can extract more feature information while reducing computational costs. A 1×1 convolution layer is used again for further feature extraction or to adjust the number of channels to meet the needs of the model. Finally, the output is passed through a sigmoid function to limit it to the range of [0, 1] to facilitate the representation of attention weights.

[0016] (3) A multi-layer global context convolution module is designed based on the GCCM module. The module uses 3 GCCM modules to form a recursive structure. The input feature map is subjected to preliminary feature extraction and processing by ConvModule1. The output feature map is split into two parts, and the split feature maps are processed by their respective local context convolution modules. This process is repeated many times to deepen the level of feature extraction. The processed feature maps are merged together to form a new feature map. Finally, the multi-layer global context convolution module of the present invention can capture long-range context information, use global average pooling and 1D strip convolution to enhance the features of the central area, and adapt to text features of different scales. This enables the model to perceive text elements in detail and establish deeper semantic associations at multiple scales, especially when dealing with challenging text instances, such as those that are interfered with by dense backgrounds or distorted in shape.

[0017] (4) The above-mentioned Transformer encoder and multi-layer global context convolution module are integrated into stage 4 of Mask R-CNN. The Transformer encoder can process these long-distance dependencies in parallel without sacrificing computational efficiency, thereby improving the processing speed of the entire system. The GCCM module is applied recursively to capture long-distance contextual information, which is crucial for understanding the relationship between text instances. By integrating these two technologies, the model can better adapt to a variety of text instances, including texts of different fonts, sizes, orientations, and layouts. This enables the model to more effectively capture the contextual information of text instances, thereby improving the accuracy of text detection, especially when facing challenging text instances such as text in dense backgrounds and text with distorted shapes, and can achieve better detection results.

[0018] In summary, the present invention can more easily distinguish text and non-text areas in complex backgrounds, cope with variable text shapes and directions, improve the detection accuracy of small text instances, and enhance the modeling ability of long-distance dependencies, thereby achieving accurate text detection in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flow chart of the present invention; Figure 2 This is the structure diagram of the global context convolution module; Figure 3 This is the structure diagram of the multi-layer global context convolution module; Figure 4 This is the network structure diagram of ResNet50-TransGC. DETAILED DESCRIPTION

[0020] The present invention will be further described below in conjunction with the accompanying drawings.

[0021] Example 1: See Figures 1 to 4 ,A complex scene text detection method based on deep learning, characterized by: comprising the following steps; S1, obtaining a text detection data set, wherein the samples in the text detection data set are text images containing text box annotations; S2, construct a GCCM module, including a global average pooling layer, a first 1×1 convolutional layer, a 1×11 depthwise separable convolutional layer, a 11×1 depthwise separable convolutional layer, a second 1×1 convolutional layer and a sigmoid activation function layer connected from top to bottom; S3, construct a multi-layer global context convolution module, including 2 ConvModule modules, 3 GCCM modules, split unit and Concat unit. The 2 ConvModule modules are marked as ConvModule1 and ConvModule2, and the 3 GCCM modules are marked as GCCM1, GCCM2 and GCCM3 respectively. The feature F of the input multi-layer global context convolution module is split into the first feature after ConvModule1 and splitting unit , Second feature , The first global context feature is outputted sequentially through GCCM1, GCCM2, and GCCM3 , the second global context feature , the third global context feature , The fourth global context feature is obtained by GCCM2 and GCCM3 in sequence , the fifth global context feature ,and and Add together to get the sixth global context feature ; , and Concatenated by Concat unit into concatenated features , and then output multi-layer global context features through ConvModule1 ; S4, construct a ResNet50-TransGC network; A Mask R-CNN network is selected, whose backbone network is Resnet50, wherein the stage 4 of the Resnet50 includes BINK1 and two BINK2s connected in sequence, BINK1 is replaced by a Transformer encoder, and the first BINK2 is replaced by a multi-layer global context convolution module, thereby obtaining a ResNet50-TransGC network; S5, train the ResNet50-TransGC network with the text detection dataset until convergence to obtain the text detection model; S6, obtain the text image to be recognized, use the text detection model to perform target recognition, and output the predicted text box.

[0022] In this embodiment, the text detection dataset includes a Total-Text dataset, an ICDAR 2015 dataset, and a CTW1500 dataset.

[0023] In the global context convolution module, if the input image size is C×W×H, C is the number of channels, W and H are the width and height of the input image respectively; Then the output size of the global average pooling layer is C×1×1; The output feature size of the first 1×1 convolutional layer is K1×1×1, where K1 is the number of output channels of the first 1×1 convolutional layer; The output feature size of the 1×11 depthwise separable convolutional layer is K2×W×H, where K2 is the number of output channels of the 1×11 depthwise separable convolutional layer; The output feature size of the 11×1 depthwise separable convolutional layer is K3×W×H, where K3 is the number of output channels of the 11×1 depthwise separable convolutional layer; The output feature size of the second 1×1 convolutional layer is K4×W×H, where K4 is the number of output channels of the second 1×1 convolutional layer; The sigmoid activation function layer is used to compress the numerical value of its input feature to the interval [0,1], and its output feature size is K4×W×H.

[0024] In addition, K1=C, K2=C / 2, K3=C / 2, K4=C.

[0025] Regarding the multi-layer global context convolution module: it contains at least three GCCM modules, and each GCCM module is connected by feature splitting and merging to recursively enhance the feature representation. The feature splitting unit divides the output feature map of the GCCM module into two parts, one part is passed to the next GCCM module, and the other part is passed to the Concat unit. The multi-layer global context convolution module can capture long-distance context information, enhance the features of the central area, and is suitable for text features of different scales. Through multiple iterations of the GCCM module, it can capture context information of different ranges and improve the quality and diversity of feature representation. The output feature map of the multi-layer global context convolution module can be used for subsequent text detection tasks, such as text instance segmentation and bounding box regression, after being processed by the final convolution module.

[0026] Example 2: In order to illustrate the effect of the present invention, this example uses the Total-Text dataset and conducts comparative experiments with four algorithms in the prior art and the present invention under the same experimental conditions, and the following Table 1 is obtained: Table 1. Comparison of experimental results of various algorithms algorithm Precision Recall F-measure TextSnake 82.70 74.50 78.40 PSENet-1s 81.77 75.11 78.30 TextSpotter 82.50 75.60 78.60 MaskR-CNN 72.83 79.83 76.17 Method of the present invention 79.81 79.95 79.88 In Table 1, Precision is the precision rate, Recall is the recall rate, and F-measure is the weighted harmonic average of Precision and Recall. As can be seen from Table 1, the present invention is superior to the existing algorithms in terms of both precision rate and recall rate.

[0027] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A complex scene text detection method based on deep learning, Features: The steps include: S1, obtaining a text detection data set, wherein the samples in the text detection data set are text images containing text box annotations; S2, construct a GCCM module, including a global average pooling layer, a first 1×1 convolutional layer, a 1×11 depthwise separable convolutional layer, a 11×1 depthwise separable convolutional layer, a second 1×1 convolutional layer and a sigmoid activation function layer connected from top to bottom; S3, construct a multi-layer global context convolution module, including 2 ConvModule modules, 3 GCCM modules, split unit and Concat unit. The 2 ConvModule modules are marked as ConvModule1 and ConvModule2, and the 3 GCCM modules are marked as GCCM1, GCCM2 and GCCM3 respectively. The feature F of the input multi-layer global context convolution module is split into the first feature after ConvModule1 and splitting unit , Second feature , The first global context feature is outputted sequentially through GCCM1, GCCM2, and GCCM3 , the second global context feature , the third global context feature , The fourth global context feature is obtained by GCCM2 and GCCM3 in sequence , the fifth global context feature ,and and Add together to get the sixth global context feature ; , and Concatenated by Concat unit into concatenated features , and then output multi-layer global context features through ConvModule1 ; S4, construct a ResNet50-TransGC network; A Mask R-CNN network is selected, whose backbone network is Resnet50, wherein the stage 4 of the Resnet50 includes BINK1 and two BINK2s connected in sequence, BINK1 is replaced by a Transformer encoder, and the first BINK2 is replaced by a multi-layer global context convolution module, thereby obtaining a ResNet50-TransGC network; S5, train the ResNet50-TransGC network with the text detection dataset until convergence to obtain the text detection model; S6, obtain the text image to be recognized, use the text detection model to perform target recognition, and output the predicted text box.

2. According to claim 1, a complex scene text detection method based on deep learning, Features: The text detection datasets include the Total-Text dataset, the ICDAR 2015 dataset, and the CTW1500 dataset.

3. According to the complex scene text detection method based on deep learning according to claim 1, Features: In the global context convolution module, if the input image size is C×W×H, C is the number of channels, W and H are the width and height of the input image respectively; Then the output size of the global average pooling layer is C×1×1; The output feature size of the first 1×1 convolutional layer is K1×1×1, where K1 is the number of output channels of the first 1×1 convolutional layer; The output feature size of the 1×11 depthwise separable convolutional layer is K2×W×H, where K2 is the number of output channels of the 1×11 depthwise separable convolutional layer; The output feature size of the 11×1 depthwise separable convolutional layer is K3×W×H, where K3 is the number of output channels of the 11×1 depthwise separable convolutional layer; The output feature size of the second 1×1 convolutional layer is K4×W×H, where K4 is the number of output channels of the second 1×1 convolutional layer; The sigmoid activation function layer is used to compress the numerical value of its input feature to the interval [0,1], and its output feature size is K4×W×H.

4. According to claim 3, a complex scene text detection method based on deep learning, Features: K1=C、K2=C / 2、K3=C / 2、K4=C。

Citation Information

Patent Citations

  • Scene text detection method, system and equipment based on deep convolutional neural network

    CN114724155A

  • Efficient and accurate ambiguous scene character detection method and system

    CN117765520A

  • Method and system for detecting scene text

    US20220207890A1