Key information extraction method and device

By obtaining multi-modal feature vectors of bank cards or invoices, combined with deep learning and image gradient edge detection, the problem of low bank card information extraction efficiency and poor applicability in the existing technology is solved, and accurate information extraction of different bank cards is achieved. and versatility.

CN118537879APending Publication Date: 2024-08-23ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310152619.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, the extraction of key information from bank cards or invoices requires customized algorithms, which cannot be applied to cards from different banks, and are inefficient, time-consuming and labor-intensive.

Method used

By obtaining the target image of the preset type of object, extract the text information, position information and image blocks of the text line, generate a multi-modal feature vector, and use the method of combining deep learning and image gradient edge detection to perform shape detection and correction, combined with text detection and recognition, generating fusion feature vectors for key information extraction.

Benefits of technology

It achieves the accuracy and versatility of extracting key information from different bank cards or invoices, improves the efficiency of information extraction, and is suitable for a variety of business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537879A
    Figure CN118537879A
Patent Text Reader

Abstract

The invention provides a key information extraction method and device. The key information extraction method comprises the following steps: acquiring a target image comprising a preset type of object; wherein the preset type object comprises at least one text line; obtaining text information, position information and image blocks corresponding to at least one text line in the preset type object; generating a multi-modal feature vector corresponding to each text line according to the text information, the position information and the image block corresponding to each text line; and extracting key information corresponding to each text line according to the multi-modal feature vector corresponding to each text line. The key information extraction method and device can be suitable for extracting key information of different objects of the same type, have good universality and can improve the accuracy of key information extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a key information extraction method and device. Background Art

[0002] In the related art, in order to improve data processing efficiency, a bank card or invoice may be photographed to obtain unstructured image data, and key information may be extracted from the image of the bank card or invoice to obtain structured information.

[0003] Taking bank cards as an example, customized algorithms are needed to extract specific key information from bank cards of a specific bank. Customized algorithms are usually rule-based methods. For example, predefined rules are used to filter based on text position, font size, etc. This results in only being able to extract key information from bank cards of a single bank. If used for bank cards of other banks, errors may occur. In order to extract key information from bank cards of different banks, multiple sets of algorithms need to be customized, which is time-consuming and labor-intensive. Summary of the invention

[0004] The embodiments of the present disclosure provide a key information extraction method and device.

[0005] According to a first aspect of an embodiment of the present disclosure, a key information extraction method is provided, the method comprising:

[0006] Acquire a target image including an object of a preset type; wherein the object of the preset type includes at least one text line;

[0007] Obtaining text information, position information, and an image block corresponding to at least one text line in the preset type object;

[0008] Generate a multimodal feature vector corresponding to each text line according to the text information, position information and image block corresponding to each text line;

[0009] According to the multimodal feature vector corresponding to each of the text lines, key information corresponding to each of the text lines is extracted.

[0010] In one embodiment, acquiring a target image including an object of a preset type includes:

[0011] Performing shape detection on the input original image to obtain a shape region containing the preset type of object;

[0012] Image correction is performed on the shape area containing the preset type of object to obtain the target image.

[0013] In one embodiment, the step of performing shape detection on the input original image to obtain a shape region containing the preset type of object includes:

[0014] Performing edge detection on the original image by using an edge detection model based on deep learning to obtain a first edge contour map;

[0015] Performing edge detection on the original image by using an edge detection algorithm based on image gradient to obtain a second edge contour map;

[0016] A logical AND operation is performed on the first edge contour map and the second edge contour map to obtain a shape area containing the preset type of object.

[0017] In one embodiment, performing edge detection on the original image by using an edge detection model based on deep learning to obtain a first edge contour map includes:

[0018] Extracting multi-scale edge features from the original image through an edge detection model based on deep learning, and fusing the multi-scale edge features to obtain fused edge features; wherein edge features of different scales are obtained by convolution layers of different layers in the edge detection model;

[0019] The first edge contour map is obtained according to the fused edge features.

[0020] In one embodiment, performing edge detection on the original image using an edge detection algorithm based on image gradient to obtain a second edge contour map includes:

[0021] Using Gaussian smoothing filter to perform noise reduction on the original image to obtain a smoothed image;

[0022] Calculating the gradient value of each pixel of the smoothed image;

[0023] Performing non-maximum suppression processing on the gradient value of each pixel point of the smoothed image;

[0024] The image obtained through the non-maximum suppression process is subjected to double threshold processing to obtain the second edge contour map.

[0025] In one embodiment, the obtaining of text information, position information, and image blocks corresponding to at least one text line in the preset type object includes:

[0026] Performing text detection on the target image to obtain position information and image blocks corresponding to each text line in the preset type object;

[0027] Text recognition is performed according to the position information corresponding to each of the text lines to obtain text information corresponding to each of the text lines.

[0028] In one embodiment, the multimodal feature vector includes: a text feature vector, a layout feature vector, and an image feature vector;

[0029] Generating a multimodal feature corresponding to each text line according to the text information, position information and image block corresponding to each text line includes:

[0030] Encoding the text information corresponding to each of the text lines to generate a text feature vector corresponding to each of the text lines;

[0031] Encoding the position information corresponding to each of the text lines to generate a layout feature vector corresponding to each of the text lines;

[0032] The image blocks corresponding to the text lines are encoded to generate image feature vectors corresponding to the text lines.

[0033] In one embodiment, extracting key information corresponding to each of the text lines according to the multimodal feature vectors corresponding to each of the text lines includes:

[0034] For each of the text lines, the text feature vector, the layout feature vector and the image feature vector corresponding to the text line are fused to obtain a fused feature vector;

[0035] The fused feature vectors corresponding to each of the text lines are input into a trained key information extraction model to obtain the key information corresponding to each of the text lines.

[0036] In one embodiment, inputting the fused feature vectors corresponding to each of the text lines into a trained key information extraction model to obtain the key information corresponding to each of the text lines includes:

[0037] Inputting the fused feature vector corresponding to each of the text lines into the feature extraction network of the key information extraction model for feature extraction;

[0038] Inputting the feature vector output by the feature extraction network into the linear transformer of the key information extraction model for linear transformation to obtain the target feature vector corresponding to each text line;

[0039] The target feature vector corresponding to each of the text lines is input into the classification function of the key information extraction model to predict the key information corresponding to each of the text lines.

[0040] According to a second aspect of an embodiment of the present disclosure, a key information extraction device is provided, the device comprising:

[0041] A first acquisition module is used to acquire a target image including an object of a preset type; wherein the object of the preset type includes at least one text line;

[0042] A second acquisition module, used to acquire text information, position information and image blocks corresponding to at least one text line in the preset type object;

[0043] A generating module, configured to generate a multimodal feature vector corresponding to each of the text lines according to the text information, position information and image blocks corresponding to each of the text lines;

[0044] The extraction module is used to extract key information corresponding to each text line according to the multimodal feature vector corresponding to each text line.

[0045] In one embodiment, the first acquisition module includes:

[0046] A first detection unit, configured to perform shape detection on an input original image to obtain a shape region containing an object of the preset type;

[0047] The correction unit is used to perform image correction on the shape area containing the preset type of object to obtain the target image.

[0048] In one embodiment, the first detection unit is used to:

[0049] Acquire a target image of the original image;

[0050] Performing edge detection on the original image by using an edge detection model based on deep learning to obtain a first edge contour map;

[0051] Performing edge detection on the original image by using an edge detection algorithm based on image gradient to obtain a second edge contour map;

[0052] A logical AND operation is performed on the first edge contour map and the second edge contour map to obtain a shape area containing the preset type of object.

[0053] In one embodiment, the first detection unit is used to:

[0054] Extracting multi-scale edge features from the original image through an edge detection model based on deep learning, and fusing the multi-scale edge features to obtain fused edge features; wherein edge features of different scales are obtained by convolution layers of different layers in the edge detection model;

[0055] The first edge contour map is obtained according to the fused edge features.

[0056] In one embodiment, the first detection unit is used to:

[0057] Using Gaussian smoothing filter to perform noise reduction on the original image to obtain a smoothed image;

[0058] Calculating the gradient value of each pixel of the smoothed image;

[0059] Performing non-maximum suppression processing on the gradient value of each pixel point of the smoothed image;

[0060] The image obtained through the non-maximum suppression process is subjected to double threshold processing to obtain the second edge contour map.

[0061] In one embodiment, the second acquisition module is used to:

[0062] A second detection unit, configured to perform text detection on the target image to obtain position information and image blocks corresponding to each text line in the preset type object;

[0063] The recognition unit is used to perform text recognition according to the position information corresponding to each of the text lines to obtain the text information corresponding to each of the text lines.

[0064] In one embodiment, the multimodal feature vector includes: a text feature vector, a layout feature vector and an image feature vector; the generation module includes:

[0065] A first encoding unit, used for encoding text information corresponding to each of the text lines to generate a text feature vector corresponding to each of the text lines;

[0066] A second encoding unit, used to encode the position information corresponding to each of the text lines, and generate a layout feature vector corresponding to each of the text lines;

[0067] The third encoding unit is used to encode the image blocks corresponding to each of the text lines to generate image feature vectors corresponding to each of the text lines.

[0068] In one embodiment, the extraction module comprises:

[0069] A fusion unit, configured to fuse, for each of the text lines, the text feature vector, the layout feature vector, and the image feature vector corresponding to the text line to obtain a fused feature vector;

[0070] The extraction unit is used to input the fused feature vector corresponding to each of the text lines into a trained key information extraction model to obtain the key information corresponding to each of the text lines.

[0071] In one embodiment, the extraction unit is used to:

[0072] Inputting the fused feature vector corresponding to each of the text lines into the feature extraction network of the key information extraction model for feature extraction;

[0073] Inputting the feature vector output by the feature extraction network into the linear transformer of the key information extraction model for linear transformation to obtain the target feature vector corresponding to each text line;

[0074] The target feature vector corresponding to each of the text lines is input into the classification function of the key information extraction model to predict the key information corresponding to each of the text lines.

[0075] According to a third aspect of an embodiment of the present disclosure, there is provided 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 steps of the key information extraction method described in any one of the first aspects are implemented.

[0076] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the key information extraction method described in any one of the first aspects are implemented.

[0077] The present disclosure provides a key information extraction method and device, which obtain a target image including an object of a preset type, and obtain text information, position information and image blocks corresponding to text lines in the object of the preset type, so as to generate a multimodal feature vector by combining information of three different dimensions, thereby improving the richness of information contained in the multimodal feature vector, so that the multimodal feature vector can more accurately characterize the features of the text lines in the target image; in this way, key information is extracted according to the multimodal feature vector corresponding to the text line, which can improve the accuracy of key information extraction, and can be applicable to extracting key information of different objects of the same type, and has good versatility.

[0078] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0080] Figure 1 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0081] Figure 2 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0082] Figure 3 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0083] Figure 4 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0084] Figure 5 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0085] Figure 6 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0086] Figure 7 A flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0087] Figure 8 An example flow chart of a key information extraction method provided by an embodiment of the present disclosure is shown.

[0088] Figure 9a A schematic diagram of an interface of an original image of a bank card provided in an embodiment of the present disclosure is shown.

[0089] Figure 9b A schematic diagram of an interface for quadrilateral detection of a bank card provided in an embodiment of the present disclosure is shown.

[0090] Fig.9c A schematic diagram of an interface for image correction of a bank card provided in an embodiment of the present disclosure is shown.

[0091] Figure 9d A schematic diagram of an interface for text detection and recognition of a bank card provided in an embodiment of the present disclosure is shown.

[0092] Fig.9e A schematic diagram showing key information of a bank card provided by an embodiment of the present disclosure is shown.

[0093] Fig.10 A structural block diagram of a key information extraction device provided by an embodiment of the present disclosure is shown.

[0094] Fig.11 A structural block diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0095] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.

[0096] The terms used in the disclosed embodiments are only for the purpose of describing specific embodiments and are not intended to limit the disclosed embodiments. The singular forms of "a", "said" and "the" used in the disclosed embodiments and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0097] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the disclosed embodiments, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the disclosed embodiments, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0098] It can be understood that the description of various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0099] The key information extraction method provided by the embodiments of the present disclosure can be applied to extract key information in various business scenarios. For example, it can be applied to extract key information from bank cards of different banks, or it can be applied to extract key information from different invoices, or it can be applied to other business scenarios where key information extraction is required.

[0100] The execution subject of the key information extraction method can be an electronic device such as a terminal or a server. The terminal can include but is not limited to: a mobile phone, a tablet computer, a personal computer (PC), an embedded device, a vehicle-mounted device and / or an intelligent robot, etc., which have data calculation, processing and storage capabilities. The server can be, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, and big data and artificial intelligence platforms.

[0101] Figure 1 FIG. 1 is a flow chart of a key information extraction method provided by an embodiment of the present disclosure. Figure 1 As shown, the key information extraction method may include the following steps:

[0102] 101, acquiring a target image including an object of a preset type; wherein the object of the preset type includes at least one text line;

[0103] 102, obtaining text information, position information, and an image block corresponding to at least one text line in an object of a preset type;

[0104] 103, generating a multimodal feature vector corresponding to each text line according to the text information, position information and image block corresponding to each text line;

[0105] 104 , extract key information corresponding to each text line according to the multimodal feature vector corresponding to each text line.

[0106] Here, the preset type object may be an object for which key information extraction is required. Exemplarily, the preset type object may include but is not limited to: a bank card, an ID card, an invoice, a receipt, a check, an insurance application form or a resume.

[0107] In some examples, in the above step 101, an image acquisition device may be used to acquire an image of an object of a preset type to obtain a target image including the object of the preset type.

[0108] For example, when it is necessary to extract key information from a bank card, an image acquisition device such as a camera or an image scanner may be used to take a photo of the bank card to obtain an image of the bank card.

[0109] In some examples, when obtaining an image including an object of a preset type, the image including the object of the preset type may be preprocessed and the preprocessed image may be used as the target image. The image preprocessing includes but is not limited to: image correction, image enhancement, image filtering, etc.

[0110] In some examples, in step 102, optical character recognition (OCR) may be performed on the target image including the preset type of object to obtain text information, position information and image blocks corresponding to at least one text line in the preset type of object. Here, the OCR recognition may include text detection and text recognition.

[0111] Here, the text information corresponding to each text line can be understood as the text content of the text line.

[0112] Here, the position information corresponding to the text line includes the coordinate information of the detection box corresponding to the text line. The coordinate information of the detection box includes the coordinate information of the four vertices of the detection box, and a detection box contains at least one character.

[0113] Here, the image block corresponding to the text line is an image block contained in the detection box corresponding to the text line.

[0114] In some examples, in the above step 103, the text information, position information and image block corresponding to each text line can be respectively input into the feature extraction (Embedding) layer for feature extraction; based on the feature vectors of the text information, position information and image block corresponding to each text line, the multimodal feature vector corresponding to each text line is determined.

[0115] In some examples, a neural network model or algorithm may be used to perform feature extraction on text information, position information, and image blocks corresponding to a text line to obtain feature vectors of the text information, position information, and image blocks.

[0116] In some examples, in the above step 104, for each text line, the multimodal feature vector corresponding to the text line can be fused to obtain the fused features corresponding to the text line, and the key information corresponding to the text line can be extracted based on the fused features corresponding to the text line through a trained key information extraction model.

[0117] In some examples, the key information extraction model may be a model built based on a deep neural network. The deep neural network may be, for example, a neural network based on a Transformer framework, a Long Short-Term Memory (LSTM) network, or the like.

[0118] In some examples, the key information extraction model can be a model built based on a BERT (Bidirectional Encoder Representations from Transformers) network.

[0119] In some examples, the key information extraction model may be obtained by fine-tuning a multimodal pre-trained model using training data of preset types of objects, wherein the multimodal pre-trained model may be, for example, a LayoutLMv3 model.

[0120] For example, taking the application scenario of bank cards as an example, the multimodal pre-trained model can be fine-tuned and trained in combination with bank card sample images to obtain a key information extraction model for bank cards.

[0121] For another example, taking the application scenario of invoices as an example, the multimodal pre-trained model can be fine-tuned and trained in combination with invoice sample images to obtain a key information extraction model for invoices.

[0122] Exemplarily, the key information may include a key-value pair, namely, an information keyword and an information key value.

[0123] For example, taking the application scenario of a bank card as an example, the key information of a bank card may include: a card-issuing bank keyword and a card-issuing bank name value, a card type keyword and a card type key value, a card number (cardNo) keyword and a card number value, an expiration date keyword and an expiration date value, and a cardholder keyword and a cardholder name value.

[0124] In some embodiments, the method may further include:

[0125] Determine the keywords of the information to be extracted;

[0126] In the above step 102, based on the information keyword to be extracted, text information, position information and image block corresponding to the target text line in the preset type object can be obtained from the target image including the preset type object; wherein the target text line is a text line containing the information key value corresponding to the information keyword to be extracted.

[0127] In the above step 103, a multimodal feature vector corresponding to the target text line is generated according to the text information, position information and image block corresponding to the target text line;

[0128] In the above step 104, key information corresponding to the target text line can be extracted according to the multimodal feature vector corresponding to the target text line.

[0129] Exemplarily, the key information corresponding to the target text line can be extracted by using the trained key information extraction model according to the multimodal feature vector corresponding to the target text line.

[0130] For example, taking the application scenario of a bank card as an example, the keywords of the information to be extracted may be the issuing bank, the card number, etc.

[0131] It should be noted that in the embodiments of the present disclosure, when the extracted key information involves user privacy or sensitive information, the user's permission or consent is required, and the application of key information involving user privacy or sensitive information needs to comply with relevant laws, regulations and standards.

[0132] The disclosed embodiment provides a key information extraction method, which obtains a target image including an object of a preset type, and obtains text information, position information and image blocks corresponding to text lines in the object of the preset type, so as to generate a multimodal feature vector by combining information of three different dimensions, thereby improving the richness of information contained in the multimodal feature vector, so that the multimodal feature vector can more accurately characterize the features of the text lines in the target image; in this way, the extraction model extracts key information according to the multimodal feature vector corresponding to the text line, thereby improving the accuracy of key information extraction, and can be applicable to extracting key information of different objects of the same type, and has good versatility.

[0133] In one embodiment, Figure 2 As shown, in the above step 101, obtaining a target image including an object of a preset type may include:

[0134] 201 , performing shape detection on the input original image to obtain a shape region containing a preset type of object.

[0135] The shape detection is used to detect the contour of the shape of a preset type of object in the original image.

[0136] In some examples, when the shape of the preset type object is a rounded rectangle (for example, the preset type object is a bank card or an ID card, etc.), or the shape of the preset type object is a rectangle (for example, the preset type object is an invoice or a resume), the shape detection is a quadrilateral detection, and the shape area is a quadrilateral area.

[0137] In other examples, when the shape of the preset type object is a triangle (for example, the preset type object is a triangle card, a triangle logo, etc.), the shape detection is a triangle detection, and the shape area is a triangle area.

[0138] It can be understood that the shape of the preset type of object can also be polygonal or circular, and accordingly, the shape detection is polygonal detection or circular detection.

[0139] In some examples, when the shape detection is quadrilateral detection, quadrilateral detection can be performed on the original image to obtain the four vertex coordinates of the quadrilateral area (also called: corner point coordinates), and the quadrilateral area is obtained according to the four vertex coordinates of the quadrilateral area.

[0140] In some examples, the quadrilateral detection may include: locating four corner points of a preset type of object in the original image by using an edge detection algorithm.

[0141] 202, performing image correction on the shape region containing the preset type of object to obtain a target image.

[0142] In some examples, when the shape region is a quadrilateral region, an image correction algorithm may be used to correct the quadrilateral region into a rectangular region, and the rectangular region may be segmented from the original image, and the rectangular region may be used as the target image.

[0143] In some examples, an image correction algorithm may be used to correct a quadrilateral region into a rectangular region, the rectangular region may be segmented from the original image, and the rectangular region may be used as the target image.

[0144] In some examples, using an image rectification algorithm to rectify a quadrilateral region to a rectangular region may include:

[0145] Determine the ratio of the length to width of the rectangular area corresponding to the quadrilateral area, determine the transformation equation for converting the quadrilateral area into a rectangular area based on the coordinates of the four vertices of the quadrilateral area and the ratio of the length to width of the rectangular area, and use the transformation equation to correct the quadrilateral area into a rectangular area.

[0146] In some examples, the quadrilateral region may be affine transformed and corrected, and the quadrilateral region after the affine transformation correction is used as the target image.

[0147] In one embodiment, Figure 3 As shown, in the above step 201, shape detection is performed on the input original image to obtain a shape region containing a preset type of object, which may include:

[0148] 301. Perform edge detection on a target image by using an edge detection model based on deep learning to obtain a first edge contour map.

[0149] In some examples, the deep learning based edge detection model may be a multi-scale edge detection model or a network reconstruction edge detection model.

[0150] In some examples, the implementation process of step 301 may include the following steps:

[0151] 301a: Extracting multi-scale edge features from the original image through a deep learning-based edge detection model, and fusing the multi-scale edge features to obtain fused edge features; wherein edge features of different scales are obtained by convolutional layers of different layers in the edge detection model.

[0152] 301b: Obtain the first edge contour map according to the fused edge features.

[0153] Exemplarily, the edge detection model includes N convolution blocks cascaded in sequence, each convolution block includes two or more cascaded convolution layers, the convolution layers of different convolution blocks are used to extract edge features of different scales, and the edge features output by the n-1th convolution block are used to input into the nth convolution block for edge feature extraction, where n is less than or equal to N and greater than 1, and N is a positive integer greater than 3.

[0154] After obtaining the edge features output by each convolution block in the edge detection model, multiple edge features can be fused to obtain fused edge features.

[0155] For example, each edge feature may be deconvolved to obtain edge features with the same feature scale map, and the edge features with the same feature scale map may be weighted according to trained weight parameters to obtain fused edge features.

[0156] In some examples, the edge detection model includes first to fifth convolution blocks, wherein:

[0157] The convolution layer in the first convolution block is used to perform a convolution operation on the original image and output a first edge feature;

[0158] The convolution layer in the second convolution block is used to perform a convolution operation on the first edge feature and output a second edge feature;

[0159] The convolution layer in the third convolution block is used to perform a convolution operation on the second edge feature and output a third edge feature;

[0160] The convolution layer in the fourth convolution block is used to perform a convolution operation on the third edge feature and output a fourth edge feature;

[0161] The convolution layer in the fifth convolution block is used to perform a convolution operation on the fourth edge feature and output a fifth edge feature.

[0162] Here, in the edge detection model, the deeper the convolution layer, the larger the convolution kernel and the larger the receptive field.

[0163] In this embodiment, by fusing edge features of different scales, high and low layer edge feature information in the image can be effectively retained, so that a first edge contour map is obtained based on the fused edge features, and a more accurate edge detection result can be obtained.

[0164] 302 , performing edge detection on the target image by using an edge detection algorithm based on image gradient to obtain a second edge contour map.

[0165] In some examples, the implementation process of the above step 302 may include the following steps:

[0166] 302a: Use Gaussian smoothing filtering to perform noise reduction processing on the original image to obtain a smoothed image.

[0167] Exemplarily, a two-dimensional Gaussian function may be used to perform noise reduction processing on the original image to obtain a smooth image.

[0168] 302b: Calculate the gradient value of each pixel point of the smoothed image.

[0169] Exemplarily, the gradient value of each pixel point of the smoothed image may be calculated according to the Sobel operator or the Roberts operator.

[0170] 302c: Perform non-maximum suppression processing on the gradient value of each pixel point of the smoothed image.

[0171] In this embodiment, non-maximum suppression is performed on the gradient value of each pixel point of the smoothed image, and pixel points with maximum gradient values ​​that are continuous in one direction are determined in a local neighborhood, and other pixel points in the neighborhood whose gradient values ​​are less than the maximum gradient value are removed; that is, the local maximum points in the gradient values ​​of the pixel points of the smoothed image are found, and other non-local maximum points are set to zero.

[0172] 302d: Perform double threshold processing on the image obtained through the non-maximum suppression processing to obtain the second edge contour map.

[0173] Exemplarily, a first threshold and a second threshold greater than the first threshold can be set to retain pixels whose pixel gradient values ​​are greater than the second threshold; pixels whose pixel gradient values ​​are between the first threshold and the second threshold are further processed to eliminate pixels whose pixel gradient values ​​are less than the first threshold, thereby obtaining the second edge contour map.

[0174] The first threshold and the second threshold may be set manually or determined according to an automatic image threshold selection method such as a maximum inter-class variance method.

[0175] In this embodiment, by performing double threshold processing on the smoothed image after non-maximum suppression processing, false edges can be eliminated and discontinuous edges can be connected, so that refined edges can be obtained and the fineness of the edges can be improved.

[0176] 303 , performing a logical AND operation on the first edge contour image and the second edge contour image to obtain a shape region containing an object of a preset type.

[0177] In this embodiment, edge detection is performed on the target image using a deep learning-based edge detection algorithm and an image gradient-based edge detection algorithm, respectively, and a logical AND operation is performed on the edge contour maps obtained by the two edge detection algorithms. This allows the respective advantages of the two edge detection algorithms to be combined to generate accurate and detailed contour edges of shape areas.

[0178] In one embodiment, Figure 4 As shown, in the above step 202, obtaining text information, position information and image blocks corresponding to at least one text line in the target image of the preset type of object may include:

[0179] 401 , performing text detection on a target image to obtain position information and an image block corresponding to at least one text line in an object of a preset type.

[0180] In this embodiment, text detection can be performed on the target image using a text detection model to obtain position information and image blocks corresponding to at least one text line in an object of a preset type.

[0181] Here, text detection through the text detection model can be performed based on the principle of text spacing. If a line of text is relatively compact, one detection box can be detected. If a line of text is separated by spaces, multiple detection boxes can be detected. In other words, one text line can correspond to one or more detection boxes.

[0182] In some examples, text line detection can be performed on the target image through a text detection model to obtain coordinate information of a detection box corresponding to at least one text line and an image block corresponding to each detection box.

[0183] In some examples, the text detection model may be a deep neural network model trained using sample images and label information corresponding to the sample images. The label information may be used to indicate whether a pixel in the sample image belongs to a text region, and to indicate the pixel position (e.g., coordinate information, etc.) that belongs to the text region.

[0184] In some examples, the text detection model may be a model built based on DBnet (Differentiable Binarization Network) or a YOLO4 model.

[0185] Among them, DBnet is a segmentation-based text detection algorithm that can adapt to image scenes to accurately detect text areas. When selecting thresholds, the DBnet algorithm obtains probability maps and threshold maps through the segmentation network. Since the threshold map is predicted by the network instead of a fixed value, it can well separate the background from the foreground.

[0186] In some examples, the training data of preset type objects can be used to fine-tune the parameters of the pre-trained DBnet model to obtain the text detection model, thereby improving the accuracy of the text detection model in performing text detection on images of preset type objects.

[0187] 402 , performing text recognition according to the position information corresponding to each text line to obtain text information corresponding to each text line.

[0188] In this embodiment, text recognition can be performed according to the position information corresponding to each text line through a text recognition model to obtain text information corresponding to each text line.

[0189] In some examples, the text recognition model can be constructed using at least one of the following neural networks: CNN (Convolutional Neural Network), RNN (Simple Recurrent Neural Network), attention neural network, etc.

[0190] In some examples, the text recognition model may be a model built based on CRNN (Convolutional Recurrent Neural Network).

[0191] Among them, the CRNN network includes: CNN (Convolutional Neural Network) layer, RNN (Recurrent Neural Network) layer and translation layer.

[0192] The CNN layer is used to extract features in the target image according to the position information corresponding to each text line to obtain a convolution feature vector. The RNN layer is used to perform sequence prediction on the convolution feature vector. The translation layer is used to translate the sequence output by the RNN layer into a string to obtain the text information corresponding to each text line.

[0193] In some examples, the parameters of a pre-trained CRNN model using training data of preset type objects can be fine-tuned to obtain the text recognition model, thereby improving the accuracy of the text recognition model in performing text recognition on images of preset type objects.

[0194] In one embodiment, the multimodal feature vector corresponding to the text line includes: a text feature vector, a layout feature vector, and an image feature vector corresponding to the text line.

[0195] The text feature vector corresponding to the text line is used to represent the text content of the text line.

[0196] The layout feature vector corresponding to the text line is used to characterize the layout position of the text line in the target image.

[0197] The image feature vector corresponding to the text line is used to characterize the image content of the image block corresponding to the text line.

[0198] like Figure 5 As shown, in the above step 203, generating the multimodal features corresponding to each text line according to the text information, position information and image blocks corresponding to each text line may include:

[0199] 501, encode the text information corresponding to each text line to generate a text feature vector corresponding to each text line.

[0200] In some examples, the text information corresponding to each text line can be input into a pre-trained RoBERTa model to generate a text feature (text embedding) vector for each text token.

[0201] 502, encoding the position information corresponding to each text line, and generating a layout feature vector corresponding to each text line.

[0202] In some examples, the coordinates of the text detection box included in the position information corresponding to each text line may be encoded to generate a layout feature (Layout Embedding) vector corresponding to each text line.

[0203] 503 , encoding the image blocks corresponding to each text line to generate image feature vectors corresponding to each text line.

[0204] In some examples, for each text line, a VIT (Vision Transformer) preprocessing strategy can be used to linearly map the image block corresponding to the text line to obtain an image feature vector. This can reduce the number of model parameters and remove relatively complex preprocessing procedures.

[0205] It should be noted that this embodiment does not specifically limit the execution order of step 501 to step 503, and it is a preferred solution to execute step 501, step 502 and step 503 simultaneously.

[0206] In one embodiment, Figure 6 As shown, in the above step 204, according to the multimodal feature vector corresponding to each text line, the extraction model extracts the key information corresponding to each text line, which may include:

[0207] 601 , for each text line, fuse the text feature vector, layout feature vector and image feature vector corresponding to the text line to obtain a fused feature vector.

[0208] In some examples, for each text line, the text feature vector, layout feature vector and image feature vector corresponding to the text line can be weightedly summed according to the weight values ​​corresponding to each of the text feature vector, layout feature vector and image feature vector to obtain a fused feature vector. Here, the weight values ​​can be pre-set based on expert experience or obtained through training data.

[0209] In some examples, for each text line, the text feature vector, the layout feature vector, and the image feature vector corresponding to the text line may be directly added to obtain a fused feature vector.

[0210] 602, input the fused feature vector corresponding to each text line into the trained key information extraction model to obtain the key information corresponding to each text line.

[0211] Here, the trained key information extraction model is used to extract key information from the text information corresponding to each text line according to the fused feature vector corresponding to each text line.

[0212] In one embodiment, Figure 7 As shown, in the above step 602, the fused feature vector corresponding to each text line is input into the trained key information extraction model to obtain the key information corresponding to each text line, which may include:

[0213] 701, inputting the fused feature vector corresponding to each text line into the feature extraction network of the key information extraction model for feature extraction;

[0214] 702, inputting the feature vector output by the feature extraction network into the linear transformer of the key information extraction model for linear transformation to obtain the target feature vector corresponding to each text line;

[0215] 703, input the target feature vector corresponding to each text line into the classification function of the key information extraction model to predict the key information corresponding to each text line.

[0216] In some examples, the feature extraction network may be a deep neural network, such as a BERT network. Of course, the feature extraction network may also be other deep neural networks such as an autoencoder network, which is not specifically limited in this embodiment.

[0217] In this embodiment, the fused feature vector corresponding to each text line is input into the key information extraction model, feature extraction is performed through the feature extraction network of the key information extraction model, and the feature vector output by the feature extraction network is sequentially passed through the linear transformer and classification function of the key information extraction model to calculate the key information probability of the feature vector, and the key information corresponding to each text line is determined according to the key information probability of the feature vector.

[0218] In some examples, the classification function can be a softmax function.

[0219] In one embodiment, the method may further include:

[0220] The key information extraction model is trained using training data of different sample objects of preset types to obtain a trained key information extraction model; wherein the different sample objects of preset types are contained in different sample images, and for each sample object, the training data of the sample object includes: multimodal features and key information labels corresponding to at least one text line in the sample object contained in the sample image.

[0221] In some examples, the step of training the key information extraction model using training data of different sample objects of preset types to obtain a trained key information extraction model may include the following steps:

[0222] For each sample object of a preset type, the multimodal features corresponding to at least one text line in the sample object are input into the trained key information extraction model to predict the key information corresponding to each text line in the sample object;

[0223] The key information extraction model is trained according to the prediction results of the key information corresponding to each text line in each sample object and the corresponding key information label.

[0224] The different sample objects of the preset types may include, for example, various bank cards or various invoices.

[0225] In some examples, the process of obtaining the multimodal features corresponding to at least one text line in each sample object of the preset type may refer to steps 102 to 103 in the above embodiment, which will not be repeated here.

[0226] In some examples, during the training process of the key information extraction model, a loss value (e.g., a cross entropy loss value) can be calculated based on the prediction results of the key information and the corresponding key information label, and the key information extraction model can be iteratively trained based on the loss value until the training stop condition is reached to obtain a trained key information extraction model.

[0227] In some examples, the training stop condition may be, for example: the loss value is less than a preset threshold or the number of iterative training reaches a preset number of iterations.

[0228] It should be noted that the training process of the key information extraction model can be performed offline to save online network resources.

[0229] In this embodiment, the key information extraction model is trained using training data of different objects of preset types, and the training data includes multimodal features and key information labels corresponding to at least one text line in the sample image. By using multimodal features to train the key information extraction model, the trained key information extraction model can be made more accurate and generalizable in predicting key information.

[0230] The technical solution provided by the embodiment of the present disclosure is exemplarily described below in conjunction with specific application scenarios. It is understandable that the application scenarios here are only for more clearly illustrating the technical solution provided by the embodiment of the present disclosure, and do not constitute a limitation on the application scenarios of the technical solution provided by the embodiment of the present disclosure.

[0231] The key information extraction method provided by the embodiment of the present disclosure can be applied to extract key information of various bank cards.

[0232] The present disclosure provides a key information extraction method, such as Figure 8 As shown, the method may include the following steps:

[0233] S1: Use the quadrilateral detection algorithm to locate the four corner points of the bank card in the original image, obtain the quadrilateral area of ​​the bank card, and use affine transformation to perform image correction on the quadrilateral area;

[0234] S2: Use the text detection model to locate the text information on the bank card, and use the text recognition model to recognize the text information on the bank card;

[0235] S3: Obtain the key information of the bank card according to the text positioning and recognition information obtained in step S2 and the bank card key information extraction model; wherein the bank card key information extraction model is obtained by fine-tuning the Layoutlmv3 model through the annotated bank card data set.

[0236] The key information of a bank card may include a key-value pair, i.e., an information keyword and an information key value. For example, the key information of a bank card may include: a card issuer keyword and a card issuer name value, a card type keyword and a card type key value, a card number keyword and a card number value, an expiration date keyword and an expiration date value, and a card holder keyword and a card holder name value.

[0237] For example, using the quadrilateral detection algorithm Figure 9a The original image shown in the figure is subjected to quadrilateral detection, and the Figure 9b The image shown is Figure 9bThe image shown is corrected to obtain Fig.9c The image shown, then Fig.9c The image shown in the figure is used for text positioning and recognition, and the Figure 9d The image shown uses the bank card key information extraction model and Figure 9d The text location and recognition information in the image shown in the figure can obtain the key information of the bank card, such as Fig.9e shown.

[0238] In some examples, the implementation process of the above step S1 may include:

[0239] The four corner points of the bank card are located using an edge detection model based on deep learning to obtain a first edge contour map. The four corner points of the bank card are located using an edge detection algorithm based on image gradient to obtain a second edge contour map. A logical AND operation is performed on the first edge contour map and the second edge contour map to obtain a quadrilateral contour edge.

[0240] Among them, the process of extracting the first edge contour map based on the edge detection model of deep learning can refer to step 301 in the above embodiment, which will not be repeated here.

[0241] The process of extracting the second edge contour map based on the edge detection algorithm of the image gradient may refer to step 302 in the above embodiment, which will not be described in detail here.

[0242] In this embodiment, considering that the contour map output by the edge detection model based on deep learning may be relatively rough and cannot locate the corner points well, the input image can be processed in conjunction with an edge detection algorithm based on image gradient. The processed binary image is logically ANDed with the binary image output by the edge detection model based on deep learning to obtain a more refined quadrilateral contour.

[0243] In some examples, in the above step S2, the text detection model may be a DBnet model, and the text recognition model may be a CRNN model. The DBnet model and the CRNN model may be fine-tuned using bank card training data to achieve a more accurate effect.

[0244] In some examples, in the above step S3, feature vectors of multiple dimensions can be extracted and multi-modal fusion can be performed based on the text positioning and recognition information obtained in step S2.

[0245] In some examples, the multiple dimensional feature vectors include: a text feature (Text Embedding) vector, a layout feature (Layout Embedding) vector, and an image feature (Image Embedding) vector. Among them:

[0246] 1. Text feature vector: Input the text information obtained in step S2 into the pre-trained RoBERTa to generate the text feature vector of each token (marker or word);

[0247] 2. Layout feature vector: Each token shares the coordinates of the OCR detection box obtained in step S2, and then generates a corresponding layout feature vector. This is because the words in each OCR detection box usually represent the same semantic information.

[0248] 3. Image feature vector: The VIT preprocessing strategy can be directly adopted to obtain image features by linearly mapping the image blocks. This can reduce the number of model parameters and remove the relatively complex preprocessing process.

[0249] The feature vectors of the above three modes are added as the input of the trained key information extraction model to obtain the key information labels predicted by the key information extraction model.

[0250] Among them, the key information extraction model can be a multimodal model such as the layoutlmv3 model. The backbone network of the model is a Bert network. The output of the Bert network is connected to a Linear, and the corresponding key information label is predicted through the softmax function.

[0251] Fig.10 FIG. 1 is a schematic diagram showing a key information extraction device provided by an embodiment of the present disclosure. Fig.10 As shown, the key information extraction device 100 may include:

[0252] A first acquisition module 110 is used to acquire a target image including an object of a preset type; wherein the object of the preset type includes at least one text line;

[0253] A second acquisition module 120, configured to acquire text information, position information, and an image block corresponding to at least one text line in the preset type of object;

[0254] A generating module 130, configured to generate a multimodal feature vector corresponding to each text line according to the text information, position information and image block corresponding to each text line;

[0255] The extraction module 140 is used to extract key information corresponding to each of the text lines using an extraction model according to the multimodal feature vector corresponding to each of the text lines.

[0256] In one embodiment, the first acquisition module 110 includes:

[0257] A first detection unit, configured to perform shape detection on an input original image to obtain a shape region containing an object of the preset type;

[0258] The correction unit is used to perform image correction on the shape area containing the preset type of object to obtain the target image.

[0259] In one embodiment, the first detection unit is used to:

[0260] Performing edge detection on the original image by using an edge detection model based on deep learning to obtain a first edge contour map;

[0261] Performing edge detection on the original image by using an edge detection algorithm based on image gradient to obtain a second edge contour map;

[0262] A logical AND operation is performed on the first edge contour map and the second edge contour map to obtain a quadrilateral region containing the preset type of object.

[0263] In one embodiment, the first detection unit is used to:

[0264] Extracting multi-scale edge features from the original image through an edge detection model based on deep learning, and fusing the multi-scale edge features to obtain fused edge features; wherein edge features of different scales are obtained by convolution layers of different layers in the edge detection model;

[0265] The first edge contour map is obtained according to the fused edge features.

[0266] In one embodiment, the first detection unit is used to:

[0267] Using Gaussian smoothing filter to perform noise reduction on the original image to obtain a smoothed image;

[0268] Calculating the gradient value of each pixel of the smoothed image;

[0269] Performing non-maximum suppression processing on the gradient value of each pixel point of the smoothed image;

[0270] The image obtained through the non-maximum suppression process is subjected to double threshold processing to obtain the second edge contour map.

[0271] In one embodiment, the second acquisition module 120 is used to:

[0272] A second detection unit, configured to perform text detection on the target image to obtain position information and image blocks corresponding to each text line in the preset type object;

[0273] The recognition unit is used to perform text recognition according to the position information corresponding to each of the text lines to obtain the text information corresponding to each of the text lines.

[0274] In one embodiment, the multimodal feature vector includes: a text feature vector, a layout feature vector and an image feature vector; the generation module 130 includes:

[0275] A first encoding unit, used for encoding text information corresponding to each of the text lines to generate a text feature vector corresponding to each of the text lines;

[0276] A second encoding unit, used to encode the position information corresponding to each of the text lines, and generate a layout feature vector corresponding to each of the text lines;

[0277] The third encoding unit is used to encode the image blocks corresponding to each of the text lines to generate image feature vectors corresponding to each of the text lines.

[0278] In one embodiment, the extraction module 140 includes:

[0279] A fusion unit, configured to fuse, for each of the text lines, the text feature vector, the layout feature vector, and the image feature vector corresponding to the text line to obtain a fused feature vector;

[0280] The extraction unit is used to input the fused feature vector corresponding to each of the text lines into a trained key information extraction model to obtain the key information corresponding to each of the text lines.

[0281] In one embodiment, the extraction unit is used to:

[0282] Inputting the fused feature vector corresponding to each of the text lines into the feature extraction network of the key information extraction model for feature extraction;

[0283] Inputting the feature vector output by the feature extraction network into the linear transformer of the key information extraction model for linear transformation to obtain the target feature vector corresponding to each text line;

[0284] The target feature vector corresponding to each of the text lines is input into the classification function of the key information extraction model to predict the key information corresponding to each of the text lines.

[0285] In one embodiment, the apparatus further comprises:

[0286] A training module is used to train a key information extraction model using training data of different sample objects of preset types to obtain a trained key information extraction model; wherein the different sample objects of preset types are contained in different sample images, and for each sample object, the training data of the sample object includes: multimodal features and key information labels corresponding to at least one text line in the sample object contained in the sample image.

[0287] Regarding the key information extraction device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0288] In an exemplary embodiment, the first acquisition module 110, the second acquisition module 120, the generation module 130, the extraction module 140, etc. can be implemented by one or more central processing units (CPU), graphics processing units (GPU), baseband processors (BP), application specific integrated circuits (ASIC), DSPs, programmable logic devices (PLD), complex programmable logic devices (CPLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers (MCU), microprocessors (Microprocessors) or other electronic components to execute the above-mentioned key information extraction method.

[0289] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above-mentioned key information extraction method is implemented when the processor executes the program.

[0290] An embodiment of the present disclosure further provides an electronic device, including:

[0291] processor;

[0292] a memory for storing processor-executable instructions;

[0293] Wherein, the processor is configured to: implement the key information extraction method described in any embodiment of the present disclosure when running the executable instructions.

[0294] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to memorize information stored thereon after the communication device loses power.

[0295] The processor may be connected to the memory via a bus or the like, and is used to read an executable program stored in the memory, for example, to implement the key information extraction method in the above embodiment.

[0296] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, wherein when the executable program is executed by a processor, the key information extraction method described in any embodiment of the present disclosure is implemented.

[0297] like Fig.11 FIG. 2 is a diagram showing a structure of an electronic device 200 according to an exemplary embodiment. For example, the electronic device 200 may be provided as a network side device. Fig.11 The electronic device 200 includes a processing component 210, which further includes one or more processors, and a memory resource represented by a memory 220 for storing instructions executable by the processing component 210, such as an application. The application stored in the memory 220 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 210 is configured to execute instructions to perform the key information extraction method in the above embodiment.

[0298] The electronic device 200 may further include a power supply component 230 configured to perform power management of the electronic device 200, a wired or wireless network interface 240 configured to connect the electronic device 200 to a network, and an input / output (I / O) interface 250. The electronic device 200 may operate based on an operating system stored in the memory 220, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0299] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0300] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A key information extraction method, characterized in that: The method comprises: Acquire a target image including an object of a preset type; wherein the object of the preset type includes at least one text line; Obtaining text information, position information, and an image block corresponding to at least one text line in the preset type object; Generate a multimodal feature vector corresponding to each text line according to the text information, position information and image block corresponding to each text line; According to the multimodal feature vector corresponding to each of the text lines, key information corresponding to each of the text lines is extracted.

2. The method according to claim 1, characterized in that: The step of acquiring a target image including an object of a preset type includes: Performing shape detection on the input original image to obtain a shape region containing the preset type of object; Image correction is performed on the shape area containing the preset type of object to obtain the target image.

3. The method according to claim 2, characterized in that The step of performing shape detection on the input original image to obtain a shape region containing the preset type of object includes: Performing edge detection on the original image by using an edge detection model based on deep learning to obtain a first edge contour map; Performing edge detection on the original image by using an edge detection algorithm based on image gradient to obtain a second edge contour map; A logical AND operation is performed on the first edge contour map and the second edge contour map to obtain a shape area containing the preset type of object.

4. The method according to claim 3, characterized in that The step of performing edge detection on the original image by using an edge detection model based on deep learning to obtain a first edge contour map includes: Extracting multi-scale edge features from the original image through an edge detection model based on deep learning, and fusing the multi-scale edge features to obtain fused edge features; wherein edge features of different scales are obtained by convolution layers of different layers in the edge detection model; The first edge contour map is obtained according to the fused edge features.

5. The method according to claim 3, characterized in that: The step of performing edge detection on the original image by using an edge detection algorithm based on image gradient to obtain a second edge contour map comprises: Using Gaussian smoothing filter to perform noise reduction on the original image to obtain a smoothed image; Calculating the gradient value of each pixel of the smoothed image; Performing non-maximum suppression processing on the gradient value of each pixel point of the smoothed image; The image obtained through the non-maximum suppression process is subjected to double threshold processing to obtain the second edge contour map.

6. The method according to claim 1, characterized in that The obtaining of text information, position information, and image blocks corresponding to at least one text line in the preset type object includes: Performing text detection on the target image to obtain position information and image blocks corresponding to each text line in the preset type object; Text recognition is performed according to the position information corresponding to each of the text lines to obtain text information corresponding to each of the text lines.

7. The method according to any one of claims 1 to 6, characterized in that: The multimodal feature vector includes: a text feature vector, a layout feature vector and an image feature vector; Generating a multimodal feature corresponding to each text line according to the text information, position information and image block corresponding to each text line includes: Encoding the text information corresponding to each of the text lines to generate a text feature vector corresponding to each of the text lines; Encoding the position information corresponding to each of the text lines to generate a layout feature vector corresponding to each of the text lines; The image blocks corresponding to the text lines are encoded to generate image feature vectors corresponding to the text lines.

8. The method according to claim 7, characterized in that The step of extracting key information corresponding to each of the text lines according to the multimodal feature vectors corresponding to each of the text lines includes: For each of the text lines, the text feature vector, the layout feature vector and the image feature vector corresponding to the text line are fused to obtain a fused feature vector; The fused feature vectors corresponding to each of the text lines are input into a trained key information extraction model to obtain the key information corresponding to each of the text lines.

9. The method according to claim 8, characterized in that The step of inputting the fused feature vectors corresponding to each of the text lines into a trained key information extraction model to obtain the key information corresponding to each of the text lines includes: Inputting the fused feature vector corresponding to each of the text lines into the feature extraction network of the key information extraction model for feature extraction; Inputting the feature vector output by the feature extraction network into the linear transformer of the key information extraction model for linear transformation to obtain the target feature vector corresponding to each text line; The target feature vector corresponding to each of the text lines is input into the classification function of the key information extraction model to predict the key information corresponding to each of the text lines.

10. A key information extraction device, characterized in that: The device comprises: A first acquisition module is used to acquire a target image including an object of a preset type; wherein the object of the preset type includes at least one text line; A second acquisition module, used to acquire text information, position information and image blocks corresponding to at least one text line in the preset type object; A generating module, configured to generate a multimodal feature vector corresponding to each of the text lines according to the text information, position information and image blocks corresponding to each of the text lines; The extraction module is used to extract key information corresponding to each text line according to the multimodal feature vector corresponding to each text line.