A method, device and medium for identifying custom bills

Through custom bill recognition methods, custom bill recognition templates are built using bill template images and recognition model libraries, which solves the efficiency and accuracy problems of custom document recognition and summary, and achieves rapid identification and efficient workflow.

CN113989817BActive Publication Date: 2025-02-25INSPUR GENERSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111324906.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2025-02-25
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively identify and summarize custom documents, resulting in inaccurate records and waste of human resources. At the same time, the period of developing custom document recognition models is relatively long, making it difficult to quickly adapt to multiple custom document types.

Method used

A custom bill recognition method is proposed. By receiving the bill template image, determining the reference field and recognition field area, selecting the specified recognition model from the recognition model library, and matching high-frequency vocabulary to correct the recognition results, building a custom bill recognition template and Carry out classified storage, supporting rapid loading and identification processing.

Benefits of technology

It realizes the rapid establishment of custom ticket recognition templates, improves work efficiency, shortens development time, ensures recognition accuracy, and reduces human resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989817B_ABST
    Figure CN113989817B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and medium for identifying a custom bill, the method comprising: receiving a bill template image, and determining a reference field and an identification field area according to the bill template image; and determining a corresponding designated identification model from a recognition model library, and matching corresponding high-frequency words, so as to correct the identification result through high-frequency words; constructing a custom bill identification template, and classifying and storing the custom bill identification template; receiving an identification service request, and loading a custom bill identification template at a corresponding startup port according to the identification service request; receiving a custom bill, and identifying and processing the custom bill image through the custom bill identification template to obtain an identification result. On the basis of ensuring a certain recognition accuracy, the development time of such bills is greatly reduced, and users can quickly obtain the required recognition template.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition, and in particular to a method, device and medium for identifying a custom bill. Background Art

[0002] With the development of modern enterprises, more and more enterprises will design a variety of custom documents for internal records or reporting according to their own business or administrative processes. There are many custom documents that need to be filled out in enterprises. When staff summarize the collected custom documents, they usually record them by hand, which can easily lead to inaccurate summary records and waste human resources.

[0003] Therefore, enterprises usually use document recognition technology to replace manpower to identify and summarize documents. However, the existing technology that can realize document recognition can only support the recognition of fixed types of documents, which is difficult to meet actual needs.

[0004] In addition, the recognition model development platform has a long development cycle when developing recognition models corresponding to custom documents. When an enterprise has many types of custom documents, it is difficult for the development platform to quickly develop recognition models corresponding to custom documents. Summary of the invention

[0005] In order to solve the above problems, that is, to solve the problem that the staff summarizes the documents by handwriting, which easily leads to inaccurate summary records and wastes human resources, and the problem that it is difficult to meet the actual needs by identifying custom documents through intelligent recognition, and the development platform is difficult to develop recognition models corresponding to a large number of custom documents in a short time, the present application proposes a method, device and medium for identifying custom documents, including: on the one hand, the present application provides a method for identifying custom documents, including: receiving a bill template image, and determining a corresponding reference field and an identification field area according to the bill template image; determining a corresponding specified recognition model from a recognition model library according to the reference field and the identification field area, and Matching corresponding high-frequency words for the designated recognition model to correct the recognition result through the high-frequency words, wherein the high-frequency words are words whose frequency of appearance in the reference field and the recognition field area is greater than a preset threshold; constructing a custom bill recognition template according to the bill template image, the reference field, the recognition field area, the designated recognition model and the high-frequency words, and classifying and storing the custom bill recognition template; receiving a recognition service request, and according to the recognition service request, loading the custom bill recognition template at the corresponding startup port; receiving a custom bill image, and performing recognition processing on the custom bill image through the custom bill recognition template to obtain a recognition result.

[0006] In one example, a custom bill image is received, and the custom bill image is recognized and processed by the custom bill recognition template. Before obtaining the recognition result, the method also includes: performing image optimization processing on the custom bill image, and the image optimization processing at least includes: denoising, sharpening, adjusting brightness, and smooth scaling; performing a first position detection on the custom bill image, and rotating the custom bill by a first preset angle according to the detection result; performing text area detection on the custom bill image to obtain multiple text areas, and cropping the custom bill image according to the multiple text areas to obtain multiple sub-images of the same number as the multiple text areas; performing a second position detection on the multiple sub-images, and rotating the multiple sub-images by a second preset angle according to the detection result; determining the blank areas corresponding to the multiple sub-images respectively, and cropping the blank areas, the blank areas being areas that do not contain text.

[0007] In one example, a custom bill image is received, and the custom bill image is recognized and processed by the custom bill recognition template to obtain a recognition result, which specifically includes: receiving a custom bill image, and performing a first recognition on the custom bill image by the specified recognition model to obtain a plurality of first recognized fields; comparing the plurality of first recognized fields with the reference field to obtain a plurality of identical fields, and grouping the plurality of identical fields according to a preset allocation strategy to obtain a plurality of groups of identical fields; performing perspective correction processing on the plurality of groups of identical fields respectively according to a preset reference point in the reference field, and integrating a plurality of perspective results to obtain a custom bill image after perspective processing; constructing the same coordinate system for the bill template image and the custom bill image after perspective processing, and determining the area to be recognized in the custom bill image after perspective processing by the coordinates of the recognition field area in the bill template image; performing a second recognition on the area to be recognized by the specified recognition model to obtain a plurality of second recognized fields; correcting the second recognized fields according to the high-frequency vocabulary to obtain a recognition result.

[0008] In one example, after constructing a custom ticket recognition template based on the ticket template image, the reference field, the recognition field area, the designated recognition model and the high-frequency vocabulary, and classifying and storing the custom ticket recognition template, the method further includes: receiving a deployment instruction, and reading the custom ticket recognition template according to the deployment instruction to generate a designated recognition model configuration file and a recognition service configuration file, wherein the designated recognition model configuration file at least includes parameter information of the designated recognition model, and the recognition service configuration file at least includes parameter information corresponding to the ticket template image, the reference field, the recognition field area and the high-frequency field respectively; obtaining a startup port of the custom ticket recognition template according to a pre-stored port startup strategy, and storing the startup port in the designated recognition model configuration file and the recognition service configuration file; obtaining the required video memory of the designated recognition model according to the designated recognition model configuration file, and adding the call instruction corresponding to the video memory and the file location of the designated recognition model configuration file to the first startup script; adding the file location of the recognition service configuration file to the second startup script.

[0009] In one example, receiving an identification service request, and loading the custom ticket identification template at a corresponding startup port according to the identification service request, specifically includes: receiving an identification service request, and determining the corresponding custom ticket identification template according to the identification service request; running the first startup script and the second startup script; allocating resources of the video memory to the startup port, and loading the specified recognition model, the ticket template image, the reference field, the recognition field area, and the high-frequency field at the startup port.

[0010] In one example, after adding the file location of the identification service configuration file to the second startup script, the method further includes: receiving a stop service instruction, and deleting the first script and the second script according to the stop service instruction, and deleting the contents in the identification model configuration file and the identification service configuration file; according to the stop service instruction, deleting the classified and stored custom ticket recognition template from the database to release storage resources.

[0011] In one example, after adding the file location of the recognition service configuration file to the second startup script, the method further includes: receiving a service export instruction, and packaging the recognition model configuration file, the recognition service configuration file, the first startup script, and the second startup script according to the service export instruction to obtain a packaged startup file; determining a file download interface, and loading the packaged startup file to the file download interface.

[0012] In one example, the method also includes: obtaining the occupancy of memory and video memory, obtaining the running number of the specified recognition model, and obtaining the running status of the custom ticket recognition template; constructing a dynamic chart based on the occupancy, the running number and the running status, and sending the dynamic chart to the front-end device for display through the front-end device.

[0013] On the other hand, the present application also provides a custom bill recognition device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the following instructions: receiving a bill template image, and determining a corresponding reference field and an identification field area according to the bill template image; determining a corresponding designated recognition model from a recognition model library according to the reference field and the identification field area, and matching corresponding high-frequency words for the designated recognition model, so as to correct the recognition result through the high-frequency words, wherein the high-frequency words are words whose frequency of appearance in the reference field and the identification field area is greater than a preset threshold; constructing a custom bill recognition template according to the bill template image, the reference field, the identification field area, the designated recognition model and the high-frequency words, and classifying and storing the custom bill recognition template; receiving a recognition service request, and according to the recognition service request, loading the custom bill recognition template at the corresponding startup port; receiving a custom bill image, and performing recognition processing on the custom bill image through the custom bill recognition template to obtain a recognition result.

[0014] In one example, the present application also provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to: receive a bill template image, and determine a corresponding reference field and an identification field area according to the bill template image; determine a corresponding designated recognition model from a recognition model library according to the reference field and the identification field area, and match corresponding high-frequency words for the designated recognition model, so as to correct the recognition result through the high-frequency words, wherein the high-frequency words are words whose frequency of appearance in the reference field and the identification field area is greater than a preset threshold; construct a custom bill recognition template according to the bill template image, the reference field, the identification field area, the designated recognition model and the high-frequency words, and classify and store the custom bill recognition template; receive a recognition service request, and load the custom bill recognition template at the corresponding startup port according to the recognition service request; receive a custom bill image, and perform recognition processing on the custom bill image through the custom bill recognition template to obtain a recognition result.

[0015] The method, device and medium for identifying a custom bill proposed in this application can bring the following beneficial effects: providing a method for establishing a custom bill identification template for users or enterprises, ensuring that users can quickly formulate corresponding identification templates according to their needs, and improving the work efficiency of users. At the same time, for such bills, on the basis of ensuring a certain recognition accuracy, the development time is greatly reduced, and users can quickly obtain the required recognition template. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 A schematic diagram of a process for identifying a custom bill in an embodiment of the present application;

[0018] Figure 2 This is a schematic diagram of a custom ticket recognition device in an embodiment of the present application. DETAILED DESCRIPTION

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

[0020] First of all, it should be noted that the method for identifying a custom ticket described in this application can be stored in a system or server in the form of a program or algorithm, and can support the program or algorithm through corresponding components in the hardware terminal where the system or server is located, such as a processor, memory, communication module, etc. In the embodiment of the present application, the server is used as an example for explanation, and the server can support the program or algorithm through the hardware terminal where it is located. At the same time, the user can log in to the server through the corresponding front-end device and realize information interaction with the server. The front-end device includes but is not limited to: mobile phones, tablet computers, personal computers and other hardware devices with corresponding computing power. Users can realize information interaction with the server through the built-in system, APP or WEB page of the front-end device, thereby realizing automatic recognition of custom tickets.

[0021] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0022] like Figure 1 As shown, a method for identifying a custom ticket provided in an embodiment of the present application includes:

[0023] S101: receiving a bill template image, and determining corresponding reference fields and identifying field areas according to the bill template image.

[0024] Specifically, the server receives a bill template image. The bill template image is usually uploaded by a user and is used to provide template support for subsequent custom bill recognition. Therefore, the bill template image here and the custom bill image below are the same custom bill.

[0025] To ensure the accuracy of the subsequent process, users need to ensure that the uploaded invoice template image is clear, complete, unbent, and undamaged. After receiving the invoice template image, the server will pre-process the invoice template image. The pre-processing process includes but is not limited to: rotation, scaling, cropping, and perspective to ensure that the invoice template image can meet the clarity requirements.

[0026] Furthermore, the server displays the pre-processed bill template image through the front-end device so that the user can view and operate it. The user can select the image, and the selected content includes the reference field and the identification field area. The reference field is the text content with a fixed position in the custom bill of the same format, for example, the header in the value-added tax invoice. To ensure the accuracy of the subsequent process, at least four reference fields are selected, and the four corners of the image are selected as much as possible.

[0027] At the same time, the user needs to select the recognition field area, which is the content filled in by the user, that is, the content that needs to be recognized.

[0028] After the user's selection, the system can determine the reference field and identification field area corresponding to the bill template image.

[0029] S102: According to the reference field and the recognition field area, determine the corresponding designated recognition model from the recognition model library, and match the corresponding high-frequency vocabulary for the designated recognition model to correct the recognition result through the high-frequency vocabulary, wherein the high-frequency vocabulary is the vocabulary whose appearance frequency in the reference field and the recognition field area is greater than a preset threshold.

[0030] Specifically, a variety of recognition models are pre-stored in the recognition model library for recognizing different types of characters, including but not limited to: Chinese character recognition, number recognition, English recognition, Russian recognition, etc. In addition, in the embodiment of the present application, the recognition model is explained by taking the OCR (optical character recognition) model as an example. To avoid excessive elaboration, the recognition model mentioned below defaults to the OCR model.

[0031] The user can select the corresponding designated recognition model from the recognition model library according to the character content in the reference field and the recognition field area. Since the character content in the reference field and the recognition field area may contain multiple types, the number of designated recognition models can also correspond to multiple.

[0032] Based on the user's selection, the server can determine the corresponding designated recognition model from the recognition model library according to the reference field and the recognition field area.

[0033] In addition, users can also enter high-frequency words by themselves. High-frequency words refer to words that appear frequently in the custom bills of this format, that is, words that appear more frequently in the reference field and the recognition field area than the preset threshold. The server can match the high-frequency words with the specified recognition model to correct the recognition results during the recognition process or after the recognition is completed to ensure the accuracy of the recognition results.

[0034] S103: constructing a custom bill recognition template according to the bill template image, the reference field, the recognition field area, the designated recognition model and the high-frequency vocabulary, and classifying and storing the custom bill recognition template.

[0035] Specifically, the server can construct a custom bill recognition template through the above-determined bill template image, reference field, recognition field area, specified recognition model and high-frequency vocabulary. The custom bill recognition template is specifically used for recognizing custom bills of this type.

[0036] The custom bill recognition template generated by the above technical solution has a short creation time, high accuracy, and simple user-side operation. Users can instantly create custom bill recognition templates according to their needs and use the templates to recognize custom bills, which greatly improves work efficiency. At the same time, due to the modularization and customization of custom bill recognition templates, the economic cost of users can also be greatly reduced. There is no need to develop another set of recognition technology for custom bills, which ensures the flexibility and timeliness of model deployment.

[0037] The server stores the custom ticket identification template in the key-value format. It should be noted that key-value is a classified storage file format that has the effect of storing large amounts of data and fast query speed.

[0038] After the server has classified and stored the custom ticket recognition template, the user can retrieve the custom ticket recognition template and perform corresponding tests. If the test results are satisfactory, the deployment instructions can be issued through the front-end device, and the server can deploy the custom ticket recognition template according to the deployment instructions.

[0039] The deployment process specifically includes:

[0040] The server receives the deployment instruction and reads the custom bill recognition template stored in each database according to the deployment instruction to generate a specified recognition model configuration file and a recognition service configuration file. The specified recognition model configuration file at least includes parameter information of the specified recognition model, and the recognition service configuration file at least includes parameter information corresponding to the bill template image, reference field, recognition field area, and high-frequency field.

[0041] The server has a built-in port startup strategy. By combining the custom ticket recognition template with the port startup strategy, the startup port of the custom ticket recognition template can be obtained through the corresponding algorithm, and the startup port can be stored in the specified recognition model configuration file and the recognition service configuration file.

[0042] Furthermore, the server obtains the required video memory for the specified model based on the specified recognition model configuration file, and adds the call instructions corresponding to the video memory and the file location of the specified recognition model configuration file to the first startup script, so that when the first startup script is started, the corresponding video memory resources are called to the startup port, and the specified recognition model is loaded to the startup port.

[0043] In addition, the system adds the file location of the identification service configuration file to the second startup script so that when the second startup script is started, the ticket template image, reference field, identification field area and high-frequency field are loaded into the startup port.

[0044] In addition, it should be noted that another implementation method of the present application is: a server configuration file is also provided in the server, which stores information such as the version number of the specified recognition model and the legitimacy proof of the server's resource retrieval. In addition, the above-mentioned startup port is first stored in the server configuration file. After the first startup script is started, the script corresponding to the server configuration file will synchronously start the mirror script that matches the recognition service configuration file. The startup port can be synchronized to the recognition service configuration file through the mirror script. At the same time, the recognition service configuration file can also load the ticket template image, reference field, recognition field area and high-frequency field to the startup port through the mirror script.

[0045] In addition, after adding the file location of the identification service configuration file to the second startup script, the user can also issue a stop service instruction as needed.

[0046] The server receives the stop service instruction, and deletes the first script and the second script according to the stop service instruction, and deletes the contents in the recognition model configuration file and the recognition service configuration file to release the computing resources of the server.

[0047] At the same time, the server can also delete the classified and stored custom bill recognition templates from the database according to the stop service instruction, including deleting the specified recognition model, bill template image, reference field, recognition field area and high-frequency words from the respective classified storage databases to release storage resources.

[0048] In addition, after the server adds the file location of the identification service configuration file to the second startup script, the user can also issue a service export instruction to export the identification service in the form of a package file for user reference.

[0049] Specifically, the system receives a service export service instruction, and packages the recognition model configuration file, the recognition service configuration file, the first startup script, and the second startup script according to the service export instruction to obtain a packaged startup file.

[0050] The server determines the file download interface corresponding to the user, and loads the packaged startup file to the file download interface for the user to download and use.

[0051] In this way, users can use the packaged startup file as an identification file package for custom tickets, apply it to other terminals, or make targeted adjustments, ensuring user flexibility.

[0052] S104: receiving an identification service request, and loading the custom bill identification template at a corresponding start port according to the identification service request.

[0053] Specifically, the server receives the identification service request, and determines a corresponding custom bill identification template according to the identification service request.

[0054] The server runs the first startup script and the second startup script.

[0055] The server allocates video memory resources corresponding to the startup port according to the video memory call instructions in the first startup script, and loads the specified recognition model, bill template image, reference field, recognition field area and high-frequency field at the startup port to prepare for subsequent recognition services.

[0056] S105: receiving a custom receipt image, and performing recognition processing on the custom receipt image using the custom receipt recognition template to obtain a recognition result.

[0057] Before the server performs recognition processing on the custom bill image through the custom bill recognition template, in order to ensure the accuracy of the recognition result, it is also necessary to perform targeted processing on the custom bill image.

[0058] Specifically include:

[0059] The customized receipt image is optimized, and the image optimization processing at least includes: denoising, sharpening, adjusting brightness, and smooth scaling.

[0060] Since custom receipts are uploaded by users, the image quality and clarity are difficult to guarantee. To avoid affecting the subsequent recognition process, image optimization processing is used to make custom receipts have higher clarity.

[0061] The custom receipts uploaded by users may contain vertical images, oblique images, or reverse images. The recognition model has a low accuracy rate when recognizing fields at these angles. To ensure accuracy, the server can perform a first position detection on the custom receipt. Based on the results of the first position detection, it can be determined whether the custom receipt is facing upward. If there is an angle deviation, the custom receipt can be rotated by a first preset angle to make it face upward.

[0062] The adjustment here is not a high-precision adjustment, so the first preset angle is set to include 0°, 90°, 180°, and 270°.

[0063] Furthermore, the server performs text region detection on the custom receipt image to determine multiple text regions in the custom receipt image, where the multiple text regions are all text contents in the custom receipt. The server crops the custom receipt image according to the multiple text regions to obtain multiple sub-images having the same number as the multiple text regions.

[0064] Since the recognition process is to identify the text area, cropping the image is conducive to fine-tuning and identifying each text area, thereby ensuring the accuracy of recognition.

[0065] The server performs a second position detection on the multiple sub-images to determine whether any of the multiple sub-images is facing upward, and performs a second preset angle rotation processing on the multiple sub-images according to the detection result. Since the adjustment accuracy here is relatively high, the second preset angle can be set in a gradient of 5°, which further improves the recognition accuracy of the sub-images.

[0066] Furthermore, the server determines the blank areas corresponding to the multiple sub-images, and crops the blank areas, where the blank areas are areas that do not contain text. By cropping the blank areas, it is possible to ensure that the text part in the sub-image occupies the maximum area, making it easier for the specified recognition model to obtain more accurate recognition results.

[0067] After the server has completed the above-mentioned targeted processing on the custom bill image, it can start recognition.

[0068] Specifically:

[0069] The server receives the custom receipt image, and performs a first recognition on the custom receipt image by using a specified recognition model to obtain a plurality of first recognized fields. More specifically, the server performs a first recognition on the plurality of sub-images.

[0070] There may be a problem of low accuracy in multiple recognized fields. The main source of this problem is that the orientation of the custom bill image is still problematic. Its orientation may be positive, but not completely upward. To solve this problem, the custom bill needs to be perspective processed so that its display orientation is completely upward.

[0071] Specifically, the server compares the multiple first identified fields with the reference fields to obtain multiple identical fields that are completely identical to the reference fields. The number of identical fields here should be at least four. If the number is greater than four, the multiple identical fields can be grouped according to a preset allocation strategy to obtain multiple groups of identical fields. For example, if there are five identical fields, there can be two groups that are not completely identical.

[0072] Determine the preset reference point in the reference field. In the embodiment of the present application, a point in the reference field at the upper left corner of the bill template image is used as the preset reference point. By placing the bill template image at the bottom layer and the custom template image at the upper layer, the custom bill image is stretched and translated according to the preset reference point in the reference field so that the same field coincides with the reference field, thereby making the custom bill image face up exactly the same as the bill template. This process is called perspective correction.

[0073] Specifically, the server performs perspective correction processing on multiple groups of identical fields according to preset reference points in the reference field, that is, performs the same number of perspective correction processing according to the number of groups to obtain multiple perspective results, and integrates the multiple perspective results to obtain a custom bill image after perspective processing. In this way, the recognition accuracy is further improved.

[0074] Furthermore, the server constructs the same coordinate system for the bill template image and the custom bill image after perspective processing, and determines the area to be identified in the custom bill image after perspective processing by identifying the coordinates of the field area in the bill template image.

[0075] The second recognition is performed on the area to be recognized by specifying the recognition model to obtain a plurality of second recognized fields, and the second recognized fields are corrected according to high-frequency words to obtain a recognition result.

[0076] Through the above technical solution, the accuracy of the recognition results is guaranteed to the greatest extent, the recognition efficiency is improved, and human resources are saved.

[0077] In one embodiment, the server may also obtain the occupancy of the memory and the video memory, obtain the number of operations of the specified recognition model, and obtain the operation status of the custom bill recognition template.

[0078] According to the above occupancy, running quantity and running status, a dynamic chart is constructed and sent to the front-end device for display.

[0079] In one embodiment, after receiving a custom receipt image and performing recognition processing on the custom receipt using the custom receipt recognition template and obtaining a recognition result, the method further includes:

[0080] Performing accuracy evaluation on the recognition result to obtain an evaluation result, and correcting the recognition result according to the evaluation result to obtain a corrected recognition result;

[0081] Classifying the corrected recognition results to obtain classification results, and determining a designated recognition model corresponding to the classification results according to the classification results;

[0082] The recognition result of this type and the custom bill image are packaged and input into the corresponding designated recognition model as a training package, so as to retrain the corresponding designated recognition model through the training package to obtain an updated recognition model;

[0083] The corresponding designated recognition model is replaced with the updated recognition model.

[0084] In one embodiment, Figure 2 As shown, the present application also provides a customized bill recognition device, including:

[0085] at least one processor; and,

[0086] a memory communicatively connected to the at least one processor; wherein,

[0087] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the following instructions:

[0088] Receiving a bill template image, and determining corresponding reference fields and identifying field areas according to the bill template image;

[0089] According to the reference field and the recognition field area, a corresponding designated recognition model is determined from a recognition model library, and a corresponding high-frequency word is matched for the designated recognition model, so as to correct the recognition result by the high-frequency word, wherein the high-frequency word is a word whose appearance frequency in the reference field and the recognition field area is greater than a preset threshold;

[0090] Constructing a custom bill recognition template according to the bill template image, the reference field, the recognition field area, the designated recognition model, and the high-frequency vocabulary, and classifying and storing the custom bill recognition template;

[0091] Receiving an identification service request, and loading the custom ticket identification template at a corresponding start port according to the identification service request;

[0092] A custom bill image is received, and recognition processing is performed on the custom bill image using the custom bill recognition template to obtain a recognition result.

[0093] In one embodiment, the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:

[0094] Receiving a bill template image, and determining corresponding reference fields and identifying field areas according to the bill template image;

[0095] According to the reference field and the recognition field area, a corresponding designated recognition model is determined from a recognition model library, and a corresponding high-frequency word is matched for the designated recognition model, so as to correct the recognition result by the high-frequency word, wherein the high-frequency word is a word whose appearance frequency in the reference field and the recognition field area is greater than a preset threshold;

[0096] Constructing a custom bill recognition template according to the bill template image, the reference field, the recognition field area, the designated recognition model, and the high-frequency vocabulary, and classifying and storing the custom bill recognition template;

[0097] Receiving an identification service request, and loading the custom ticket identification template at a corresponding start port according to the identification service request;

[0098] A custom bill image is received, and recognition processing is performed on the custom bill image using the custom bill recognition template to obtain a recognition result.

[0099] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0100] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0103] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0105] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0106] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0107] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0108] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0109] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for identifying a custom bill, characterized in that: include: Receiving a bill template image, and determining corresponding reference fields and identifying field areas according to the bill template image; According to the reference field and the recognition field area, a corresponding designated recognition model is determined from a recognition model library, and a corresponding high-frequency word is matched for the designated recognition model, so as to correct the recognition result by the high-frequency word, wherein the high-frequency word is a word whose appearance frequency in the reference field and the recognition field area is greater than a preset threshold; Constructing a custom bill recognition template according to the bill template image, the reference field, the recognition field area, the designated recognition model, and the high-frequency vocabulary, and classifying and storing the custom bill recognition template; Receiving an identification service request, and loading the custom ticket identification template at a corresponding start port according to the identification service request; Receiving a custom bill image, and performing recognition processing on the custom bill image using the custom bill recognition template to obtain a recognition result; Before receiving a custom receipt image and performing recognition processing on the custom receipt image using the custom receipt recognition template to obtain a recognition result, the method further includes: Performing image optimization processing on the custom receipt image, wherein the image optimization processing at least includes: denoising, sharpening, adjusting brightness, and smoothing scaling; Performing a first position detection on the custom bill image, and performing a first preset angle rotation processing on the custom bill according to the detection result; Performing text region detection on the custom receipt image to obtain a plurality of text regions, and cropping the custom receipt image according to the plurality of text regions to obtain a plurality of sub-images having the same number as the plurality of text regions; Performing a second position detection on the multiple sub-images, and performing a second preset angle rotation process on the multiple sub-images according to the detection result; Determine blank areas corresponding to the multiple sub-images respectively, and crop the blank areas, wherein the blank areas are areas that do not contain text; Receiving a custom receipt image, and performing recognition processing on the custom receipt image using the custom receipt recognition template to obtain a recognition result, specifically including: Accepting a custom receipt image, and performing a first recognition on the custom receipt image through the specified recognition model to obtain a plurality of first recognized fields; Comparing the plurality of first identified fields with the reference field to obtain a plurality of identical fields, and grouping the plurality of identical fields according to a preset allocation strategy to obtain a plurality of groups of identical fields; Performing perspective correction processing on the plurality of groups of identical fields respectively according to preset reference points in the reference fields, and integrating the plurality of perspective results to obtain a customized bill image after perspective processing; Constructing the same coordinate system for the bill template image and the custom bill image after perspective processing, and determining the area to be identified in the custom bill image after perspective processing by using the coordinates of the identification field area in the bill template image; Performing a second recognition on the area to be recognized by using the specified recognition model to obtain a plurality of second recognized fields; Correcting the second recognized field according to the high-frequency vocabulary to obtain a recognition result; According to the bill template image, the reference field, the identification field area, the designated identification model and the high-frequency vocabulary, a custom bill identification template is constructed, and after the custom bill identification template is classified and stored, the method further includes: Receive a deployment instruction, and read the custom bill recognition template according to the deployment instruction to generate a specified recognition model configuration file and a recognition service configuration file, wherein the specified recognition model configuration file at least includes parameter information of the specified recognition model, and the recognition service configuration file at least includes parameter information corresponding to the bill template image, the reference field, the recognition field area, and the high-frequency field respectively; According to the pre-stored port startup strategy, the startup port of the custom ticket recognition template is obtained, and the startup port is stored in the specified recognition model configuration file and the recognition service configuration file; Obtaining the required video memory of the specified recognition model according to the specified recognition model configuration file, and adding the call instruction corresponding to the video memory and the file location of the specified recognition model configuration file to the first startup script; The file location of the identification service configuration file is added to the second startup script.

2. A method for identifying a custom ticket according to claim 1, characterized in that: Receiving an identification service request, and loading the custom ticket identification template at a corresponding startup port according to the identification service request, specifically including: Receiving an identification service request, and determining the corresponding custom bill identification template according to the identification service request; Run the first startup script and the second startup script; The resources of the video memory are allocated to the startup port, and the designated recognition model, the bill template image, the reference field, the recognition field area and the high-frequency field are loaded at the startup port.

3. A method for identifying a custom ticket according to claim 1, characterized in that: After adding the file location of the identification service configuration file to the second startup script, the method further includes: receiving a stop service instruction, and deleting the first script and the second script according to the stop service instruction, and deleting the contents in the recognition model configuration file and the recognition service configuration file; According to the stop service instruction, the custom ticket identification template after the classification storage is deleted from the database to release the storage resources.

4. A method for identifying a custom ticket according to claim 1, characterized in that: After adding the file location of the identification service configuration file to the second startup script, the method further includes: receiving a service export instruction, and packaging the recognition model configuration file, the recognition service configuration file, the first startup script, and the second startup script according to the service export instruction to obtain a packaged startup file; A file download interface is determined, and the packaged startup file is loaded into the file download interface.

5. A method for identifying a custom ticket according to claim 1, characterized in that: The method further comprises: Obtain the occupancy of the memory and video memory, obtain the number of operations of the specified recognition model, and obtain the operation status of the custom bill recognition template; A dynamic chart is constructed according to the occupancy situation, the running quantity and the running status, and the dynamic chart is sent to a front-end device for display through the front-end device.

6. A device for identifying a custom ticket, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for identifying a customized ticket as described in any one of claims 1-5.

7. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: execute a method for identifying a custom ticket as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Bill identification method based on OCR, equipment, storage medium and device

    CN111444793A

  • Invoice identification method and device, and medium

    CN112085029A