A multi-scene invoice automatic recognition and classification method and system

By combining adaptive preprocessing and deep learning models, the problems of limited adaptability, low accuracy, and poor system integration in invoice recognition and classification technology are solved. This enables efficient and accurate automatic recognition and classification of invoices in multiple scenarios, reduces manual intervention, and improves the adaptability and scalability of the system.

CN120496110BActive Publication Date: 2025-10-21JINCAI SHUKE (BEIJING) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510332470.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-10-21
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

Existing invoice recognition and classification technologies suffer from limited adaptability, low recognition accuracy, slow processing speed, excessive reliance on manual intervention, and poor system scalability and integration, making it difficult to meet the diverse financial management needs of enterprises.

Method used

By employing adaptive preprocessing algorithms and deep learning models, combined with machine learning algorithms and cloud storage technology, a flexible system architecture is designed to achieve automatic invoice recognition and classification in multiple scenarios. Adaptive preprocessing technology improves image clarity, optimizes the deep learning model structure, reduces manual intervention, and supports seamless integration with financial management systems.

Benefits of technology

It improves the accuracy and efficiency of invoice recognition and classification, reduces labor costs, enhances the system's adaptability and interoperability, and meets the diverse needs of enterprises.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120496110B_ABST
    Figure CN120496110B_ABST
Patent Text Reader

Abstract

The application provides a multi-scene invoice automatic identification and classification method and system, which comprises the following steps: carrying out self-adaptive pretreatment such as denoising, binarization and rotation correction on the imported invoice image; carrying out text detection and text recognition to locate and extract the text information in the invoice; extracting the structured key field; using a classification model to classify the invoice in multiple dimensions; using a visual interface to customize and drag the configuration, using transfer learning fine-tuning, detecting abnormal invoices based on an abnormality detection algorithm and triggering manual review, and adaptively adapting to the identification and classification of multiple different invoice formats and scenes; carrying out data persistent processing on the invoice identification and classification results, and supporting interface interaction with an ERP system. The application can automatically adjust the pretreatment parameters according to the actual situation of the invoice image, improve the clarity and readability of the invoice image, optimize the model structure and training strategy, improve the recognition ability of the model for complex invoice images, and improve the invoice identification and classification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of finance and taxation management technology, in particular, to the field of invoice recognition technology; specifically, to a method and system for automatic recognition and classification of invoices in multiple scenarios. Background Art

[0002] As business transaction volumes increase, traditional manual invoice processing can no longer meet the demands of modern financial management. Consequently, automated, intelligent invoice recognition and classification programs have emerged. Invoice recognition technology is a crucial component of intelligent finance and taxation, and its core focus lies in efficiently and accurately processing various types of invoice data.

[0003] The foundation of invoice recognition technology is optical character recognition (OCR). OCR scans and analyzes invoice images, converting textual information into computer-readable character codes. However, invoice formats and content vary widely, and different types of invoices may have different fonts and layouts, which poses certain difficulties and challenges for OCR technology.

[0004] To address these challenges, researchers are continuously refining OCR algorithms, improving their ability to recognize complex images and irregular text. Furthermore, the rise of deep learning technology has brought new breakthroughs in invoice recognition. Deep learning models, such as convolutional neural networks (CNNs), can automatically learn features and patterns in invoice images. Trained with large amounts of invoice sample data, deep learning models can recognize a wide range of information on invoices, including numbers, text, and tables. The advantage of deep learning technology lies in its ability to continuously optimize and self-learn. With the accumulation of data and in-depth training, recognition accuracy continues to improve.

[0005] However, existing invoice recognition and classification technologies still have the following shortcomings:

[0006] 1. Limited adaptability: Many existing invoice recognition systems can only process invoices of specific formats or types. They are ineffective in recognizing complex and diverse invoice scenarios, such as handwritten invoices and invoice formats from different countries. This limitation restricts the system's wide application and flexibility.

[0007] 2. Recognition accuracy needs to be improved: Although advanced technologies such as deep learning have improved the accuracy of invoice recognition, existing invoice recognition systems still make recognition errors in certain complex situations, such as when the invoice image quality is poor, the text is blurred, or the layout is irregular.

[0008] 3. There are technical bottlenecks in processing speed: When processing a large number of invoices, the existing system may face performance bottlenecks, resulting in slower processing speeds and an inability to meet the company's needs for efficient invoice processing.

[0009] 4. Over-reliance on manual intervention: Some existing systems still require manual intervention in the process of invoice classification and information extraction, which not only increases labor costs but also may introduce human errors.

[0010] 5. Poor system scalability and integration: The architecture and design of some existing invoice recognition systems are not flexible enough, making it difficult to seamlessly integrate with other financial management systems, which limits the system's scalability and interoperability.

[0011] In the invoice processing process, in addition to identification technology, invoices also need to be classified and stored. Traditional classification methods often rely on manual operations, which are inefficient and prone to errors. Summary of the Invention

[0012] In view of this, the purpose of the present invention is to address the above-mentioned shortcomings of the prior art and propose a multi-scenario invoice automatic recognition and classification method and system. By designing an adaptive preprocessing algorithm and deep learning model, it can process invoices of different formats and scenarios, thereby improving the adaptability and flexibility of the system; optimizing the architecture and training strategy of the deep learning model, improving the recognition ability of complex invoice images, reducing recognition errors, and improving the accuracy and reliability of recognition; through automated classification and information extraction technology, reducing manual participation, reducing labor costs, reducing human errors, and improving the degree of automation and accuracy of invoice recognition and classification; and designing a flexible system architecture and API interface to facilitate seamless integration with other financial management systems, improve the scalability and interoperability of the system, and meet the diverse needs of enterprises.

[0013] The present invention provides a multi-scenario invoice automatic recognition and classification method, comprising the following steps:

[0014] S1. performing adaptive preprocessing operations such as denoising, binarization, and rotation correction on the imported invoice image;

[0015] Preferably, during the pre-processing process, the processing parameters are automatically adjusted according to the actual situation of the invoice image to improve the accuracy of the subsequent recognition step;

[0016] S2. Perform text detection and text recognition on the preprocessed invoice image to locate and extract text information in the invoice;

[0017] S3. Extract structured key fields of the invoice text information;

[0018] S4. Using a classification model to classify invoices in multiple dimensions, the multiple dimensions including: invoice type, invoicing unit, amount range, and industry keywords;

[0019] Preferably, a machine learning algorithm is used to classify invoices, and the invoices are classified into different categories according to the content and format of the invoices, thereby reducing the workload of classification and improving the accuracy and efficiency of classification.

[0020] S5. Customize drag-and-drop configuration using a visual interface, fine-tune using transfer learning, detect abnormal invoices based on anomaly detection algorithms and trigger manual review, and achieve adaptive recognition and classification of various invoice formats and scenarios.

[0021] Specifically, it provides a visual configuration interface based on the template engine, allowing users to drag and drop field areas to define new templates;

[0022] When there is insufficient data for new scenarios, transfer learning is used to reuse the feature extraction layer of a pre-trained model (such as ResNet) and only fine-tune the top-level classifier.

[0023] Identify unknown invoice types based on anomaly detection algorithms (such as the Isolation Forest algorithm) and trigger the manual review process.

[0024] S6. Perform data persistence processing on invoice identification and classification results, and support interaction with the ERP system.

[0025] Preferably, cloud storage technology is used to store and manage invoice data to ensure data security and accessibility. Data privacy and integrity are protected through measures such as data encryption and backup.

[0026] Machine learning algorithms are used to automate the classification and storage of invoices. By training the classification algorithm, invoices can be automatically categorized into different types based on their content and format. At the same time, the application of cloud storage technology also improves the security and reliability of invoice storage.

[0027] Furthermore, the method of the adaptive preprocessing operation in step S1 includes:

[0028] Use Gaussian filtering algorithm to smooth the salt and pepper noise in scanned or photographed invoice images;

[0029] The image tilt angle is detected using Hough transform, and rotation correction is performed through affine transformation. For local distortion, a grid-based perspective transformation algorithm (such as OpenCV's warpPerspective) is used to correct it.

[0030] Furthermore, the text detection method in step S2 includes: using the EAST (Efficient and Accurate Scene Text Detector) model to extract image features through the PVANet backbone network to generate text area geometric frames; for dense text areas, introducing the NMS (non-maximum suppression) algorithm to optimize the detection frame overlap problem;

[0031] The text recognition method includes: using a CRNN (convolutional recurrent neural network) model in combination with a CTC (connectionist temporal classification) loss function to support recognition of text of variable length; for multilingual scenarios, integrating the Tesseract OCR engine to achieve mixed Chinese and English recognition; and post-processing the recognition results, which includes correcting recognition errors through dictionary constraints (such as a special invoice term library) to improve accuracy.

[0032] Specifically, the OCR recognition technology of the Tesseract OCR engine is used to extract key data from paper or electronic invoices, such as invoice number, date, amount, etc., and the OCR algorithm is continuously optimized to improve the recognition ability of complex invoice images.

[0033] Furthermore, the S3 step includes:

[0034] Perform semantic understanding based on pre-trained models (such as BERT) to identify entities (such as "amount" and "date"). Use a rule engine (such as Drools) to match pre-set invoice information templates and extract key fields from the invoice information templates. For example, use the regular expression \d{12} to extract the invoice code.

[0035] Build a field dependency graph (for example, "Purchaser Name" and "Tax Number" are adjacent) to improve the extraction accuracy of fuzzy fields.

[0036] Furthermore, the S4 step includes:

[0037] Extract features such as invoice type, invoicing unit, amount range, industry keywords, etc.

[0038] It uses XGBoost to integrate deep learning models, supporting multi-label classification (e.g., "VAT Invoice - Catering Category - Electronic Version"). For small sample scenarios, it introduces Few-Shot Learning, using contrastive learning to enhance model generalization capabilities.

[0039] Specifically, deep learning models (such as CNN) are trained and optimized to improve the accuracy and generalization of invoice recognition. Deep learning models automatically learn features and patterns in invoice images, enabling accurate recognition of different invoice types.

[0040] Preferably, parallel processing technology and efficient algorithms are used to increase processing speed and meet the enterprise's demand for efficient batch invoice processing.

[0041] Based on online learning, classification weights are adjusted in real time according to user feedback.

[0042] Furthermore, the S6 step includes:

[0043] Output JSON format data, which contains metadata such as field confidence and the original image path of the invoice;

[0044] Use MySQL database, design table structure, and optimize MySQL query efficiency (such as storage by date partition);

[0045] Supports API connection between MySQL database and ERP system (such as SAP) to achieve real-time data synchronization;

[0046] Generate Excel reports using Apache POI, preserving the original image thumbnails and hyperlinks of the invoices.

[0047] Furthermore, before the S1 step, the following steps are further included:

[0048] Organize and store the invoice image files (such as PDF, JPG, etc.) that need to be identified in a designated folder; select the folder containing the invoice image files to import the invoice images, and read all the invoice image files in the folder.

[0049] In this embodiment, the user double-clicks the program icon or enters the corresponding command in the command line to start the program; after the program is started, the user enters the main interface, which displays operation options and the current working status; the user organizes the invoice image files that need to be identified (such as PDF, JPG, etc. formats) and stores them in a designated folder; preferably, the invoice images are ensured to be clear and complete, without serious obstruction or damage; the user clicks the "Import Invoice Images" button on the program interface, selects the folder containing the invoice images for import, and the program automatically reads all the invoice image files in the folder.

[0050] The present invention also provides a multi-scenario invoice automatic recognition and classification system, which implements the multi-scenario invoice automatic recognition and classification method as described above, including:

[0051] Image preprocessing module: used for adaptive preprocessing operations such as denoising, binarization, and rotation correction on imported invoice images;

[0052] Text detection and recognition module: used to perform text detection and text recognition on pre-processed invoice images, locate and extract text information in the invoice;

[0053] Key information extraction module: used to extract structured key fields of invoice text information;

[0054] Invoice classification module: used to classify invoices in multiple dimensions using a classification model, including invoice type, invoicing unit, amount range, and industry keywords;

[0055] Multi-scenario adaptation module: This module uses a visual interface to customize drag-and-drop configurations, utilizes transfer learning for fine-tuning, and uses anomaly detection algorithms to detect abnormal invoices and trigger manual review, enabling adaptive recognition and classification of various invoice formats and scenarios.

[0056] Result output and storage module: used for data persistence processing of invoice recognition and classification results, and supports docking and interaction with the ERP system.

[0057] Furthermore, the image preprocessing module includes:

[0058] Denoising unit: Used to smooth the salt and pepper noise in scanned or photographed invoice images using a Gaussian filtering algorithm;

[0059] Tilt correction unit: used to detect the image tilt angle using Hough transform and perform rotation correction through affine transformation; for local distortion, a grid-based perspective transformation algorithm is used to correct it.

[0060] Furthermore, the key information extraction module includes:

[0061] Natural Language Processing (NLP) unit: used to understand semantics and identify entities based on pre-trained models; uses a rule engine to match preset invoice information templates and extract key fields from invoice information templates;

[0062] Context association unit: used to build a field dependency graph and improve the extraction accuracy of fuzzy fields.

[0063] Furthermore, the invoice classification module includes:

[0064] Feature Engineering Unit: used to extract features such as invoice type, invoicing unit, amount range, industry keywords, etc.

[0065] Classification model unit: used to integrate deep learning models using XGBoost and support multi-label classification; for small sample scenarios, Few-Shot Learning is introduced to enhance the generalization ability of the model using contrastive learning;

[0066] Dynamic update unit: used to adjust classification weights in real time based on online learning and user feedback.

[0067] Furthermore, the result output and storage module includes:

[0068] Data structuring unit: used to output JSON format data, which contains metadata such as field confidence and the original image path of the invoice;

[0069] Storage structure unit: used to use MySQL database, design table structure, and optimize MySQL query efficiency;

[0070] Support interaction unit: used to support MySQL database and ERP system through API docking to achieve real-time data synchronization;

[0071] Export unit: used to generate Excel reports using Apache POI, preserving the original image thumbnails and hyperlinks of the invoice.

[0072] This invention innovatively introduces adaptive preprocessing technology for multi-scenario automatic invoice recognition and classification. This technology automatically adjusts preprocessing parameters such as denoising, binarization, and rotation correction based on the actual invoice image conditions, significantly improving the clarity and readability of invoice images and laying a solid foundation for subsequent recognition steps.

[0073] This paper uses deep learning models (such as convolutional neural networks (CNNs)) to extract and classify invoice features. By optimizing the model structure and training strategy, the model's ability to recognize complex invoice images is improved, enabling accurate classification and information extraction for invoices in multiple scenarios.

[0074] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the multi-scenario invoice automatic identification and classification method as described above.

[0075] The present invention also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the multi-scenario invoice automatic identification and classification method as described above are implemented.

[0076] Compared with the prior art, the present invention has the following beneficial effects:

[0077] The multi-scenario invoice automatic recognition and classification method and system provided by the present invention introduce adaptive preprocessing technology, which can automatically adjust preprocessing parameters (such as denoising intensity, binarization threshold, etc.) according to the actual situation of the invoice image, significantly improving the clarity and readability of the invoice image; adopting a deep learning model to extract and classify invoice features, and by optimizing the model structure and training strategy, improving the deep learning model's recognition ability for complex invoice images, and improving the invoice recognition and classification efficiency; moreover, the multi-scenario invoice automatic recognition and classification system provides a concise and clear user operation interface, allowing users to easily get started with invoice recognition and classification operations, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Various other advantages and benefits will become apparent to those skilled in the art by reading the following detailed description of the preferred embodiment.The accompanying drawings are only for the purpose of illustrating the preferred embodiment and are not to be considered as limiting the present invention.

[0079] In the attached figure:

[0080] Figure 1 This is a flow chart of a multi-scenario invoice automatic recognition and classification method of the present invention;

[0081] Figure 2 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0082] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of systems and products consistent with certain aspects of the present disclosure, as detailed in the appended claims.

[0083] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

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

[0085] The embodiments of the present invention are described in further detail below.

[0086] The embodiment of the present invention provides a multi-scenario invoice automatic recognition and classification method, see Figure 1 Shown, including:

[0087] Organize and store the invoice image files (such as PDF, JPG, etc.) that need to be identified in a designated folder; select the folder containing the invoice image files to import the invoice images, and read all the invoice image files in the folder.

[0088] This embodiment develops an application program that implements a multi-scenario automatic invoice recognition and classification method. The user starts the application program by double-clicking the application icon or entering the corresponding command in the command line. After the program starts, the user enters the main interface, which displays operation options and the current working status. The user organizes the invoice image files (such as PDF, JPG, etc.) to be recognized and stores them in a designated folder. Preferably, the invoice images are clear and complete, without serious obstruction or damage. The user clicks the "Import Invoice Images" button on the program interface, selects the folder containing the invoice images for import, and the program automatically reads all the invoice image files in the folder.

[0089] S1. performing adaptive preprocessing operations such as denoising, binarization, and rotation correction on the imported invoice image;

[0090] Methods for adaptive preprocessing operations include:

[0091] Use Gaussian filtering algorithm to smooth the salt and pepper noise in scanned or photographed invoice images;

[0092] The image tilt angle is detected using Hough transform, and rotation correction is performed through affine transformation. For local distortion, a grid-based perspective transformation algorithm (OpenCV's warpPerspective) is used to correct it.

[0093] During the pre-processing process, the processing parameters are automatically adjusted according to the actual situation of the invoice image to improve the accuracy of the subsequent recognition step;

[0094] S2. Perform text detection and text recognition on the preprocessed invoice image to locate and extract text information in the invoice;

[0095] The text detection method includes: using the EAST (Efficient and Accurate Scene Text Detector) model to extract image features through the PVANet backbone network to generate text area geometric frames; for dense text areas, introducing the NMS (non-maximum suppression) algorithm to optimize the detection frame overlap problem;

[0096] The text recognition method includes: using a CRNN (convolutional recurrent neural network) model in combination with a CTC (connectionist temporal classification) loss function to support recognition of text of variable length; for multilingual scenarios, integrating the Tesseract OCR engine to achieve mixed Chinese and English recognition; and post-processing the recognition results, including correcting recognition errors through dictionary constraints (invoice-specific terminology library) to improve accuracy.

[0097] Utilize the OCR recognition technology of the Tesseract OCR engine to extract key data from paper or electronic invoices, including invoice number, date, amount, etc., continuously optimize the OCR algorithm and improve the recognition ability of complex invoice images.

[0098] S3. Extract structured key fields of the invoice text information;

[0099] Based on a pre-trained model (BERT model), semantic understanding is performed to identify entities (including "amount" and "date"). A rule engine (Drools) is used to match the preset invoice information template and extract key fields from the invoice information template.

[0100] In this embodiment, the invoice code is extracted by the regular expression \d{12};

[0101] Construct a field dependency graph. In the field dependency graph of this embodiment, "purchaser name" and "tax number" are constructed to be adjacent to each other, thereby improving the extraction accuracy of fuzzy fields.

[0102] S4. Using a classification model to classify invoices in multiple dimensions, the multiple dimensions including: invoice type, invoicing unit, amount range, and industry keywords;

[0103] Extract features such as invoice type, invoicing unit, amount range, industry keywords, etc.

[0104] It uses XGBoost to integrate deep learning models, supporting multi-label classification (e.g., "VAT Invoice - Catering Category - Electronic Version"). For small sample scenarios, it introduces Few-Shot Learning, using contrastive learning to enhance model generalization capabilities.

[0105] Based on online learning, classification weights are adjusted in real time according to user feedback.

[0106] Through training and optimization of deep learning models (such as CNN), deep learning models automatically learn the features and patterns in invoice images, enabling accurate recognition of different invoice types. Using machine learning algorithms to classify invoices into different categories based on their content and format reduces the classification workload, improves the accuracy and generalization of invoice recognition, and enhances classification accuracy and efficiency.

[0107] The embodiment of the present invention adopts a deep learning model (convolutional neural network CNN) to extract and classify invoice features. By optimizing the model structure and training strategy, the model's ability to recognize complex invoice images is improved, and accurate classification and information extraction of invoices in multiple scenarios are achieved.

[0108] S5. Customize drag-and-drop configuration using a visual interface, fine-tune using transfer learning, detect abnormal invoices based on anomaly detection algorithms and trigger manual review, and achieve adaptive recognition and classification of various invoice formats and scenarios.

[0109] Provides a visual configuration interface based on the template engine, allowing users to drag and drop field areas to define new templates;

[0110] When there is insufficient data for new scenarios, transfer learning is used to reuse the feature extraction layer of a pre-trained model (such as ResNet) and only fine-tune the top-level classifier.

[0111] Identify unknown invoice types based on anomaly detection algorithms (such as the Isolation Forest algorithm) and trigger the manual review process.

[0112] S6. Perform data persistence processing on invoice identification and classification results, and support interaction with the ERP system.

[0113] Output JSON format data, which contains metadata such as field confidence and the original image path of the invoice;

[0114] Use MySQL database, design table structure, and optimize MySQL query efficiency (such as storage by date partition);

[0115] Supports API connection between MySQL database and ERP system (such as SAP) to achieve real-time data synchronization;

[0116] Generate Excel reports using Apache POI, preserving the original image thumbnails and hyperlinks of the invoices.

[0117] In this embodiment, cloud storage technology is used to store and manage invoice data, ensuring the security and accessibility of the data, and protecting the privacy and integrity of the data through measures such as data encryption and backup.

[0118] Machine learning algorithms are used to automate the classification and storage of invoices. By training the classification algorithms, invoices can be automatically categorized into different types based on their content and format. The use of cloud storage technology also improves the security and reliability of invoice storage.

[0119] The present invention facilitates seamless integration with other financial management systems by designing a flexible system architecture and API interface, improving the scalability and interoperability of the system to meet the diverse needs of enterprises.

[0120] An embodiment of the present invention further provides a multi-scenario invoice automatic recognition and classification system, which implements the multi-scenario invoice automatic recognition and classification method described above, including:

[0121] Image preprocessing module: used for adaptive preprocessing operations such as denoising, binarization, and rotation correction on imported invoice images;

[0122] The image preprocessing module includes:

[0123] Denoising unit: Used to smooth the salt and pepper noise in scanned or photographed invoice images using a Gaussian filtering algorithm;

[0124] Tilt correction unit: used to detect the image tilt angle using Hough transform and perform rotation correction through affine transformation; for local distortion, a grid-based perspective transformation algorithm is used to correct it.

[0125] Text detection and recognition module: used to perform text detection and text recognition on pre-processed invoice images, locate and extract text information in the invoice;

[0126] Key information extraction module: used to extract structured key fields of invoice text information;

[0127] The key information extraction module includes:

[0128] Natural Language Processing (NLP) unit: used to understand semantics and identify entities based on pre-trained models; uses a rule engine to match preset invoice information templates and extract key fields from invoice information templates;

[0129] Context association unit: used to build a field dependency graph and improve the extraction accuracy of fuzzy fields.

[0130] Invoice classification module: used to classify invoices in multiple dimensions using a classification model, including invoice type, invoicing unit, amount range, and industry keywords;

[0131] The invoice classification module includes:

[0132] Feature Engineering Unit: used to extract features such as invoice type, invoicing unit, amount range, industry keywords, etc.

[0133] Classification model unit: used to integrate deep learning models using XGBoost and support multi-label classification; for small sample scenarios, Few-Shot Learning is introduced to enhance the generalization ability of the model using contrastive learning;

[0134] Dynamic update unit: used to adjust classification weights in real time based on online learning and user feedback.

[0135] Multi-scenario adaptation module: This module uses a visual interface to customize drag-and-drop configurations, utilizes transfer learning for fine-tuning, and uses anomaly detection algorithms to detect abnormal invoices and trigger manual review, enabling adaptive recognition and classification of various invoice formats and scenarios.

[0136] Result output and storage module: used for data persistence processing of invoice recognition and classification results, and supports docking and interaction with the ERP system.

[0137] The result output and storage module includes:

[0138] Data structuring unit: used to output JSON format data, which contains metadata such as field confidence and the original image path of the invoice;

[0139] Storage structure unit: used to use MySQL database, design table structure, and optimize MySQL query efficiency;

[0140] Support interaction unit: used to support MySQL database and ERP system through API docking to achieve real-time data synchronization;

[0141] Export unit: used to generate Excel reports using Apache POI, preserving the original image thumbnails and hyperlinks of the invoice.

[0142] The present invention innovatively introduces adaptive preprocessing technology for multi-scenario automatic invoice recognition and classification. This technology automatically adjusts preprocessing parameters such as denoising, binarization, and rotation correction based on the actual invoice image, significantly improving the clarity and readability of the invoice image and laying a solid foundation for subsequent recognition steps.

[0143] An embodiment of the present invention further provides a computer device, Figure 2 This is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention; see the accompanying drawings Figure 2 As shown, the computer device includes: an input system 23, an output system 24, a memory 22 and a processor 21; the memory 22 is used to store one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 implement the multi-scenario invoice automatic recognition and classification method provided in the above embodiment; wherein the input system 23, the output system 24, the memory 22 and the processor 21 can be connected by a bus or other means, Figure 2 The bus connection is taken as an example.

[0144] The memory 22, as a readable and writable storage medium of a computing device, can be used to store software programs and computer executable programs, such as program instructions corresponding to the multi-scenario automatic invoice recognition and classification method described in an embodiment of the present invention. The memory 22 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data created based on the use of the device. In addition, the memory 22 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 may further include memory remotely located relative to the processor 21, and such remote memory may be connected to the device via a network. Examples of the aforementioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0145] The input system 23 may be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device; the output system 24 may include display devices such as a display screen.

[0146] The processor 21 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 22, thereby realizing the above-mentioned multi-scenario invoice automatic recognition and classification method.

[0147] The computer device provided above can be used to execute the multi-scenario invoice automatic identification and classification method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0148] Embodiments of the present invention also provide a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform the multi-scenario automatic invoice identification and classification method provided in the above embodiments. The storage medium is any of various types of memory devices or storage devices. Storage media include: installation media, such as CD-ROMs, floppy disks, or tape systems; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disks or optical storage); registers or other similar types of memory elements; the storage medium may also include other types of memory or a combination thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system via a network (such as the Internet); the second computer system may provide program instructions to the first computer for execution. The storage medium includes two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.

[0149] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present invention is not limited to the multi-scenario invoice automatic recognition and classification method described in the above embodiment, and can also execute related operations in the multi-scenario invoice automatic recognition and classification method provided in any embodiment of the present invention.

[0150] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.

[0151] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A multi-scenario invoice automatic recognition and classification method, characterized by: The following steps are involved: S1. performing adaptive preprocessing operations such as denoising, binarization, and rotation correction on the imported invoice image; S2. Perform text detection and text recognition on the preprocessed invoice image to locate and extract text information in the invoice; S3. Extract structured key fields of the invoice text information; S4. Using a classification model to classify invoices in multiple dimensions, the multiple dimensions including: invoice type, invoicing unit, amount range, and industry keywords; S5. Customize drag-and-drop configuration using a visual interface, fine-tune using transfer learning, detect abnormal invoices based on anomaly detection algorithms and trigger manual review, and achieve adaptive recognition and classification of various invoice formats and scenarios. S6. Perform data persistence processing on invoice identification and classification results, and support interaction with the ERP system; The method of the adaptive preprocessing operation in step S1 includes: Use Gaussian filtering algorithm to smooth the salt and pepper noise in scanned or photographed invoice images; The image tilt angle is detected using Hough transform, and rotation correction is performed through affine transformation. For local distortion, a grid-based perspective transformation algorithm is used to correct it. The S3 step includes: Perform semantic understanding and entity recognition based on pre-trained models; use the rule engine to match preset invoice information templates and extract key fields from the invoice information templates; Build a field dependency graph to improve the extraction accuracy of fuzzy fields; The S4 step includes: Extract features such as invoice type, invoicing unit, amount range, and industry keywords; XGBoost is used to integrate deep learning models and support multi-label classification. Few-Shot Learning is introduced for small sample scenarios, and contrastive learning is used to enhance the generalization ability of the model. Based on online learning, classification weights are adjusted in real time according to user feedback.

2. The multi-scenario invoice automatic identification and classification method according to claim 1 is characterized in that: The text detection method of step S2 includes: using the EAST model to extract image features through the PVANet backbone network to generate text area geometric frames; for dense text areas, introducing the NMS algorithm to optimize the detection frame overlap problem; The text recognition method includes: using a CRNN model in combination with a CTC loss function to support variable-length text recognition; for multilingual scenarios, implementing mixed Chinese and English recognition by integrating a Tesseract OCR engine; and post-processing the recognition results, wherein the post-processing includes correcting recognition errors through dictionary constraints.

3. The multi-scenario invoice automatic identification and classification method according to claim 1 is characterized in that: The S6 step includes: Outputting JSON format data, wherein the JSON format data includes meta information such as field confidence and the original image path of the invoice; Use MySQL database, design table structure, and optimize MySQL query efficiency; Support MySQL database and ERP system docking through API to achieve real-time data synchronization; Generate Excel reports using Apache POI, preserving the original image thumbnails and hyperlinks of the invoices.

4. The multi-scenario invoice automatic identification and classification method according to claim 1 is characterized in that: The S1 step also includes: The invoice image files to be identified are sorted and stored in a designated folder; the folder containing the invoice image files is selected to import the invoice images, and all the invoice image files in the folder are read.

5. A multi-scenario invoice automatic recognition and classification system, which implements the multi-scenario invoice automatic recognition and classification method according to any one of claims 1 to 4, characterized in that: include: Image preprocessing module: used for adaptive preprocessing operations such as denoising, binarization, and rotation correction on imported invoice images; Text detection and recognition module: used to perform text detection and text recognition on pre-processed invoice images, locate and extract text information in the invoice; Key information extraction module: used to extract structured key fields of invoice text information; Invoice classification module: used to classify invoices in multiple dimensions using a classification model, including invoice type, invoicing unit, amount range, and industry keywords; Multi-scenario adaptation module: This module uses a visual interface to customize drag-and-drop configurations, utilizes transfer learning for fine-tuning, and uses anomaly detection algorithms to detect abnormal invoices and trigger manual review, enabling adaptive recognition and classification of various invoice formats and scenarios. Result output and storage module: used for data persistence processing of invoice recognition and classification results, and supports docking and interaction with the ERP system.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the multi-scenario invoice automatic recognition and classification method according to any one of claims 1 to 4 are implemented.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the multi-scenario invoice automatic identification and classification method as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Invoice information identification method and device, equipment and storage medium

    CN118072321A

  • Image feature information extraction processing method and device

    CN119007219A