CN112560855B - Image information extraction method and device, electronic equipment and storage medium - Google Patents

Image information extraction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112560855B
CN112560855B CN202011502197.0A CN202011502197A CN112560855B CN 112560855 B CN112560855 B CN 112560855B CN 202011502197 A CN202011502197 A CN 202011502197A CN 112560855 B CN112560855 B CN 112560855B
Authority
CN
China
Prior art keywords
character
block
image
text
character block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011502197.0A
Other languages
Chinese (zh)
Other versions
CN112560855A (en
Inventor
张舒婷
赖众程
李骁
姜笃一
李林毅
马超
王小红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202011502197.0A priority Critical patent/CN112560855B/en
Publication of CN112560855A publication Critical patent/CN112560855A/en
Application granted granted Critical
Publication of CN112560855B publication Critical patent/CN112560855B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Class or cluster creation or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Databases & Information Systems (AREA)
  • Character Input (AREA)
  • Character Discrimination (AREA)

Abstract

The invention relates to a data processing technology, and discloses an image information extraction method, which comprises the following steps: extracting an image main body and a text from an original image to obtain a character block set, and generating an original sequence chain according to the arrangement sequence of the character block set; obtaining a first probability value according to each character block and a character block adjacent to the right of each character block in the character block set, and obtaining a second probability value according to each character block and a character block adjacent to the right of each character block in the character block set; and adjusting the original sequential chain according to the first and second probability values to obtain a standard sequential chain, splicing character blocks according to the standard sequential chain to obtain a character string, and extracting fields of the character string to obtain a target information set. The invention also relates to blockchain techniques, where the original images etc. can be stored in blockchain nodes. The invention also discloses an image information extraction device, electronic equipment and a storage medium. The invention can solve the problems of low image information extraction efficiency and inaccurate identification result.

Description

Image information extraction method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to an image information extraction method and apparatus, an electronic device, and a computer-readable storage medium.
Background
At present, images become a main carrier of information in our lives, and in order to analyze the information in the images, the information in the images needs to be recognized firstly. For example, in a private banking fund service scenario, qualified investors need to have corresponding risk identification capability and risk tolerance capability, so that certain requirements are imposed on the personal assets of the investors. Thus, investor asset certification requires investors to upload individual asset images, such as multiple types of asset certification images, e.g., bank/financing platform screenshots, deposit certificates, income certificates, etc. The bank back-end auditor needs to complete the audit of the asset image within the first time after the investor uploads the asset proof image.
The traditional asset image auditing is based on a screenshot template extracting method, and the information in the image is extracted by comparing the existing screenshot template with the asset image to be audited. However, the interfaces of each image are different, the templates are not universal and cannot be exhausted, different image interface formats have large differences, a specific template needs to be manually set for each image interface, a large amount of auditing manpower needs to be consumed, the efficiency is low, and the identification result is inaccurate.
Disclosure of Invention
The invention provides an image information extraction method, an image information extraction device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problems of low image information extraction efficiency and inaccurate identification result.
In order to achieve the above object, the present invention provides an image information extraction method, including:
acquiring an original image, and performing image main body extraction processing on the original image to obtain a standard image;
performing text extraction on the standard image by using a preset text extraction algorithm to obtain a character block set;
generating an original sequence chain of the character block set according to the arrangement sequence of the character block set in the standard image, and searching adjacent character blocks of each character block in the original sequence chain, wherein the adjacent character blocks comprise a lower adjacent character block and a right adjacent character block;
sequentially selecting one of the character blocks from the character block set through traversal operation, inputting the selected character block and the corresponding right adjacent character block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected character block and the corresponding lower adjacent character block into the sequential rearrangement model again to obtain a second probability value;
maintaining the original sequential chain when the first probability value is greater than the second probability value, and inserting the lower adjacent text block between the selected text block and the right adjacent text block if the first probability value is less than or equal to the second probability value to obtain a standard sequential chain;
and splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set.
Optionally, the performing image subject extraction processing on the original image to obtain a standard image includes:
performing edge detection processing on the original image by using a preset edge detection algorithm to obtain an initial image;
and carrying out affine transformation on the initial image to obtain a standard image.
Optionally, the performing edge detection processing on the original image by using a preset edge detection algorithm to obtain an initial image includes:
performing Gaussian filtering on the original image to obtain a noise reduction image;
calculating the gradient value of each pixel point in the noise-reduced image, and screening edge pixel points according to the gradient value;
and extracting the area formed by the edge pixel points to obtain the initial image.
Optionally, the searching for a neighboring block of each block in the original sequential chain includes:
acquiring a central point of the character block, calculating a central difference value between a vertical coordinate of the central point and vertical coordinates of central points of other character blocks, and selecting the character block with the smallest central difference value and below the character block as a lower adjacent character block; or
Calculating a left alignment difference value between the vertical coordinate of the upper left corner of the text block and the vertical coordinates of the upper left corners of other text blocks, and selecting the text block with the minimum left alignment difference value and below the text block as a lower adjacent text block; or
And calculating a right alignment difference value between the vertical coordinate of the upper right corner of the text block and the vertical coordinates of the upper right corners of other text blocks, and selecting the text block with the smallest middle-right alignment difference value and below the text block as a lower adjacent text block.
Optionally, the inputting the selected text block and the corresponding right-adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value includes:
vectorizing the selected text block and the corresponding right adjacent text block to obtain a text block vector and a right adjacent text block vector;
and performing probability calculation on the character block and the right adjacent character block vector by using a classification network and a preset activation function in the sequential rearrangement model to obtain a first probability value.
Optionally, the extracting fields of the character string by using the pre-constructed entity recognition model to obtain an output field set includes:
acquiring a historical data set, and carrying out field marking processing on the historical data set to obtain a training data set;
constructing an initial entity recognition model;
and performing iterative training on the initial entity recognition model by using the training data set until the initial recognition model is converged to obtain the entity recognition model.
Optionally, the formatting the output field set to obtain a target information set includes:
carrying out separator removal processing on the output field set to obtain a standard field set;
and extracting the field type of the standard field set, and performing corresponding unified format conversion on the standard field set according to the field type to obtain a target information set.
In order to solve the above problem, the present invention also provides an image information extraction apparatus comprising:
the main body extraction module is used for acquiring an original image and performing image main body extraction processing on the original image to obtain a standard image;
the text extraction module is used for extracting the text of the standard image by using a preset text extraction algorithm to obtain a character block set;
the adjacent character block searching module is used for generating an original sequence chain of the character block set according to the arrangement sequence of the character block set in the standard image and searching adjacent character blocks of each character block in the original sequence chain, wherein the adjacent character blocks comprise a lower adjacent character block and a right adjacent character block;
a standard sequential chain generation module, configured to sequentially select one of the text blocks from the text block set through traversal operation, input the selected text block and the corresponding right-adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value, and input the selected text block and the corresponding lower-adjacent text block into the sequential rearrangement model again to obtain a second probability value; maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain;
and the target information set generation module is used for splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to cause the at least one processor to perform the image information extraction method described above.
In order to solve the above problem, the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the image information extraction method described above.
Firstly, carrying out image main body extraction and text extraction processing on an original image to obtain a character block set; generating an original sequence chain of the text block set according to the arrangement sequence of the text block set in the image after the image main body is extracted, and searching adjacent text blocks of each text block in the original sequence chain; sequentially selecting one of the text blocks from the text block set through traversal operation, inputting the selected text block and the corresponding right adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected text block and the corresponding lower adjacent text block into the sequential rearrangement model again to obtain a second probability value; maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain; the problem of logic confusion caused by simple character extraction can be avoided, the semantic information of the context is relied on, and the accuracy is improved. And splicing the character blocks in the standard sequential chain to obtain a character string, extracting fields of the character string by using a pre-constructed entity recognition model to obtain an output field set, and formatting the output field set to obtain a target information set, so that the generalization capability is improved, and the text information is more accurately extracted. Therefore, the image information extraction method, the image information extraction device and the computer readable storage medium provided by the invention can improve the efficiency of the image information extraction method and solve the problems of low information extraction efficiency and inaccurate identification result based on the screenshot template.
Drawings
Fig. 1 is a schematic flow chart of an image information extraction method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of an image information extraction apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device for implementing an image information extraction method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides an image-based image information extraction method, and an execution subject of the image-based image information extraction method includes but is not limited to at least one of a server, a terminal and other electronic devices which can be configured to execute the method provided by the embodiment of the application. In other words, the image information extraction method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of an image information extraction method based on an image according to an embodiment of the present invention. In this embodiment, the image-based image information extraction method includes:
s1, acquiring an original image, and performing image main body extraction processing on the original image to obtain a standard image.
In the embodiment of the invention, the original image can be a personal asset image uploaded by an investor and used for proving the asset authentication of the investor, for example, a plurality of asset proving images of various types such as a bank or a financing platform screenshot, a deposit certificate, a income certificate and the like.
The image subject refers to a portion of the personal asset image that contains asset information. In detail, since the original image uploaded by the investor may be an irregular photographed image such as a hand-held printed image, the original image needs to be subjected to image body extraction processing, the body part of the image is extracted, and the image is adjusted to a normal rectangle to obtain a standard image. Specifically, the performing image subject extraction processing on the original image to obtain a standard image includes:
performing edge detection processing on the original image by using a preset edge detection algorithm to obtain an initial image;
and carrying out affine transformation on the initial image to obtain a standard image.
In the embodiment of the invention, the preset edge detection algorithm can be a Canny operator edge detection algorithm and a Sobel operator edge detection algorithm. The affine transformation refers to that one vector space is subjected to linear transformation once and then is subjected to translation, and then is transformed into the other vector space.
Further, the performing edge detection processing on the original image by using a preset edge detection algorithm to obtain an initial image includes:
performing Gaussian filtering on the original image to obtain a noise reduction image;
calculating the gradient value of each pixel point in the noise-reduced image, and screening edge pixel points according to the gradient value;
and extracting the area formed by the edge pixel points to obtain the initial image.
And S2, performing text extraction on the standard image by using a preset text extraction algorithm to obtain a character block set.
In the embodiment of the invention, a preset text extraction algorithm is utilized to extract the text character strings and the four coordinate points thereof in the standard image, so as to obtain a character block set.
Preferably, the text extraction algorithm in the embodiment of the present invention is an OCR algorithm.
And S3, generating an original sequence chain of the text block set according to the arrangement sequence of the text block set in the standard image, and searching adjacent text blocks of each text block in the original sequence chain, wherein the adjacent text blocks comprise a lower adjacent text block and a right adjacent text block.
In the embodiment of the present invention, the adjacent text blocks include a lower adjacent text block and a right adjacent text block. Further, the arrangement order corresponding to the text block set refers to an order in the row direction in the standard image, for example, the original order chain is: chunk 1-chunk 2-chunk 3-chunk 4 … chunk N.
Specifically, the searching for the adjacent text block of each text block in the original sequential chain includes:
acquiring a central point of the character block, calculating a central difference value between a vertical coordinate of the central point and vertical coordinates of central points of other character blocks, and selecting the character block with the smallest central difference value and below the character block as a lower adjacent character block; or
Calculating a left alignment difference value between the vertical coordinate of the upper left corner of the text block and the vertical coordinates of the upper left corners of other text blocks, and selecting the text block with the minimum left alignment difference value and below the text block as a lower adjacent text block; or
And calculating a right alignment difference value between the vertical coordinate of the upper right corner of the text block and the vertical coordinates of the upper right corners of other text blocks, and selecting the text block with the smallest middle-right alignment difference value and below the text block as a lower adjacent text block.
And S4, sequentially selecting one of the character blocks from the character block set through traversal operation.
S5, inputting the selected character block and the corresponding right adjacent character block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected character block and the corresponding lower adjacent character block into the sequential rearrangement model again to obtain a second probability value.
In the embodiment of the present invention, the sequential rearrangement model may be an ALBert base network whose backbone model is an ALBert model.
Wherein the inputting the selected text block and the corresponding right adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value includes:
vectorizing the selected text block and the corresponding right adjacent text block to obtain a text block vector and a right adjacent text block vector;
and performing probability calculation on the character block and the right adjacent character block vector by using a classification network and a preset activation function in the sequential rearrangement model to obtain a first probability value.
In detail, the activation function is a log-softmax function.
Further, the selected text block and the lower adjacent text block corresponding to the selected text block are input into the sequential rearrangement model again, and the method for obtaining the second probability value is the same as the method for obtaining the first probability value, which is not described herein again.
The probability value of the selected text block and the corresponding right adjacent text block is calculated by utilizing the pre-trained sequence rearrangement model, the probability value of the selected text block and the corresponding lower adjacent text block is compared, and the sequence of the text blocks is rearranged by comparing the two probability values, so that the generalization capability is improved, the natural reading sequence among different text blocks can be directly analyzed without applying an interface template, and the required fields are extracted more accurately.
And S6, judging whether the first probability value is larger than the second probability value.
When the first probability value is greater than the second probability value, S7, it is determined whether the traversal operation is completed, that is, whether all the text blocks have been selected from the text block set.
And when the traversal operation is not completed, returning to the step S4, and selecting the next character block from the character block set through the traversal operation. Otherwise, when the traversal operation is completed, executing S8, and outputting the original sequence chain as a standard sequence chain.
If the first probability value is smaller than or equal to the second probability value in the step S6, the step S9 is executed, the lower adjacent character block is inserted between the selected character block and the corresponding right adjacent character block, the step S7 is executed, and whether the traversal operation is finished or not is judged.
And when the traversal operation is not completed, returning to the step S4, and selecting the next character block from the character block set through the traversal operation. Otherwise, when the traversal operation is completed, executing S8, and obtaining a standard sequence chain according to the insertion operation.
In the embodiment of the present invention, the original sequence chain is: text block 1-text block 2-text block 3-text block 4 … text block N, if the first probability value of each text block is greater than the second probability value, then the original sequential chain text block 1-text block 2-text block 3-text block 4 … is a standard sequential chain. If the first probability value of the text block 2 is smaller than or equal to the second probability value, inserting the lower adjacent text block of the text block 2 between the text block 2 and the text block 3, thereby obtaining a standard sequence chain.
And S10, splicing character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and formatting the output field set to obtain a target information set.
In the embodiment of the invention, because the text sequence in the standard sequence chain is determined, the text blocks in the standard sequence chain are spliced, all the text blocks are spliced together to obtain a complete character string, and the character string has context semantic information.
Specifically, before performing field extraction on the character string by using the pre-constructed entity recognition model to obtain an output field set, the method further includes:
acquiring a historical data set, and carrying out field marking processing on the historical data set to obtain a training data set;
constructing an initial entity recognition model;
and performing iterative training on the initial entity recognition model by using the training data set until the initial recognition model is converged to obtain the entity recognition model.
In detail, a preset BIO labeling method is used for carrying out field labeling processing on the historical data set to obtain a training data set, in the embodiment of the invention, the training data set is { O, B-name, I-name, B-account, I-account, B-date, and I-date }, and respectively represents O: non-decimated field character, B-name: name field start character, I-name: name field middle characters (except the start character), B-account: amount field start character, I-amount: amount field middle character (except for start character), B-date: date field start character, I-date: date field middle characters (except for the start character).
Specifically, the backbone model for constructing the initial recognition model is a Bert network, and parameters of a Bert Chinese pre-training model are used as initialization model parameters. The Bert model is followed by a Dense layer and a CRF layer, the Dense layer calculates the probability that each character belongs to a certain field, and the CRF layer establishes transition matrixes among Start, B, I and O so as to restrict the transition probability of each label.
Further, the initial recognition model is iteratively trained by using the training data set until the initial recognition model is obtained, so as to obtain the entity recognition model.
Specifically, the formatting the output field set to obtain a target information set includes:
carrying out separator removal processing on the output field set to obtain a standard field set;
and extracting the field type of the standard field set, and performing corresponding unified format conversion on the standard field set according to the field type to obtain a target information set.
Wherein the type of the set of output fields includes, but is not limited to, a date type and an amount type.
For example, when the type of the standard field is the amount type, the unified format conversion is performed on the set of standard fields to convert the amount to the RMB currency format.
In detail, in order to facilitate the downstream task, the output field set needs to be formatted, and the date and amount fields in the output field set are mainly uniformly formatted.
Firstly, carrying out image main body extraction and text extraction processing on an original image to obtain a character block set; generating an original sequence chain of the text block set according to the arrangement sequence of the text block set in the image after the image main body is extracted, and searching adjacent text blocks of each text block in the original sequence chain; sequentially selecting one of the character blocks from the character block set through traversal operation, inputting the selected character block and the corresponding right adjacent character block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected character block and the corresponding lower adjacent character block into the sequential rearrangement model again to obtain a second probability value; maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain; the problem of logic confusion caused by simple character extraction can be avoided, the semantic information of the context is relied on, and the accuracy is improved. And splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set. The generalization capability is improved, and the text information is extracted more accurately. Therefore, the image information extraction method, the image information extraction device and the computer readable storage medium provided by the invention can improve the efficiency of the image information extraction method and solve the problems of low information extraction efficiency and inaccurate identification result based on the screenshot template.
Fig. 2 is a schematic block diagram of an image information extraction apparatus according to an embodiment of the present invention.
The image information extraction apparatus 100 according to the present invention may be installed in an electronic device. According to the realized functions, the image information extraction apparatus 100 may include a main body extraction module 101, a text extraction module 102, an adjacent text block search module 103, a standard sequence chain generation module 104, and a target information set generation module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform a fixed function, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the main body extraction module 101 is configured to obtain an original image, and perform image main body extraction processing on the original image to obtain a standard image;
the text extraction module 102 is configured to perform text extraction on the standard image by using a preset text extraction algorithm to obtain a text block set;
the adjacent text block searching module 103 is configured to generate an original sequence chain of the text block set according to an arrangement sequence of the text block set in the standard image, and search for an adjacent text block of each text block in the original sequence chain, where the adjacent text block includes a lower adjacent text block and a right adjacent text block;
the standard sequential chain generating module 104 is configured to sequentially select one of the text blocks from the text block set through traversal operation, input the selected text block and the corresponding right-adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value, and input the selected text block and the corresponding lower-adjacent text block into the sequential rearrangement model again to obtain a second probability value; maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain;
the target information set generating module 105 is configured to perform splicing processing on the text blocks in the standard sequential chain to obtain a character string, perform field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and perform formatting processing on the output field set to obtain a target information set.
In detail, when each module in the image information extraction apparatus 100 is executed by a processor of an electronic device, an image information extraction method can be implemented, and the specific implementation steps of the image information extraction method are the same as those of the specific implementation mode, and are not described herein again.
Fig. 3 is a schematic structural diagram of an electronic device implementing the image information extraction method according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as an image information extraction program 12, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as a code of the image information extraction program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (for example, executing an image information extraction program and the like) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The image information extraction program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
acquiring an original image, and performing image main body extraction processing on the original image to obtain a standard image;
performing text extraction on the standard image by using a preset text extraction algorithm to obtain a character block set;
generating an original sequence chain of the character block set according to the arrangement sequence of the character block set in the standard image, and searching adjacent character blocks of each character block in the original sequence chain, wherein the adjacent character blocks comprise a lower adjacent character block and a right adjacent character block;
sequentially selecting one of the character blocks from the character block set through traversal operation, inputting the selected character block and the corresponding right adjacent character block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected character block and the corresponding lower adjacent character block into the sequential rearrangement model again to obtain a second probability value;
maintaining the original sequential chain when the first probability value is greater than the second probability value, and inserting the lower adjacent text block between the selected text block and the right adjacent text block if the first probability value is less than or equal to the second probability value to obtain a standard sequential chain;
and splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile, and may include, for example: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic diskette, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, which stores a computer program that, when executed by a processor of an electronic device, can implement:
acquiring an original image, and performing image main body extraction processing on the original image to obtain a standard image;
performing text extraction on the standard image by using a preset text extraction algorithm to obtain a character block set;
generating an original sequence chain of the character block set according to the arrangement sequence of the character block set in the standard image, and searching adjacent character blocks of each character block in the original sequence chain, wherein the adjacent character blocks comprise a lower adjacent character block and a right adjacent character block;
sequentially selecting one of the character blocks from the character block set through traversal operation, inputting the selected character block and the corresponding right adjacent character block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected character block and the corresponding lower adjacent character block into the sequential rearrangement model again to obtain a second probability value;
maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain;
and splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying claims should not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not to denote any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An image information extraction method, characterized in that the method comprises:
acquiring an original image, and performing image main body extraction processing on the original image to obtain a standard image;
performing text extraction on the standard image by using a preset text extraction algorithm to obtain a character block set;
generating an original sequence chain of the character block set according to the arrangement sequence of the character block set in the standard image, and searching adjacent character blocks of each character block in the original sequence chain, wherein the adjacent character blocks comprise a lower adjacent character block and a right adjacent character block;
sequentially selecting one of the character blocks from the character block set through traversal operation, inputting the selected character block and the corresponding right adjacent character block into a pre-trained sequential rearrangement model to obtain a first probability value, and inputting the selected character block and the corresponding lower adjacent character block into the sequential rearrangement model again to obtain a second probability value;
maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain;
and splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set.
2. The image information extraction method according to claim 1, wherein the performing image subject extraction processing on the original image to obtain a standard image includes:
carrying out edge detection processing on the original image by using a preset edge detection algorithm to obtain an initial image;
and carrying out affine transformation on the initial image to obtain a standard image.
3. The image information extraction method according to claim 2, wherein the performing edge detection processing on the original image by using a preset edge detection algorithm to obtain an initial image comprises:
performing Gaussian filtering on the original image to obtain a noise reduction image;
calculating the gradient value of each pixel point in the noise-reduced image, and screening edge pixel points according to the gradient value;
and extracting the area formed by the edge pixel points to obtain the initial image.
4. The method of extracting image information according to claim 1, wherein said finding neighboring blocks of each block in the original sequential chain comprises:
acquiring a central point of the character block, calculating a central difference value between a vertical coordinate of the central point and vertical coordinates of central points of other character blocks, and selecting the character block with the smallest central difference value and below the character block as a lower adjacent character block; or
Calculating left alignment difference values between the vertical coordinates of the upper left corners of the character blocks and the vertical coordinates of the upper left corners of other character blocks, and selecting the character block with the minimum left alignment difference value and below the character block as a lower adjacent character block; or
And calculating a right alignment difference value between the vertical coordinate of the upper right corner of the text block and the vertical coordinate of the upper right corner of other text blocks, and selecting the text block with the smallest right alignment difference value and below the text block as a lower adjacent text block.
5. The image information extraction method of claim 1, wherein the inputting the selected text block and the corresponding right-adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value comprises:
vectorizing the selected text block and the corresponding right adjacent text block to obtain a text block vector and a right adjacent text block vector;
and performing probability calculation on the character block and the right adjacent character block vector by using a classification network and a preset activation function in the sequence rearrangement model to obtain a first probability value.
6. The image information extraction method according to claim 1, wherein the field extraction of the character string by using the pre-constructed entity recognition model to obtain an output field set comprises:
acquiring a historical data set, and carrying out field marking processing on the historical data set to obtain a training data set;
constructing an initial entity recognition model;
and performing iterative training on the initial entity recognition model by using the training data set until the initial recognition model is converged to obtain the entity recognition model.
7. The image information extraction method according to any one of claims 1 to 6, wherein the formatting the output field set to obtain a target information set includes:
carrying out separator removal processing on the output field set to obtain a standard field set;
and extracting the field type of the standard field set, and performing corresponding unified format conversion on the standard field set according to the field type to obtain a target information set.
8. An image information extraction apparatus, characterized in that the apparatus comprises:
the main body extraction module is used for acquiring an original image and performing image main body extraction processing on the original image to obtain a standard image;
the text extraction module is used for extracting the text of the standard image by using a preset text extraction algorithm to obtain a character block set;
the adjacent character block searching module is used for generating an original sequence chain of the character block set according to the arrangement sequence of the character block set in the standard image and searching adjacent character blocks of each character block in the original sequence chain, wherein the adjacent character blocks comprise a lower adjacent character block and a right adjacent character block;
a standard sequential chain generation module, configured to sequentially select one of the text blocks from the text block set through traversal operation, input the selected text block and the corresponding right-adjacent text block into a pre-trained sequential rearrangement model to obtain a first probability value, and input the selected text block and the corresponding lower-adjacent text block into the sequential rearrangement model again to obtain a second probability value; maintaining the original sequential chain when the first probability value is greater than the second probability value, and if the first probability value is less than or equal to the second probability value, inserting the lower adjacent text block between the selected text block and the right adjacent text block to obtain a standard sequential chain;
and the target information set generation module is used for splicing the character blocks in the standard sequential chain to obtain a character string, performing field extraction on the character string by using a pre-constructed entity recognition model to obtain an output field set, and performing formatting processing on the output field set to obtain a target information set.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the image information extraction method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the image information extraction method according to any one of claims 1 to 7.
CN202011502197.0A 2020-12-18 2020-12-18 Image information extraction method and device, electronic equipment and storage medium Active CN112560855B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011502197.0A CN112560855B (en) 2020-12-18 2020-12-18 Image information extraction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011502197.0A CN112560855B (en) 2020-12-18 2020-12-18 Image information extraction method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112560855A CN112560855A (en) 2021-03-26
CN112560855B true CN112560855B (en) 2022-10-14

Family

ID=75063381

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011502197.0A Active CN112560855B (en) 2020-12-18 2020-12-18 Image information extraction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112560855B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114419640B (en) * 2022-02-25 2023-08-11 北京百度网讯科技有限公司 Text processing method, device, electronic equipment and storage medium
CN116450807B (en) * 2023-06-15 2023-08-11 中国标准化研究院 Massive data text information extraction method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1384940A (en) * 1999-11-05 2002-12-11 微软公司 Language input architecture fot converting one text form to another text form with modeless entry
CN109145284A (en) * 2017-06-19 2019-01-04 阿里巴巴集团控股有限公司 Information processing method and device
CN110533020A (en) * 2018-05-25 2019-12-03 腾讯科技(深圳)有限公司 A kind of recognition methods of text information, device and storage medium
CN111460827A (en) * 2020-04-01 2020-07-28 北京爱咔咔信息技术有限公司 Text information processing method, system, equipment and computer readable storage medium
CN111914825A (en) * 2020-08-03 2020-11-10 腾讯科技(深圳)有限公司 Character recognition method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10372821B2 (en) * 2017-03-17 2019-08-06 Adobe Inc. Identification of reading order text segments with a probabilistic language model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1384940A (en) * 1999-11-05 2002-12-11 微软公司 Language input architecture fot converting one text form to another text form with modeless entry
CN109145284A (en) * 2017-06-19 2019-01-04 阿里巴巴集团控股有限公司 Information processing method and device
CN110533020A (en) * 2018-05-25 2019-12-03 腾讯科技(深圳)有限公司 A kind of recognition methods of text information, device and storage medium
CN111460827A (en) * 2020-04-01 2020-07-28 北京爱咔咔信息技术有限公司 Text information processing method, system, equipment and computer readable storage medium
CN111914825A (en) * 2020-08-03 2020-11-10 腾讯科技(深圳)有限公司 Character recognition method and device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
自然图像中文字检测与识别研究;姚聪;《中国博士学位论文全文数据库 信息科技辑》;20150715;第I138-90页 *

Also Published As

Publication number Publication date
CN112560855A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
CN109543690B (en) Method and device for extracting information
CN112528863A (en) Identification method and device of table structure, electronic equipment and storage medium
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
WO2022105179A1 (en) Biological feature image recognition method and apparatus, and electronic device and readable storage medium
CN111476324B (en) Traffic data labeling method, device, equipment and medium based on artificial intelligence
CN112560855B (en) Image information extraction method and device, electronic equipment and storage medium
CN113961473A (en) Data testing method and device, electronic equipment and computer readable storage medium
CN112528616B (en) Service form generation method and device, electronic equipment and computer storage medium
CN113704614A (en) Page generation method, device, equipment and medium based on user portrait
CN112860905A (en) Text information extraction method, device and equipment and readable storage medium
CN115471775A (en) Information verification method, device and equipment based on screen recording video and storage medium
CN112668575A (en) Key information extraction method and device, electronic equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN114708461A (en) Multi-modal learning model-based classification method, device, equipment and storage medium
CN113344125A (en) Long text matching identification method and device, electronic equipment and storage medium
CN116757812A (en) Method, device, electronic equipment and storage medium for detecting abnormal data
CN116468025A (en) Electronic medical record structuring method and device, electronic equipment and storage medium
CN115346095A (en) Visual question answering method, device, equipment and storage medium
CN112580505B (en) Method and device for identifying network point switch door state, electronic equipment and storage medium
CN115146064A (en) Intention recognition model optimization method, device, equipment and storage medium
CN115203364A (en) Software fault feedback processing method, device, equipment and readable storage medium
CN114120347A (en) Form verification method and device, electronic equipment and storage medium
CN113221888A (en) License plate number management system testing method and device, electronic equipment and storage medium
CN113822215A (en) Equipment operation guide file generation method and device, electronic equipment and storage medium
CN112183520A (en) Intelligent data information processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant