Receipt recognition model training method, receipt recognition method and related equipment
By iterating through multiple training sets and using data augmentation techniques, a high-quality target training set is constructed. Multiple recognition models are then fine-tuned, solving the problem of existing receipt recognition methods relying on manually defined rule templates. This improves the accuracy and adaptability of receipt recognition and reduces costs.
Patent Information
- Application Number
- CN202511519080.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-01-16
AI Technical Summary
Existing receipt recognition methods rely on manually defined rule templates, which results in a large workload and difficulty in covering all receipt formats, leading to failure in recognizing new receipt formats and low accuracy.
By iterating through multiple training sets and using data augmentation techniques, a basic dataset covering various levels of completeness and categories of information is constructed. Multiple recognition models are then fine-tuned to reduce reliance on manually defined templates and improve the model's adaptability to different receipt formats and recognition accuracy.
It improves the accuracy and robustness of receipt identification, reduces development and maintenance costs, and enhances the system's usability and customer acceptance.
Smart Images

Figure CN121354130A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of return slip recognition, and more particularly, to a return slip recognition model training method, a return slip recognition method, a return slip recognition model training device, a return slip recognition device, an electronic device, a computer readable storage medium, and a computer program product containing instructions. BACKGROUND
[0002] With the development of financial business, the quantity and diversity of bank return slips are increasing, and the demand for return slip recognition is also increasing.
[0003] The existing return slip recognition method is to first convert the return slip into a picture, and then extract structured text information through OCR technology. Then, corresponding rule templates are set for return slips of different banks in the system, and the program reads these rule templates to complete return slip segmentation and key information extraction.
[0004] However, the existing return slip recognition method relies on manual collection and definition of a large number of rule templates, which is labor-intensive and difficult to cover all return slip formats, resulting in recognition failure when new formats of return slips appear. Therefore, the accuracy of return slip recognition is low. SUMMARY
[0005] Embodiments of the present application provide a return slip recognition model training method, a return slip recognition method, a return slip recognition model training device, a return slip recognition device, an electronic device, a computer readable storage medium, and a computer program product containing instructions, which can train a return slip recognition model while improving the accuracy of return slip recognition.
[0006] In a first aspect, embodiments of the present application provide a return slip recognition model training method, comprising:
[0007] Obtain a plurality of first original return slip samples and an initial return slip training set, the first original return slip samples being original return slip samples corresponding to the same recognition information of a plurality of recognition models, the original return slip samples being labeled with corresponding recognition information, and the initial return slip training set including a plurality of initial return slip samples corresponding to each complete degree category of recognition information, the initial return slip samples being labeled with initial recognition information;
[0008] Identify the plurality of first original return slip samples using a plurality of pre-trained recognition models respectively, and determine a plurality of second original return slip samples corresponding to the same recognition information of the plurality of pre-trained recognition models, the plurality of pre-trained recognition models being trained from the initial return slip training set;
[0009] The plurality of second original return receipt samples are classified based on each identification information category, and a plurality of target return receipt samples corresponding to each identification information category are determined from the plurality of second original return receipt samples corresponding to each identification information category, to construct a target return receipt training set, wherein the target return receipt samples are labeled with target identification information;
[0010] The plurality of target return receipt samples are identified by using the plurality of pre-trained identification models respectively, to obtain predicted target identification information of the plurality of target return receipt samples corresponding to each of the plurality of pre-trained identification models, and when a loss between the predicted target identification information corresponding to each of the plurality of pre-trained identification models and the labeled target identification information reaches a preset convergence condition, a plurality of individually fine-tuned identification models are obtained, which are used to identify return receipts.
[0011] In a second aspect, an embodiment of the present application provides a return receipt identification method, comprising:
[0012] Obtaining at least one return receipt;
[0013] Identifying the at least one return receipt by using the plurality of individually fine-tuned identification models respectively, to obtain initial identification results of the at least one return receipt output by each of the plurality of individually fine-tuned identification models;
[0014] Determining a target identification result of the at least one return receipt based on a determination result of whether the initial identification results of the at least one return receipt output by each of the plurality of individually fine-tuned identification models are consistent.
[0015] In a third aspect, an embodiment of the present application provides a return receipt identification model training device, comprising:
[0016] An obtaining unit is configured to obtain a plurality of first original return receipt samples and an initial return receipt training set, wherein the first original return receipt samples are original return receipt samples with consistent identification information corresponding to a plurality of identification models, the original return receipt samples are labeled with corresponding identification information, and the initial return receipt training set comprises a plurality of initial return receipt samples corresponding to each of various completeness categories of identification information, and the initial return receipt samples are labeled with initial identification information.
[0017] A determining unit is configured to identify the plurality of first original return receipt samples by using a plurality of pre-trained identification models respectively, and to determine a plurality of second original return receipt samples with consistent identification information corresponding to the plurality of pre-trained identification models, wherein the plurality of pre-trained identification models are trained by using the initial return receipt training set.
[0018] The determination unit is further configured to classify the plurality of second original return receipt samples based on respective identification information categories, and determine a plurality of target return receipt samples corresponding to each identification information category from the plurality of second original return receipt samples corresponding to the respective identification information categories, to construct a target return receipt training set, wherein the target return receipt samples are labeled with target identification information.
[0019] The acquisition unit is further configured to identify the plurality of target return receipt samples by using the plurality of pre-trained identification models respectively, to obtain predicted target identification information of the plurality of target return receipt samples corresponding to each of the plurality of pre-trained identification models, and obtain a plurality of identification models after individual fine-tuning when a loss between the predicted target identification information corresponding to each of the plurality of pre-trained identification models and the labeled target identification information reaches a preset convergence condition, wherein the plurality of identification models after individual fine-tuning are used to identify return receipts.
[0020] In a fourth aspect, an embodiment of the present application provides a return receipt identification device, comprising:
[0021] An acquisition unit is configured to acquire at least one return receipt.
[0022] An identification unit is configured to identify the at least one return receipt by using the plurality of identification models after individual fine-tuning respectively, to obtain initial identification results of the at least one return receipt output by the plurality of identification models after individual fine-tuning respectively.
[0023] A determination unit is configured to determine a target identification result of the at least one return receipt based on a determination result of whether the initial identification results of the at least one return receipt output by the plurality of identification models after individual fine-tuning respectively are consistent.
[0024] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising:
[0025] A central processing unit, a memory, an input and output interface, a wired or wireless network interface, and a power supply;
[0026] The memory is a transitory storage memory or a persistent storage memory;
[0027] The central processing unit is configured to communicate with the memory, and execute instruction operations in the memory to perform the method of the first aspect or the second aspect.
[0028] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, which comprises instructions, when the instructions are run on a computer, cause the computer to perform the method of the first aspect or the second aspect.
[0029] In a seventh aspect, the embodiments of the present application provide a computer program product containing instructions, which, when the computer program product is run on a computer, cause the computer to execute the method of the first aspect or the second aspect.
[0030] From the above technical solutions, it can be seen that the embodiments of the present application have the following advantages: the present application uses data sampling technology to construct a basic data set covering various completeness categories and various application scenarios of identification information categories through twice iteration of the training set, and obtains a target return single training set with higher quality through screening and optimization, and then fine-tunes each identification model based on the target return single training set. In this way, limited data resources are effectively utilized, and identification models learn more diversified features, thereby improving the adaptability and identification accuracy, robustness and generalization ability of different return single formats.
[0031] Correspondingly, the return single identification model training device, the return single identification device, the electronic equipment, the computer readable storage medium and the computer program product containing instructions provided by the present application also have the above technical effects. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 An architecture schematic diagram of a return single identification model training system disclosed by the embodiments of the present application is shown in FIG. 1;
[0033] Figure 2 A flow schematic diagram of a return single identification model training method disclosed by the embodiments of the present application is shown in FIG. 2;
[0034] Figure 2-1-1 A schematic diagram of a bank return single disclosed by the embodiments of the present application is shown in FIG. 3;
[0035] Figure 2-1 A return single picture schematic diagram of a data type of “explicitly giving out a payee and a payer” disclosed by the embodiments of the present application is shown in FIG. 4;
[0036] Figure 2-2 A return single picture schematic diagram of a data type of “only explicitly giving out a payee” disclosed by the embodiments of the present application is shown in FIG. 5;
[0037] Figure 2-3 A return single picture schematic diagram of a data type of “only explicitly giving out a payer” disclosed by the embodiments of the present application is shown in FIG. 6;
[0038] Figure 2-4 A return single picture schematic diagram of a data type of “neither explicitly giving out a payee nor explicitly giving out a payer” disclosed by the embodiments of the present application is shown in FIG. 7;
[0039] Figure 2-5 A return single picture schematic diagram of a data type of “A bank _ fee return single” disclosed by the embodiments of the present application is shown in FIG. 8;
[0040] Figure 2-6 A receipt picture schematic diagram of a data type of "B bank _ tax payment receipt" disclosed by the embodiment of the present application;
[0041] Figure 2-7 A receipt picture schematic diagram of a data type of "C bank _ reciprocal receipt" disclosed by the embodiment of the present application;
[0042] Figure 2-8 A receipt picture schematic diagram of a data type of "D bank _ deduction receipt" disclosed by the embodiment of the present application;
[0043] Figure 2-9 A schematic diagram of a receipt page disclosed by the embodiment of the present application;
[0044] Figure 3 A flowchart of a receipt recognition method disclosed by the embodiment of the present application;
[0045] Figure 3-1 A flowchart of another receipt recognition method disclosed by the embodiment of the present application;
[0046] Figure 4 A structural schematic diagram of a receipt recognition model training device disclosed by the embodiment of the present application;
[0047] Figure 5 A structural schematic diagram of a receipt recognition device disclosed by the embodiment of the present application;
[0048] Figure 6 A structural schematic diagram of an electronic device disclosed by the embodiment of the present application. DETAILED DESCRIPTION
[0049] The embodiment of the present application provides a receipt recognition model training method, a receipt recognition method, a receipt recognition model training device, a receipt recognition device, an electronic device, a computer readable storage medium and a computer program product containing instructions, which can train a receipt recognition model while improving the accuracy of receipt recognition.
[0050] Currently, there are two existing methods for single return recognition. The first method is to convert the single return into a picture first, and then extract the structured text information through OCR technology. Then, corresponding rule templates are set for single returns of different banks in the system, and the program reads these rule templates to complete the single return segmentation and key information extraction. However, the existing single return recognition method relies on manual collection and definition of a large number of rule templates, which is time-consuming and difficult to cover all single return formats, resulting in recognition failure when new formats of single return appear. Therefore, the single return recognition accuracy is low. The second method is to convert the single return into a picture, extract the structured text information through OCR technology, and then call a large model to return the key information of the single return for subsequent processing by using the general recognition ability of the large model. However, the cost is high, and the accuracy is uncontrollable (there is a large model illusion). However, in the financial application scenario, the accuracy of data is crucial. If the returned data has uncertain errors, the credibility of the entire business data will be affected, and manual verification steps need to be added, which limits the actual effect and application of the scheme, and the customer acceptance is not high. Based on this, in the embodiments of the present application, a single return recognition model training method and a single return recognition method are provided, which obtain a target data set through two iterations of data sets of multiple recognition models to train multiple recognition models. It can be seen that the embodiments of the present application can achieve the following effects: first, through multiple iterations of training sets and data enhancement technology, the limited data resources are fully utilized to enable the model to learn more diversified features. Second, improve the adaptability and recognition accuracy, robustness and generalization ability of the model to different single return formats. Third, reduce the dependence on manually defined templates, reduce development and maintenance costs, and improve the practicality of the system and customer acceptance.
[0051] Please refer to Figure 1 The architecture of the single return recognition model training system in the embodiments of the present application includes:
[0052] The server 101 and the client 102. When performing single return recognition model training, the server 101 can obtain a plurality of first original single return samples and an initial single return training set, recognize the plurality of first original single return samples by using a plurality of pre-trained recognition models respectively, and determine a plurality of second original single return samples whose recognition information corresponding to the plurality of pre-trained recognition models are consistent. The plurality of second original single return samples are classified based on each recognition information category, and a plurality of target single return samples corresponding to each recognition information category are determined from the plurality of second original single return samples corresponding to each recognition information category, to construct a target single return training set. The plurality of target single return samples are recognized by using the plurality of pre-trained recognition models respectively, and when the loss between the predicted target recognition information of each of the plurality of pre-trained recognition models and the labeled target recognition information reaches a preset convergence condition, the plurality of recognition models after individual fine-tuning are obtained. The client 102 can call the plurality of recognition models after individual fine-tuning of the server 101 to recognize new single returns.
[0053] Based on Figure 1 Please refer to the single return recognition model training system shown in Figure 2 , Figure 2 The flowchart of the single return recognition model training method disclosed in the embodiments of the present application is shown in the figure, and the method comprises:
[0054] 201, a plurality of first original single return samples and an initial single return training set are obtained, the first original single return sample is an original single return sample with consistent recognition information corresponding to a plurality of recognition models, the original single return sample is labeled with corresponding recognition information, and the initial single return training set comprises a plurality of initial single return samples corresponding to each complete degree category of recognition information, and the initial single return sample is labeled with initial recognition information.
[0055] In an optional embodiment, the single return can include but is not limited to bank single return (such as transfer single return, payment single return, etc.), tax single return or enterprise internal single, etc. The bank single return is a voucher provided to the customer by the bank when the bank accepts the customer's settlement business (including various payment and receipt transactions made by the customer through the bank, etc.) to prove the occurrence of the business and the receipt and payment of the money, which has important accounting and business proof functions. For specific bank single return, please refer to Figure 2-1-1 , Figure 2-1-1 The schematic diagram of the bank single return disclosed in the embodiments of the present application is shown in the figure, which comprises Figure 2-1-1 It can be seen that it comprises the name of the payee, the name of the payer, the account number of the payee, the account number of the payer, the single return number, the transaction amount, the single return abstract, the transaction time, the currency, the postscript, the bank seal and other content information. The first original single return sample is a sample with consistent recognition information verified by a plurality of recognition models, which is used to ensure the high quality and reliability of the training data. The complete degree category of the recognition information refers to the classification according to the completeness of the single return key information (including but not limited to the name of the payee, the name of the payer, the account number of the payee, the account number of the payer, the single return number, the transaction amount, the single return abstract, the transaction time, etc.), such as whether the information of the payee and the payer is complete or whether other key information is complete, etc., aiming to optimize the training data structure and improve the adaptability of the model to different data completeness.
[0056] 202, a plurality of second original single return samples with consistent recognition information corresponding to the plurality of pre-trained recognition models are determined by respectively identifying a plurality of first original single return samples using a plurality of pre-trained recognition models, and the plurality of pre-trained recognition models are trained from the initial single return training set.
[0057] In an optional implementation, the plurality of first original return receipt samples are identified respectively by using a plurality of pre-trained identification models, and a plurality of second original return receipt samples whose corresponding identification information of the plurality of pre-trained identification models are consistent are determined, aiming to filter out high-confidence samples through multi-model cross-validation, and further improve the quality of training data.
[0058] 203、The plurality of second original return receipt samples are classified based on each identification information category, and a plurality of target return receipt samples corresponding to each identification information category are determined from the plurality of second original return receipt samples corresponding to each identification information category, to construct a target return receipt training set, and the target return receipt samples are labeled with target identification information.
[0059] In an optional implementation, each identification information category can include but is not limited to categories such as "business type as collection", "business type as payment", "business type as transfer", or a combination of bank name and business type such as "A bank-collection", "A bank-payment", "B bank-collection", etc., for fine-grained classification of return receipts, to help the model accurately identify different categories of return receipts in multi-task learning, and enhance the adaptability to complex return receipt formats.
[0060] 204、The plurality of target return receipt samples are identified respectively by using a plurality of pre-trained identification models, to obtain the predicted target identification information of the plurality of target return receipt samples corresponding to each of the plurality of pre-trained identification models, and when the loss between the predicted target identification information corresponding to each of the plurality of pre-trained identification models and the labeled target identification information reaches a preset convergence condition, a plurality of identification models after individual fine-tuning are obtained, and the plurality of identification models after individual fine-tuning are used to identify return receipts.
[0061] In an optional implementation, individual fine-tuning means fine-tuning each identification model individually during the training of the identification model to optimize its performance. The identification model can be a large model or other machine learning model. Assuming that Qwen2.5vl-7B large model is used as identification model A and InternVL3-8B large model is used as identification model B, both of which are trained in Lora mode, and a total of 10 epochs are trained.
[0062] In this way, the present application iterates twice through the training set, uses the BootStrapping method (a data sampling and enhancement technology) to construct a basic data set covering multiple application scenarios (such as various completeness categories and various identification information categories), and obtains a higher-quality target training set through screening and optimization. Combined with Lora fine-tuning (an efficient fine-tuning method), the limited data resources are effectively utilized, the model learns more diversified features, and the adaptability and identification accuracy, robustness and generalization ability to different return receipt formats are improved.
[0063] In an optional implementation, obtaining the plurality of first original return receipt samples and the initial return receipt training set comprises: obtaining an original return receipt training set, the original return receipt training set comprising a plurality of original return receipt samples from different data sources, the original return receipt samples being labeled with corresponding identification information, identifying the plurality of original return receipt samples respectively by using a plurality of identification models to obtain identification information of the plurality of original return receipt samples corresponding to each of the plurality of identification models, and determining a plurality of first original return receipt samples corresponding to the identification information consistent with each of the plurality of identification models, classifying the plurality of original return receipt samples based on a completeness category of the identification information labeled by the plurality of original return receipt samples, and determining a plurality of initial return receipt samples corresponding to each of the completeness categories from the plurality of original return receipt samples corresponding to each of the completeness categories to construct the initial return receipt training set, the initial return receipt samples being labeled with initial identification information.
[0064] Specifically, the different data sources refer to the original return receipt samples coming from different banks or other financial institutions, etc., so as to ensure the diversity and universality of the data. The determination of the plurality of initial return receipt samples corresponding to each of the completeness categories from the plurality of original return receipt samples corresponding to each of the completeness categories represents the classification of the original return receipt samples according to the completeness of the information in the return receipt samples (such as whether the information of the payee and the payer is complete, etc.). The samples meeting the requirements are selected from each category as part of the initial return receipt training set for subsequent model training. In this way, the diversity and representativeness of the training set can be ensured, and the model can better adapt to the return receipt identification task under various conditions.
[0065] In this way, the original return receipt samples are obtained from different data sources such as different banks or other financial institutions, etc., so as to ensure the universality and diversity of the data. In this way, the model trained can adapt to various different return receipt formats and contents, and improve the universality and generalization ability of the model. Secondly, by classifying based on the completeness of the information in the return receipt samples and selecting the samples meeting the requirements from each category to construct the initial return receipt training set, the quality and representativeness of the training data are ensured. This helps the model to maintain high identification accuracy and robustness when processing return receipts with different completeness.
[0066] In an optional implementation, an original receipt training set is acquired, the original receipt training set including a plurality of original receipt samples of different data sources, the original receipt samples being labeled with corresponding recognition results, including: acquiring original receipt file samples, performing text page division on the original receipt file samples to obtain a plurality of original receipt page samples, the original receipt page samples including a plurality of original receipt samples of different data sources, using a pre-trained segmentation model to segment a plurality of original receipt samples from the plurality of original receipt page samples, using a preset rule template to parse the plurality of original receipt samples, and taking the parsed information of the plurality of original receipt samples as the recognition information labeled on the plurality of original receipt samples to construct the original receipt training set.
[0067] Specifically, a receipt file refers to a file provided by a bank or other financial institution for recording transaction information, including various receipts such as transfer receipts, payment receipts, etc. These receipts usually contain key information such as account information of both parties of a transaction, transaction amount, transaction time, etc. The text page division operation refers to the process of dividing a long text file into multiple independent pages (receipt pages). Each page (receipt page) contains one or more specific receipt records or partial content. The preset rule template is a set of extraction rules defined in advance according to the fixed format, keywords or data position of the receipt, etc., used to identify and extract key information from the receipt. In the parsing process, the original receipt samples can be processed according to the preset rule template to identify and extract the key information that meets the rules as the recognition result. For example, if the amount field of the receipt is always located at a certain fixed position, the rule template can define this position, and then the amount information can be directly extracted from this position during parsing.
[0068] In this way, by integrating receipt files of different data sources and performing text page division, combining the pre-trained segmentation model and the preset rule template, the key information is efficiently extracted, and a high-quality original receipt training set is constructed, which can achieve the following technical effects: 1) integrating diversified data sources to improve the generalization ability of the model; 2) improving data processing efficiency and labeling quality through structured processing and automatic information extraction; 3) laying a solid foundation for subsequent model training, enhancing the accuracy and adaptability of receipt recognition.
[0069] In an optional implementation, the general logic in the preset rule template can be extracted and organized into a verification rule or a prompt word rule of the recognition model to improve the recognition ability of the recognition model.
[0070] Specifically, the preset rule template is formulated according to the fixed format of the receipt, the keyword, the data position and the like. The common logic refers to the common part in the preset rule template, for example, the amount is in the upper right corner of the receipt, the date format is "YYYY-MM-DD", the payee information starts with "payee", and the like. The verification rule is used to verify the correctness of the information extracted by the model. For example, if the preset rule template specifies that the date format is "YYYY-MM-DD", the verification rule can be formulated as "check whether the extracted date conforms to the format. If not, the information may be incorrect". The prompt word rule is used to guide the recognition model to more accurately extract information. For example, if the payee information often starts with "payee", the prompt word rule can be formulated as "prompt the model to find the content starting with "payee" when extracting the payee information", so that the model extracts more accurately.
[0071] In this way, by extracting the common logic in the preset rule template and arranging it into the verification rule or the prompt word rule, additional guidance and verification mechanism can be provided for the recognition model. This helps the recognition model to more accurately recognize and extract the key information in the receipt, thereby improving the overall recognition ability.
[0072] To facilitate understanding of the training scheme of the plurality of recognition models of the embodiments of the present application, a specific example is described as follows:
[0073] I. Data set construction (constructing two data sets)
[0074] The embodiments of the present application can construct two data sets by using the BootStrapping method. The format of each data in the data set is (img, label). img represents a single receipt picture, and label represents the label of the receipt, including the payee name, the payer name, the payee account number, the payer account number, the receipt number, the transaction amount, the receipt abstract, and the transaction time. The process of data set construction is as follows:
[0075] 1. Collect 10,000 receipt PDF files, and use a pre-trained segmentation model to segment the PDF files into 200,000 receipt pictures.
[0076] 2. First construct a data set (initial receipt training set):
[0077] a) Write a rule engine (preset rule template): develop a rule engine to support the recognition of the receipt format of 30 head banks.
[0078] b) Recognize using the rule engine: use the engine to recognize 200,000 receipt pictures, and extract the receipt pictures and corresponding labels (i.e. annotated recognition information such as payee name, payer name, etc.) that can be hit by the rule engine.
[0079] c) Classification and sampling: According to the OCR results of the remittance receipt pictures, the data obtained in the previous step is divided into four data types ("explicitly gives the payee and the payer", "only explicitly gives the payee", "only explicitly gives the payer", "does not explicitly give the payee and does not explicitly give the payer"), and 25,000 data of each type are randomly selected to form an initial remittance receipt training set as the first constructed data set. The remittance receipt pictures of the "explicitly gives the payee and the payer" data type are shown in Figure 2-1 , the remittance receipt pictures of the "only explicitly gives the payee" data type are shown in Figure 2-2 , the remittance receipt pictures of the "only explicitly gives the payer" data type are shown in Figure 2-3 , and the remittance receipt pictures of the "does not explicitly give the payee and does not explicitly give the payer" data type are shown in Figure 2-4 .
[0080] 3. Training the preliminary recognition model:
[0081] The Qwen2.5vl-7B large model and the InternVL3-8B large model are trained using the first constructed data set (initial remittance receipt training set).
[0082] 4. Reconstructing the training data set (target remittance receipt training set):
[0083] a) Multi-model recognition: The bank name and business type of the full amount of 200,000 remittance receipt pictures are recognized using the two large models (Qwen2.5vl-72B and InternVL3-78B), and 50,000 data with consistent results are taken.
[0084] b) Further screening: The 50,000 data are further recognized by the preliminary trained model, and 20,000 data with consistent results are taken.
[0085] c) Classification and sampling: The data with consistent recognition results in the previous step are classified according to "bank name_business type", a total of 200+ classes are obtained, and up to 120 data of each class are taken, a total of 11,200 data are obtained, and finally 11,200 data are obtained as the target remittance receipt training set. The remittance receipt pictures of the data type "A bank_fee receipt" are shown in Figure 2-5 , the remittance receipt pictures of the data type "B bank_tax payment receipt" are shown in Figure 2-6 , the remittance receipt pictures of the data type "C bank_trade receipt" are shown in Figure 2-7 , and the remittance receipt pictures of the data type "D bank_deduction receipt" are shown in Figure 2-8 .
[0086] II. Model training:
[0087] The embodiment of the application uses Qwen2.5vl-7B model as the identification model A, and InternVL3-8B model as the identification model B, both of which are trained in the Lora training mode for 10 cycles (epochs). Through training on the target return single training set, the identification model learns the characteristics of the return single better, and the identification accuracy and adaptability are improved.
[0088] In an optional embodiment, before the plurality of original return single samples are segmented from the plurality of original return single page samples by using the pre-trained segmentation model, the method further comprises: obtaining a target return single page training set, the target return single page training set comprising a plurality of target return single page samples corresponding to various formats, the plurality of target return single page samples corresponding to various formats comprising at least one target return single sample of various return single sizes and various return single layouts, the target return single sample being labeled with a corresponding return single detection box, determining a predicted return single detection box of the at least one target return single sample from the plurality of target return single page samples by using the segmentation model, the predicted return single detection box being used to segment the at least one target return single sample in the plurality of target return single page samples to obtain the at least one target return single sample, and obtaining the trained segmentation model when the predicted return single detection box of the at least one target return single sample is verified to be qualified and when a loss between the predicted return single detection box of the at least one target return single sample and the labeled return single detection box of the at least one target return single sample reaches a preset convergence condition.
[0089] Specifically, the return single size refers to the width-to-height ratio of the return single, which is used to distinguish return singles of different sizes. Various return single sizes can include, but are not limited to, "large return single: width-to-height ratio less than 1", "medium return single: width-to-height ratio greater than 1 and less than or equal to 3", and "small return single: width-to-height ratio greater than 3". The return single layout represents the arrangement of the return single on the page, and various return single layouts can include, but are not limited to, "three return singles evenly arranged at the upper, middle and lower positions of the picture", "two return singles at the upper and middle positions of the picture", "two return singles at the upper and lower positions of the picture", "one return single appearing above the picture", "one return single randomly appearing at one of the upper and lower positions of the picture", and "the entire return single page being one return single", etc. These layout information can help the identification model understand the possible distribution of the return single on the page, so as to more accurately segment the return single. The application can use the YOLOv5 model architecture for training, and the training period is 100 epochs.
[0090] In this way, by using a target training set with diversified return single sizes and layouts and combining the YOLOv5 model training for 100 cycles, the segmentation model can efficiently adapt to return singles of different formats, can improve the generalization ability of the segmentation model, and can ensure accurate segmentation of return singles of various complex layouts and sizes, thereby improving the overall efficiency and accuracy of the return single identification system.
[0091] In an alternative embodiment, the obtaining the target receipt page training set comprises: obtaining an initial receipt page training set, the initial receipt page training set comprising a plurality of initial receipt page samples corresponding to various formats, the plurality of initial receipt page samples corresponding to various formats comprising at least one initial receipt sample of various receipt sizes and various receipt layouts; determining a plurality of target receipt page samples corresponding to various formats from the plurality of initial receipt page samples corresponding to various formats to construct the target receipt page training set.
[0092] Specifically, the target receipt page training set can be a manually constructed data set for training the segmentation model. The data set construction process is as follows: the format of the training data is (img, boxes), wherein img is a single page pdf (receipt page) in picture format, and boxes is a detection box of a bank receipt in the picture (receipt page). By collecting and analyzing a large number of single page pdfs, it can be found that there are three different receipt sizes, including but not limited to "large receipt: aspect ratio less than 1", "medium receipt: aspect ratio greater than 1 and less than or equal to 3", and "small receipt: aspect ratio greater than 3". The sizes of the multiple receipts contained in the single page pdf picture can be the same or different, which is not limited in the present application. The receipt layout can include but is not limited to the following 7 categories:
[0093] 1. A picture contains three small receipts, and the three small receipts are evenly arranged at the upper, middle and lower positions of the picture.
[0094] 2. A picture contains two small receipts, and the two small receipts are at the upper and middle positions of the picture.
[0095] 3. A picture contains two small receipts, and the two small receipts are at the upper and lower positions of the picture.
[0096] 4. A picture contains one small receipt, and the small receipt appears at the upper position of the picture.
[0097] 5. A picture contains two medium receipts, and the two medium receipts are at the upper and lower positions of the picture.
[0098] 6. A picture contains one medium receipt, and the medium receipt randomly appears at one of the upper and lower positions of the picture.
[0099] 7. A picture contains one large receipt, and the entire page is a large receipt.
[0100] Understandably, we can collect single-page PDF images of different formats, gathering 10 images for each format, for a total of 100 formats and 1000 images in total (200 large spreadsheets, 300 medium spreadsheets, and 500 small spreadsheets). Then, based on the summarized patterns, we can generate 100,000 training images by randomly combining these spreadsheet images. Please refer to the generated single-page PDF images (split spreadsheets) for details. Figure 2-9 , Figure 2-9 This is a schematic diagram of a receipt pagination method disclosed in an embodiment of this application. Figure 2-9 As can be seen, the three small receipts are evenly arranged in the top, middle, and bottom positions of the image.
[0101] In this way, constructing training datasets through artificial synthesis can reduce annotation costs while improving dataset quality.
[0102] In one optional implementation, obtaining the target order pagination training set includes: obtaining an initial order pagination training set, which includes multiple initial order pagination samples corresponding to various layouts, each initial order pagination sample including at least one initial order sample of various order sizes and layouts; obtaining order pagination samples of new layouts; and adding the new layout order pagination samples to the initial order pagination training set to obtain the target order pagination training set.
[0103] Specifically, once the system is online, if a new receipt format is encountered that is not currently supported, support for that new version can be quickly implemented through simple steps. The specific steps could be: first, collect a small number of samples, add them to the existing dataset, regenerate the dataset, and then retrain the model. For example, you only need to collect 10 receipt images of the new version, then add these 10 images to the existing receipt image set, regenerate the training dataset using the updated receipt image set, and then retrain the segmentation model using the new dataset.
[0104] In this way, the entire process takes only two days, requires minimal development work, and can be quickly deployed to support the new receipt format. Through simple data updates and model retraining, it can quickly adapt to the new receipt format, ensuring that the system can handle diverse receipt formats, thereby improving the system's usability and scalability.
[0105] In one optional implementation, determining that the predicted order detection box of at least one target order sample passes the verification includes at least one of the following: if there are multiple target order samples, and it is determined that there is no overlap between the order content within the predicted order detection boxes of the multiple target order samples, then the predicted order detection box of the multiple target order samples passes the verification; if it is determined that the aspect ratio of the predicted order detection box of at least one target order sample meets a preset aspect ratio range, then the predicted order detection box of at least one target order sample passes the verification; if it is determined that the richness of the text content within the predicted order detection box of at least one target order sample meets a preset richness range, then the predicted order detection box of at least one target order sample passes the verification; if it is determined that the amount of text outside the predicted order detection box of at least one target order sample in the multiple target order pagination samples is less than a preset amount of text, then the predicted order detection box of at least one target order sample passes the verification.
[0106] Specifically, an automatic verification module for the segmentation results can use heuristic rules to determine whether the segmentation results are correct, thereby improving the efficiency of automation. The specific rules are as follows:
[0107] 1. Check if there is overlap in the segmented receipts: If the contents of the prediction detection boxes of multiple receipt samples do not overlap, then these detection boxes are considered to be qualified.
[0108] 2. Check if the aspect ratio of the return receipt is reasonable: If the aspect ratio of the predicted return receipt detection box is within the preset range, the detection box is considered to be qualified, so as to avoid incorrect identification of extreme aspect ratios.
[0109] 3. Check the richness of the text content: If the richness of the text content in the detection box is appropriate, neither too little nor too much, the detection box is considered to have passed the verification, in order to prevent the receipt content from being missing or containing too much irrelevant text.
[0110] 4. Check if the amount of text outside the receipt is appropriate: If the amount of text outside the check box is within a reasonable range, the check box is considered to have passed the verification, in order to avoid incomplete receipt content or the inclusion of too much external text.
[0111] In this way, through these rules, the automatic verification module can determine whether the segmentation is successful, reducing manual intervention and improving the level of automation.
[0112] It's worth noting that the segmentation model can be trained using manually constructed datasets, and this method offers the following advantages and features: First, it can quickly support new receipt formats: If a receipt format not supported by the current segmentation model is encountered, support for that new version can be quickly achieved within 2-3 days by constructing a manually constructed dataset. This provides good adaptability and scalability, enabling rapid response to new business needs or changes. Second, it automatically determines the correctness of the segmentation: The segmentation model can automatically determine whether the segmentation result is correct. If the segmentation is incorrect, the model will throw a "segmentation failed" exception, prompting the user for manual confirmation. If the segmentation is correct, the receipt will automatically proceed to the next step of large-scale model recognition, without manual intervention. Third, it improves automation: This ability to automatically determine the correctness of the segmentation significantly improves the automation level of the entire processing flow. Traditional processing methods may require customers to confirm the segmentation of each receipt individually, while the method in this application reduces this workload of manual confirmation and improves work efficiency.
[0113] Please see Figure 3 , Figure 3 This is a flowchart illustrating a receipt identification method disclosed in an embodiment of this application. The method includes:
[0114] 301. Obtain at least one receipt.
[0115] In one alternative implementation, the receipt may include, but is not limited to, bank receipts (such as transfer receipts, payment receipts, etc.), tax receipts, or internal company documents.
[0116] 302. Utilize respectively, such as Figure 2 Each of the individually fine-tuned recognition models identifies at least one receipt, resulting in the initial recognition result of at least one receipt output by each of the individually fine-tuned recognition models.
[0117] In one alternative implementation, the same receipt is identified using multiple individually fine-tuned recognition models to obtain preliminary results for each model, which are then used to determine the final recognition result.
[0118] 303. Based on the determination of whether the initial recognition results of at least one receipt output by each of the multiple recognition models after individual fine-tuning are consistent, determine the target recognition result of at least one receipt.
[0119] In one optional implementation, if the initial recognition results of at least one receipt output by each of the multiple individually fine-tuned recognition models are consistent, then the consistent initial recognition results are taken as the target recognition results. If the initial recognition results of at least one receipt output by each of the multiple individually fine-tuned recognition models are inconsistent, then the target recognition result of at least one receipt is determined based on the specific inconsistency. The method for determining the target recognition result of at least one receipt may include, but is not limited to, manual intervention.
[0120] In this way, by employing a separately fine-tuned recognition model, the system can intelligently handle some unknown changes in receipts. The recognition model can automatically adapt to new receipt formats and changes, making the system more flexible and adaptable. Secondly, the recognition model can learn to automatically adapt to new receipt formats, reducing the workload and related costs of manually maintaining a large number of receipt template rules.
[0121] In one optional implementation, obtaining at least one receipt includes: obtaining a receipt file and paginating the receipt file to obtain receipt pages, wherein each receipt page includes at least one receipt, using methods such as... Figure 2 The pre-trained segmentation model segments at least one order from the order page.
[0122] Specifically, a transaction receipt is a document provided by a bank or other financial institution to record transaction information. This includes various receipts such as transfer receipts and payment receipts, which typically contain key information such as the account information of both parties, the transaction amount, and the transaction time. Text pagination refers to the process of dividing a long text file into multiple independent pages (receipt paginations). Each page (receipt pagination) contains one or more specific receipt records or portions of content.
[0123] In this way, by paginating the receipt file and using a pre-trained segmentation model to extract individual receipts, the efficiency and accuracy of receipt recognition are effectively improved.
[0124] In one alternative implementation, using, for example Figure 2 The pre-trained segmentation model segments at least one order from the order pagination, including: parsing at least one order using a preset rule template to obtain the parsing result of at least one order; if the parsing result of at least one order does not meet the preset parsing standard, then executing the following steps: Figure 2 The pre-trained segmentation model segments at least one order from the order page.
[0125] Specifically, the "preset rule template" is a set of extraction rules predefined based on the fixed format, keywords, or data positions of the receipt, used to identify and extract key information from the receipt. During the parsing process, the original receipt sample can be processed according to the preset rule template to identify key information that conforms to the rules and extract it as the identification result. For example, if the amount field of the receipt is always located in a fixed position, the rule template can define this position, and then the amount information can be directly extracted from that position during parsing. "If the parsing result of at least one receipt does not meet the preset parsing standard" means that after parsing the receipt using the rule template, the obtained parsing result does not meet the pre-set completeness and accuracy requirements. This may be because the receipt format is new, and the new receipt format does not completely match the existing rule template, resulting in missing or incorrect key information.
[0126] In this way, the dual checks of preset rule templates and recognition models effectively ensure the accuracy of receipt recognition results, reducing the workload of customer verification. Secondly, common receipts are processed using preset rule templates, while the recognition model is only invoked for infrequent receipts. This reduces the frequency of recognition model calls, saves resources, and improves system response speed. Furthermore, this combined approach adapts to new receipt formats while reducing the cost of continuously maintaining rule templates, avoiding the high workload caused by frequent rule template updates. Finally, using multiple recognition models to check the results further confirms the accuracy of the results, enhancing the stability and reliability of the system.
[0127] In one optional implementation, the preset rule template and the recognition model scheme can be separated into two independent schemes for use separately. This achieves the following technical effects: First, high flexibility: the preset rule template or the recognition model scheme can be selected based on the specific circumstances of the receipt. Receipts with fixed formats can be quickly extracted using the preset rule template scheme, while complex or uncommon receipts can be accurately identified using the recognition model scheme. Second, strong targeting: running the two schemes separately can better handle different scenarios. The preset rule template scheme is suitable for common receipts with clear rules, resulting in low computational costs; the recognition model scheme is suitable for complex and variable receipts, adapting to special situations through training to improve recognition accuracy. Third, easy maintenance and optimization: the separated schemes are easier to maintain and optimize independently. The preset rule template can be updated independently to adapt to minor changes; the recognition model can also be trained and tuned independently to improve the ability to handle complex receipts without affecting the stable operation of the other scheme. Fourth, reasonable resource allocation: independent operation allows for on-demand allocation of system resources. When processing large batches of common receipts, the preset rule template scheme is mainly used to save resources; for a small number of complex receipts, more resources are allocated to the recognition model scheme to ensure overall processing efficiency and effectiveness.
[0128] In one optional implementation, after determining the target recognition result of at least one receipt based on whether the initial recognition results of at least one receipt corresponding to the output of each of the multiple recognition models after individual fine-tuning are consistent, the method further includes: determining at least one target receipt whose initial recognition results corresponding to each of the multiple recognition models are inconsistent, and obtaining the target recognition information of at least one target receipt obtained after user intervention; constructing a new receipt training set based on at least one target receipt and the target recognition result of at least one target receipt; and retraining the multiple recognition models individually based on the new receipt training set to obtain the retrained multiple recognition models.
[0129] Specifically, when multiple recognition models produce inconsistent initial recognition results for the same receipt, the system filters out these receipts and obtains the correct recognition information confirmed by the user. These user-intervened receipts and their correct recognition results are added to the training set, forming new training samples. Then, the recognition model is retrained using this new training set to improve its ability to recognize receipt content that was previously difficult to accurately identify, thereby improving the overall accuracy and reliability of the model.
[0130] To facilitate understanding of the receipt recognition scheme provided in this application, a specific example is given below:
[0131] Please see Figure 3-1 , Figure 3-1 This is a flowchart illustrating another receipt identification method disclosed in an embodiment of this application. Figure 3-1 The process of the receipt recognition method is as follows:
[0132] Step 1: Determine the feasibility of text parsing: First, check if the incoming receipt file can be directly parsed. Text parsing provides more accurate text information and avoids potential errors associated with using Optical Character Recognition (OCR).
[0133] Step 2, Text Parsing and Pagination: If the receipt file can be directly parsed as text, then paginate it and save the text content of each page.
[0134] Step 3, OCR Recognition: For receipts that cannot be directly parsed, first convert the file to image format page by page, then use OCR technology to recognize the text content of each page and save the text.
[0135] Step 4: Template Feature Retrieval and Information Extraction: Using the paginated text content, retrieve whether it matches the preset template features. If a match is successful, segment the order and extract key information according to the preset template rules.
[0136] Step 5: Call the segmentation model: If the receipt format cannot be confirmed through template features, call the pre-trained segmentation model to segment the receipt.
[0137] Step 6, Multimodal Large Model Recognition: Input the segmented single receipts into two pre-trained multimodal large models (two pre-trained recognition models) to obtain key information.
[0138] Step 7: Model Result Comparison: Compare whether the key information returned by the two large models is consistent. If they are consistent, the recognition result is considered correct, and the result is returned.
[0139] Step 8: Manual intervention: If the results of the two models are inconsistent, the identification is considered to have failed, and a failure message is returned for the customer to perform manual intervention.
[0140] Step 9, Model Optimization: Use the correct recognition results obtained after manual intervention as new training data to further train and optimize the large model in order to improve its recognition ability.
[0141] In this way, by combining text parsing, OCR technology, template matching, machine learning model recognition, and human intervention, the efficiency and accuracy of receipt recognition can be ensured. At the same time, through continuous model training and optimization, the intelligence level and adaptability of the system are improved.
[0142] For further details, please refer to Figure 4 One embodiment of the receipt recognition model training device in this application includes:
[0143] The acquisition unit is used to acquire multiple first original receipt samples and an initial receipt training set. The first original receipt samples are original receipt samples whose recognition information is consistent across multiple recognition models. The original receipt samples are labeled with corresponding recognition information. The initial receipt training set includes multiple initial receipt samples corresponding to each category of completeness of recognition information. The initial receipt samples are labeled with initial recognition information.
[0144] The determining unit is used to identify the multiple first original receipt samples using multiple pre-trained recognition models, and to determine multiple second original receipt samples whose recognition information is consistent with the multiple pre-trained recognition models. The multiple pre-trained recognition models are trained from the initial receipt training set.
[0145] The determining unit is further configured to classify the plurality of second original return receipt samples based on each identification information category, and determine the plurality of target return receipt samples corresponding to each identification information category from the plurality of second original return receipt samples corresponding to each identification information category, so as to construct a target return receipt training set, wherein the target return receipt samples are labeled with target identification information;
[0146] The acquisition unit is further configured to use the pre-trained multiple recognition models to identify the multiple target return receipt samples respectively, obtain the predicted target recognition information of the multiple target return receipt samples corresponding to each of the pre-trained multiple recognition models, and when the loss between the predicted target recognition information and the labeled target recognition information corresponding to each of the pre-trained multiple recognition models reaches a preset convergence condition, obtain the multiple recognition models after individual fine-tuning, and the multiple recognition models after individual fine-tuning are used to identify return receipts.
[0147] In one alternative implementation, the acquisition unit may be used for:
[0148] A training set of original receipts is obtained, comprising multiple original receipt samples from different data sources. Each original receipt sample is labeled with corresponding identification information. Multiple identification models are used to identify these original receipt samples, obtaining identification information for each of the multiple identification models. Multiple first original receipt samples with identical identification information for all multiple identification models are identified. Based on the completeness category of the identification information labeled on the multiple original receipt samples, the multiple original receipt samples are classified. Multiple initial receipt samples corresponding to each completeness category are determined from the original receipt samples corresponding to each completeness category to construct the initial receipt training set. These initial receipt samples are labeled with initial identification information.
[0149] In one alternative implementation, the acquisition unit may be used for:
[0150] Obtain original receipt file samples, perform text pagination on the original receipt file samples to obtain multiple original receipt pagination samples. The original receipt pagination samples include multiple original receipt samples from different data sources. Use a pre-trained segmentation model to segment the multiple original receipt pagination samples into multiple original receipt samples. Use a preset rule template to parse the multiple original receipt samples, and use the parsed information of the multiple original receipt samples as the identification information for the annotation of the multiple original receipt samples to construct the original receipt training set.
[0151] In one alternative implementation, the acquisition unit may be used for:
[0152] Obtain a target order pagination training set, which includes multiple target order pagination samples corresponding to various layouts. The multiple target order pagination samples corresponding to various layouts include at least one target order sample with various order sizes and various order layouts. The target order samples are labeled with corresponding order detection boxes.
[0153] Determining a unit can be used for:
[0154] A segmentation model is used to determine the predicted return detection box of at least one target return sample from the plurality of target return pagination samples. The predicted return detection box is used to segment the at least one target return sample from the plurality of target return pagination samples to obtain at least one target return sample.
[0155] The acquisition unit can be used for:
[0156] The trained segmentation model is obtained when the predicted return detection box of the at least one target return sample is verified as qualified, and when the loss between the predicted return detection box of the at least one target return sample and the labeled return detection box of the at least one target return sample reaches the preset convergence condition.
[0157] In one alternative implementation, the acquisition unit may be used for:
[0158] Obtain an initial order pagination training set, which includes multiple initial order pagination samples corresponding to various layouts. The multiple initial order pagination samples corresponding to various layouts include at least one initial order sample of various order sizes and various order layouts. Determine multiple target order pagination samples corresponding to various layouts from the multiple initial order pagination samples corresponding to various layouts to construct the target order pagination training set.
[0159] In one alternative implementation, the acquisition unit may be used for:
[0160] Obtain an initial order pagination training set, which includes multiple initial order pagination samples corresponding to various layouts. The multiple initial order pagination samples corresponding to various layouts include at least one initial order sample of various order sizes and various order layouts. Obtain order pagination samples of new layouts and add the order pagination samples of new layouts to the initial order pagination training set to obtain the target order pagination training set.
[0161] In one alternative implementation, the determining unit may be used for:
[0162] If there are multiple target order samples, and it is determined that there is no overlap between the order content within the predicted order detection boxes of the multiple target order samples, then the predicted order detection boxes of the multiple target order samples are deemed to be qualified. If it is determined that the aspect ratio of the predicted order detection box of at least one target order sample meets the preset aspect ratio range, then the predicted order detection box of at least one target order sample is deemed to be qualified. If it is determined that the richness of the text content within the predicted order detection box of at least one target order sample meets the preset richness range, then the predicted order detection box of at least one target order sample is deemed to be qualified. If it is determined that the amount of text outside the predicted order detection box of at least one target order sample in the multiple target order pagination samples is less than the preset amount of text, then the predicted order detection box of at least one target order sample is deemed to be qualified.
[0163] For further details, please refer to Figure 5 One embodiment of the receipt identification device in this application includes:
[0164] The acquisition unit is used to acquire at least one receipt;
[0165] Identification unit, used to respectively utilize such as Figure 2 The individually fine-tuned multiple recognition models identify the at least one receipt, and obtain the initial recognition results of the at least one receipt output by each of the individually fine-tuned multiple recognition models;
[0166] The determining unit is used to determine the target recognition result of the at least one receipt based on the determination result of whether the initial recognition results of the at least one receipt output by the multiple individually fine-tuned recognition models are consistent.
[0167] In one alternative implementation, the acquisition unit may be used for:
[0168] Obtain the receipt file and paginate the receipt file to obtain receipt pages, each receipt page including at least one receipt, using methods such as... Figure 2 The pre-trained segmentation model segments at least one order from the order page.
[0169] In one alternative implementation, the acquisition unit may be used for:
[0170] The at least one receipt is parsed using a preset rule template to obtain the parsing result of the at least one receipt. If the parsing result of the at least one receipt does not meet the preset parsing standard, then the process of using the preset rule template is executed. Figure 2 The step of the pre-trained segmentation model segmenting at least one order from the order page.
[0171] In one alternative implementation, the acquisition unit may also be used for:
[0172] Identify at least one target order whose initial recognition results for each of the multiple recognition models are inconsistent, and obtain the target recognition result of the at least one target order obtained after user intervention. Based on the at least one target order and its target recognition result, construct a new order training set. Based on the new order training set, retrain the multiple recognition models individually to obtain multiple retrained recognition models.
[0173] For further details, please refer to Figure 6 One embodiment of the electronic device in this application includes:
[0174] Central processing unit 601, memory 605, input / output interface 604, wired or wireless network interface 603, and power supply 602;
[0175] Memory 605 is either a short-term storage memory or a persistent storage memory;
[0176] The central processing unit 601 is configured to communicate with the memory 605 and execute instructions stored in the memory 605 to perform the aforementioned operations. Figure 2 or Figure 3 The method in the illustrated embodiment.
[0177] Furthermore, embodiments of this application also provide a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the aforementioned... Figure 2 or Figure 3 The method in the illustrated embodiment.
[0178] Furthermore, embodiments of this application also provide a computer program product containing instructions, which, when run on a computer, causes the computer to perform the aforementioned... Figure 2 or Figure 3 The method in the illustrated embodiment.
[0179] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0180] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0181] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0182] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0183] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0184] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for training a return single identification model, characterized in that, The method comprises the following steps: obtaining a plurality of first original return single samples and an initial return single training set, the first original return single samples being original return single samples with consistent identification information corresponding to a plurality of identification models, the original return single samples being labeled with corresponding identification information, and the initial return single training set comprising a plurality of initial return single samples corresponding to each complete degree category of identification information, the initial return single samples being labeled with initial identification information; identifying the plurality of first original return single samples by using a plurality of pre-trained identification models respectively, and determining a plurality of second original return single samples with consistent identification information corresponding to the plurality of pre-trained identification models, the plurality of pre-trained identification models being trained by the initial return single training set; classifying the plurality of second original return single samples based on each identification information category, and determining a plurality of target return single samples corresponding to each identification information category from the plurality of second original return single samples corresponding to each identification information category, to construct a target return single training set, the target return single samples being labeled with target identification information; identifying the plurality of target return single samples by using the plurality of pre-trained identification models respectively, obtaining predicted target identification information of the plurality of target return single samples corresponding to each of the plurality of pre-trained identification models, and obtaining a plurality of identification models after individual fine-tuning when a loss between the predicted target identification information corresponding to each of the plurality of pre-trained identification models and the labeled target identification information reaches a preset convergence condition, the plurality of identification models after individual fine-tuning being used for identifying return single.
2. The method of claim 1, wherein, The method comprises the following steps: obtaining an initial return single training set, the initial return single training set comprising a plurality of original return single samples of different data sources, the original return single samples being labeled with corresponding identification information; identifying the plurality of original return single samples by using a plurality of identification models respectively, obtaining identification information of the plurality of original return single samples corresponding to each of the plurality of identification models, and determining the plurality of first original return single samples with consistent identification information corresponding to the plurality of identification models; classifying the plurality of original return single samples based on a complete degree category of the identification information labeled by the plurality of original return single samples, and determining a plurality of initial return single samples corresponding to each of the complete degree categories from the plurality of original return single samples corresponding to each of the complete degree categories, to construct the initial return single training set, the initial return single samples being labeled with initial identification information.
3. The method of claim 2, wherein, The method of obtaining an initial return single training set, the initial return single training set comprising a plurality of original return single samples of different data sources, the original return single samples being labeled with corresponding identification information, comprises the following steps: obtaining original return single file samples; performing text page division on the original return single file samples to obtain a plurality of original return single page samples, the original return single page samples comprising a plurality of original return single samples of different data sources; cutting the plurality of original return single samples from the plurality of original return single page samples by using a pre-trained cutting model; The method comprises the following steps: parsing the plurality of original receipt samples by using a preset rule template, and taking the parsed information of the plurality of original receipt samples as identification information labeled by the plurality of original receipt samples to construct the original receipt training set.
4. The method of claim 3, wherein, Before the plurality of original receipt samples are segmented from the plurality of original receipt page samples by using the pre-trained segmentation model, the method further comprises the following steps: obtaining a target receipt page training set, wherein the target receipt page training set comprises a plurality of target receipt page samples corresponding to various formats, the plurality of target receipt page samples corresponding to the various formats comprise at least one target receipt sample in various receipt sizes and various receipt layouts, and the target receipt sample is labeled with a corresponding receipt detection box; determining a predicted receipt detection box of the at least one target receipt sample from the plurality of target receipt page samples by using a segmentation model, wherein the predicted receipt detection box is used to segment the at least one target receipt sample in the plurality of target receipt page samples to obtain at least one target receipt sample; when the predicted receipt detection box of the at least one target receipt sample is verified to be qualified, and when a loss between the predicted receipt detection box of the at least one target receipt sample and the labeled receipt detection box of the at least one target receipt sample reaches a preset convergence condition, obtaining a trained segmentation model.
5. The method of claim 4, wherein, The method further comprises the following steps: obtaining an initial receipt page training set, wherein the initial receipt page training set comprises a plurality of initial receipt page samples corresponding to various formats, the plurality of initial receipt page samples corresponding to the various formats comprise at least one initial receipt sample in various receipt sizes and various receipt layouts; determining the plurality of target receipt page samples corresponding to the various formats from the plurality of initial receipt page samples corresponding to the various formats to construct the target receipt page training set.
6. The method of claim 4, wherein, The method further comprises the following steps: obtaining an initial receipt page training set, wherein the initial receipt page training set comprises a plurality of initial receipt page samples corresponding to various formats, the plurality of initial receipt page samples corresponding to the various formats comprise at least one initial receipt sample in various receipt sizes and various receipt layouts; obtaining a receipt page sample of a new format; adding the receipt page sample of the new format to the initial receipt page training set to obtain the target receipt page training set.
7. The method of claim 4, wherein, The method further comprises the following steps: if the number of target receipt samples is a plurality, and it is determined that there is no overlap between receipt contents in the predicted receipt detection boxes of the plurality of target receipt samples, it is determined that the predicted receipt detection boxes of the plurality of target receipt samples are verified to be qualified; if it is determined that the aspect ratio of the predicted receipt detection box of the at least one target receipt sample satisfies a preset aspect ratio range, it is determined that the predicted receipt detection box of the at least one target receipt sample is verified to be qualified. If it is determined that the richness of the text content in the predicted return receipt detection box of the at least one target return receipt sample meets the preset richness range, it is determined that the predicted return receipt detection box of the at least one target return receipt sample passes the check. If it is determined that the number of texts outside the predicted return receipt detection box of the at least one target return receipt sample in the plurality of target return receipt page samples is less than the preset text number range, the predicted return receipt detection box of the at least one target return receipt sample passes the check.
8. A method of recognizing a reply slip, characterized by, The method comprises: obtaining at least one return receipt; identifying the at least one return receipt by using the plurality of individually fine-tuned recognition models respectively to obtain initial recognition results of the at least one return receipt output by the plurality of individually fine-tuned recognition models respectively; determining a target recognition result of the at least one return receipt based on a determination result of whether the initial recognition results of the at least one return receipt output by the plurality of individually fine-tuned recognition models respectively are consistent.
9. The method of claim 8, wherein, The obtaining at least one return receipt comprises: obtaining a return receipt file and performing file paging on the return receipt file to obtain a return receipt page, the return receipt page comprising at least one return receipt; cutting the at least one return receipt from the return receipt page by using the pre-trained cutting model.
10. The method of claim 9, wherein, The cutting the at least one return receipt from the return receipt page by using the pre-trained cutting model comprises: analyzing the at least one return receipt by using a preset rule template to obtain an analysis result of the at least one return receipt; if the analysis result of the at least one return receipt does not meet a preset analysis result standard, performing the step of cutting the at least one return receipt from the return receipt page by using the pre-trained cutting model.
11. The method of claim 8, wherein, After the determining a target recognition result of the at least one return receipt based on a determination result of whether the initial recognition results of the at least one return receipt output by the plurality of individually fine-tuned recognition models respectively are consistent, the method further comprises: determining at least one target return receipt whose initial recognition results corresponding to the plurality of recognition models are inconsistent and obtaining a target recognition result of the at least one target return receipt after user intervention; constructing a new return receipt training set based on the at least one target return receipt and the target recognition result of the at least one target return receipt; retraining the plurality of recognition models based on the new return receipt training set to obtain a plurality of retrained recognition models. 12.A device for training a reply identification model, characterized in that, The method comprises: an obtaining unit, configured to obtain a plurality of first original return receipt samples and an initial return receipt training set, the first original return receipt samples being original return receipt samples whose corresponding recognition information is consistent, the original return receipt samples being labeled with the corresponding recognition information, the initial return receipt training set comprising a plurality of initial return receipt samples corresponding to each of a plurality of completeness categories of recognition information, the initial return receipt samples being labeled with initial recognition information; The determination unit is configured to identify the plurality of first original reply samples respectively by using the plurality of pre-trained identification models, and determine a plurality of second original reply samples whose identification information corresponding to the plurality of pre-trained identification models are consistent, wherein the plurality of pre-trained identification models are trained by the initial reply training set. The determination unit is further configured to classify the plurality of second original reply samples based on each identification information category, and determine a plurality of target reply samples corresponding to each identification information category from the plurality of second original reply samples corresponding to each identification information category, so as to construct a target reply training set, wherein the target reply samples are labeled with target identification information. The obtaining unit is further configured to identify the plurality of target reply samples respectively by using the plurality of pre-trained identification models, obtain the prediction target identification information of the plurality of target reply samples corresponding to each of the plurality of pre-trained identification models, and obtain a plurality of identification models after individual fine-tuning when the loss between the prediction target identification information corresponding to each of the plurality of pre-trained identification models and the labeled target identification information reaches a preset convergence condition, wherein the plurality of identification models after individual fine-tuning are used to identify a reply.
13. A return envelope identification apparatus, characterized by: Comprising: An obtaining unit configured to obtain at least one reply; An identification unit configured to identify the at least one reply respectively by using the plurality of identification models after individual fine-tuning, and obtain initial identification results of the at least one reply output by each of the plurality of identification models after individual fine-tuning; A determination unit configured to determine a target identification result of the at least one reply based on a determination result of whether the initial identification results of the at least one reply output by each of the plurality of identification models after individual fine-tuning are consistent.
14. An electronic device, comprising: Comprising: A central processing unit and a memory; The memory is a transitory storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory, and execute instruction operations in the memory to perform the method in any one of claims 1 to 7 or any one of claims 8 to 11.
15. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises instructions, when the instructions are executed on a computer, causing the computer to perform the method in any one of claims 1 to 7 or any one of claims 8 to 11.
16. A computer program product comprising instructions, characterized in that, When the computer program product is executed on a computer, causing the computer to perform the method in any one of claims 1 to 7 or any one of claims 8 to 11.