Text separation method, device, electronic device and storage medium

Through the text separation method of generative adversarial network, the problem of overlapping text separation in text areas in OCR bill text recognition is solved, and the text recognition accuracy and image quality are improved.

CN114638957BActive Publication Date: 2024-11-26GANYI INTELLIGENT TECH (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210249247.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2024-11-26
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

The prior art cannot effectively separate overlapping text in text areas in OCR bill text recognition scenarios, resulting in low text recognition accuracy.

Method used

The text separation method based on a generative adversarial network is adopted, and the text separation model and discriminant model are separated to generate images that are closer to the real text separation.

Benefits of technology

It realizes effective separation of overlapping text in the text area, improves text recognition accuracy, and ensures the naturalness and fidelity of the text separation image, improving image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638957B_ABST
    Figure CN114638957B_ABST
Patent Text Reader

Abstract

The present invention provides a text separation method, device, electronic device and storage medium, wherein the method comprises: determining overlapping text images to be separated; inputting the overlapping text images into a text separation model to obtain a text separation image output by the text separation model; the text separation model is obtained by adversarial training based on sample overlapping text images and sample text separation images of the sample overlapping text images in conjunction with a discriminant model, the discriminant model is used to distinguish between a predicted text separation image and a sample text separation image, the predicted text separation image is determined by the text separation model based on the sample overlapping text image, and a generation and adversarial mechanism is introduced to train the text separation model, so that the text separation capability of the overlapping text image can be guaranteed, the defect that the traditional scheme cannot realize overlapping text separation can be overcome, and while realizing overlapping text separation, the naturalness and realism of the text separation image are guaranteed, and the image quality of the text separation image is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a text separation method, device, electronic device and storage medium. Background Art

[0002] In the OCR (Optical Character Recognition) bill text recognition scenario, there may be misaligned lines in bill printing, which can lead to a large amount of text overlap in the bill, that is, the overlap between the fixed text on the bill itself and the printed text printed later. The overlapping text can be separated through image processing methods.

[0003] In the traditional scheme, the text pixels and background pixels are mainly distinguished, and the text image is binarized by strengthening the text pixels. However, the above method of distinguishing the text area and the background area by the size of the pixel value can only separate the text area and the background area in the overlapping image, but cannot separate the overlapping text in the text area; and the separation effect is not good for natural scenes with complex backgrounds. Summary of the invention

[0004] The present invention provides a text separation method, device, electronic device and storage medium to solve the defect that the prior art can only distinguish between text areas and background areas, but cannot separate overlapping texts in the text area, thus resulting in low accuracy of subsequent text recognition.

[0005] The present invention provides a text separation method, comprising:

[0006] Determining overlapping text images to be separated;

[0007] Inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model;

[0008] The text separation model is obtained by adversarial training based on sample overlapping text images and sample text separation images of the sample overlapping text images in conjunction with a discriminant model. The discriminant model is used to distinguish between the predicted text separation image and the sample text separation image. The predicted text separation image is determined by the text separation model based on the sample overlapping text image.

[0009] According to a text separation method provided by the present invention, the step of inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model comprises:

[0010] Inputting the overlapping text image into the feature convolution network in the text separation model to obtain image features of the overlapping text image output by the feature convolution network;

[0011] Inputting the image features into the fixed text generation network in the text separation model to obtain a fixed text image output by the fixed text generation network;

[0012] The image features are input into the printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network, and the fixed text image and the printed text image constitute the text separation image.

[0013] According to a text separation method provided by the present invention, the step of inputting the image features into a printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network comprises:

[0014] Inputting the image features into the printed text generation branch and the printed text binary image generation branch under the printed text generation network respectively, obtaining an initial printed text image output by the printed text generation branch and a printed text binary image output by the printed text binary image generation branch;

[0015] The printed text image is determined based on the printed text binary image and the initial printed text image.

[0016] According to a text separation method provided by the present invention, the discrimination model includes a fixed text discrimination branch, a printed text discrimination branch and a printed text binary image discrimination branch;

[0017] The fixed text discrimination branch is used to discriminate the authenticity of the fixed text image;

[0018] The printed text identification branch is used to identify the authenticity of the initial printed text image;

[0019] The printed text binary image discrimination branch is used to discriminate the authenticity of the printed text binary image.

[0020] According to a text separation method provided by the present invention, the text separation model and the discrimination model are determined based on the following steps:

[0021] Construct an initial text separation model and an initial discriminant model;

[0022] Inputting the sample overlapping text image into the initial text separation model to obtain a predicted text separation image output by the initial text separation model;

[0023] Inputting the predicted text separation image and the sample text separation image into the initial discriminant model respectively, and obtaining the discrimination result of the predicted text separation image and the sample text separation image output by the initial discriminant model;

[0024] Based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image, the parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

[0025] According to a text separation method provided by the present invention, the initial text separation model and the initial discriminant model are updated with parameters based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image to obtain the text separation model and the discriminant model, including:

[0026] Determining a generation loss of the initial text separation model based on the predicted text separation image and the sample text separation image;

[0027] Determining the discrimination loss of the initial discrimination model based on the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image;

[0028] Based on the generation loss and the discrimination loss, parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

[0029] According to a text separation method provided by the present invention, the generation loss includes a fixed text generation loss and a printed text generation loss, and the printed text generation loss includes an initial printed text generation loss and a printed text binary image generation loss;

[0030] The fixed text generation loss is determined based on the predicted fixed text image in the predicted text separation image and the sample fixed text image in the sample text separation image;

[0031] The initial printed text generation loss is determined based on the predicted initial printed text image in the predicted text separation image and the sample initial printed text image in the sample text separation image;

[0032] The initial printed text binary image generation loss is determined based on the predicted printed text binary image in the predicted text separation image and the sample printed text binary image in the sample text separation image.

[0033] The present invention also provides a text separation device, comprising:

[0034] An image determination unit, used for determining overlapping text images to be separated;

[0035] A text separation unit is used to input the overlapping text image into a text separation model to obtain a text separation image output by the text separation model; the text separation model is obtained by adversarial training based on a sample overlapping text image and a sample text separation image of the sample overlapping text image, in conjunction with a discriminant model, the discriminant model is used to distinguish between a predicted text separation image and the sample text separation image, the predicted text separation image being determined by the text separation model based on the sample overlapping text image.

[0036] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the text separation method as described above is implemented.

[0037] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the text separation method as described in any one of the above is implemented.

[0038] The text separation method, device, electronic device and storage medium provided by the present invention input overlapping text images into a text separation model to obtain a text separation image output by the text separation model; wherein the text separation model is obtained by adversarial training based on sample overlapping text images and sample text separation images of sample overlapping text images in conjunction with a discriminant model, and a generation and adversarial mechanism is introduced to train the text separation model, so that the text separation ability of the trained text separation model for overlapping text images can be guaranteed; and the text separation model can not only achieve the purpose of overlapping text separation, but also the output text separation image is closer to the real text separation image, completely overcoming the defect that the traditional scheme cannot achieve the separation of overlapping text in the text area, resulting in low accuracy of subsequent text recognition, while achieving overlapping text separation, ensuring the naturalness and realism of the text separation image, and greatly improving the image quality of the text separation image. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1It is a flowchart of the text separation method provided by the present invention;

[0041] Figure 2 It is a structural schematic diagram of the discrimination model provided by the present invention;

[0042] Figure 3 It is a structural schematic diagram of the text separation device provided by the present invention;

[0043] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention.

[0044] Reference numerals:

[0045] 210: Conv_Bn_ReLU; 220: FC. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] In the OCR bill text recognition scenario, due to the phenomenon of wrong lines in bill printing, the wrong lines will cause a large amount of text overlap in the bill, that is, the overlap of the fixed text of the bill itself and the printed text printed later. The emergence of this situation will undoubtedly increase the difficulty of subsequent text recognition on the bill by a level. Therefore, in traditional solutions, image processing methods are often used to separate overlapping texts, thereby improving the accuracy of subsequent text recognition.

[0048] The current text separation method mainly uses traditional image processing technology to distinguish text pixels from background pixels, and realizes text image binarization by strengthening text pixels; however, the above-mentioned scheme of distinguishing text areas and background areas by the size of pixel values, although it can achieve the separation of text and background, is not effective for natural scenes with more complex backgrounds, and thus the subsequent text recognition effect is worrying; moreover, the above-mentioned scheme can only achieve the separation of text areas and background areas, but cannot achieve the separation of overlapping text in text areas; in addition, the data storage process of the above-mentioned scheme is relatively simple, the calculation volume is large, and real-time updates cannot be achieved.

[0049] In view of the above situation, the present invention provides a text separation method, which aims to separate overlapping texts based on a generative adversarial network, realize the separation of fixed text and printed text in overlapping texts, and improve the subsequent text recognition accuracy. Figure 1It is a flow chart of the text separation method provided by the present invention, such as Figure 1 As shown, the method includes:

[0050] Step 110, determining overlapping text images to be separated;

[0051] Specifically, before performing text separation, it is first necessary to determine the separation object, that is, the overlapping text image to be separated. It should be noted that text separation is mostly used in bill scenarios. Therefore, the overlapping text image here can be a bill image with overlapping text. Of course, it can also be other images with overlapping text, such as message images. The embodiment of the present invention does not make specific limitations on this.

[0052] In bill images, there are usually fixed keywords, such as machine numbers, taxpayer identification numbers, etc. Such keywords and their corresponding values ​​exist on the bills in advance, and the specific content is printed on them. Since the keywords and font colors are fixed, the fixed keywords can be used as the background of the bill image, and then the background and foreground can be separated through the generative adversarial network.

[0053] Step 120, input the overlapping text image into the text separation model to obtain the text separation image output by the text separation model; the text separation model is obtained by adversarial training based on the sample overlapping text image and the sample text separation image of the sample overlapping text image, and the discriminant model is used to distinguish the predicted text separation image from the sample text separation image, and the predicted text separation image is determined by the text separation model based on the sample overlapping text image.

[0054] Specifically, after obtaining the overlapping text image to be separated through step 110, step 120 can be executed to perform text separation on the overlapping text image to be separated to obtain a text separation image of the overlapping text image. The specific process includes the following steps:

[0055] First, the overlapping text image to be separated is input into the text separation model, and then the text separation model performs text separation on the input overlapping text image to be separated. Specifically, the text area and background area in the overlapping text image, as well as the overlapping text in the text area are separated, and finally a text separation image of the overlapping text image is obtained as output by the text separation model.

[0056] The text separation image here includes the background image of the overlapping text image, that is, the fixed text image covering the fixed keywords, and the text image after the overlapping text in the text area is separated. Since the overlapping text in the text area is actually printed text printed later, the text image can be called a printed text image, that is, the text separation image includes a fixed text image and a printed text image.

[0057] Before inputting the overlapping text images to be separated into the text separation model, the sample overlapping text images can be used to pre-train the text separation model. Specifically, when training the text separation model, the sample overlapping text images can be used as training samples, and the sample text separation images of the sample overlapping text images can be used as training labels to perform supervised training, so that the text separation model can learn the mapping relationship between the sample overlapping text images and the sample text separation images during the training process, so that the trained text separation model can apply the above mapping relationship to generate corresponding text separation images for the input overlapping text images to be separated, thereby achieving the purpose of overlapping text separation.

[0058] However, when the text separation model obtained by the above-mentioned supervised training method is used for text separation, the obtained text separation image may be distorted. Taking this into consideration, the embodiment of the present invention adopts the idea of ​​Generative Adversarial Networks (GAN) to perform adversarial training on the text separation model and the discriminant model.

[0059] It should be noted that generative adversarial networks are mostly used in scenarios such as image synthesis and style transfer. They include a generator network and a discriminator network. The generator is a network that generates images, and the discriminator is a network that determines whether an image is real or fake. The goal of the generator is to generate images that are as realistic as possible and can confuse the discriminator. The goal of the discriminator is to distinguish between the images generated by the generator and the real images as much as possible. The two compete with each other to improve the overall performance of the network and obtain better output results.

[0060] In adversarial training, the text separation model can be regarded as a generator, and the discriminant model can be regarded as a discriminator. The text separation model as a generator can perform text separation on the input sample overlapping text image, thereby outputting the generated text separation image, that is, the predicted text separation image; the discriminant model as a discriminator can discriminate the input text separation image, that is, distinguish whether the input text separation image is the predicted text separation image generated by the generator or the real sample text separation image. In this process, the generator and the discriminator compete with each other. The generator outputs the predicted text separation image as similar as possible to the sample text separation image, in order to achieve the purpose of making it difficult for the discriminator to distinguish between the sample text separation image and the predicted text separation image. The discriminator outputs the discrimination result consistent with the actual situation of the input text separation image, in order to achieve a more accurate and reliable discrimination effect.

[0061] The text separation method provided by the present invention inputs overlapping text images into a text separation model to obtain a text separation image output by the text separation model; wherein the text separation model is obtained by adversarial training based on sample overlapping text images and sample text separation images of sample overlapping text images in conjunction with a discriminant model, and a generation and adversarial mechanism is introduced to train the text separation model, so that the text separation ability of the trained text separation model for overlapping text images can be guaranteed; and the text separation model can not only achieve the purpose of overlapping text separation, but also output a text separation image that is closer to a real text separation image, completely overcoming the defect that traditional solutions cannot achieve the separation of overlapping texts in a text area, resulting in low accuracy of subsequent text recognition, and while achieving overlapping text separation, the naturalness and realism of the text separation image are guaranteed, thereby greatly improving the image quality of the text separation image.

[0062] Based on the above embodiment, in step 120, the overlapping text image is input into the text separation model to obtain the text separation image output by the text separation model, including:

[0063] Input the overlapping text image into the feature convolution network in the text separation model to obtain the image features of the overlapping text image output by the feature convolution network;

[0064] Input the image features into the fixed text generation network in the text separation model to obtain a fixed text image output by the fixed text generation network;

[0065] The image features are input into the printed text generation network in the text separation model to obtain the printed text image output by the printed text generation network. The fixed text image and the printed text image constitute the text separation image.

[0066] Since the essence of the generative adversarial network is to realize the feature extraction of the input image and the generation of the target image (text separation image) through the deep structure of "encoder-decoder", the generation effect is improved through the synergy of the generation network and the discriminator network.

[0067] Based on this, in step 120, the text separation model trained based on the idea of ​​generative adversarial network is applied to perform text separation on the overlapping text image to be separated, which can be divided into the following steps:

[0068] Firstly, the overlapping text image to be separated is input into the feature convolution network in the text separation model, and the feature convolution network extracts the features of the input overlapping text image, and finally obtains the image features of the overlapping text image output by the feature extraction network, that is, the feature extraction of the overlapping text image is realized through the feature convolution network in the text separation model, and the image features of the overlapping text image are obtained;

[0069] Then, the image features of the overlapping text image can be input into the fixed text generation network in the text separation model, and the fixed text generation network generates a fixed text image of the overlapping text image by using the input image features;

[0070] At the same time, the image features of the overlapping text image can also be input into the printed text generation network in the text separation model. The printed text generation network generates a printed text image of the overlapping text image according to the input image features. Based on this printed text image and the fixed text image output by the fixed text generation network, the text separation image of the overlapping text image can be determined. It can also be understood that the text separation image is composed of the fixed text image and the printed text image.

[0071] In an embodiment of the present invention, feature extraction of overlapping text images is achieved through the feature convolutional network in the text separation model, and based on the image features of the overlapping text images obtained through feature extraction, a fixed text image and a printed text image of the overlapping text image are generated respectively through a fixed text generation network and a printed text generation network, thereby achieving separation of text areas and background areas in the overlapping text images; at the same time, with the help of the fixed text generation network, the effectiveness of the features of the printed text generation network is also improved.

[0072] Based on the above embodiment, in the text separation model, the network structure of the feature convolutional network can be set accordingly according to actual needs. Preferably, in the embodiment of the present invention, the feature convolutional network is set to four layers. When the size of the input overlapping text image to be separated is 3*64*480, 3 represents the number of channels, 64 is the height, and 480 is the width, each layer is set as follows:

[0073] First layer:

[0074] conv_bn_relu(3, 32, 3, 1, 1)

[0075] conv_bn_relu(32, 32, 3, 1, 1)

[0076] conv_bn_relu(32, 64, 3, 2, 1)

[0077] Output 64*32*240

[0078] Second layer:

[0079] conv_bn_relu(64, 64, 3, 1, 1)

[0080] conv_bn_relu(64, 64, 3, 1, 1)

[0081] conv_bn_relu(64,128,3,2,1)

[0082] Output 128*16*120

[0083] Third layer:

[0084] conv_bn_relu(128, 128, 3, 1, 1)

[0085] conv_bn_relu(128, 128, 3, 1, 1)

[0086] conv_bn_relu(128,256,3,2,1)

[0087] Output 256*8*60

[0088] Fourth floor:

[0089] conv_bn_relu(256, 256, 3, 1, 1)

[0090] conv_bn_relu(256, 256, 3, 1, 1)

[0091] Output 256*8*60

[0092] Taking "conv_bn_relu(3, 32, 3, 1, 1)" in the first layer as an example, the parameters are explained:

[0093] Among them, conv (Convolution) represents the convolution layer, bn (batch_normal) represents the batch normalization layer, relu (Rectified Linear Unit) represents the activation layer, conv_bn_relu represents the convolution layer + batch normalization layer + activation layer, the first 3 is the input channel, 32 is the output channel, the second 3 is the convolution kernel, the first 1 is the stride, and the second 1 is the padding.

[0094] Based on the above embodiment, in step 120, the image features are input into the printed text generation network in the text separation model to obtain the printed text image output by the printed text generation network, including:

[0095] Inputting the image features into the printed text generation branch and the printed text binary image generation branch under the printed text generation network respectively, obtaining an initial printed text image output by the printed text generation branch and a printed text binary image output by the printed text binary image generation branch;

[0096] Based on the printed text binary image and the initial printed text image, a printed text image is determined.

[0097] Considering that most of the generative adversarial networks in traditional solutions have only a single output branch, which is relatively thin, resulting in poor separation effect. Therefore, a multi-branch structure is adopted in the embodiment of the present invention to enhance the output effect of the main branch through auxiliary branches.

[0098] Specifically, in an embodiment of the present invention, the printed text generation network is a multi-branch structure, which includes two branches, namely a printed text generation branch and a printed text binary image generation branch, and the two branches share some network weights. Among them, the printed text binary image generation branch can improve the performance of the printed text generation branch, thereby optimizing the text separation effect.

[0099] Based on this, the process of inputting the image features of the overlapping text image into the printed text generation network in the text separation model to obtain the printed text image output by the printed text generation network may specifically include the following steps:

[0100] First, the image features of the overlapping text image are input into the printed text generation branch of the printed text generation network in the text separation model. The printed text generation branch generates a printed text image using the image features of the input overlapping text image. However, since the printed text image obtained at this time still needs to be optimized, it can be called the initial printed text image.

[0101] At the same time, the image features of the overlapping text image can also be input into the printed text binary image generation branch under the printed text generation network in the text separation model. The printed text binary image generation branch can generate a printed text binary image of the overlapping text image according to the input image features, and finally obtain the printed text binary image output by the printed text binary image generation branch.

[0102] Subsequently, the printed text image of the overlapping text image can be determined based on the initial printed text image and the printed text binary image obtained in the previous step. Specifically, the initial printed text image output by the printed text generation branch and the printed text binary image output by the printed text binary image generation branch can be connected through a Concat structure, in order to enhance the initial printed text image with the help of the printed text binary image, thereby achieving an improved text separation effect.

[0103] Based on the above embodiment, the first three layers of the printed text generation network are upsampling layers, and the printed text generation branch and the printed text binary image generation branch below them share the first two upsampling layers. The settings of these two upsampling layers are as follows:

[0104] The output of the above feature convolutional network is 256*8*60, which is used as the input of the printed text generation network. At this time, the first two upsampling layers can be named the fifth and sixth layers, and their settings are:

[0105] Fifth floor

[0106] conv_bn_relu(256, 256, 3, 1, 1)

[0107] conv_bn_relu(256, 256, 3, 1, 1)

[0108] upsample(2)

[0109] conv_bn_relu(256,128,3,1,0)

[0110] Output 128*16*120

[0111] Sixth floor

[0112] conv_bn_relu(128, 128, 3, 1, 1)

[0113] conv_bn_relu(128, 128, 3, 1, 1)

[0114] upsample(2)

[0115] conv_bn_relu(128, 64, 3, 1, 0)

[0116] Output 64*32*240

[0117] Among them, upsample represents the upsampling layer and sacle is equal to 2.

[0118] Based on the above embodiment, the discrimination model includes a fixed text discrimination branch, a printed text discrimination branch and a printed text binary image discrimination branch;

[0119] The fixed text discrimination branch is used to discriminate the authenticity of fixed text images;

[0120] The printed text discrimination branch is used to discriminate the authenticity of the initial printed text image;

[0121] The printed text binary image discrimination branch is used to discriminate the authenticity of the printed text binary image.

[0122] Specifically, the text separation model includes a fixed text generation network and a printed text generation network, wherein the printed text generation network includes a printed text generation branch and a printed text binary image generation branch. In summary, the text separation model includes three different branches (networks), and the images generated by each branch (network) are different. Therefore, the discriminant model corresponding to the text separation model also has three branches, namely, a fixed text discriminant branch, a printed text discriminant branch, and a printed text binary image discriminant branch.

[0123] Among them, the fixed text discrimination branch is used to discriminate the authenticity of the fixed text image output by the fixed text generation network in the text separation model, that is, to distinguish the fixed text image output by the fixed text generation network from the fixed text image in the real text separation image.

[0124] The printed text discrimination branch is used to discriminate the authenticity of the initial printed text image output by the printed text generation branch under the printed text generation network in the text separation model. It can also be understood that it is used to distinguish the initial printed text image output by the printed text generation branch under the printed text generation network from the initial printed text image in the real text separation image.

[0125] The printed text binary image discrimination branch is used to discriminate the authenticity of the printed text binary image output by the printed text binary image generation branch under the printed text generation network in the text separation model. It can also be understood that it is used to distinguish the printed text binary image output by the printed text binary image generation branch under the printed text generation network from the printed text binary image in the real text separation image.

[0126] It should be noted that Figure 2 It is a schematic diagram of the structure of the discriminant model provided by the present invention, such as Figure 2 As shown, the discriminant model in the embodiment of the present invention is composed of 210 and 220, wherein 210 represents Conv_Bn_ReLU (convolutional layer + batch normalization layer + activation layer), and 220 represents FC (Fully connected layer).

[0127] Based on the above embodiment, the text separation model and the discrimination model are determined based on the following steps:

[0128] Construct an initial text separation model and an initial discriminant model;

[0129] Input the sample overlapping text image into the initial text separation model to obtain the predicted text separation image output by the initial text separation model;

[0130] Inputting the predicted text separation image and the sample text separation image into the initial discriminant model respectively, and obtaining the discriminant result of the predicted text separation image output by the initial discriminant model and the discriminant result of the sample text separation image;

[0131] Based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image, the parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

[0132] Specifically, the process of determining the text separation model and the discriminant model includes the following steps:

[0133] First, determine the initial text separation model and the initial discriminant model. Specifically, the initial text separation model and the initial discriminant model can be constructed on the basis of the generative adversarial network. The initial text separation model can be regarded as the generator of the generative adversarial network, and the initial discriminant model can be regarded as the discriminator.

[0134] Then, the sample overlapping text images collected in advance are input into the initial text separation model. The initial text separation model as a generator can perform text separation on the input sample overlapping text images, thereby outputting a predicted text separation image of the sample overlapping text images;

[0135] Subsequently, the predicted text separation image of the sample overlapping text image output by the initial text separation model and the sample text separation image of the predetermined sample overlapping text image can be respectively input into the initial discriminant model. The initial discriminant model as a discriminator can discriminate the input predicted text separation image and the sample text separation image, that is, distinguish whether the input text separation image is the predicted text separation image generated by the initial text separation model (generator) or the real sample text separation image, thereby outputting the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image;

[0136] After that, the parameters of the initial text separation model and the initial discriminant model can be adjusted based on the predicted text separation image of the sample overlapping text image and the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image, so as to obtain the text separation model and the discrimination model. Specifically, when adjusting, for the initial text separation model, the predicted text separation image that is as similar as possible to the sample text separation image can be output as a means to achieve the purpose that the initial discriminant model is difficult to distinguish between the sample text separation image and the predicted text separation image; for the initial discriminant model, the output discrimination result can be consistent with the actual situation of the input text separation image as a means to achieve a more accurate and reliable discrimination effect.

[0137] Based on the above embodiment, based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image, the parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model, including:

[0138] Determine the generation loss of the initial text separation model based on the predicted text separation image and the sample text separation image;

[0139] Determine the discrimination loss of the initial discrimination model based on the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image;

[0140] Based on the generation loss and the discrimination loss, the parameters of the initial text separation model and the initial discriminant model are updated to obtain the text separation model and the discriminant model.

[0141] Specifically, the process of updating the parameters of the initial text separation model and the initial discrimination model according to the predicted text separation image and the discrimination result thereof, and the sample text separation image and the discrimination result thereof, thereby obtaining the text separation model and the discrimination model, includes the following steps:

[0142] First, the difference between the predicted text separation image of the sample overlapping text image output by the initial text separation model and the sample text separation image of the sample overlapping text image can be determined. Then, the loss of the initial text separation model in the process of generating the predicted text separation image can be determined based on the difference, that is, the generation loss of the initial text separation model. This generation loss consists of three parts, namely, fixed text generation loss, initial printed text generation loss and printed text binary image generation loss, wherein the initial printed text generation loss and printed text binary image generation loss are collectively referred to as printed text generation loss;

[0143] At the same time, the discrimination loss of the initial discriminant model can be determined according to the discrimination result of the predicted text separation image output by the initial discriminant model and the discrimination result of the sample text separation image. Specifically, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image can be judged respectively, and the similarities and differences between them and the actual situation, and the discrimination loss of the initial discriminant model can be determined according to the judgment result;

[0144] It should be noted that the discrimination loss here also consists of three parts, namely fixed text discrimination loss, printed text discrimination loss and printed text binary image discrimination loss.

[0145] Afterwards, the generation loss of the initial text separation model and the discrimination loss of the initial discrimination model can be used as a benchmark to adjust the parameters of the initial text separation model and the initial discrimination model. The specific process includes the following steps: first, determine the partial derivatives of the generation loss on each parameter of the initial text separation model and the partial derivatives of the discrimination loss on each parameter of the discrimination model; then, adjust the initial text separation model and the initial discrimination model according to the learning rate of the initial text separation model, the learning rate of the discrimination model, the partial derivatives of the generation loss on each parameter of the initial text separation model, and the partial derivatives of the discrimination loss on each parameter of the discrimination model, so as to obtain the text separation model and the discrimination model.

[0146] Based on the above embodiment, the generation loss includes a fixed text generation loss and a printed text generation loss, and the printed text generation loss includes an initial printed text generation loss and a printed text binary image generation loss;

[0147] The fixed text generation loss is determined based on the predicted fixed text image in the predicted text separation image and the sample fixed text image in the sample text separation image;

[0148] The initial printed text generation loss is determined based on the predicted initial printed text image in the predicted text separation image and the sample initial printed text image in the sample text separation image;

[0149] The initial printed text binary image generation loss is determined based on the predicted printed text binary image in the predicted text separation image and the sample printed text binary image in the sample text separation image.

[0150] Based on the above embodiment, the generation loss of the initial text separation model includes a fixed text generation loss and a printed text generation loss, wherein the printed text generation loss includes an initial printed text generation loss and a printed text binary image generation loss.

[0151] When determining the generation loss of the initial text separation model based on the predicted text separation image and the sample text separation image, specifically, it can be: determining the fixed text generation loss based on the predicted fixed text image in the predicted text separation image and the sample fixed text image in the sample text separation image; determining the initial printed text generation loss based on the predicted initial printed text image in the predicted text separation image and the sample initial printed text image in the sample text separation image; determining the initial printed text binary image generation loss based on the predicted printed text binary image in the predicted text separation image and the sample printed text binary image in the sample text separation image.

[0152] It can also be understood that the fixed text generation loss is determined based on the predicted fixed text image in the predicted text separation image and the sample fixed text image in the sample text separation image; the initial printed text generation loss is determined based on the predicted initial printed text image in the predicted text separation image and the sample initial printed text image in the sample text separation image; and the initial printed text binary image generation loss is determined based on the predicted printed text binary image in the predicted text separation image and the sample printed text binary image in the sample text separation image.

[0153] Based on the above embodiment, the calculation formulas of the fixed text generation loss, the initial printed text generation loss, the printed text binary image generation loss, and the generation loss of the initial text separation model in the generation loss are as shown below:

[0154] Among them, the calculation formula for fixed text generation loss can be expressed as:

[0155]

[0156] Among them, L t2 represents the fixed text generation loss, T t2 represents the sample fixed text image in the sample text separation image, I s represents the sample overlapping text image, E represents the corresponding expectation, and D t2 represents the fixed text discrimination loss, O t2 represents the predicted fixed text image in the predicted text separation image, ‖*‖1 represents the L1 norm, and θ2 is the adjustment parameter.

[0157] The calculation formula for the initial printed text generation loss can be expressed as:

[0158]

[0159] Among them, L t1 represents the initial printed text generation loss, T t1 represents the sample initial printed text image in the sample text separation image, D t1 represents the printed text discrimination loss, O t1 represents the predicted initial printed text image in the predicted text separation image, and θ1 is the adjustment parameter.

[0160] The calculation formula for the loss of generating binary images of printed text can be expressed as:

[0161]

[0162] Among them, L b represents the printed text binary image generation loss, T b Denotes the binary image of sample printed text in the sample text separation image, D b represents the printed text binary image discrimination loss, O b It represents the predicted printed text binary image in the predicted text separation image, and θ3 is the adjustment parameter.

[0163] The generation loss of the initial text separation model can be expressed as follows:

[0164]

[0165] Among them, G represents the initial text separation model, L G represents the generation loss of the initial text separation model, D represents the discriminative loss of the initial discriminative model, D = {D t1 ,D t2 ,D b}, arg min G (L t1 +L t2 +L b ) means that the goal of the initial text separation model is to make L t1 +Lt2 +L b The goal of the initial discriminant model is to distinguish the predicted text separation image generated by the initial text separation model and the sample text separation image as much as possible. D (L t1 +L t2 +L b ) means that the initial discriminant model needs to make L t1 +L t2 +L b The value of is maximized.

[0166] Based on the above embodiment, the overall process of the text separation method includes the following steps:

[0167] First, determine the overlapping text images to be separated;

[0168] Then, the overlapping text image is input into the text separation model to obtain the text separation image output by the text separation model. The specific process includes: inputting the overlapping text image into the feature convolution network in the text separation model to obtain the image features of the overlapping text image output by the feature convolution network; inputting the image features into the fixed text generation network in the text separation model to obtain the fixed text image output by the fixed text generation network; inputting the image features into the printed text generation branch and the printed text binary image generation branch under the printed text generation network respectively to obtain the initial printed text image output by the printed text generation branch and the printed text binary image output by the printed text binary image generation branch; determining the printed text image based on the printed text binary image and the initial printed text image; the fixed text image and the printed text image constitute the text separation image.

[0169] Among them, the text separation model is based on sample overlapping text images, and sample text separation images of the sample overlapping text images, and is obtained by adversarial training with a joint discriminant model. The discriminant model is used to distinguish between the predicted text separation image and the sample text separation image. The predicted text separation image is determined by the text separation model based on the sample overlapping text image.

[0170] The discrimination model includes a fixed text discrimination branch, a printed text discrimination branch and a printed text binary image discrimination branch; the fixed text discrimination branch is used to discriminate the authenticity of a fixed text image; the printed text discrimination branch is used to discriminate the authenticity of an initial printed text image; the printed text binary image discrimination branch is used to discriminate the authenticity of a printed text binary image.

[0171] The method provided by the embodiment of the present invention inputs overlapping text images into a text separation model to obtain a text separation image output by the text separation model; wherein the text separation model is obtained by adversarial training based on sample overlapping text images and sample text separation images of sample overlapping text images in conjunction with a discriminant model, and a generation and adversarial mechanism is introduced to train the text separation model, so that the text separation ability of the trained text separation model for overlapping text images can be guaranteed; and the text separation model can not only achieve the purpose of overlapping text separation, but also output a text separation image that is closer to a real text separation image, completely overcoming the defect that traditional solutions cannot achieve the separation of overlapping text in text areas, resulting in low accuracy of subsequent text recognition, and while achieving overlapping text separation, the naturalness and realism of the text separation image are guaranteed, greatly improving the image quality of the text separation image.

[0172] The text separation device provided by the present invention is described below. The text separation device described below and the text separation method described above can be referenced to each other.

[0173] Figure 3 is a structural schematic diagram of the text separation device provided by the present invention, such as Figure 3 As shown, the device comprises:

[0174] An image determination unit 310, used to determine overlapping text images to be separated;

[0175] The text separation unit 320 is used to input the overlapping text image into a text separation model to obtain a text separation image output by the text separation model; the text separation model is obtained by adversarial training based on a sample overlapping text image and a sample text separation image of the sample overlapping text image, in conjunction with a discriminant model, wherein the discriminant model is used to distinguish between a predicted text separation image and the sample text separation image, and the predicted text separation image is determined by the text separation model based on the sample overlapping text image.

[0176] The text separation device provided by the present invention inputs overlapping text images into a text separation model to obtain a text separation image output by the text separation model; wherein the text separation model is obtained by adversarial training based on sample overlapping text images and sample text separation images of sample overlapping text images in conjunction with a discriminant model, and a generation and adversarial mechanism is introduced to train the text separation model, so that the text separation ability of the trained text separation model for overlapping text images can be guaranteed; and the text separation model can not only achieve the purpose of overlapping text separation, but also output a text separation image that is closer to a real text separation image, completely overcoming the defect that the traditional scheme cannot achieve the separation of overlapping text in the text area, resulting in low accuracy of subsequent text recognition, and while achieving overlapping text separation, the naturalness and realism of the text separation image are guaranteed, greatly improving the image quality of the text separation image.

[0177] Based on the above embodiment, the text separation unit 320 is used for:

[0178] Inputting the overlapping text image into the feature convolution network in the text separation model to obtain image features of the overlapping text image output by the feature convolution network;

[0179] Inputting the image features into the fixed text generation network in the text separation model to obtain a fixed text image output by the fixed text generation network;

[0180] The image features are input into the printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network, and the fixed text image and the printed text image constitute the text separation image.

[0181] Based on the above embodiment, the text separation unit 320 is used for:

[0182] Inputting the image features into the printed text generation branch and the printed text binary image generation branch under the printed text generation network respectively, obtaining an initial printed text image output by the printed text generation branch and a printed text binary image output by the printed text binary image generation branch;

[0183] The printed text image is determined based on the printed text binary image and the initial printed text image.

[0184] Based on the above embodiment, the discrimination model includes a fixed text discrimination branch, a printed text discrimination branch and a printed text binary image discrimination branch;

[0185] The fixed text discrimination branch is used to discriminate the authenticity of the fixed text image;

[0186] The printed text identification branch is used to identify the authenticity of the initial printed text image;

[0187] The printed text binary image discrimination branch is used to discriminate the authenticity of the printed text binary image.

[0188] Based on the above embodiment, the device further includes a model determination unit, which is used to:

[0189] Construct an initial text separation model and an initial discriminant model;

[0190] Inputting the sample overlapping text image into the initial text separation model to obtain a predicted text separation image output by the initial text separation model;

[0191] Inputting the predicted text separation image and the sample text separation image into the initial discriminant model respectively, and obtaining the discrimination result of the predicted text separation image and the sample text separation image output by the initial discriminant model;

[0192] Based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image, the parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

[0193] Based on the above embodiment, the model determination unit is used for:

[0194] Determining a generation loss of the initial text separation model based on the predicted text separation image and the sample text separation image;

[0195] Determining the discrimination loss of the initial discrimination model based on the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image;

[0196] Based on the generation loss and the discrimination loss, parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

[0197] Based on the above embodiment, the generation loss includes a fixed text generation loss and a printed text generation loss, and the printed text generation loss includes an initial printed text generation loss and a printed text binary image generation loss;

[0198] The fixed text generation loss is determined based on the predicted fixed text image in the predicted text separation image and the sample fixed text image in the sample text separation image;

[0199] The initial printed text generation loss is determined based on the predicted initial printed text image in the predicted text separation image and the sample initial printed text image in the sample text separation image;

[0200] The initial printed text binary image generation loss is determined based on the predicted printed text binary image in the predicted text separation image and the sample printed text binary image in the sample text separation image.

[0201] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the text separation method, which includes: determining the overlapping text image to be separated; inputting the overlapping text image into a text separation model to obtain the text separation image output by the text separation model; the text separation model is obtained by conducting adversarial training based on the sample overlapping text image and the sample text separation image of the sample overlapping text image in conjunction with the discriminant model, wherein the discriminant model is used to distinguish the predicted text separation image from the sample text separation image, and the predicted text separation image is determined by the text separation model based on the sample overlapping text image.

[0202] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0203] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the text separation method provided by the above-mentioned methods, and the method includes: determining an overlapping text image to be separated; inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model; the text separation model is based on a sample overlapping text image, and a sample text separation image of the sample overlapping text image, and is obtained by adversarial training with a discriminant model, and the discriminant model is used to distinguish between a predicted text separation image and the sample text separation image, and the predicted text separation image is determined by the text separation model based on the sample overlapping text image.

[0204] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the text separation method provided by the above-mentioned methods, the method comprising: determining an overlapping text image to be separated; inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model; the text separation model is obtained by adversarial training based on a sample overlapping text image and a sample text separation image of the sample overlapping text image, and a joint discriminant model, the discriminant model being used to distinguish between a predicted text separation image and the sample text separation image, the predicted text separation image being determined by the text separation model based on the sample overlapping text image.

[0205] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0206] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A text separation method, characterized in that: include: Determining overlapping text images to be separated; Inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model; The text separation model is obtained by conducting adversarial training based on a sample overlapping text image and a sample text separation image of the sample overlapping text image in conjunction with a discriminant model, wherein the discriminant model is used to distinguish between a predicted text separation image and the sample text separation image, wherein the predicted text separation image is determined by the text separation model based on the sample overlapping text image; The step of inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model comprises: Inputting the overlapping text image into the feature convolution network in the text separation model to obtain image features of the overlapping text image output by the feature convolution network; Inputting the image features into the fixed text generation network in the text separation model to obtain a fixed text image output by the fixed text generation network; Inputting the image features into the printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network, wherein the fixed text image and the printed text image constitute the text separation image; The step of inputting the image features into the printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network comprises: Inputting the image features into the printed text generation branch and the printed text binary image generation branch under the printed text generation network respectively, obtaining an initial printed text image output by the printed text generation branch and a printed text binary image output by the printed text binary image generation branch; Determine the printed text image based on the printed text binary image and the initial printed text image; The discrimination model includes a fixed text discrimination branch, a printed text discrimination branch and a printed text binary image discrimination branch; The fixed text discrimination branch is used to discriminate the authenticity of the fixed text image; The printed text identification branch is used to identify the authenticity of the initial printed text image; The printed text binary image discrimination branch is used to discriminate the authenticity of the printed text binary image.

2. The text separation method according to claim 1, characterized in that: The text separation model and the discrimination model are determined based on the following steps: Construct an initial text separation model and an initial discriminant model; Inputting the sample overlapping text image into the initial text separation model to obtain a predicted text separation image output by the initial text separation model; Inputting the predicted text separation image and the sample text separation image into the initial discriminant model respectively, and obtaining the discrimination result of the predicted text separation image and the sample text separation image output by the initial discriminant model; Based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image, the parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

3. The text separation method according to claim 2, characterized in that: The method of updating the parameters of the initial text separation model and the initial discrimination model based on the predicted text separation image, the sample text separation image, the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image to obtain the text separation model and the discrimination model includes: Determining a generation loss of the initial text separation model based on the predicted text separation image and the sample text separation image; Determining the discrimination loss of the initial discrimination model based on the discrimination result of the predicted text separation image and the discrimination result of the sample text separation image; Based on the generation loss and the discrimination loss, parameters of the initial text separation model and the initial discrimination model are updated to obtain the text separation model and the discrimination model.

4. The text separation method according to claim 3, characterized in that: The generation loss includes a fixed text generation loss and a printed text generation loss, and the printed text generation loss includes an initial printed text generation loss and a printed text binary image generation loss; The fixed text generation loss is determined based on the predicted fixed text image in the predicted text separation image and the sample fixed text image in the sample text separation image; The initial printed text generation loss is determined based on the predicted initial printed text image in the predicted text separation image and the sample initial printed text image in the sample text separation image; The printed text binary image generation loss is determined based on the predicted printed text binary image in the predicted text separation image and the sample printed text binary image in the sample text separation image.

5. A text separation device, characterized in that: include: An image determination unit, used for determining overlapping text images to be separated; A text separation unit, used for inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model; the text separation model is obtained by conducting adversarial training based on a sample overlapping text image and a sample text separation image of the sample overlapping text image in conjunction with a discriminant model, wherein the discriminant model is used to distinguish between a predicted text separation image and the sample text separation image, wherein the predicted text separation image is determined by the text separation model based on the sample overlapping text image; The step of inputting the overlapping text image into a text separation model to obtain a text separation image output by the text separation model comprises: Inputting the overlapping text image into the feature convolution network in the text separation model to obtain image features of the overlapping text image output by the feature convolution network; Inputting the image features into the fixed text generation network in the text separation model to obtain a fixed text image output by the fixed text generation network; Inputting the image features into the printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network, wherein the fixed text image and the printed text image constitute the text separation image; The step of inputting the image features into the printed text generation network in the text separation model to obtain a printed text image output by the printed text generation network comprises: Inputting the image features into the printed text generation branch and the printed text binary image generation branch under the printed text generation network respectively, obtaining an initial printed text image output by the printed text generation branch and a printed text binary image output by the printed text binary image generation branch; Determine the printed text image based on the printed text binary image and the initial printed text image; The discrimination model includes a fixed text discrimination branch, a printed text discrimination branch and a printed text binary image discrimination branch; The fixed text discrimination branch is used to discriminate the authenticity of the fixed text image; The printed text identification branch is used to identify the authenticity of the initial printed text image; The printed text binary image discrimination branch is used to discriminate the authenticity of the printed text binary image.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the text separation method according to any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the text separation method according to any one of claims 1 to 4 is implemented.