Text information extraction method, extraction system, electronic device and storage medium

The pre-trained model is used to perform seal erasure and text detection and recognition, which solves the problem of seal coverage affecting text recognition accuracy and improves the accuracy of information extraction from image data in the financial industry.

CN114973271BInactive Publication Date: 2024-09-17CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210581957.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2024-09-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When the existing technology uses optical character recognition technology, the seal covers the text area in the image data, resulting in a decrease in text detection and recognition accuracy, which has a great impact especially on the processing of business image data in the financial industry.

Method used

The pre-trained text erasure model is used to stamp erase the target image, combined with the pre-trained text detection model for text line detection, and the pre-trained text recognition model and text line coordinate information are used for text recognition. Through stamp erasure and Text detection and recognition methods improve the accuracy of information extraction.

Benefits of technology

It effectively improves the accuracy of text detection and recognition of seal images, and enhances the accuracy of information extraction, especially in the processing of business image data such as investment forms, underwriting documents, and claim documents in the financial industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114973271B
    Figure CN114973271B
Patent Text Reader

Abstract

The embodiments of the present application provide a text information extraction method, extraction system, electronic device and storage medium, which belong to the field of artificial intelligence technology. The method includes: obtaining a target image to be extracted; using a pre-trained text erasure model to perform seal erasure on the target image to obtain a first image with the seal removed from the target image; using a pre-trained text detection model to perform text line detection on the first image to obtain at least one set of text line coordinate information; using a pre-trained text recognition model and each set of text line coordinate information to perform text recognition on the first image to obtain multiple target text information. The embodiments of the present application can realize text detection and recognition of images with seals, and improve the accuracy of information extraction from images with seals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text information extraction method, extraction system, electronic device and storage medium. Background Art

[0002] At present, many image materials are accompanied by seals. For example, in the financial industry, such as the insurance field, when using optical character recognition (OCR) technology to convert many business image materials (such as insurance applications, underwriting materials, claims documents, etc.) into text and store them in a structured manner, the seal covers the area with text in the image material, which has a great impact on the effect of text detection or text recognition and the recognition accuracy of information extraction. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a text information extraction method, extraction system, electronic device and storage medium, which can realize text detection and recognition of stamped images and improve the accuracy of information extraction of stamped images.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a text information extraction method, the method comprising:

[0005] Acquire the target image to be extracted;

[0006] Using a pre-trained text erasure model to perform seal erasure on the target image, to obtain a first image with the seal on the target image removed;

[0007] Performing text line detection on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information;

[0008] The pre-trained text recognition model and each set of text row coordinate information are used to perform text recognition on the first image to obtain multiple target text information.

[0009] In some embodiments, the using of the pre-trained text recognition model and each set of text line coordinate information to perform text recognition on the first image to obtain multiple target text information includes:

[0010] Performing text image interception on the first image according to each set of text line coordinate information to obtain a text line image;

[0011] A pre-trained text recognition model is used to perform text recognition on each of the text line images to obtain a plurality of target text information.

[0012] In some embodiments, after performing text image interception on the first image according to each set of text line coordinate information to obtain a text line image, the method further includes:

[0013] Grayscale image conversion is performed on the text line image to update the text line image.

[0014] In some embodiments, the pre-trained text erasure model is trained by the following method:

[0015] Constructing a first training sample set, wherein the first training sample set includes a plurality of first training samples, each of which includes an initial image with a seal and a sample image with the seal removed;

[0016] Build an end-to-end initial text erasure model based on the EraseNet algorithm;

[0017] Inputting the plurality of initial images with seals into the initial text erasing model for model training to obtain a second image without seals;

[0018] determining a first loss value according to the second image and the sample image with the stamp removed;

[0019] The model parameters of the initial text erasure model are adjusted according to the second image and the sample image with the seal removed, and the adjusted model is continuously trained based on the first training sample set until the first loss value meets the preset training end condition to obtain the text erasure model.

[0020] In some embodiments, the building of an end-to-end initial text erasure model based on the EraseNet algorithm includes:

[0021] Build the first end-to-end text erasure model based on the EraseNet algorithm;

[0022] The first text erasure model is optimized using the Mobilenet-v3 network structure to obtain an initial text erasure model.

[0023] In some embodiments, the pre-trained text detection model is trained by the following method:

[0024] Constructing a second training sample set, wherein the second training sample set includes a plurality of second training samples, each of which includes an initial training image and a sample image after detection;

[0025] Build an initial text detection model based on the DBNet algorithm;

[0026] Inputting the plurality of initial training images into the initial text detection model for model training to obtain a third image;

[0027] Determine a second loss value according to the third image and the detected sample image;

[0028] The model parameters of the initial text detection model are adjusted according to the third image and the detected sample image, and the adjusted model is continued to be trained based on the second training sample set until the second loss value meets the preset training end condition to obtain the text detection model.

[0029] In some embodiments, the step of constructing an initial text detection model based on the DBNet algorithm includes:

[0030] Build the first text detection model based on DBNet algorithm;

[0031] The first text detection model is optimized using the Resnet-50 network structure to obtain an initial text detection model.

[0032] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a text information extraction system, the system comprising:

[0033] An image acquisition module, used to acquire a target image to be extracted;

[0034] A seal erasing module, used for performing seal erasing on the target image using a pre-trained text erasing model to obtain a first image with the seal on the target image removed;

[0035] A text line detection module, used to perform text line detection on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information;

[0036] The text recognition module is used to perform text recognition on the first image using a pre-trained text recognition model and each set of text line coordinate information to obtain multiple target text information.

[0037] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application provides an electronic device, including:

[0038] at least one memory;

[0039] at least one processor;

[0040] at least one computer program;

[0041] The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement the text information extraction method described in the first aspect above.

[0042] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute a text information extraction method described in the first aspect above.

[0043] The embodiments of the present application propose a method, an extraction system, an electronic device, and a storage medium for extracting text information. By acquiring a target image to be extracted, in order to avoid being unable to extract information covered by a seal on the target image, a pre-trained text erasure model is used to erase the seal on the target image, and a first image with the seal removed from the target image is obtained. In order to improve the ability to recognize text information in the first image, a pre-trained text detection model is used to detect text lines on the first image to obtain at least one set of text line coordinate information. The pre-trained text recognition model and each set of text line coordinate information are used to perform text recognition on the first image to obtain multiple target text information. By combining the seal erasure and text detection and recognition methods, the present application can realize text detection and recognition of images with seals, thereby improving the accuracy of information extraction from images with seals. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flowchart of a text information extraction method provided in an embodiment of the present application;

[0045] Figure 2 yes Figure 1 Flow chart of step S140 in FIG.

[0046] Figure 3 is a training flow chart of a text erasure model provided in an embodiment of the present application;

[0047] Figure 4 yes Figure 3 Flow chart of step S320 in FIG.

[0048] Figure 5 is a training flow chart of a text detection model provided in an embodiment of the present application;

[0049] Figure 6 yes Figure 5 Flow chart of step S520 in FIG.

[0050] Figure 7 It is a structural schematic diagram of a text information extraction system provided in an embodiment of the present application;

[0051] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0055] First, some nouns involved in this application are analyzed:

[0056] Artificial Intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science. AI attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0057] Convolutional Recurrent Neural Network (CRNN): It is a network structure that is mainly used for end-to-end recognition of text sequences of indefinite length. It does not require cutting individual characters first, but converts text recognition into a time-dependent sequence learning problem, that is, image-based sequence recognition.

[0058] Long Short-Term Memory (LSTM): It is a time recurrent neural network that not only solves the problem that RNN cannot handle long-distance dependencies, but also solves common problems in neural networks such as gradient explosion or gradient disappearance. It is very effective in processing sequence data.

[0059] Bidirectional LSTM (Long Short-Term Memory, BiLSTM): The same input sequence is connected to the forward and backward LSTMs respectively, and then the hidden layers of the two networks are connected together and connected to the output layer for prediction.

[0060] Convolutional Neural Networks (CNN): It is a multi-layer supervised learning neural network. The convolution layer and pool sampling layer of the hidden layer are the core modules to realize the feature extraction function of the convolutional neural network. The network model uses the gradient descent method to minimize the loss function to reversely adjust the weight parameters in the network layer by layer, and improves the accuracy of the network through frequent iterative training.

[0061] Multi-channel images: refers to images of the same scene taken by multiple cameras or images of the same scene taken by one camera at different times. When representing an image, multiple channels are used to encode the image. Multi-channel images are often used in the field of artificial intelligence.

[0062] Three-channel image: refers to an image with three channels, RGB, that is, a color image, where R is red, G is green, and B is blue.

[0063] Single-channel image: also known as grayscale image, that is, each pixel of the image has only one value to represent the color, and its pixel value is between 0 and 255, 0 is black, 255 is white, and the intermediate value represents some different levels of gray.

[0064] Encoder-Decoder: It is a common model framework in deep learning. Many common applications are designed using the encoder-decoder framework. The Encoder and Decoder parts can be any text, voice, image, and video data. Various models can be designed based on Encoder-Decoder.

[0065] Feature Pyramid Network (FPN): It uses both the high resolution of low-level features and the high semantic information of high-level features to achieve prediction results by fusing features from different layers.

[0066] Differentiable Binarization Network (DBNet): is a segmentation-based text detection algorithm that can adapt to image scenes to accurately detect text areas. In terms of threshold selection, the DBNet algorithm uses the network to predict the threshold at each position of the image instead of using a fixed value, so that the background and foreground can be separated well. At the same time, the DBNet algorithm uses the FPN network structure for feature extraction, which can better realize text detection.

[0067] At present, many image materials are accompanied by seals. For example, in the financial industry, such as the insurance field, when using optical character recognition (OCR) technology to convert many business image materials (such as insurance applications, underwriting materials, claims documents, etc.) into text and store them in a structured manner, the seal covers the area with text in the image material, which has a great impact on the effect of text detection or text recognition and the recognition accuracy of information extraction.

[0068] Based on this, the embodiments of the present application provide a text information extraction method, extraction system, electronic device and storage medium, which can realize text detection and recognition of stamped images, and improve the accuracy of information extraction of stamped images.

[0069] The information extraction method, information extraction system, electronic device and storage medium provided in the embodiments of the present application are specifically explained through the following embodiments. First, a text information extraction method in the embodiments of the present application is described.

[0070] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0071] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0072] A text information extraction method provided in an embodiment of the present application relates to the field of artificial intelligence technology. A text information extraction method provided in an embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and cloud servers that provide basic cloud computing services such as big data and artificial intelligence platforms; the software can be an application that implements a text information extraction method, etc., but is not limited to the above forms.

[0073] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0074] See also Figure 1 , Figure 1 is an optional flowchart of a text information extraction method provided in an embodiment of the present application. Figure 1 The method may specifically include but is not limited to steps S110 to S140.

[0075] Step S110, obtaining a target image to be extracted;

[0076] Step S120, using a pre-trained text erasure model to perform seal erasure on the target image to obtain a first image with the seal removed from the target image;

[0077] Step S130, performing text line detection on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information;

[0078] Step S140: Perform text recognition on the first image using the pre-trained text recognition model and each set of text row coordinate information to obtain a plurality of target text information.

[0079] In steps S110 to S140 of some embodiments, by acquiring a target image to be extracted, in order to avoid being unable to extract information covered by a seal on the target image, a pre-trained text erasure model is used to erase the seal on the target image to obtain a first image with the seal removed from the target image. In order to improve the ability to recognize text information in the first image, a pre-trained text detection model is used to perform text line detection on the first image to obtain at least one set of text line coordinate information. The pre-trained text recognition model and each set of text line coordinate information are used to perform text recognition on the first image to obtain multiple target text information. The present application can realize text detection and recognition of images with seals by combining seal erasure and text detection and recognition methods, thereby improving the accuracy of information extraction from images with seals.

[0080] In step S110 of some embodiments, in order to realize text detection and recognition of a stamped image, first, a target image to be extracted is obtained. Specifically, an image acquisition device, such as a camera, an image scanner, etc., can be used to acquire an image of the stamped image to be recognized to obtain a target image. For example, when it is necessary to extract information from a stamped document, an image acquisition device such as a camera can be used to obtain the target image.

[0081] It should be noted that when an initial image containing a target file with a seal is obtained by an image acquisition device, since the initial image may contain background information that may interfere with the target file, the initial image may be firstly captured to obtain the target image to be extracted.

[0082] In step S120 of some embodiments, in order to effectively detect text on a stamped image, a pre-trained text erasure model is used to erase the stamp on the target image to obtain a first image with the stamp removed from the target image. Specifically, in order to avoid interference of the stamp in the target image with text information extraction, before performing text line detection on the target image, it is necessary to erase the stamp on the target image using a pre-trained text erasure model to obtain a first image with the stamp removed from the target image. The embodiments of the present application can detect and recognize text on stamped images by combining the method of stamp erasure, thereby improving the accuracy of information extraction from stamped images.

[0083] In step S130 of some embodiments, after obtaining the first image with the stamp removed from the target image, in order to extract the text information in the target image, the first image is subjected to text line detection using a pre-trained text detection model to obtain at least one set of text line coordinate information. Specifically, the first image is subjected to text line detection using a text detection model to obtain at least one text box containing text information, and at least one set of text line coordinate information corresponding to the first image is obtained based on the position information of each text box in the first image.

[0084] In step S140 of some embodiments, when a text box list consisting of at least one set of text row coordinate information is obtained, text recognition is performed on the first image using a pre-trained text recognition model and each set of text row coordinate information to obtain multiple target text information. Specifically, text recognition is performed on the text box corresponding to each set of text row coordinate information using the text recognition model to obtain all the target text information in the text box. After text recognition is performed on the text boxes corresponding to all the text row coordinate information in the first image, multiple target text information corresponding to the target image is obtained. The embodiment of the present application can realize text detection and recognition of stamped images by combining the seal erasure method, thereby improving the accuracy of information extraction from stamped images.

[0085] It should be noted that in order to realize text recognition of the first image according to each group of text row coordinate information, a text recognition model based on the CRNN network structure is used to perform text recognition on the first image. Specifically, the text recognition model CRNN includes a convolution layer, a circulation layer and a transcription layer. The convolution layer is used to extract features of each group of text row coordinate information in the first image to obtain a convolution feature vector, thereby achieving feature dimension reduction and reduction of the amount of calculation for the first image. The convolution feature vector is labeled by the circulation layer to obtain a label distribution. And the label distribution is feature integrated by the transcription layer to obtain the target text information corresponding to each group of text row coordinate information. For example, multiple groups of text row coordinate information and the first image are input into a pre-trained text recognition model, and multiple target text information is output. The embodiment of the present application improves the accuracy of information extraction of stamped images by detecting and recognizing text in stamped images.

[0086] It should be noted that in order to improve the recognition efficiency of the text recognition model, the bidirectional LSTM part in the CRNN network structure is removed, and the CNN backbone network part in the CRNN network structure is retained to obtain a pre-trained text recognition model, which improves the recognition efficiency of the text recognition model.

[0087] It should be noted that the information extraction method of the embodiment of the present application can be applied to different fields. For example, in the insurance field of the financial industry, when it is necessary to convert some business images and other materials that have been stamped, such as insurance applications, underwriting materials, claims documents, etc., into text and store them in a structured manner, the information extraction method of the embodiment of the present application can be used to accurately detect and recognize text on images with stamps. The method of the embodiment of the present application can also be applied to other business scenarios that require information extraction from document information with stamps.

[0088] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0089] See also Figure 2 , Figure 2 is a flowchart of a specific method of step S140 in some embodiments of the present application. In some embodiments of the present application, step S140 specifically includes but is not limited to step S210 and step S220. Figure 2 These two steps are introduced in detail.

[0090] Step S210, performing text image interception on the first image according to each set of text line coordinate information to obtain a text line image;

[0091] Step S220, using a pre-trained text recognition model to perform text recognition on each text line image to obtain multiple target text information.

[0092] In step S210 and step S220 of some embodiments, in order to improve the text recognition efficiency of each set of text line coordinate information in the first image, the text image of the first image is intercepted according to each set of text line coordinate information to obtain the corresponding text line image, that is, the text line image represents the text box corresponding to each set of text line coordinate information in the first image. A pre-trained text recognition model is used to perform text recognition on each text line image to obtain multiple target text information. Specifically, the text recognition model is used to perform text recognition on the text box corresponding to each set of text line coordinate information to obtain all the target text information in the text box. After performing text recognition on the text boxes corresponding to all the text line coordinate information in the first image, multiple target text information corresponding to the target image is obtained. The embodiment of the present application can realize text detection and recognition of images with seals by combining the method of seal erasure, thereby improving the accuracy of information extraction from images with seals.

[0093] In some embodiments of the present application, after step S210, a text information extraction method of the present application further includes: performing grayscale image conversion on the text line image to update the text line image.

[0094] In some embodiments, in order to reduce the amount of computation of the text recognition model and to improve the recognition efficiency of the text recognition model for text line images, before each text line image is input into the text recognition model, a grayscale image conversion is performed on each text line image, that is, a text line image belonging to a multi-channel image is converted to a text line image belonging to a single-channel image to update the text line image. For example, when the text line image is a three-channel image, the text line image is converted to a grayscale image and converted to a text line image belonging to a single-channel image to update the text line image. The embodiment of the present application improves the accuracy of information extraction from stamped images by performing grayscale image conversion on text line images.

[0095] See also Figure 3 , Figure 3 is a training flow chart of the text erasure model pre-trained in this application. In some embodiments of this application, the training process of the text erasure model specifically includes but is not limited to steps S310 to S350. Figure 3 These five steps are introduced in detail.

[0096] Step S310, constructing a first training sample set, the first training sample set including a plurality of first training samples, each of the first training samples including an initial image with a seal and a sample image with the seal removed;

[0097] Step S320, constructing an end-to-end initial text erasure model based on the EraseNet algorithm;

[0098] Step S330, inputting a plurality of initial images with seals into an initial text erasure model for model training to obtain a second image with the seals removed;

[0099] Step S340, determining a first loss value according to the second image and the sample image with the seal removed;

[0100] Step S350, adjusting the model parameters of the initial text erasure model according to the second image and the sample image with the seal removed, and continuing to train the adjusted model based on the first training sample set until the first loss value meets the preset training end condition to obtain the text erasure model.

[0101] In step S310 of some embodiments, in order to avoid the interference of the seal in the image on the extraction of text information, a first training sample set is constructed, and the first training sample set includes multiple first training samples, each of which includes an initial image with a seal and a sample image with the seal removed, that is, a large number of initial images with seals are sent to the model for training, so that the obtained text erasure model has the seal erasure function.

[0102] In steps S320 to S350 of some embodiments, in order to obtain a text erasure model for realizing the seal erasure function, first, an end-to-end initial text erasure model is constructed based on the EraseNet algorithm. A plurality of initial images with seals are input into the initial text erasure model for model training to obtain a second image with the seal removed, and a first loss value is determined according to the second image and the sample image. The first loss value is used to represent the error between the second image obtained by training and the sample image with the seal removed, and the model parameters of the initial text erasure model are adjusted according to the second image and the sample image, and the adjusted model is continued to be trained based on the first training sample set until the first loss value meets the preset training end condition to obtain the text erasure model. The present application can realize text detection and recognition of images with seals by combining seal erasure and text detection and recognition methods, thereby improving the accuracy of information extraction from images with seals.

[0103] It should be noted that the end-to-end initial text erasure model built based on the EraseNet algorithm includes: a coarse erasure network, a fine erasure network and a segmentation head for perceiving text areas. Among them, the coarse erasure network includes multiple residual blocks and lateral connections, and by adopting nonlinear transformations and convolution operations, it can realize feature extraction and integration from different layers. In order to improve the ability of the initial text erasure model to erase seals, an optimized subnetwork, namely the fine erasure network, is cascaded to the coarse erasure network, and the output of the coarse erasure network is sent to the fine erasure network for prediction, which can predict a higher quality output result. Specifically, the fine erasure network includes dilated convolution and hollow convolution, which are used to expand the size of the convolution kernel without increasing the redundant computational cost, and integrate higher-level semantic information and lower-level detail information from the coarse erasure network and the fine erasure network by combining skip connections. In order to avoid the occurrence of mis-erasure of text or mis-erasure of text background, a segmentation head for perceiving text areas is added to the coarse erasure network. Among them, the segmentation head is another encoder-decoder architecture, the decoder part is cascaded after the convolution layer of the coarse erasure network, and the encoder part shares weights with the backbone network, thereby effectively solving the problem of sample imbalance in the first training sample set. The present application can realize text detection and recognition of stamped images by combining seal erasure and text detection and recognition methods, thereby improving the accuracy of information extraction from stamped images.

[0104] See also Figure 4 , Figure 4 is a flowchart of a specific method of step S320 in an embodiment of the present application. In some embodiments of the present application, step S320 specifically includes but is not limited to step S410 and step S420. Figure 4 These two steps are introduced in detail.

[0105] Step S410, constructing an end-to-end first text erasure model based on the EraseNet algorithm;

[0106] Step S420, using the Mobilenet-v3 network structure to optimize the first text erasure model to obtain an initial text erasure model.

[0107] In some embodiments, in order to reduce the model size of the initial text erasure model and improve the efficiency of information extraction from stamped images, first, an end-to-end first text erasure model is constructed based on the EraseNet algorithm, and the first text erasure model is optimized using a lightweight Mobilenet-v3 network structure to obtain an initial text erasure model. Multiple initial images with seals are input into the initial text erasure model for model training to obtain a second image with the seal removed, and a first loss value is determined based on the second image and the sample image. Among them, the first loss value is used to represent the error between the second image obtained by training and the sample image with the seal removed, and the model parameters of the initial text erasure model are adjusted according to the second image and the sample image, and the adjusted model is continued to be trained based on the first training sample set until the first loss value meets the preset training end condition to obtain a text erasure model. The present application optimizes the initial text erasure model to obtain a text erasure model, which can realize the erasure of the seal of the stamped image and improve the accuracy of information extraction from the stamped image.

[0108] See also Figure 5 , Figure 5 is a training flow chart of the pre-trained text detection model of the present application. In some embodiments of the present application, the training process of the text detection model specifically includes but is not limited to steps S510 to S550. Figure 5 These five steps are introduced in detail.

[0109] Step S510, constructing a second training sample set, the second training sample set including a plurality of second training samples, each second training sample including an initial training image and a sample image after detection;

[0110] Step S520, constructing an initial text detection model based on the DBNet algorithm;

[0111] Step S530, inputting a plurality of initial training images into an initial text detection model for model training to obtain a third image;

[0112] Step S540, determining a second loss value according to the third image and the detected sample image;

[0113] Step S550, adjusting the model parameters of the initial text detection model according to the third image and the detected sample image, and continuing to train the adjusted model based on the second training sample set until the second loss value meets the preset training end condition to obtain the text detection model.

[0114] In some embodiments, a second training sample set is constructed, and the second training sample set includes multiple second training samples, and each second training sample includes an initial training image and a sample image after detection. Wherein, the sample image after detection is an image corresponding to all text line coordinate information obtained in the initial training image. In order to improve the detection efficiency of the text detection model, an initial text detection model is constructed based on the DBNet algorithm. Multiple initial training images are input into the initial text detection model for model training to obtain a third image, and a second loss value is determined based on the third image and the sample image after detection. Wherein, the second loss value is used to represent the error between the third image obtained by training and the corresponding sample image after detection, and the model parameters of the initial text detection model are adjusted according to the third image and the sample image after detection, and the adjusted model is continued to be trained based on the second training sample set until the second loss value meets the preset training end condition to obtain a text detection model. The present application performs text line detection on the first image through the text detection model, thereby realizing text recognition of the image with seal, and improving the accuracy of information extraction of the image with seal.

[0115] See also Figure 6 , Figure 6 is a flowchart of a specific method of step S520 in an embodiment of the present application. In some embodiments of the present application, step S520 specifically includes but is not limited to step S610 and step S620. Figure 6 These two steps are introduced in detail.

[0116] Step S610, constructing a first text detection model based on the DBNet algorithm;

[0117] Step S620, using the Resnet-50 network structure to optimize the first text detection model to obtain an initial text detection model.

[0118] In step S610 and step S620 of some embodiments, in order to improve the detection accuracy of the text detection model, first, a first text detection model is constructed based on the DBNet algorithm. In order to improve the feature extraction capability of the convolutional layer in the first text detection model, the first text detection model is optimized using the Resnet-50 network structure to obtain an initial text detection model. Afterwards, multiple initial training images are input into the initial text detection model for model training to obtain a third image, and a second loss value is determined based on the third image and the sample image after detection. The second loss value is used to represent the error between the third image obtained by training and the corresponding sample image after detection. The model parameters of the initial text detection model are adjusted based on the third image and the sample image after detection, and the adjusted model is continued to be trained based on the second training sample set until the second loss value meets the preset training end condition to obtain a text detection model. The present application improves the text line detection capability of the text detection model for the first image by optimizing the text detection model, thereby realizing text recognition of the image with seal, and improving the accuracy of information extraction of the image with seal.

[0119] It should be noted that the DBNet algorithm uses an FPN network structure for feature extraction. In order to extract richer and more accurate text line coordinate information, the number of feature extraction layers of the FPN part in the first text detection model can be increased to five layers to obtain an initial text detection model, thereby improving the initial text detection model's ability to detect small targets. Model training is performed based on the optimized initial text detection model to obtain a text detection model, which can improve the text detection model's ability to detect text lines in the first image, thereby realizing text recognition of stamped images and improving the accuracy of information extraction from stamped images. It should be noted that the embodiments of the present application are not limited to increasing the number of feature extraction layers of the FPN part to five layers, and can be adjusted according to actual needs and the improvement of the recognition performance of the text detection model, which will not be repeated here.

[0120] The embodiment of the present application provides a method for extracting text information. By acquiring a target image to be extracted, in order to avoid being unable to extract information covered by a seal on the target image, a pre-trained text erasure model is used to erase the seal on the target image to obtain a first image with the seal removed from the target image. In order to improve the recognition ability of text information in the first image, a pre-trained text detection model is used to detect text lines on the first image to obtain at least one set of text line coordinate information. In order to improve the text recognition efficiency of each set of text line coordinate information in the first image, the first image is intercepted according to each set of text line coordinate information to obtain a corresponding text line image, that is, the text line image represents the text box corresponding to each set of text line coordinate information in the first image. In order to reduce the calculation amount of the text recognition model and improve the recognition efficiency of the text recognition model for the text line image, each text line image is converted to a grayscale image, that is, the text line image belonging to the multi-channel image is converted to a grayscale image, and converted to a text line image belonging to the single-channel image to update the text line image. The pre-trained text recognition model and each set of text line coordinate information are used to perform text recognition on the first image to obtain multiple target text information. In order to improve the accuracy of information extraction from stamped images, the present application performs stamp erasure on the target image by combining an optimized text erasure model, and combines an optimized text detection model to improve the text line detection capability of the text detection model for the first image, thereby realizing text recognition for stamped images and improving the accuracy of information extraction from stamped images.

[0121] See also Figure 7 The embodiment of the present application also provides a text information extraction system that can implement the above-mentioned text information extraction method. The system includes an image acquisition module 710, a seal erasing module 720, a text line detection module 730 and a text recognition module 740.

[0122] An image acquisition module 710 is used to acquire a target image to be extracted;

[0123] A seal erasing module 720 is used to perform seal erasing on a target image using a pre-trained text erasing model to obtain a first image with the seal on the target image removed;

[0124] A text line detection module 730 is used to perform text line detection on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information;

[0125] The text recognition module 740 is used to perform text recognition on the first image using a pre-trained text recognition model and each set of text line coordinate information to obtain multiple target text information.

[0126] It should be noted that the text information extraction system of the embodiment of the present application is used to implement the above-mentioned text information extraction method. The text information extraction system of the embodiment of the present application corresponds to the aforementioned text information extraction method. Please refer to the aforementioned text information extraction method for the specific processing process, which will not be repeated here.

[0127] The text information extraction system provided by the embodiment of the present application can implement the above-mentioned text information extraction method, by obtaining the target image to be extracted, in order to avoid the inability to extract the information covered by the seal on the target image, the seal is erased on the target image using a pre-trained text erasure model, and the first image with the seal removed from the target image is obtained. In order to improve the recognition ability of the text information in the first image, the text line detection is performed on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information. In order to improve the text recognition efficiency of each set of text line coordinate information in the first image, the text image is intercepted on the first image according to each set of text line coordinate information to obtain the corresponding text line image, that is, the text line image represents the text box corresponding to each set of text line coordinate information in the first image. In order to reduce the calculation amount of the text recognition model and improve the recognition efficiency of the text recognition model for the text line image, each text line image is converted to a grayscale image, that is, the text line image belonging to the multi-channel image is converted to a grayscale image, and is converted to a text line image belonging to the single-channel image to update the text line image. The pre-trained text recognition model and each set of text line coordinate information are used to perform text recognition on the first image to obtain multiple target text information. In order to improve the accuracy of information extraction from stamped images, the present application performs stamp erasure on the target image by combining an optimized text erasure model, and combines an optimized text detection model to improve the text line detection capability of the text detection model for the first image, thereby realizing text recognition on stamped images and improving the accuracy of information extraction from stamped images.

[0128] The embodiment of the present application also provides an electronic device, which includes: at least one memory, at least one processor, and at least one computer program, wherein the at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement any of the text information extraction methods in the above embodiments. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0129] See also Figure 8 , Figure 8 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0130] The processor 810 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0131] The memory 820 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 820 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 820, and the processor 810 calls and executes the text information extraction method of the embodiment of this application;

[0132] Input / output interface 830, used to implement information input and output;

[0133] The communication interface 840 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0134] bus 850 , which transmits information between the various components of the device (e.g., processor 810 , memory 820 , input / output interface 830 , and communication interface 840 );

[0135] The processor 810 , the memory 820 , the input / output interface 830 and the communication interface 840 are connected to each other in communication within the device via a bus 850 .

[0136] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute any one of the text information extraction methods in the above embodiments.

[0137] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0138] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0139] It can be understood by those skilled in the art that Figures 1 to 6 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.

[0140] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0141] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0142] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0143] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0144] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0145] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or 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 multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0148] The preferred embodiments of the present invention are described with reference to the accompanying drawings, but the scope of the present invention is not limited by the above. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A text information extraction method, characterized in that: Used to extract text information of image data in insurance business, wherein the image data includes at least one of an insurance application form, underwriting information, and a claim settlement document, the method comprising: Acquire the target image to be extracted; The target image is subjected to seal erasure using a pre-trained text erasure model to obtain a first image with the seal removed from the target image; wherein the process of constructing the text erasure model specifically includes: constructing an end-to-end first text erasure model based on the EraseNet algorithm; optimizing the first text erasure model using a Mobilenet-v3 network structure to obtain an initial text erasure model, wherein the model structure of the initial text erasure model is smaller than the model structure of the first text erasure model; and training the initial text erasure model according to a first training sample set to obtain the text erasure model; Perform text line detection on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information; wherein the pre-trained text detection model is trained by the following method: construct a second training sample set, wherein the second training sample set includes multiple second training samples, and each second training sample includes an initial training image and a sample image after detection; construct an initial text detection model based on a DBNet algorithm; input multiple initial training images into the initial text detection model for model training to obtain a third image; determine a second loss value based on the third image and the sample image after detection; adjust the model parameters of the initial text detection model based on the third image and the sample image after detection, and continue to train the adjusted model based on the second training sample set until the second loss value meets a preset training end condition to obtain the text detection model; wherein the construction of the initial text detection model based on the DBNet algorithm includes: constructing a first text detection model based on the DBNet algorithm, wherein the DBNet algorithm uses a five-layer FPN network structure for feature extraction; optimizing the first text detection model using a Resnet-50 network structure to obtain an initial text detection model; The first image is subjected to text recognition using a pre-trained text recognition model and each set of text line coordinate information to obtain a plurality of target text information; wherein, the text recognition using a pre-trained text recognition model and each set of text line coordinate information to obtain a plurality of target text information comprises: performing text image interception on the first image according to each set of text line coordinate information to obtain a text line image; performing grayscale image conversion on the text line image to update the text line image, and the updated text line image is a single-channel image; and performing text recognition on each of the text line images using a pre-trained text recognition model to obtain a plurality of target text information.

2. A text information extraction method according to claim 1, characterized in that: The pre-trained text erasure model is trained by the following method: Constructing a first training sample set, wherein the first training sample set includes a plurality of first training samples, each of which includes an initial image with a seal and a sample image with the seal removed; Build an end-to-end initial text erasure model based on the EraseNet algorithm; Inputting the plurality of initial images with seals into the initial text erasing model for model training to obtain a second image without seals; determining a first loss value according to the second image and the sample image with the stamp removed; The model parameters of the initial text erasure model are adjusted according to the second image and the sample image with the seal removed, and the adjusted model is continuously trained based on the first training sample set until the first loss value meets the preset training end condition to obtain the text erasure model.

3. A text information extraction system, characterized in that: The system is used to extract text information of image data in insurance business, wherein the image data includes at least one of an insurance application form, underwriting information, and a claim settlement document, and the system includes: An image acquisition module, used to acquire a target image to be extracted; A seal erasure module is used to perform seal erasure on the target image using a pre-trained text erasure model to obtain a first image with the seal on the target image removed; wherein the process of constructing the text erasure model specifically includes: constructing an end-to-end first text erasure model based on the EraseNet algorithm; optimizing the first text erasure model using the Mobilenet-v3 network structure to obtain an initial text erasure model, and the model structure of the initial text erasure model is smaller than the model structure of the first text erasure model; and performing model training on the initial text erasure model according to a first training sample set to obtain the text erasure model; A text line detection module, used to perform text line detection on the first image using a pre-trained text detection model to obtain at least one set of text line coordinate information; wherein the pre-trained text detection model is trained by the following method: constructing a second training sample set, the second training sample set includes multiple second training samples, each second training sample includes an initial training image and a detected sample image; constructing an initial text detection model based on a DBNet algorithm; inputting multiple initial training images into the initial text detection model for model training to obtain a third image; determining a second loss value according to the third image and the detected sample image; adjusting the model parameters of the initial text detection model according to the third image and the detected sample image, and continuing to train the adjusted model based on the second training sample set until the second loss value meets a preset training end condition to obtain the text detection model; wherein the initial text detection model is constructed based on the DBNet algorithm, including: constructing a first text detection model based on the DBNet algorithm, the DBNet algorithm uses a five-layer FPN network structure for feature extraction; optimizing the first text detection model using a Resnet-50 network structure to obtain an initial text detection model; A text recognition module is used to perform text recognition on the first image using a pre-trained text recognition model and each set of text line coordinate information to obtain multiple target text information; wherein, the use of the pre-trained text recognition model and each set of text line coordinate information to perform text recognition on the first image to obtain multiple target text information includes: performing text image interception on the first image according to each set of text line coordinate information to obtain a text line image; performing grayscale image conversion on the text line image to update the text line image, and the updated text line image is a single-channel image; using the pre-trained text recognition model to perform text recognition on each of the text line images to obtain multiple target text information.

4. An electronic device, characterized in that: include: at least one memory; at least one processor; at least one computer program; The at least one computer program is stored in the at least one memory, and the at least one processor executes the at least one computer program to implement: A method for extracting text information as claimed in any one of claims 1 to 2.

5. A storage medium, the storage medium being a computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, and the computer program is used to cause a computer to execute: A method for extracting text information as claimed in any one of claims 1 to 2.