Method for detecting and correcting arbitrary shape text based on fourier series coding and application

By using Fourier series encoding and bilinear interpolation correction in polar coordinates, the computational resource consumption and detection accuracy issues of deep learning methods when detecting text of arbitrary shapes are solved, achieving efficient text detection and correction.

CN115393879BActive Publication Date: 2025-11-25HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211078512.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2025-11-25
Estimated Expiration
2042-09-05

AI Technical Summary

Technical Problem

Existing deep learning methods suffer from high computational resource consumption and poor performance in detecting curved text when detecting text of arbitrary shapes in natural scenes. In particular, segmentation methods have difficulty separating neighboring text, and regression methods do not perform well in detecting text with a high degree of curvature.

Method used

Fourier series encoding is used to represent text boundaries in polar coordinates. By constructing an arbitrary-shape text detection network consisting of a feature extractor, a classification encoder, and a regression encoder, and combining it with bilinear interpolation correction, high-precision detection and correction of text regions are achieved.

Benefits of technology

The number of parameters was reduced, which improved the training speed and detection accuracy of the text detection network, and the accuracy of subsequent recognition tasks was improved through correction processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115393879B_ABST
    Figure CN115393879B_ABST
Patent Text Reader

Abstract

The application discloses an arbitrary shape text detection and correction method based on Fourier series coding and application, and steps of the method comprise the following steps: 1, constructing a training data set, comprising data acquisition and pretreatment; 2, constructing an arbitrary shape text detection network, training the network, adjusting parameters, and obtaining an optimal arbitrary shape text detection network, specifically adopting a neural network architecture based on ResNet50, and the whole network comprises a feature extractor, an encoder and a decoder; 3, post-processing of a detection result, specifically adopting a bilinear interpolation correction processing. The application can be used for high-precision detection and shape correction of arbitrary shape text in a natural scene picture, so that the recognition precision of the arbitrary shape text in the picture can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to problems in the field of image and text detection and correction, specifically to a method and application for detecting and correcting arbitrary-shaped text based on Fourier series encoding. Background Technology

[0002] In our daily lives, there are numerous images containing text information, which serve as important carriers for our information exchange and perception of the world. Image-text detection is a prerequisite for understanding the text content within these images. However, due to the influence of factors such as the size of the text area, the shape of the text, and background elements, scene text detection is fraught with challenges, especially the detection of arbitrarily shaped text, which includes curved, slanted, and elongated text.

[0003] Deep learning methods can automate complex computational processes by having neural networks learn and directly generate corresponding output results from input images. This end-to-end learning approach boasts low learning costs and excellent performance. With the development of deep learning technology, arbitrary shape text detection networks based on deep learning are currently mainly divided into two categories: segmentation methods and regression methods. Segmentation methods classify pixels in an image to obtain text regions and thus text boundaries. However, this method consumes significant computational resources and cannot effectively separate some adjacent text. Regression methods encode text boundaries, allowing the neural network to learn the encoded parameters and then decode the corresponding text boundaries. While this method is simple and easy to train, its performance is poor for text with significant curvature due to the limitations of the encoding method. Summary of the Invention

[0004] The present invention addresses the shortcomings of the existing technology by proposing a method and application for detecting and correcting arbitrary-shaped text based on Fourier series coding. This method aims to enable high-precision detection and shape correction of arbitrary-shaped text in natural scene images, thereby improving the recognition accuracy of arbitrary-shaped text in images.

[0005] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0006] The present invention provides a method for detecting and correcting arbitrary-shaped text based on Fourier series encoding, characterized by the following steps:

[0007] Step 1: Construct the training dataset, including data acquisition and preprocessing:

[0008] Step 1.1: Obtain the text image dataset, denoted as I = {I1, I2, ..., I...} p ,...,I u}, I p Let p represent the p-th text image in the text image dataset I, and u represent the total number of text images in the text image dataset I;

[0009] Step 1.2: Extract the p-th text image I p The text region in the text is obtained by taking the corresponding set of text region boundary points, denoted as . And form the text region boundary, where, Represents the p-th text image I p The coordinates of the qth boundary point of the Chinese text region, where l represents the number of boundary points of the text region;

[0010] Step 1.3: Obtain the p-th text image I p Chinese text area tr p The text center line area tcrgt p , Text header area thrgt p Text tail area ttrgt p Text upper and lower boundary areas tbrgt p Thus, the set of text centerline regions in text image dataset I is obtained, denoted as tcrgt = {tcrgt1, tcrgt2, ..., tcrgt}. p ,...tcrgt u The set of text header regions is denoted as thrgt = {thrgt1, thrgt2, ..., thrgt}. p ,...,thrgt u The set of regions at the end of the text is denoted as ttrgt = {ttrgt1, ttrgt2, ..., ttrgt}. p ,...ttrgt u The set of upper and lower boundary regions of the text is denoted as tbr={tbrgt1,tbrgt2,...,tbrgt}. p ,...,tbrgt u};

[0011] Step 1.4: Calculate the p-th text image I in polar coordinates. p Modeling is performed to obtain the corresponding text image. Thus, the set of text images in polar coordinates is obtained as follows:

[0012] Step 1.5: Obtain the p-th text image The center point of the inner text region (x p ,y p ),and Using the center point (x) of the text region p ,yp Let be the emission point, and emit k rays at equal angular intervals, intersecting the boundary of the text region. The set of distances between the center point and the boundary point of the text region is denoted as . in, This represents the p-th text image. The center point of the inner text region (x p ,y p ) to the s-th boundary point of the text region The distance between them is used to obtain the text image set. The distance set is denoted as reggt = {reggt1, reggt2, ..., reggt} p ,...,reggt u};

[0013] Step 2: Construct an arbitrary-shape text detection network, including a feature extractor, encoder, and decoder; and process the text image set... Input into the arbitrary shape text detection network;

[0014] The feature extractor described in step 2.1 consists of a ResNet50 network, a deconvolutional network, and a feature pyramid network;

[0015] The p-th text image After passing through a RestNet50 network, a deconvolutional network, and a feature pyramid network in sequence, the p-th feature map is output as result. p Thus, the feature extraction network outputs a set of text images. The feature map set result = {result1, result2, ..., result p ,...,result u};

[0016] The encoder described in step 2.2 includes a classification encoder and a regression encoder; wherein the classification encoder is composed of r two-dimensional convolutional layers with kernels of e×e and r ReLU nonlinear activation layers connected alternately; the regression encoder is composed of v two-dimensional convolutional layers with kernels of c×c and v ReLU nonlinear activation layers connected alternately.

[0017] The feature map result p After processing by the classification encoder, the p-th classification feature map cls is output. p ;

[0018] The feature map result p After processing by the regression encoder, the p-th regression feature map reg is output. p ;

[0019] The decoder described in step 2.3 includes a classification decoder and a regression decoder; wherein the classification decoder consists of a two-dimensional convolutional layer with a kernel of f×f and a softmax function; the regression decoder consists of a two-dimensional convolutional layer with a kernel of w×w and an inverse Fourier transform function.

[0020] The p-th classification feature map cls p After processing by the classification decoder, the output is the predicted p-th text centerline region tcrpred. p The predicted p-th text header region is thrpred p The predicted p-th text tail region ttrpred p The predicted upper and lower boundary regions of the p-th text (tbrpred) p Thus, the classification decoder outputs a set of text images. The set of predicted text centerline regions is tcrpred = {tcrpred1, tcrpred2, ..., tcrpred}. p ,...,tcrpred u The predicted set of text header regions is thrpred = {thrpred1, thrpred2, ..., thrpred}. p ,...,thrpred u The predicted set of text tail regions is ttrpred = {ttrpred1, ttrpred2, ..., ttrpred}. p ,...,ttrpred u The predicted set of upper and lower boundary regions of the text is tbrpred = {tbrpred1, tbrpred2, ..., tbrpred}. p ,...,tbrpred u};

[0021] The p-th regression feature map reg p After processing by the regression decoder, the p-th predicted distance set is output. in, This represents the p-th text image predicted by the arbitrary-shape text detection network. The center point of the inner text region (x p ,y p (to the g-th boundary point of the text region) The distance; thus the text image set output by the regression decoder. The predicted distance set is denoted as:

[0022] regpred={regpred1,regpred2,...,regpred p ,...,regpred u};

[0023] Step 2.4 Use equation (1) to establish the loss function L for backpropagation:

[0024] L = L tcr +L thr +L ttr +L tbr +L reg (1)

[0025] In equation (1), L tcr L thr L ttr L tbr All are cross-entropy losses, and are obtained from equations (2), (3), (4), and (5), respectively;

[0026]

[0027]

[0028]

[0029]

[0030] In equation (1), L reg It is the smoothl1 loss, and is obtained from equation (6);

[0031]

[0032] Step 2.5: Based on the text image set The arbitrary shape text detection network is trained using the gradient descent method, and the loss function L is calculated. Training stops when the number of training iterations reaches a set number or the loss error is less than a set threshold, thus obtaining the optimal arbitrary shape text detection network.

[0033] Step 3: Post-processing of detection results, including: bilinear interpolation correction;

[0034] Step 3.1 Utilize the optimal arbitrary-shape text detection network to process the text image data set. The corresponding text region boundary set is processed and output, denoted as txt = {txt1, txt2, ..., txt...}. p ,...,txt u}, where txt p This represents the p-th text image. Text region boundaries in the text;

[0035] Step 3.2 After correcting the text region boundary set txt using bilinear interpolation, the corrected text set is denoted as txt′={txt′1,txt′2,...,txt′}. p ,...,txt' u}; where txt′ p Represents p text images The corrected text region boundaries.

[0036] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program that supports the processor in executing the method for detecting and correcting text of arbitrary shapes, and the processor is configured to execute the program stored in the memory.

[0037] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the method for detecting and correcting text of arbitrary shapes.

[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0039] 1. Complex, highly curved text boundaries require a large number of boundary points to represent, while simple rectangular text can be represented with fewer boundary points, leading to differences in the representation of text boundaries. This invention addresses this by modeling text of arbitrary shapes in a polar coordinate system, using the pole of the coordinate system and N rays emanating from that pole to represent the text boundary. This provides a unified representation method for both complex, highly curved text and simple rectangular text, ensuring that text boundaries of varying complexity have the same expressive form.

[0040] 2. In order to learn the parameter distribution of text boundaries, this invention uses Fourier series to encode text boundaries. In this way, the complex text boundary detection problem is transformed into a simple Fourier series learning problem, thereby reducing the number of parameters of arbitrary shape text detection networks and improving the training speed of arbitrary shape text detection networks.

[0041] 3. This invention divides the text region into the text center line region, the text head region, the text tail region, and the text upper and lower boundary regions. By learning the features of different regions, it can not only distinguish the foreground and background in the image, but also distinguish adjacent text, thereby improving the detection accuracy of arbitrary shape text detection networks.

[0042] 4. Regular rectangular text is easier for recognition networks to recognize than curved or slanted text. Considering the subsequent recognition tasks, this invention performs bilinear interpolation correction on the detected arbitrary-shaped text, correcting the arbitrary-shaped irregular text into regular rectangular text, thereby improving the recognition accuracy of subsequent recognition tasks. Attached Figure Description

[0043] Figure 1 This is a flowchart of the detection and correction method of the present invention;

[0044] Figure 2 This is a framework diagram of the network of the present invention. Detailed Implementation

[0045] In this embodiment, a method for detecting and correcting arbitrary-shaped text based on Fourier series encoding is described in the following steps: Figure 1 As shown, it includes the following steps:

[0046] Step 1: Construct the training dataset, including data acquisition and preprocessing:

[0047] Step 1.1: Obtain the text image dataset, denoted as I = {I1, I2, ..., I...} p ,...,I u}, I p Let p represent the p-th text image in the text image dataset I, and u represent the total number of text images in the text image dataset I. In this implementation, the CTW1500 natural scene arbitrary shape text dataset is used. The dataset is divided into a training set and a test set. The training set contains 1000 images, and the test set contains 500 images. The text shapes in the images are tilted, curved, and elongated. The images in the dataset are read and scaled to obtain a size of 3×800×800 for each image, where 3 is the number of channels and 800 is the image size.

[0048] Step 1.2: Extract the p-th text image I p The text area tr in p The corresponding set of text region boundary points is denoted as . And form the text region boundary, where, Represents the p-th text image I p The coordinates of the qth boundary point of the Chinese text region, where l represents the number of boundary points of the text region;

[0049] Step 1.3: Obtain the p-th text image I p The text center line area of ​​the Chinese text region tcrgt p , Text header area thrgt p Text tail area ttrgtp Text upper and lower boundary areas tbrgt p Thus, the set of text centerline regions in text image dataset I is obtained, denoted as tcrgt = {tcrgt1, tcrgt2, ..., tcrgt}. p ,...tcrgt u The set of text header regions is denoted as thrgt = {thrgt1, thrgt2, ..., thrgt}. p ,...,thrgt u The set of regions at the end of the text is denoted as ttrgt = {ttrgt1, ttrgt2, ..., ttrgt}. p ,...ttrgt u The set of upper and lower boundary regions of the text is denoted as tbr={tbrgt1,tbrgt2,...,tbrgt}. p ,...,tbrgt u}; In this implementation, the p-th text image I p The text center line area of ​​the Chinese text region tcrgt p From text area tr p Obtained by shrinking the size by 0.3 times, the text header region thrgt p For text area tr p The left half was reduced by 0.2 times to obtain the text tail region ttrgt. p For text area tr p The right half was reduced by 0.2 times to obtain the text's upper and lower boundary regions tbrgt. p It is obtained by multiplying the distance from the center line of the text region to the upper and lower boundaries of the text region by 0.2.

[0050] Step 1.4: Calculate the p-th text image I in polar coordinates. p Modeling is performed to obtain the corresponding text image. Thus, the set of text images in polar coordinates is obtained as follows:

[0051] Step 1.5: Obtain the p-th text image The center point of the inner text region (x p ,y p ),and Using the center point (x) of the text region p ,y p Let be the emission point, and emit k rays at equal angular intervals, intersecting the boundary of the text region. The set of distances between the center point and the boundary point of the text region is denoted as . in, This represents the p-th text image. The center point of the inner text region (x p ,y p ) to the s-th boundary point of the text region The distance between them is used to obtain the text image set. The distance set is denoted as reggt = {reggt1, reggt2, ..., reggt} p ,...,reggt u In this implementation, the number of text region boundary points k is selected as 90, with the text center point (x) as the boundary. p ,y p ( ) is the coordinate pole, and one ray is emitted every 4°. When the ray intersects the text region boundary at a certain angle multiple times, the intersection point with the largest distance is selected as the data for the arbitrary shape text detection network to learn. When the ray does not intersect the text region boundary, the distance length is set to ε = 10. -6 ;

[0052] Step 2: As Figure 2 As shown, an arbitrary-shape text detection network is constructed, including a feature extractor, an encoder, and a decoder; and a set of text images is used. Input into an arbitrary-shape text detection network;

[0053] Step 2.1 The feature extractor consists of a ResNet50 network, a deconvolutional network, and a feature pyramid network;

[0054] p-th text image After passing through a RestNet50 network, a deconvolutional network, and a feature pyramid network in sequence, the p-th feature map is output as result. p Thus, the feature extraction network outputs a set of text images. The feature map set result = {result1, result2, ..., result p ,...,result u};

[0055] Step 2.2 The encoder includes a classification encoder and a regression encoder; wherein, the classification encoder is composed of r two-dimensional convolutional layers with kernel size e×e and r ReLU nonlinear activation layers connected alternately; the regression encoder is composed of v two-dimensional convolutional layers with kernel size c×c and v ReLU nonlinear activation layers connected alternately; in this embodiment, the number of convolutional layers r of the classification encoder is 3 and the kernel size e is 3, the number of convolutional layers v of the regression encoder is 4 and the kernel size c is 5;

[0056] Feature map result p After processing by the classification encoder, the p-th classification feature map cls is output. p ;

[0057] Feature map result p After processing by the regression encoder, the p-th regression feature map reg is output. p ;

[0058] Step 2.3 Decoder, including: classification decoder and regression decoder; wherein, the classification decoder consists of a two-dimensional convolutional layer with a kernel size of f×f and a softmax function; the regression decoder consists of a two-dimensional convolutional layer with a kernel size of w×w and an inverse Fourier transform function; in this embodiment, the kernel size f of the classification decoder is 3 and the kernel size w of the regression decoder is 5.

[0059] The p-th classification feature map cls p After processing by the classification decoder, the output is the predicted p-th text centerline region tcrpred. p The predicted p-th text header region is thrpred p The predicted p-th text tail region ttrpred p The predicted upper and lower boundary regions of the p-th text (tbrpred) p Thus, the classification decoder outputs a set of text images. The set of predicted text centerline regions is tcrpred = {tcrpred1, tcrpred2, ..., tcrpred}. p ,...,tcrpred u The predicted set of text header regions is thrpred = {thrpred1, thrpred2, ..., thrpred}. p ,...,thrpred u The predicted set of text tail regions is ttrpred = {ttrpred1, ttrpred2, ..., ttrpred}. p ,...,ttrpred u The predicted set of upper and lower boundary regions of the text is tbrpred = {tbrpred1, tbrpred2, ..., tbrpred}. p ,...,tbrpred u};

[0060] The p-th regression feature map reg p After processing by the regression decoder, the p-th predicted distance set is output. in, This represents the p-th text image predicted by the arbitrary-shape text detection network. The center point of the inner text region (x p,y p (to the g-th boundary point of the text region) The distance; thus the text image set output by the regression decoder. The predicted distance set is denoted as:

[0061] regpred={regpred1,regpred2,...,regpred p ,...,regpred u};

[0062] Step 2.4 Use equation (1) to establish the loss function L for backpropagation:

[0063] L = L tcr +L thr +L ttr +L tbr +L reg (1)

[0064] In equation (1), L tcr L thr L ttr L tbr All are cross-entropy losses, and are obtained from equations (2), (3), (4), and (5), respectively;

[0065]

[0066]

[0067]

[0068]

[0069] In equation (1), L reg It is the smoothl1 loss, and is obtained from equation (6);

[0070]

[0071] Step 2.5: Based on the text image set The arbitrary shape text detection network is trained using the gradient descent method, and the loss function L is calculated. Training stops when the number of training iterations reaches a set number or the loss error is less than a set threshold, thus obtaining the optimal arbitrary shape text detection network.

[0072] Step 3: Post-processing of detection results, including: bilinear interpolation correction;

[0073] Step 3.1 Utilize the optimal arbitrary-shape text detection network to process the text image data set. The corresponding text region boundary set is processed and output, denoted as txt = {txt1, txt2, ..., txt...}. p ,...,txt u}, where txt p This represents the p-th text image. The text region boundary in the image; in this implementation, the p-th text image is predicted by an arbitrary-shape text detection network to generate the p-th text centerline region tcrpred p and the p-th distance set Select the point (x) within the center line area of ​​the text region. p ,y p ), with point (x) p ,y p () is the launch point, and the distance set is... Get the set of boundary points of the text region in

[0074] Step 3.2 After correcting the text region boundary set txt using bilinear interpolation, the corrected text set is denoted as txt′={txt′1,txt′2,...,txt′}. p ,...,txt' u}; where txt′ p Represents p text images The corrected text region boundary in the p-th image. In this implementation, the corrected text region boundary in the p-th image is defined as the boundary. p ,in The length and width of the rectangle are respectively There is a one-to-one correspondence between pixel Q at coordinate point p(x,y) in the text area before correction and pixel Q′ at the corresponding coordinate point p′(x′,y′) in the rectangular text area after correction. For pixel values ​​with decimal coordinates after correction, bilinear interpolation is used. For a point with coordinates p′(x′,y′), four surrounding coordinate points p′1(x′1,y′1), p′2(x′2,y′1), p′3(x′1,y′2), and p′4(x′2,y′2) are taken. The pixel values ​​of these four points are Q′1, Q′2, Q′3, and Q′4, respectively. First, p′ is calculated from the pixel values ​​of p′1(x′1,y′1) and p′2(x′2,y′1). 12 The pixel value Q′ of (x′, y′1) 12 Then, p′ is calculated from the pixel values ​​of p′3(x′1,y′2) and p′4(x′2,y′2). 34 (x′, y′2) pixel value Q′ 34 Finally, by p′ 12 (x′,y′1) and p′34 Calculate the pixel value Q′ of the coordinate point p′(x′,y′) from the pixel value of (x′,y′2).

[0075] Q′ 12 for:

[0076] Q′ 34 for:

[0077] Q′ is:

[0078] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the methods described above, and the processor is configured to execute the program stored in the memory.

[0079] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

Claims

1. A method for detecting and correcting text of arbitrary shapes based on Fourier series encoding, characterized in that, Includes the following steps: Step 1: Construct the training dataset, including data acquisition and preprocessing: Step 1.1: Obtain the text image dataset, denoted as I = {I1, I2, ..., I...} p ,...,I u }, I p Let p represent the p-th text image in the text image dataset I, and u represent the total number of text images in the text image dataset I; Step 1.2: Extract the p-th text image I p The text region in the text is obtained by taking the corresponding set of text region boundary points, denoted as . And form the text region boundary, where, Represents the p-th text image I p The coordinates of the qth boundary point of the Chinese text region, where l represents the number of boundary points of the text region; Step 1.3: Obtain the p-th text image I p Chinese text area tr p The text center line area tcrgt p , Text header area thrgt p Text tail area ttrgt p Text upper and lower boundary areas tbrgt p Thus, the set of text centerline regions in text image dataset I is obtained, denoted as tcrgt = {tcrgt1, tcrgt2, ..., tcrgt}. p ,...tcrgt u The set of text header regions is denoted as thrgt = {thrgt1, thrgt2, ..., thrgt}. p ,...,thrgt u The set of regions at the end of the text is denoted as ttrgt = {ttrgt1, ttrgt2, ..., ttrgt}. p ,...ttrgt u The set of upper and lower boundary regions of the text is denoted as tbr={tbrgt1,tbrgt2,...,tbrgt}. p ,...,tbrgt u }; Step 1.4: Calculate the p-th text image I in polar coordinates. p Modeling is performed to obtain the corresponding text image. Thus, the set of text images in polar coordinates is obtained as follows: Step 1.5: Obtain the p-th text image The center point of the inner text region (x p ,y p ),and Using the center point (x) of the text region p ,y p Let be the emission point, and emit k rays at equal angular intervals, intersecting the boundary of the text region. The set of distances between the center point and the boundary point of the text region is denoted as . in, This represents the p-th text image. The center point of the inner text region (x p ,y p ) to the s-th boundary point of the text region The distance between them is used to obtain the text image set. The distance set is denoted as reggt = {reggt1, reggt2, ..., reggt} p ,...,reggt u }; Step 2: Construct an arbitrary-shape text detection network, including a feature extractor, encoder, and decoder; and process the text image set... Input into the arbitrary shape text detection network; The feature extractor described in step 2.1 consists of a ResNet50 network, a deconvolutional network, and a feature pyramid network; The p-th text image After passing through a RestNet50 network, a deconvolutional network, and a feature pyramid network in sequence, the p-th feature map is output as result. p Thus, the feature extraction network outputs a set of text images. The feature map set result = {result1, result2, ..., result p ,...,result u }; The encoder described in step 2.2 includes a classification encoder and a regression encoder; wherein the classification encoder is composed of r two-dimensional convolutional layers with kernels of e×e and r ReLU nonlinear activation layers connected alternately; the regression encoder is composed of v two-dimensional convolutional layers with kernels of c×c and v ReLU nonlinear activation layers connected alternately. The feature map result p After processing by the classification encoder, the p-th classification feature map cls is output. p ; The feature map result p After processing by the regression encoder, the p-th regression feature map reg is output. p ; The decoder described in step 2.3 includes a classification decoder and a regression decoder; wherein the classification decoder consists of a two-dimensional convolutional layer with a kernel of f×f and a softmax function; the regression decoder consists of a two-dimensional convolutional layer with a kernel of w×w and an inverse Fourier transform function. The p-th classification feature map cls p After processing by the classification decoder, the output is the predicted p-th text centerline region tcrpred. p The predicted p-th text header region is thrpred p The predicted p-th text tail region ttrpred p The predicted upper and lower boundary regions of the p-th text (tbrpred) p Thus, the classification decoder outputs a set of text images. The set of predicted text centerline regions is tcrpred = {tcrpred1, tcrpred2, ..., tcrpred}. p ,...,tcrpred u The predicted set of text header regions is thrpred = {thrpred1, thrpred2, ..., thrpred}. p ,...,thrpred u The predicted set of text tail regions is ttrpred = {ttrpred1, ttrpred2, ..., ttrpred}. p ,...,ttrpred u The predicted set of upper and lower boundary regions of the text is tbrpred = {tbrpred1, tbrpred2, ..., tbrpred}. p ,...,tbrpred u }; The p-th regression feature map reg p After processing by the regression decoder, the p-th predicted distance set is output. in, This represents the p-th text image predicted by the arbitrary-shape text detection network. The center point of the inner text region (x p ,y p (to the g-th boundary point of the text region) The distance; thus the text image set output by the regression decoder. The predicted distance set is denoted as: regpred={regpred1,regpred2,...,regpred p ,...,lawyer u }; Step 2.4 Use equation (1) to establish the loss function L for backpropagation: L=L tcr +L thr +L ttr +L tbr +L reg (1) In equation (1), L tcr L thr L ttr L tbr All are cross-entropy losses, and are obtained from equations (2), (3), (4), and (5), respectively; In equation (1), L reg It is the smoothl1 loss, and is obtained from equation (6); Step 2.5: Based on the text image set The arbitrary shape text detection network is trained using the gradient descent method, and the loss function L is calculated. Training stops when the number of training iterations reaches a set number or the loss error is less than a set threshold, thus obtaining the optimal arbitrary shape text detection network. Step 3: Post-processing of detection results, including: bilinear interpolation correction; Step 3.1 Utilize the optimal arbitrary-shape text detection network to process the text image data set. The corresponding text region boundary set is processed and output, denoted as txt = {txt1, txt2, ..., txt...}. p ,...,txt u }, where txt p This represents the p-th text image. Text region boundaries in the text; Step 3.2 After correcting the text region boundary set txt using bilinear interpolation, the corrected text set is denoted as txt′={txt1′,txt′2,...,txt′}. p ,...,txt' u }; where txt′ p Represents p text images The corrected text region boundaries.

2. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports a processor in executing the method of claim 1, the processor being configured to execute the program stored in the memory.

3. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the steps of the method of claim 1.

Citation Information

Patent Citations

  • Natural scene text detection method

    CN107480648A

  • Deep scene text detection method based on random form edge geometric modeling

    CN111931763A