CN113269101A - Bill identification method, device and equipment - Google Patents

Bill identification method, device and equipment Download PDF

Info

Publication number
CN113269101A
CN113269101A CN202110591829.3A CN202110591829A CN113269101A CN 113269101 A CN113269101 A CN 113269101A CN 202110591829 A CN202110591829 A CN 202110591829A CN 113269101 A CN113269101 A CN 113269101A
Authority
CN
China
Prior art keywords
target
information set
field
key field
identification information
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.)
Pending
Application number
CN202110591829.3A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110591829.3A priority Critical patent/CN113269101A/en
Publication of CN113269101A publication Critical patent/CN113269101A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/414Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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

Abstract

The embodiment of the specification provides a bill identification method, a bill identification device and bill identification equipment, and relates to the technical field of artificial intelligence, wherein the bill identification method comprises the following steps: cutting the target image to obtain an image of a target area in the target image; the target area is a part for recording the title in the target image whole area; identifying the image of the target area by using an optical character identification technology to obtain a target identification information set; matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises key fields of titles and corresponding bill types; and determining the bill type corresponding to the target image according to the matching result. In the embodiment of the specification, the bill type can be added by recording the corresponding relation between the key field for matching and the bill type in the feature information set, a training model is not required to collect a large amount of data, and the business requirement can be quickly responded.

Description

Bill identification method, device and equipment
Technical Field
The embodiment of the specification relates to the technical field of artificial intelligence, in particular to a bill identification method, a bill identification device and bill identification equipment.
Background
In the existing electronic financial reimbursement system, the unified electronic image scanning and recording are required to be carried out on financial reimbursement bills inside companies and organizations, external financial reimbursement bills such as value-added tax invoices and train tickets, and then various structured data in the bills are recorded. The situation that various paper bills are not classified and structured data need to be input in batches often exists in the unified collection process of the paper bills, so that electronic images of the bills input in batches need to be classified and automatic bill information input is carried out.
In the prior art, images are generally classified by using a computer vision algorithm such as an artificial intelligence neural network such as a convolutional neural network, and the like, and by adopting the method, a large amount of training data needs to be collected, so that the development period and the cost are high, and bills with very close formats are difficult to effectively distinguish. Therefore, the technical scheme in the prior art cannot effectively respond to the business requirement to classify the bills.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the specification provides a bill identification method, a bill identification device and bill identification equipment, and aims to solve the problem that in the prior art, business requirements cannot be efficiently responded so as to classify bills.
The embodiment of the specification provides a bill identification method, which comprises the following steps: cutting the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area; identifying the image of the target area by using an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification; matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type; and determining the bill type corresponding to the target image according to the matching result.
An embodiment of the present specification further provides a bill identifying apparatus, including: the cutting module is used for cutting the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area; the identification module is used for identifying the image of the target area by utilizing an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification; the matching module is used for matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type; and the determining module is used for determining the bill type corresponding to the target image according to the matching result.
The embodiment of the present specification further provides a bill identifying device, which includes a processor and a memory for storing processor-executable instructions, and when the processor executes the instructions, the steps of the bill identifying method in the embodiment of the present specification are implemented.
The present specification also provides a computer readable storage medium, on which computer instructions are stored, and when executed, the instructions implement the steps of the bill identifying method in the present specification.
The embodiment of the specification provides a bill identification method, which can obtain an image of a target area in a target image by cutting the target image, wherein the target area can be a part of a title recorded in the whole area of the target image. The fields contained in the image of the target area can be identified by using an optical character recognition technology to obtain a target identification information set. Furthermore, each key field in the feature information set can be matched with a field in the target identification information set to obtain a matching result; wherein, the characteristic information is recorded with the corresponding relation between the key field of the title and the bill type. Because the incidence relation between the key field and the bill type is recorded in the feature information set, the bill type corresponding to the target image can be determined according to the matching result after the matching result is obtained. The method has the advantages that the bills can be classified in advance, the corresponding relation between the key fields for matching and the bill types is recorded in the characteristic information set to add the requirement of a newly-added support type, the data collection and model retraining are not needed, the development period is short, the cost is low, and the service requirement can be responded quickly. And only partial region in the target image can be identified, so that the identification efficiency is effectively improved, and the data processing amount is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the disclosure, are incorporated in and constitute a part of this specification, and are not intended to limit the embodiments of the disclosure. In the drawings:
FIG. 1 is a schematic diagram illustrating steps of a method for identifying a bill provided in accordance with an embodiment of the present disclosure;
FIG. 2(a) is a schematic illustration of a base type document provided in accordance with an embodiment of the present disclosure;
FIG. 2(b) is a schematic diagram of a two line title type ticket provided in accordance with an embodiment of the present description;
FIG. 2(C) is a schematic illustration of a ticket of the type C1 provided in accordance with embodiments of the present description;
FIG. 2(d) is a schematic illustration of a ticket of the type C2 provided in accordance with embodiments of the present description;
FIG. 3 is a schematic structural diagram of a bill identifying device provided according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a bill identifying apparatus provided according to an embodiment of the present specification.
Detailed Description
The principles and spirit of the embodiments of the present specification will be described with reference to a number of exemplary embodiments. It should be understood that these embodiments are presented merely to enable those skilled in the art to better understand and to implement the embodiments of the present description, and are not intended to limit the scope of the embodiments of the present description in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, implementations of the embodiments of the present description may be embodied as a system, an apparatus, a method, or a computer program product. Therefore, the disclosure of the embodiments of the present specification can be embodied in the following forms: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
Although the flow described below includes operations that occur in a particular order, it should be appreciated that the processes may include more or less operations that are performed sequentially or in parallel (e.g., using parallel processors or a multi-threaded environment).
Referring to fig. 1, the present embodiment can provide a method for identifying a bill. The bill identification method can be used for efficiently identifying the bill type corresponding to the target image. The bill identifying method may include the following steps.
S101: cutting the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area where the title is recorded.
In this embodiment, since the key information for distinguishing the types of the bills usually occupies only a partial area in the entire image, the target image may be first cut to obtain an image of the target area in the target image. The target area may be a portion of the target image entire area where a title is recorded.
In this embodiment, an image scanning system may be used to obtain an electronic image of a target paper document, thereby obtaining a target image. The target image can be an electronic image of a target paper bill of the bill type to be confirmed, and the target image can be an integral electronic image of the target paper bill.
In this embodiment, the target area can be determined by analyzing the position of the title in different types of bills. Preferably, the target area may be an area having a height of 30% or more in the document. Of course, the manner of setting the target area is not limited to the above examples, and other modifications may be made by those skilled in the art within the spirit of the embodiments of the present disclosure, but the function and effect of the embodiments of the present disclosure are also within the scope of the embodiments of the present disclosure.
In this embodiment, when the type of the ticket is preferably not determined by the title, the target area may be an area where other key information is located, and may be specifically determined according to actual circumstances, which is not limited in the examples of this specification.
In some embodiments, tickets can be divided into 6 major categories: the basic type (a) matching key field is the main title of the ticket and is a line of text, as shown in fig. 2 (a); two rows title type (B) the matching key field is the main title of the ticket, but the field is divided into two rows, as shown in fig. 2 (B); the C1 type ticket contains a main title and a subtitle, wherein the main title is different from the subtitle consistently, and the subtitles are distinguished by subtitle, as shown in fig. 2 (C); the C2 type ticket contains a main title and a subtitle, wherein the main title and the subtitle are completely consistent, and only the format and the key field are different, and other key field are used for distinguishing the sub-classes, as shown in fig. 2 (d); the content of the bill without the title class (D) has no title text, but fixed fields are arranged at relatively fixed positions to match keys, such as train tickets, airplane tickets and the like; other types of tickets (Z) are not yet supported. In the embodiment, the bills can be classified in advance, the key fields for matching are determined to add the requirement of a new support type, data collection is not needed, a model is not trained again, the development period is short, the cost is low, and the service requirement can be responded quickly.
S102: identifying the image of the target area by using an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification.
In this embodiment, an optical character recognition technology may be used to recognize an image of a target area, so as to obtain a target recognition information set; the target identification information set may include at least one field obtained by identification. In some embodiments, the target identification information set may be empty, and in the case that the target identification information set is empty, it indicates that the target image is not suitable for identification by using the image of the target area or the target image is a missing or erroneous image, and at this time, an abnormality may be fed back, or the target image may be wholly identified by using an optical character recognition technology to determine the type of the target image. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
In the present embodiment, Optical Character Recognition (OCR) refers to a process of scanning text data, analyzing an image file, and acquiring text and layout information. At least one field contained in the image from which the target area can be identified is identified using optical character recognition techniques.
S103: matching each key field in the characteristic information set with a field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type.
In this embodiment, each key field in the feature information set may be matched with a field in the target identification information set to obtain a matching result; the feature information set may include a plurality of sets of data, and each set of data may include a key field of a title and a corresponding ticket type.
In this embodiment, the feature information set may be based on the association relationship between the key fields of various different types of ticket records and the ticket types, and the data in the feature information set may be used as module data for matching. Each key field in the feature information set can be matched with a field in the target identification information set respectively to determine whether the key field recorded in the feature information set exists in the target identification information set, so that a matching result can be obtained.
In this embodiment, the matching result may be used to characterize whether the matching is successful, and if the matching is successful, the matching result may further include a specific field in which the feature information set is matched with the target identification information set. It is understood that the matching result may also include other information, such as: degree of matching, etc. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
S104: and determining the bill type corresponding to the target image according to the matching result.
In the embodiment, since the association relationship between the key field and the ticket type is centrally recorded in the feature information, the ticket type corresponding to the target image can be determined according to the matching result after the matching result is obtained. Under the condition of successful matching, the bill type corresponding to the key field matched in the feature information set can be used as the bill type corresponding to the target image; under the condition of failed matching, the bill type corresponding to the target image can be determined to be other types, the bill type can be further confirmed by performing full text recognition on the target image by utilizing optical character recognition, and manual processing can also be carried out. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
From the above description, it can be seen that the embodiments of the present specification achieve the following technical effects: the image of the target area in the target image may be obtained by cutting the target image, where the target area may be a portion of the entire target image in which a title is recorded. The fields contained in the image of the target area can be identified by using an optical character recognition technology to obtain a target identification information set. Furthermore, each key field in the feature information set can be matched with a field in the target identification information set to obtain a matching result; wherein, the characteristic information is recorded with the corresponding relation between the key field of the title and the bill type. Because the incidence relation between the key field and the bill type is recorded in the feature information set, the bill type corresponding to the target image can be determined according to the matching result after the matching result is obtained. The method has the advantages that the bills can be classified in advance, the corresponding relation between the key fields for matching and the bill types is recorded in the characteristic information set to add the requirement of a newly-added support type, the data collection and model retraining are not needed, the development period is short, the cost is low, and the service requirement can be responded quickly. And only partial region in the target image can be identified, so that the identification efficiency is effectively improved, and the data processing amount is reduced.
In one embodiment, recognizing the image of the target area by using an optical character recognition technique to obtain a target recognition information set may include: recognizing the image of the target area by using an optical character recognition technology to obtain a first recognition information set; wherein the first identification information set may include at least one field obtained by identification. According to the coordinates of each field in the first identification information set, the high and low orders of each field in the target image can be determined. Further, the fields may be sorted from high to low based on the high-low order of the fields in the target image to obtain a second identification information set, and the second identification information set is used as a target identification information set.
In the present embodiment, since the image of the target area may be recognized by the optical character recognition technique to obtain a plurality of fields, the fields of the title may be recorded in front of the target recognition information set as much as possible, so that the fields of the title may be matched first at the time of matching, thereby improving the matching efficiency. Thus, the identified fields may be sorted.
In this embodiment, the coordinates of each field in the first identification information set may be acquired, so that the order of the fields in the target image, and the left and right orders may be determined according to the coordinates of the fields, and the target identification information set may be obtained by sorting the fields in the target image in rows based on the order of the fields in the target image.
In an embodiment, the feature information set may further include coordinates corresponding to each key field, and the matching of each key field in the feature information set and a field in the target identification information set to obtain a matching result may include: and determining the matching degree of each primary key field in the characteristic information set and each field in the target identification information set based on an edit distance algorithm. In a case where it is determined that there is a first target field in the target identification information set and a matching degree of the target primary key field is greater than or equal to a first preset threshold, the coordinates of the first target field may be determined. And determining the coordinate matching degree according to the coordinates of the target primary key field and the coordinates of the first target field. And under the condition that the coordinate matching degree is greater than or equal to a second preset threshold, determining whether the target primary key field has a related target secondary key field. In the event that it is determined to be not present, it may be determined that the target primary key field matches the first target field successfully.
In this embodiment, the key fields in the feature information set may be ranked, for example, as shown in fig. 2(d), wherein the main title may be a first-level key field, the subtitle may be a second-level key field, and the other key fields may be third-level key fields. It is understood that more or fewer stages may be included, and the details may be determined according to the structure of the bill, which is not limited in the embodiments of the present specification.
In this embodiment, the primary key fields may be preferentially matched. The Edit Distance (Edit Distance) refers to the minimum number of editing operations required to change from one string to another string. Permitted editing operations include replacing one character with another, inserting one character, and deleting one character. Generally, the smaller the edit distance, the greater the similarity of the two strings. Therefore, the matching degree of each primary key field in the feature information set and each field in the target identification information set can be determined based on an edit distance algorithm, and the smaller the edit distance, the higher the corresponding matching degree.
In the embodiment, the first preset threshold may be determined according to the types of the tickets, for example, some tickets may have place names (for example, a special invoice for shanghai value-added tax, a special invoice for taxi in beijing city, etc.) in their titles, so that a 1-2 word error may be allowed, and in some cases, a word recognition error may also be allowed, where the first preset threshold may be set to 0.9, 0.88, etc.; some bill titles are short and no qualifier exists in the title, and in order to make the recognition result accurate, the first preset threshold value can be set to be 1 and 0.99. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
In the present embodiment, when the key field matching is successful, the coordinates may be matched in order to ensure the accuracy of the matching result. Since the key fields specific to the same type of ticket are usually in a fixed position, the degree of coordinate matching can be determined based on the coordinates of the target primary key field and the coordinates of the first target field.
In this embodiment, the coordinates may be coordinates of each character in the field, or may be coordinates of a geometric center point of the field. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
In this embodiment, the circumscribed matrix of the target primary key field may be determined according to the coordinates of the target primary key field and the number of characters of the target primary key field, and the circumscribed matrix of the first target field may be determined according to the coordinates of the first target field and the number of characters of the first target field. Further, the coincidence degree of the external matrix of the first-level key field of the target and the external matrix of the first target field can be calculated, and the coincidence degree is used as the coordinate matching degree, and the higher the coincidence degree is, the higher the coordinate matching degree is. In some embodiments, the coordinate matching degree may also be determined according to a distance between the coordinates of the target primary key field and the coordinates of the first target field, and the shorter the distance, the higher the coordinate matching degree. Of course, the method of determining the coordinate matching degree is not limited to the above examples, and other modifications may be made by those skilled in the art within the spirit of the embodiments of the present disclosure, but the function and effect of the embodiments of the present disclosure are all covered by the scope of the embodiments of the present disclosure.
In this embodiment, when the degree of matching of the coordinates is greater than or equal to a second preset threshold, it is indicated that the coordinates of the target primary key field and the first target field are matched, at this time, it may be determined whether there is a related target secondary key field in the target primary key field, and if there is no description of a matching result based on the primary key field, the type of the ticket may be uniquely determined, so as to obtain a matching result. If the bill exists, the bill type cannot be determined, which indicates that secondary matching is needed.
In this embodiment, the second preset threshold may be a value greater than 0, for example: 0.05, 0.12, etc. The specific method can be determined according to actual precision requirements, and the embodiment of the present specification does not limit this.
In one embodiment, determining the type of the bill corresponding to the target image according to the matching result may include: determining the bill type corresponding to the target primary key field based on the characteristic information set; and taking the bill type corresponding to the target primary key field as the bill type corresponding to the target image.
In the embodiment, since the association relationship between the key field and the ticket type is centrally recorded in the feature information, the ticket type corresponding to the target image can be determined according to the matching result after the matching result is obtained. Under the condition of successful matching, the bill type corresponding to the target primary key field can be used as the bill type corresponding to the target image; under the condition of failed matching, the bill type corresponding to the target image can be determined to be other types, the bill type can be further confirmed by performing full text recognition on the target image by utilizing optical character recognition, and manual processing can also be carried out. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
In one embodiment, after determining the matching degree of each primary key field in the feature information set and each field in the target identification information set based on an edit distance algorithm, the method may further include: and under the condition that the matching degree of the target primary key field and a first target field in the target identification information set is determined to be not less than a first preset threshold, determining the distance from an external matrix of each field in the target identification information set to the origin. Two fields with the distance difference smaller than or equal to a third preset threshold value can be spliced in the order from high to low to obtain a preprocessed target identification information set. And determining the matching degree of each primary key field in the characteristic information set and each field in the preprocessed target identification information set based on an edit distance algorithm. Under the condition that the matching degree of the target primary key field and a second target field in the preprocessed target identification information set is determined to be larger than or equal to a second preset threshold, the coordinate of the second target field can be determined. And determining the coordinate matching degree according to the coordinates of the target primary key field and the coordinates of the second target field. Further, under the condition that the coordinate matching degree is greater than or equal to a second preset threshold, whether the target primary key field has an associated target secondary key field or not may be determined. In the event of a determination of absence, determining that the target primary key field matches the second target field successfully.
In the present embodiment, in a case where it is determined that there is no target primary key field and the matching degree of the first target field in the target identification information set is equal to or greater than the first preset threshold, it is explained that there may be a case as shown in fig. 2 (b). The matching may not be successful due to the broken line, and at this time, the two broken line fields may be spliced by using a sorting algorithm to obtain a preprocessed target identification information set, and matching is performed again based on the preprocessed target identification information set.
In this embodiment, the distance from the external matrix of each field in the target identification information set to the origin may be determined, and two fields with a distance difference smaller than or equal to a third preset threshold are spliced in the order from high to low, so that the two broken fields are spliced to obtain the preprocessed target identification information set. The origin may be the upper left corner of the target image. It is to be understood that any other specific location may be determined according to practical circumstances, and the embodiment of the present disclosure is not limited thereto.
In this embodiment, the primary key fields may be preferentially matched. The Edit Distance (Edit Distance) refers to the minimum number of editing operations required to change from one string to another string. Permitted editing operations include replacing one character with another, inserting one character, and deleting one character. Generally, the smaller the edit distance, the greater the similarity of the two strings. Therefore, the matching degree of each primary key field in the feature information set and each field in the preprocessed target identification information set can be determined based on an edit distance algorithm, and the smaller the edit distance, the higher the corresponding matching degree.
In the present embodiment, when the key field matching is successful, the coordinates may be matched in order to ensure the accuracy of the matching result. Since the key fields specific to the same type of ticket are usually in a fixed position, the degree of coordinate matching can be determined based on the coordinates of the target primary key field and the coordinates of the second target field. The coordinates may be coordinates of each character in the field, or coordinates of a geometric center point of the field. The specific situation can be determined according to actual situations, and the embodiment of the present specification does not limit the specific situation.
In this embodiment, the circumscribed matrix of the target primary key field may be determined according to the coordinates of the target primary key field and the number of characters of the target primary key field, and the circumscribed matrix of the second target field may be determined according to the coordinates of the second target field and the number of characters of the second target field. Further, the coincidence degree of the external matrix of the first-level key field of the target and the external matrix of the second target field can be calculated, and the coincidence degree is used as the coordinate matching degree, and the higher the coincidence degree is, the higher the coordinate matching degree is. In some embodiments, the coordinate matching degree may also be determined according to a distance between the coordinates of the target primary key field and the coordinates of the second target field, and the shorter the distance, the higher the coordinate matching degree. Of course, the method of determining the coordinate matching degree is not limited to the above examples, and other modifications may be made by those skilled in the art within the spirit of the embodiments of the present disclosure, but the function and effect of the embodiments of the present disclosure are all covered by the scope of the embodiments of the present disclosure.
In this embodiment, when the degree of matching of the coordinates is greater than or equal to a second preset threshold, it indicates that the coordinates of the target primary key field and the second target field are matched, at this time, it may be determined whether there is a related target secondary key field in the target primary key field, and if there is no description of a matching result based on the primary key field, the type of the ticket may be uniquely determined, so as to obtain a matching result, where the determined type of the ticket may be as shown in fig. 2(a) and fig. 2 (b). If the bill exists, the bill type cannot be determined, which indicates that secondary matching is needed.
In this embodiment, the second preset threshold may be a value greater than 0, for example: 0.05, 0.12, etc. The specific method can be determined according to actual precision requirements, and the embodiment of the present specification does not limit this.
In one embodiment, after determining the matching degree between each primary key field in the feature information set and each field in the preprocessed target identification information set, the method may further include: and under the condition that the matching degree of the target primary key field and a second target field in the preprocessed target identification information set is determined to be not less than a first preset threshold, carrying out full-text identification on the target image by using an optical character identification technology to obtain a third identification information set. Further, each key field in the feature information set may be matched with each field in the third identification information set to obtain a matching result.
In this embodiment, when it is determined that the matching degree between the target primary key field and the second target field in the preprocessed target identification information set is not greater than a first preset threshold, it indicates that the target image may be a bill without a title type, and at this time, full-text identification may be performed on the target image by using an optical character recognition technology to obtain a third identification information set.
In this embodiment, each key field in the feature information set may be matched with each field in the third identification information set to obtain a matching result, and a specific matching manner may refer to the above embodiment, and repeated details are not described again. If the matching fails, the note type possibly indicating other note types which are not recorded with the characteristic information set can be manually processed so as to complete the characteristic information set.
In one embodiment, after determining whether there is an associated target secondary key field in the target primary key field, the method may further include: in the case of determining that the field exists, determining a matching degree of a target secondary key field associated with the target primary key field and each field in the target identification information set based on an edit distance algorithm. In a case that it is determined that a third target field exists in the target identification information set, and the matching degree of the target secondary key field is greater than or equal to a first preset threshold, the coordinate of the third target field may be determined. The coordinate matching degree can be determined according to the coordinates of the target secondary key field and the coordinates of the third target field. And under the condition that the coordinate matching degree is greater than or equal to a third preset threshold, determining whether the target secondary key field has a related target tertiary key field. In the event that the determination is not present, determining that the target secondary key field matches the third target field successfully.
In this embodiment, when it is determined that the target primary key field has the associated target secondary key field, it is described that the target secondary key field needs to be further matched to determine whether a third target field matched with the target secondary key field exists in the target identification information set.
In this embodiment, the field matching and the coordinate matching may be performed according to the above embodiments, and repeated details are not repeated.
In this embodiment, in the case that the coordinate matching of the target secondary key field and the third target field is successful, it may be further determined whether there is an associated target tertiary key field in the target secondary key field, and if there is no description about the matching result based on the secondary key field, the type of the ticket may be uniquely determined, so as to obtain the matching result, where the determined type of the ticket may be as shown in fig. 2 (c). If the bill exists, the bill type cannot be determined, which indicates that three-level matching is needed.
In one embodiment, after determining whether there is an associated target tertiary key field in the target secondary key field, the method may further include: under the condition that the target secondary key field is determined to have the associated target tertiary key field, full-text recognition can be performed on the target image by using an optical character recognition technology to obtain a third recognition information set. Further, the target tertiary key field may be matched with each field in the third identification information set to obtain a matching result.
In this embodiment, in the case that it is determined that there is an associated target tertiary key field in the target secondary key field, it is described that the target image may be of the type shown in fig. 2(d), since the tertiary key field is not usually in the area where the title is located, but in the content portion. Therefore, the full text recognition can be performed on the target image by using the optical character recognition technology, and a third recognition information set is obtained.
In this embodiment, each key field in the feature information set may be matched with each field in the third identification information set to obtain a matching result, and a specific matching manner may refer to the above embodiment, and repeated details are not described again. If the matching fails, the note type possibly indicating other note types which are not recorded with the characteristic information set can be manually processed so as to complete the characteristic information set.
In one embodiment, after determining the coordinate matching degree, the method may further include: and under the condition that the coordinate matching degree is smaller than a second preset threshold, determining the comprehensive matching degree according to the matching degree of the fields and the coordinate matching degree. And determining that the matching fails under the condition that the comprehensive matching degree is less than or equal to a fourth preset threshold value. Further, full-text recognition can be performed on the target image by using an optical character recognition technology to obtain a third recognition information set. And matching each key field in the characteristic information set with each field in the third identification information set to obtain a matching result.
In this embodiment, when the field matching is successful but the coordinate matching is failed, the comprehensive matching degree may be further determined according to the matching degree of the field and the coordinate matching degree, so as to avoid a situation that the image obtained by the original scanning is distorted or the original bill has a part missing so that the calculation of the coordinate matching degree has an error when the time comes.
In this embodiment, the matching degree of the field and the matching degree of the coordinate may be multiplied or added to obtain a comprehensive matching degree. Of course, the calculation method of the comprehensive matching degree is not limited to the above example, and other modifications may be made by those skilled in the art in light of the technical spirit of the embodiments of the present disclosure, but the functions and effects achieved by the embodiments of the present disclosure are all within the scope of the embodiments of the present disclosure.
In this embodiment, when the integrated matching degree is greater than the fourth preset threshold, it may be determined that the matching is successful. At this time, whether the associated secondary key field and the associated tertiary key field exist can be further confirmed according to the above embodiment, and the corresponding bill type is determined according to the matching result, and the repeated parts are not described again.
In this embodiment, when the integrated matching degree is equal to or less than a fourth preset threshold, it is determined that the matching has failed. The target image may be a bill without a title, and the target image may be subjected to full text recognition by using an optical character recognition technology to obtain a third recognition information set.
In this embodiment, each key field in the feature information set may be matched with each field in the third identification information set to obtain a matching result, and at this time, matching may be performed only by using the key field of the ticket without the title type in the feature information set. If the matching fails, the note type possibly indicating other note types which are not recorded with the characteristic information set can be manually processed so as to complete the characteristic information set.
In the embodiment of the specification, automatic classification of the bill images can be realized, the automation level of the system is improved, and manual intervention is reduced; for most scenes with the bill types of A, B, C1, due to the fact that the images are sliced, the calculated amount of optical character recognition is effectively reduced, and the classification efficiency is improved; the development and implementation period is short, the cost is low, the requirement for newly added support bills can be quickly responded, and the expandability is strong; the bill text information, the font size information and the text position information are comprehensively utilized, so that the robustness and the accuracy are high; the method has the advantages of obtaining better balance on accuracy, speed and robustness on the whole, and being simpler and more practical on scheme implementation and system maintenance.
Based on the same inventive concept, the embodiment of the present specification further provides a bill identifying device, as described in the following embodiments. Because the principle of the bill identifying device for solving the problems is similar to that of the bill identifying method, the implementation of the bill identifying device can refer to the implementation of the bill identifying method, and repeated details are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated. Fig. 3 is a block diagram of a structure of a bill identifying apparatus according to an embodiment of the present disclosure, and as shown in fig. 3, the bill identifying apparatus may include: a cutting module 301, an identification module 302, a matching module 303, and a determination module 304, which are described below.
The cutting module 301 may be configured to cut the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area;
the identification module 302 may be configured to identify an image of the target area by using an optical character recognition technique, so as to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification;
the matching module 303 may be configured to match each key field in the feature information set with a field in the target identification information set, so as to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type;
the determining module 304 may be configured to determine a bill type corresponding to the target image according to the matching result.
The embodiment of the present specification further provides an electronic device, which may specifically refer to a schematic structural diagram of an electronic device based on the ticket recognition method provided by the embodiment of the present specification, shown in fig. 4, where the electronic device may specifically include an input device 41, a processor 42, and a memory 43. The input device 41 may be specifically configured to input a target image. The processor 42 may be specifically configured to cut the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area; identifying the image of the target area by using an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification; matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type; and determining the bill type corresponding to the target image according to the matching result. The memory 43 may be specifically configured to store parameters such as a type of a bill corresponding to the target image.
In this embodiment, the input device may be one of the main apparatuses for information exchange between a user and a computer system. The input device may include a keyboard, a mouse, a camera, a scanner, a light pen, a handwriting input board, a voice input device, etc.; the input device is used to input raw data and a program for processing the data into the computer. The input device can also acquire and receive data transmitted by other modules, units and devices. The processor may be implemented in any suitable way. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The memory may in particular be a memory device used in modern information technology for storing information. The memory may include multiple levels, and in a digital system, the memory may be any memory as long as it can store binary data; in an integrated circuit, a circuit without a physical form and with a storage function is also called a memory, such as a RAM, a FIFO and the like; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card and the like.
In this embodiment, the functions and effects specifically realized by the electronic device can be explained by comparing with other embodiments, and are not described herein again.
Embodiments of the present specification further provide a computer storage medium based on a bill identification method, where the computer storage medium stores computer program instructions, and when the computer program instructions are executed, the computer storage medium may implement: cutting the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area; identifying the image of the target area by using an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification; matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type; and determining the bill type corresponding to the target image according to the matching result.
In this embodiment, the storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache (Cache), a Hard Disk Drive (HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects specifically realized by the program instructions stored in the computer storage medium can be explained by comparing with other embodiments, and are not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present specification described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed over a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different from that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present description are not limited to any specific combination of hardware and software.
Although the embodiments herein provide the method steps as described in the above embodiments or flowcharts, more or fewer steps may be included in the method based on conventional or non-inventive efforts. In the case of steps where no causal relationship is logically necessary, the order of execution of the steps is not limited to that provided by the embodiments of the present description. When the method is executed in an actual device or end product, the method can be executed sequentially or in parallel according to the embodiment or the method shown in the figure (for example, in the environment of a parallel processor or a multi-thread processing).
It is to be understood that the above description is intended to be illustrative, and not restrictive. Many embodiments and many applications other than the examples provided will be apparent to those of skill in the art upon reading the above description. The scope of embodiments of the present specification should, therefore, be determined not with reference to the above description, but should instead be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled.
The above description is only a preferred embodiment of the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure, and it will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.

Claims (12)

1. A method of bill identification, comprising:
cutting the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area;
identifying the image of the target area by using an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification;
matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type;
and determining the bill type corresponding to the target image according to the matching result.
2. The method of claim 1, wherein recognizing the image of the target area using optical character recognition techniques to obtain a set of target recognition information comprises:
recognizing the image of the target area by using an optical character recognition technology to obtain a first recognition information set; wherein, the first identification information set comprises at least one field obtained by identification;
determining the high-low sequence of each field in the target image according to the coordinate of each field in the first identification information set;
based on the high-low sequence of each field in the target image, sequencing each field from high to low to obtain a second identification information set;
and taking the second identification information set as a target identification information set.
3. The method according to claim 1, wherein the feature information set further includes coordinates corresponding to each key field, and the matching between each key field in the feature information set and a field in the target identification information set to obtain a matching result includes:
determining the matching degree of each primary key field in the characteristic information set and each field in the target identification information set based on an edit distance algorithm;
under the condition that the matching degree of a target primary key field and a first target field in the target identification information set is determined to be larger than or equal to a first preset threshold value, determining the coordinate of the first target field;
determining the coordinate matching degree according to the coordinates of the target primary key field and the coordinates of the first target field;
under the condition that the coordinate matching degree is greater than or equal to a second preset threshold value, determining whether the target primary key field has a related target secondary key field;
in the event of a determination of absence, determining that the target primary key field matches successfully with the first target field.
4. The method of claim 3, wherein determining the bill type corresponding to the target image according to the matching result comprises:
determining the bill type corresponding to the target primary key field based on the characteristic information set;
and taking the bill type corresponding to the target primary key field as the bill type corresponding to the target image.
5. The method of claim 3, after determining a matching degree of each primary key field in the feature information set with each field in the target identification information set based on an edit distance algorithm, further comprising:
under the condition that the matching degree of a target primary key field and a first target field in the target identification information set is determined to be not greater than a first preset threshold, determining the distance from an external matrix of each field in the target identification information set to an origin;
splicing two fields with the distance difference smaller than or equal to a third preset threshold value according to the sequence from high to low to obtain a preprocessed target identification information set;
determining the matching degree of each primary key field in the characteristic information set and each field in the preprocessed target identification information set based on an edit distance algorithm;
under the condition that the matching degree of the target primary key field and a second target field in the preprocessed target identification information set is determined to be larger than or equal to a second preset threshold value, determining the coordinate of the second target field;
determining the coordinate matching degree according to the coordinates of the target primary key field and the coordinates of the second target field;
under the condition that the coordinate matching degree is greater than or equal to a second preset threshold value, determining whether the target primary key field has a related target secondary key field;
in the event of a determination of absence, determining that the target primary key field matches the second target field successfully.
6. The method according to claim 5, further comprising, after determining a matching degree of each primary key field in the feature information set with each field in the preprocessed target identification information set:
under the condition that the matching degree of a target primary key field and a second target field in the preprocessed target identification information set is determined to be not more than a first preset threshold, full-text identification is carried out on the target image by using an optical character identification technology to obtain a third identification information set;
and matching each key field in the characteristic information set with each field in the third identification information set to obtain a matching result.
7. The method of claim 3, after determining whether there is an associated target secondary key field for the target primary key field, further comprising:
under the condition that the target identification information set exists, determining the matching degree of a target secondary key field associated with the target primary key field and each field in the target identification information set based on an editing distance algorithm;
under the condition that the matching degree of a third target field and the target secondary key field in the target identification information set is determined to be greater than or equal to a first preset threshold value, determining the coordinate of the third target field;
determining the coordinate matching degree according to the coordinates of the target secondary key field and the coordinates of the third target field;
under the condition that the coordinate matching degree is greater than or equal to a third preset threshold value, determining whether the target secondary key field has a related target tertiary key field;
in the event that the determination is not present, determining that the target secondary key field matches the third target field successfully.
8. The method of claim 7, after determining whether there is an associated target tertiary key field for the target secondary key field, further comprising:
under the condition that the target secondary key field is determined to have the associated target tertiary key field, full-text recognition is carried out on the target image by utilizing an optical character recognition technology to obtain a third recognition information set;
and matching the target tertiary key field with each field in the third identification information set to obtain a matching result.
9. The method of claim 3, 5 or 7, further comprising, after determining the degree of coordinate match:
under the condition that the coordinate matching degree is smaller than a second preset threshold value, determining a comprehensive matching degree according to the matching degree of the fields and the coordinate matching degree;
determining that the matching fails under the condition that the comprehensive matching degree is less than or equal to a fourth preset threshold value;
carrying out full-text recognition on the target image by using an optical character recognition technology to obtain a third recognition information set;
and matching the key fields in the characteristic information set with the fields in the third identification information set to obtain a matching result.
10. A bill identifying apparatus, comprising:
the cutting module is used for cutting the target image to obtain an image of a target area in the target image; the target area is a part of the target image whole area, wherein a title is recorded in the target image whole area;
the identification module is used for identifying the image of the target area by utilizing an optical character identification technology to obtain a target identification information set; wherein, the target identification information set comprises at least one field obtained by identification;
the matching module is used for matching each key field in the characteristic information set with the field in the target identification information set to obtain a matching result; the characteristic information set comprises a plurality of groups of data, and each group of data comprises a key field of a title and a corresponding bill type;
and the determining module is used for determining the bill type corresponding to the target image according to the matching result.
11. A bill identification device comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 9.
12. A computer-readable storage medium having stored thereon computer instructions which, when executed, implement the steps of the method of any one of claims 1 to 9.
CN202110591829.3A 2021-05-28 2021-05-28 Bill identification method, device and equipment Pending CN113269101A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110591829.3A CN113269101A (en) 2021-05-28 2021-05-28 Bill identification method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110591829.3A CN113269101A (en) 2021-05-28 2021-05-28 Bill identification method, device and equipment

Publications (1)

Publication Number Publication Date
CN113269101A true CN113269101A (en) 2021-08-17

Family

ID=77233384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110591829.3A Pending CN113269101A (en) 2021-05-28 2021-05-28 Bill identification method, device and equipment

Country Status (1)

Country Link
CN (1) CN113269101A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116778623A (en) * 2023-08-16 2023-09-19 南方电网调峰调频发电有限公司信息通信分公司 Safety early warning device for operation and maintenance information of power grid and operation method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116778623A (en) * 2023-08-16 2023-09-19 南方电网调峰调频发电有限公司信息通信分公司 Safety early warning device for operation and maintenance information of power grid and operation method thereof
CN116778623B (en) * 2023-08-16 2023-11-24 南方电网调峰调频发电有限公司信息通信分公司 Safety early warning device for operation and maintenance information of power grid and operation method thereof

Similar Documents

Publication Publication Date Title
US10885323B2 (en) Digital image-based document digitization using a graph model
EP1016033B1 (en) Automatic language identification system for multilingual optical character recognition
e Silva et al. Design of an end-to-end method to extract information from tables
US9384389B1 (en) Detecting errors in recognized text
US20140369602A1 (en) Methods for Automatic Structured Extraction of Data in OCR Documents Having Tabular Data
US20060036649A1 (en) Index extraction from documents
US20070065011A1 (en) Method and system for collecting data from a plurality of machine readable documents
JP4661921B2 (en) Document processing apparatus and program
WO2007080642A1 (en) Sheet slip processing program and sheet slip program device
GB2417109A (en) Automatic document indexing and classification system
JP6055297B2 (en) Character recognition apparatus and method, and character recognition program
CN112508011A (en) OCR (optical character recognition) method and device based on neural network
CN110866116A (en) Policy document processing method and device, storage medium and electronic equipment
CN105740857A (en) OCR based automatic acquisition and recognition system for fast pencil-and-paper voting result
CN113469005A (en) Recognition method of bank receipt, related device and storage medium
CN113269101A (en) Bill identification method, device and equipment
JPH08161436A (en) Receipt reader
CN112699671A (en) Language marking method and device, computer equipment and storage medium
US20230315799A1 (en) Method and system for extracting information from input document comprising multi-format information
GB2417108A (en) Index extraction using a plurality of indexing entities
CN116403233A (en) Image positioning and identifying method based on digitized archives
CN115294593A (en) Image information extraction method and device, computer equipment and storage medium
US20220138259A1 (en) Automated document intake system
CN112541505B (en) Text recognition method, text recognition device and computer-readable storage medium
CN115880702A (en) Data processing method, device, equipment, program product 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