Image recognition method and device, equipment and storage medium

By preprocessing and text information extraction of the image to be recognized, combined with word participle matching technology, the existing OCR system has solved the problem of low efficiency and insufficient accuracy in identifying complex documents, and achieved more efficient and accurate information recognition and processing.

CN119625770APending Publication Date: 2025-03-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411812747.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When existing OCR systems identify reimbursement vouchers and documents with complex formats and a wide range of contents, the processing speed is slow and the accuracy is not high, so they cannot achieve effective information identification and processing.

Method used

By obtaining the image of the document to be identified, pre-processing includes noise reduction processing, extracting character tiles and text information, combining word segmentation matching and classification techniques, generating and uploading recognition result data.

Benefits of technology

It improves the clarity and recognition accuracy of the image, effectively solves the recognition difficulties caused by complicated document content and inconsistent format, and improves the efficiency and accuracy in the office automation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625770A_ABST
    Figure CN119625770A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image recognition method and device, equipment and a storage medium, and relates to the field of financial science and technology or other related fields. The method comprises the steps of obtaining a to-be-recognized image corresponding to a to-be-recognized document, preprocessing the to-be-recognized image, then extracting character image blocks in the preprocessed to-be-recognized image, then extracting text information in the character image blocks, and finally generating and uploading recognition result data based on the text information. According to the method provided by the invention, the difficulty in identification caused by complicated contents and inconsistent formats of the receipts is effectively solved, and the difficulty in identification caused by complicated contents and inconsistent formats of the receipts is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology or other related fields, and in particular to an image recognition method, device, equipment and storage medium. Background Art

[0002] With the rapid development of Internet technology, OCR (Optical Character Recognition) technology has been widely used in many fields, such as digital document processing, machine translation, and automated data input. However, in practical applications, especially in the field of office automation, users hope that OCR technology can be combined with data processing and other technologies to achieve more automated data recognition and processing. For example, in the expense reimbursement process, it is hoped that OCR technology can be used to complete the recognition and information entry of various reimbursement vouchers and documents.

[0003] In the related technology, users need to submit a variety of reimbursement vouchers and documents with specific format requirements, such as reimbursement application forms, activity schedule record forms, etc. Due to the large amount of content and different formats of the documents, the existing OCR system has a slow processing speed and low accuracy when recognizing these document types, resulting in the inability to achieve effective information recognition and processing. Summary of the invention

[0004] The present application provides an image recognition method, apparatus, device and storage medium to solve the problem of low efficiency and insufficient accuracy of OCR technology in recognizing document types in related technologies.

[0005] In a first aspect, the present application provides an image recognition method, comprising:

[0006] Acquire an image to be identified corresponding to the document to be identified, and preprocess the image to be identified, wherein the preprocessing includes noise reduction processing;

[0007] Extracting character blocks from the preprocessed image to be recognized, wherein the character blocks are used to represent an image containing a single character;

[0008] Extracting text information from the character block, wherein the text information includes document items and content information corresponding to each document item;

[0009] Based on the text information, generate and upload recognition result data.

[0010] In a second aspect, the present application provides an image recognition device, comprising:

[0011] An acquisition module is used to acquire an image to be identified corresponding to the document to be identified, and preprocess the image to be identified, wherein the preprocessing includes noise reduction processing;

[0012] An extraction module, used for extracting character blocks from the preprocessed image to be recognized, wherein the character blocks are used to represent an image containing a single character;

[0013] A recognition module, used to extract text information from the character block, wherein the text information includes document items and content information corresponding to each document item;

[0014] The output module is used to generate and upload recognition result data based on text information.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0016] The memory stores computer-executable instructions;

[0017] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0020] The image recognition method, device, equipment and storage medium provided by the embodiments of the present disclosure obtain the image to be recognized corresponding to the document to be recognized, pre-process the image to be recognized, extract the character blocks in the pre-processed image to be recognized, and then extract the text information in the character blocks. Finally, based on the text information, the recognition result data is generated and uploaded. Thus, by pre-processing the image to be recognized, including noise reduction, the clarity and recognition accuracy of the image are improved. By extracting character blocks and text information, the solution effectively solves the recognition difficulties caused by complex document content and inconsistent formats. By using word segmentation matching and classification technology, the solution can accurately extract document items and their corresponding content information, and improve the accuracy and processing speed of recognition results. The recognition result data finally generated and uploaded significantly improves the efficiency and accuracy in the office automation process. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0022] Figure 1 An application scenario diagram of the image recognition method provided by the embodiment of the present disclosure;

[0023] Figure 2 A flowchart of an image recognition method provided by an embodiment of the present disclosure;

[0024] Figure 3a A flowchart of an image recognition method provided by yet another embodiment of the present disclosure;

[0025] Figure 3b for Figure 3a A flow chart of a method for identifying a document item provided by the illustrated embodiment;

[0026] Figure 3c for Figure 3a A flow chart of a method for identifying content information provided by the illustrated embodiment;

[0027] Figure 4 A schematic diagram of the structure of an image recognition device provided by another embodiment of the present disclosure;

[0028] Figure 5 A schematic diagram of the structure of an electronic device provided by one embodiment of the present disclosure.

[0029] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0032] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.

[0033] It should be noted that the image recognition method, device, equipment and storage medium provided in this application can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application field of the image recognition method, device, equipment, storage medium and product in this application is not limited.

[0034] Figure 1 A schematic diagram of an application scenario of the image recognition method provided in this application, such as Figure 1 As shown, during the image recognition process, the user takes a photo of the document to be reimbursed 110 through a device 100 including a camera (such as a smart phone), and uploads the image to an image processing server 120. The image processing server 120 will identify the document-related information therein and upload it to the financial system server 130, completing the image recognition and document processing process.

[0035] It should be noted that Figure 1 In the scenario shown, the devices containing cameras, the documents to be reimbursed, the image processing servers, and the financial system servers are illustrated by only one or a specific number, but the present disclosure is not limited to this. That is, the number of devices containing cameras, the documents to be reimbursed, the image processing servers, and the financial system servers can be arbitrary.

[0036] With the rapid development of Internet technology, OCR technology has been widely used in many fields, such as digital document processing and automated data input. However, with the complexity of application scenarios, especially in the field of office automation, OCR technology faces new challenges. For example, in the expense reimbursement process, users need to deal with a variety of reimbursement vouchers and documents with complex formats and rich contents, such as reimbursement application forms and activity schedule record sheets. These documents usually contain a lot of information and are not in a uniform format, which results in slow processing speed and low accuracy of existing OCR systems during recognition. In addition, factors such as handwriting, different fonts, and irregular filling further increase the complexity of recognition.

[0037] Since the recognition process involves many variables, such as document format, font diversity, and large amount of information, these factors make it difficult to directly identify the root cause of the problem. The difficulty in solving these problems lies mainly in the need to develop an OCR technology solution that can adapt to a variety of formats and contents. The solution must have efficient image preprocessing capabilities, such as handwritten font recognition. At the same time, the solution must also have powerful text information extraction and classification capabilities to cope with the diversity and inconsistency of document content. This requires innovation in algorithm design, accuracy optimization, and recognition and judgment of a variety of different information to improve recognition accuracy and processing speed. It involves many fields and is difficult to solve.

[0038] The image recognition method provided by this application solves the recognition difficulties caused by complex formats and large amounts of information by preprocessing the image to be recognized to improve clarity. By extracting character blocks and text information, combined with word segmentation matching and classification technology, it can effectively cope with diversified document formats and text information of various different contents, and improve recognition accuracy and processing speed.

[0039] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0040] Figure 2 Schematic diagram of the image recognition method provided in this application Figure 1 ,like Figure 2 As shown, the method includes:

[0041] S201, obtaining an image to be recognized corresponding to the document to be recognized, and preprocessing the image to be recognized.

[0042] Among them, preprocessing includes noise reduction processing.

[0043] Specifically, this embodiment is used to summarize the main process of the image recognition method.

[0044] The executor of the image recognition method in the embodiment of the present disclosure may be a server in an enterprise, a high-performance computer used as a server, or other equipment capable of data processing, which are collectively referred to as servers below for the convenience of explanation.

[0045] Before performing image recognition, the server first needs to obtain the corresponding image to be recognized.

[0046] That is, the user corresponding to the document that needs to be reimbursed, or the user who manages the entry of document-related information (such as financial personnel) generates an image of the document to be recognized through a high-resolution scanner or high-definition camera.

[0047] In order to facilitate subsequent processing, the clarity of the image needs to be ensured.

[0048] After acquiring the image, before further image recognition, it is necessary to first enter the preprocessing stage to optimize the image quality and ensure the accuracy of subsequent image recognition results.

[0049] In some embodiments, the preprocessing may include multiple sub-steps: first, noise reduction processing, usually using Gaussian filtering or median filtering to remove random noise and interference points in the image, so that the edges of the characters are clearer. Next, grayscale processing is performed to convert the color image into a grayscale image to simplify the data and highlight the character information. Then, binarization processing is performed to convert the grayscale image into a black and white image by selecting an appropriate threshold to enhance the contrast between the characters and the background.

[0050] In some embodiments, in addition to the above steps, preprocessing may also include: performing geometric correction to adjust the tilt angle of the image to ensure the horizontal arrangement of the characters. In addition, adaptive threshold technology may be used to adapt to different lighting conditions and image quality, or perspective transformation correction may be performed to correct image distortion caused by the shooting angle. In order to improve the efficiency of preprocessing, parallel processing technology may be used to divide the image into multiple regions for simultaneous processing.

[0051] In some embodiments, if the document type can be predetermined (the user can transmit relevant information of the specified document type to the server in advance), for such predetermined specific type of documents, template matching technology can also be applied to identify and locate key areas in the document, such as titles and tables.

[0052] S202: extracting character blocks from the preprocessed image to be recognized.

[0053] Among them, the character tile is used to represent an image containing a single character.

[0054] Specifically, after the image preprocessing is completed, the next step is to extract the character blocks from the image. The accuracy of this step directly affects the subsequent character recognition effect.

[0055] In actual processing, image segmentation technology can be used to extract character blocks. For example, connected domain analysis or contour detection methods can be used to separate characters from the background. Connected domain analysis determines the character boundaries by identifying connected pixel areas in the image, while contour detection achieves segmentation by identifying the external contours of the characters. In order to improve accuracy, algorithms such as Canny edge detection can be used to ensure the integrity and continuity of the character contours.

[0056] In addition, morphological processing algorithms, such as dilation and erosion algorithms, can be combined to repair broken character edges or noise interference.

[0057] In some embodiments, the server may also adjust the parameters of the segmentation algorithm according to character size, spacing, and font features, or use a deep learning model for automatic segmentation to adapt to different fonts and typesetting styles.

[0058] In some embodiments, in order to handle complex backgrounds or overlapping characters (such as overlapping of handwritten content and document characters), image enhancement technology can be combined to improve the distinguishability of characters, or machine learning algorithms can be applied to automatically mark and segment character areas.

[0059] S203: extracting text information from the character block.

[0060] The text information includes document items and content information corresponding to each document item.

[0061] Specifically, text information is extracted from each character tile, which is the core of image recognition.

[0062] In the specific implementation, first, the character blocks are recognized using an OCR algorithm, for example, the traditional Tesseract algorithm or a convolutional neural network (CNN) model based on deep learning can be selected (the relevant algorithms are common knowledge in the art and will not be described in detail here).

[0063] For different types of text information, different algorithms such as word segmentation and template matching can be combined to ensure that the recognition results meet the expected format and content. Alternatively, different languages ​​and character sets can be used for different types of text information, and appropriate OCR models can be selected, or custom models can be trained to improve targeted recognition results.

[0064] In some embodiments, in order to process handwriting or irregular fonts, image feature extraction technology can be combined to enhance the recognition ability of complex characters, and context correction algorithm can be combined to perform semantic analysis and error correction based on the recognized text information to improve the overall recognition accuracy.

[0065] S204: Generate and upload recognition result data based on the text information.

[0066] Specifically, by generating structured recognition result data from the extracted text information, the results can be easily uploaded and stored in a designated system or database (such as a financial system for processing documents).

[0067] The generated data is usually in JSON, XML and other formats to facilitate subsequent data processing and analysis.

[0068] In terms of specific implementation, first, the recognized text information can be constructed into a corresponding data structure according to the preset data structure corresponding to the document type, ensuring that each document item and content information has a clear identification and hierarchical relationship. Then, the recognition results are uploaded to the target system through the API interface or data transmission protocol to ensure the real-time and security of the data.

[0069] In some embodiments, data verification and format conversion can also be performed during the upload process to ensure the integrity and consistency of the data. The data format and upload frequency can be customized according to business needs, or encryption technology can be used to protect the security of data transmission. In addition, data analysis tools can be integrated to further count and analyze the recognition results to support business decisions and optimization. In order to improve the efficiency of data processing, batch processing technology can be used to upload and store multiple recognition results at the same time. For application scenarios that require high security, blockchain technology can be used to record the process of data upload to ensure the immutability and transparency of the data.

[0070] The image recognition method provided in the embodiment of the present application obtains the image to be recognized corresponding to the document to be recognized, pre-processes the image to be recognized, extracts the character blocks in the pre-processed image to be recognized, and then extracts the text information in the character blocks. Finally, based on the text information, the recognition result data is generated and uploaded. Thus, by pre-processing the image to be recognized, including noise reduction, the clarity and recognition accuracy of the image are improved. By extracting character blocks and text information, the scheme effectively solves the recognition difficulties caused by complex document content and inconsistent formats. Using word segmentation matching and classification technology, the scheme can accurately extract document items and their corresponding content information, and improve the accuracy and processing speed of recognition results. The recognition result data finally generated and uploaded significantly improves the efficiency and accuracy in the office automation process.

[0071] Figure 3a Schematic diagram of the image recognition process provided for this application Figure 2 ,like Figure 3a As shown, in this embodiment Figure 2 Based on the embodiment, the specific process in the image recognition method is described in detail, and the method includes:

[0072] S301, obtaining an image to be recognized corresponding to the document to be recognized.

[0073] Specifically, this embodiment is used to explain in detail the specific steps of the image recognition method.

[0074] In actual applications, if the user who needs to upload the image to be identified (that is, the image corresponding to the document) does not have a high-resolution scanner or high-definition camera equipment, he can also use the mobile phone camera to take a photo of the document to be reimbursed and upload the image to the server for processing to ensure user convenience.

[0075] S302: Convert the image to be recognized into a grayscale image.

[0076] Specifically, converting a color image to a grayscale image is a key step to simplify data and highlight character information. The server can achieve grayscale conversion based on the RGB color model and combined with the weighted average method. The following is a detailed description:

[0077] Exemplarily, the method of converting to a grayscale image comprises the following steps:

[0078] Step A1: Obtain the color value corresponding to each pixel in the image to be identified.

[0079] The color value includes a red component value, a green component value, and a blue component value.

[0080] Specifically, the color value of each pixel in the image to be identified is extracted, including red, green and blue component values. These component values ​​are usually in the range of 0 to 255, indicating the color intensity of the pixel.

[0081] Step A2: Determine the grayscale value of the pixel by taking the weighted average of the color value and the weight corresponding to each color.

[0082] Specifically, the weighted average method is used to calculate the gray value, and its calculation formula can be expressed as:

[0083] V = W_R × R + W_G × G + W_B × B;

[0084] Among them, R, G, B represent the red, green, and blue component values ​​of each pixel in the original image, and W_R, W_G, and W_B are channel weights.

[0085] In some embodiments, commonly used weights are 0.299 for red, 0.587 for green, and 0.114 for blue, which just correspond to the sensitivity of the human eye to different colors. Therefore, the above calculation formula can also be expressed as:

[0086] Gray value = 0.299*red + 0.587*green + 0.114*blue.

[0087] The resulting grayscale value usually ranges from 0 to 255, with 0 representing black and 255 representing white.

[0088] Step A3: based on the gray value of each pixel in the image to be identified, convert the image to be identified into a grayscale image.

[0089] Specifically, the grayscale value of each pixel is applied to each pixel in the image, so that a grayscale image can be generated.

[0090] By converting a color image to grayscale, subsequent processing steps are simplified and computational complexity is reduced. Optional actions include applying a histogram equalization technique to enhance the contrast and details of the image.

[0091] S303: Based on the Otsu segmentation algorithm, the grayscale image is converted into a black and white image.

[0092] Specifically, after obtaining the grayscale image, it is necessary to further convert the grayscale image into an image containing only black and white.

[0093] In this embodiment, the algorithm used for black and white image conversion is the Otsu segmentation algorithm, which automatically determines the optimal threshold value by maximizing the inter-class variance to divide pixels into foreground and background. When performing this step, the grayscale histogram of the image is first calculated, and then the Otsu algorithm is applied to determine the threshold value.

[0094] Optionally, before passing through the Otsu segmentation algorithm, the image can be smoothed to reduce the impact of noise on threshold calculation. For images with complex backgrounds, local threshold segmentation technology can be combined to improve the accuracy of segmentation.

[0095] S304: Perform noise reduction processing on the black and white image based on a noise reduction algorithm.

[0096] Specifically, for the obtained black and white image, a filter can be used to reduce noise of a specific frequency in the image, such as dust, scratches, etc., so as to reduce the interference of the noise on subsequent text recognition.

[0097] In some embodiments, a noise reduction algorithm may be used for processing before any one of steps S302 and S303, or before both steps, to improve the noise reduction effect.

[0098] S305: extracting contour information corresponding to the text in the preprocessed image to be recognized.

[0099] Specifically, the server may use image processing technologies such as edge detection and contour analysis to extract the text contour of the black-and-white image to be recognized.

[0100] In addition to using edge detection algorithms (such as Canny edge detection) to identify the outer contour of characters, you can also use contour tracking technology to extract the boundary information of each character. In addition, you can adjust the edge detection parameters according to the size and shape of the character to improve the accuracy of contour extraction. For complex backgrounds, you can combine image enhancement technology to improve the visibility of character contours.

[0101] S306 : Based on the contour information, identify a target area containing text in the preprocessed image to be recognized, and segment the target area into character blocks.

[0102] Specifically, the extracted contour information can be used to identify the target area containing text in the image, and the character area can be determined by analyzing the geometric features of the contour (such as area, aspect ratio). At this time, each target area usually corresponds to a text line.

[0103] Subsequently, a segmentation algorithm (such as connected component analysis) is applied to segment the target area into individual character tiles by segmenting the text line into individual characters and segmenting each character into a separate image, namely, a character tile.

[0104] Optionally, the parameters of the segmentation algorithm are adjusted according to the character spacing and typesetting style, or a deep learning model is used for automatic segmentation to improve the accuracy and robustness of the segmentation.

[0105] S307: Extract the text in each character block based on a text recognition algorithm.

[0106] Specifically, since each character block at this time contains only one character (or text), an OCR algorithm can be used to recognize text information in each character block at this time.

[0107] S308. Based on the pre-configured form template, identify the document items in the text.

[0108] Among them, document items include document name, document type and form item name.

[0109] Specifically, after obtaining the above text, the corresponding text can be further recognized to extract the document information corresponding to the image.

[0110] For example, you can combine the word segmentation algorithm with the pre-configured form template to identify document items in the text, including the document name, document type, and form item name.

[0111] In the specific implementation, it is necessary to find the document name and the names of each table item in the table from the recognized text. Among them, the N-shortest path word segmentation method can be used for the document name, and the detail keyword matching method can be used for the table item name. By comparing with the various reimbursement document template information preset by the system, the current document type can be determined to prepare for subsequent information recognition.

[0112] For example, the recognized document name is "Receipt form for physical items received at the central union activity", and the word segmentation results are "central union", "activity", "physical items", "receipt", and "receipt form", and the table item name recognition results are "item name", "quantity", "amount", "name of winner", "type of award", etc. Based on the comparison results, the document is determined to be a "receipt form" type.

[0113] Furthermore, if Figure 3b As shown, it is a flow chart of a method for identifying a document item. The method for identifying a document item includes the following steps:

[0114] Step S3081: Identify the document name in the text based on the shortest path word segmentation algorithm.

[0115] Specifically, to facilitate specific identification, word segmentation processing is first required. At this time, the shortest path word segmentation algorithm can be used to divide the text into vocabulary units.

[0116] The shortest path word segmentation algorithm, also known as the N-shortest path word segmentation algorithm, uses dynamic programming to find the optimal path for word segmentation. By matching the identified words with the preset document names, the document names in the text can be determined. In the specific processing, the parameters of the word segmentation algorithm can also be adjusted according to the vocabulary of a specific field to improve the accuracy of word segmentation.

[0117] Step S3082: Based on the keyword matching algorithm, the result of matching the preset table item name in the text with the preset template is determined as the table item name.

[0118] Specifically, based on the word segmentation in the above step, for words that are not document names, a keyword matching algorithm can be used to identify words that match the table item names in the preset template.

[0119] During the matching process, fuzzy matching technology can be combined to improve the recognition ability of table item information in documents of different states. For example, the table item name may be partially covered by the user's handwritten text, or the document may be wrinkled, resulting in partial text recognition errors in the table item name.

[0120] In some embodiments, the matching algorithm parameters may be adjusted according to the characteristics of the table item names, or semantic analysis may be performed in combination with context information to improve the matching accuracy.

[0121] Step S3083: Determine the form type corresponding to the document to be identified based on the form item name and the form type corresponding to the preset table item name in the preset template.

[0122] Specifically, the server has preset form types corresponding to different table item names and document names. Therefore, based on the above steps, the form type corresponding to the form name and table item name can be determined. For example, by looking up the mapping relationship in the preset template, the form type can be quickly determined. The mapping relationship can be customized by the developer according to business needs, or it can be automatically classified in combination with a machine learning algorithm to improve the flexibility and accuracy of recognition.

[0123] S309: Identify content information in the text based on a pre-configured content information dictionary.

[0124] The content information includes identity information and non-identity information.

[0125] Specifically, the document item information is the information inherent in the document, and the content information is the information that needs to be filled in and entered by the user. For the latter, a pre-configured content information dictionary can be used to identify the content information in the text, including identity information and non-identity information.

[0126] For example, a complete standard character template library of all possible content information involved in all documents can be pre-established in the server (because the information such as name, identity, reimbursement amount, etc. that need to be filled in the document is relatively fixed, so it can be pre-configured) to identify the content information in the form. By using an improved dictionary search algorithm, the content text is compared with the template library dictionary value for similarity, and the one with the highest similarity is the recognition result, and finally the recognition of all form line content is completed.

[0127] Furthermore, if Figure 3c As shown, it is a flow chart of a method for identifying content information. The method for identifying content information includes the following steps:

[0128] Step S3091: perform word segmentation processing on the text based on the word segmentation processing algorithm.

[0129] Specifically, the word segmentation processing of the text can also be completed in the aforementioned process of identifying the document item information, or can be implemented through a statistical method or a rule-based method.

[0130] Step S3092: Match the result of the word segmentation processing with the content information dictionary, and determine the content information based on the matching result.

[0131] Specifically, for organizations under different enterprise structures, the department, employee name, and reimbursement document type required in the corresponding reimbursement documents are relatively fixed. Therefore, the corresponding specific dictionary values ​​can be pre-built to obtain the content information dictionary. The result of the word segmentation processing is then matched with the content information dictionary to determine the content information.

[0132] Specific matches include the following:

[0133] Case 1: if there is a first-category word in the content information dictionary that completely matches the result of the word segmentation processing, the first-category word is determined as the content information corresponding to the result of the word segmentation processing.

[0134] Specifically, directly matching words are determined as content information to ensure the accuracy of recognition. When specifically calculating the degree of matching, a hash table or a dictionary tree can be used to accelerate the matching efficiency.

[0135] Case 2: If there is no first-category vocabulary in the content information dictionary that completely matches the result of the word segmentation processing, and there is a second-category vocabulary whose similarity with the result of the word segmentation processing is greater than a set threshold, the second-category vocabulary is determined as the content information corresponding to the result of the word segmentation processing.

[0136] Specifically, in the case where the first category of words cannot be directly matched, similarity calculation (such as edit distance or cosine similarity) can also be used to identify similar words.

[0137] Case 3: If there is no first-category word in the content information dictionary that completely matches the result of the word segmentation processing, and there is no second-category word whose similarity with the result of the word segmentation processing is greater than a set threshold, an alarm message is generated based on the word segmentation processing result.

[0138] Specifically, in the case where a content information dictionary result that matches the word segmentation processing result cannot be found in a similarity calculation with a threshold, it can be considered that the user has filled in the information incorrectly. In this case, there is no need to force a matching result (because the result found at this time is likely to be wrong), but an alarm message should be generated to prompt the user to manually check to ensure the integrity of the recognition.

[0139] In some embodiments, the server may record unsuccessful word segmentation processing results for subsequent analysis and updating of the content information dictionary.

[0140] For example, taking the "receipt form" template as an example, the "name of the winner" is compared with the names of all employees in the system, and the final result is output as "Zhang San". The "winner's department" is compared with the system's institutional department parameter dictionary values ​​such as office, business R&D management department, security department, etc., and the final result is output as "business R&D management department". The "award type" is compared with the system's award type parameter dictionary values ​​such as first prize, second prize, third prize, encouragement prize, and participation prize, and the final result is output as "first prize", thereby identifying all text content.

[0141] S310: Based on the set verification rules, determine whether the characters and numbers in the text information pass the corresponding checks.

[0142] Specifically, after obtaining the text information, the server can verify the recognition result, such as checking whether the characters are valid and whether the reimbursement amount is correct. In this solution, since the recognition process uses preset templates, content information dictionaries, etc. for matching, there is no need to correct the final recognition result, thereby ensuring recognition efficiency.

[0143] Specific verification rules may include format checks (such as date format, phone number format), value range checks (such as amount range), etc. For text information that does not comply with the rules, a warning or prompt message may be generated to remind the user to perform manual verification.

[0144] S311. Generate and upload recognition result data based on the text information.

[0145] Specifically, after completing the verification, the server can combine all the recognized text information into various types of reimbursement document form files according to pre-defined requirements, and upload them to the enterprise financial system for processing.

[0146] Therefore, this solution first performs subject identification (i.e., document item identification) on the uploaded content, and then classifies and identifies the content in different ways according to different subjects.

[0147] At the same time, a proprietary vocabulary library for reimbursement documents is formed based on the reimbursement standards and actual document templates within the enterprise, such as union activities, receipt forms, delivery forms, award types, etc., and the N-shortest path word segmentation method is used for the document name, and the detail keyword matching method is used for the reimbursement form item name, which can more efficiently compare information and determine the type of reimbursement document.

[0148] In addition, based on the organizational structure within the enterprise, specific dictionary values ​​and a complete character template library are constructed for the organizational department, employee name, and other contents required in the reimbursement documents, and the dictionary search algorithm is improved, so that text recognition can be performed better and faster.

[0149] The image recognition method provided by the embodiment of the present disclosure improves the clarity of the image and the distinguishability of the characters by performing multi-level preprocessing (including graying, noise reduction and Otsu segmentation) on the image to be recognized. Secondly, the edge detection and contour analysis techniques are used to accurately extract character blocks to ensure the integrity of character segmentation. By combining the traditional OCR algorithm and the deep learning model, the solution achieves high-precision character recognition in text recognition. Furthermore, based on the preset template and content information dictionary, the solution can effectively identify document items and content information, and improve the accuracy of recognition by keyword matching and similarity calculation. Finally, by setting verification rules and uploading structured data, the integrity and security of the recognition results are ensured. The overall solution not only solves the recognition problems caused by complex backgrounds and inconsistent formats, but also adapts to a variety of application scenarios through flexible algorithm adjustments and custom rules, thereby improving the robustness and practicality of the system.

[0150] Figure 4 A schematic diagram of the structure of the image recognition device provided in this application, such as Figure 4 As shown, the image recognition device 400 provided in this embodiment includes:

[0151] The acquisition module 410 is used to acquire the image to be identified corresponding to the document to be identified, and pre-process the image to be identified, wherein the pre-processing includes noise reduction processing;

[0152] An extraction module 420, used to extract character blocks from the preprocessed image to be recognized, wherein the character blocks are used to represent an image containing a single character;

[0153] The recognition module 430 is used to extract text information from the character block, wherein the text information includes the document items and the content information corresponding to each document item;

[0154] The output module 440 is used to generate and upload recognition result data based on the text information.

[0155] In a possible implementation, the acquisition module 410 is specifically used to obtain the image to be identified corresponding to the document to be identified; convert the image to be identified into a grayscale image; based on the Otsu segmentation algorithm, convert the grayscale image into a black and white image; based on the noise reduction algorithm, perform noise reduction processing on the black and white image.

[0156] In one possible implementation, the acquisition module 410 is specifically used to obtain the color value corresponding to each pixel in the image to be identified, the color value including a red component value, a green component value, and a blue component value; determine the weighted average of the color value and the weight corresponding to each color as the grayscale value of the pixel; and convert the image to be identified into a grayscale image based on the grayscale value of each pixel in the image to be identified.

[0157] In a possible implementation, the extraction module 420 is specifically used to extract contour information corresponding to the text in the preprocessed image to be recognized; based on the contour information, identify the target area containing text in the preprocessed image to be recognized, and segment the target area into character blocks.

[0158] In one possible implementation, the recognition module 430 is specifically used to extract text from each character block based on a text recognition algorithm; recognize document items in the text based on a preconfigured form template; and recognize content information in the text based on a preconfigured content information dictionary.

[0159] In one possible implementation, the identification module 430 is specifically used to: if the document item includes a document name, a document type, and a table item name; based on the shortest path word segmentation algorithm, identify the document name in the text; based on the keyword matching algorithm, determine the result of matching the text with the preset table item name in the preset template as the table item name; based on the table item name and the form type corresponding to the preset table item name in the preset template, determine the form type corresponding to the document to be identified.

[0160] In a possible implementation, the identification module 430 is specifically used to, if the content information includes identity information and non-identity information; perform word segmentation on the text based on a word segmentation algorithm; match the word segmentation result with the content information dictionary, and determine the content information based on the matching result.

[0161] In one possible implementation, the identification module 430 is specifically used to, if there is a first-category word in the content information dictionary that completely matches the result of the word segmentation processing, determine the first-category word as the content information corresponding to the word segmentation processing result; if there is no first-category word in the content information dictionary that completely matches the result of the word segmentation processing, and there is a second-category word whose similarity with the result of the word segmentation processing is greater than a set threshold, determine the second-category word as the content information corresponding to the word segmentation processing result.

[0162] In one possible implementation, the identification module 430 is also used to match the result of the word segmentation processing with the content information dictionary. After determining the content information based on the matching result, if there is no first-category vocabulary in the content information dictionary that completely matches the result of the word segmentation processing, and there is no second-category vocabulary whose similarity with the result of the word segmentation processing is greater than a set threshold, an alarm message is generated based on the word segmentation processing result.

[0163] In a possible implementation, the output module 440 is further used to determine whether characters and numbers in the text information pass corresponding checks based on set verification rules before generating and uploading recognition result data based on the text information.

[0164] The image recognition device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail in this embodiment.

[0165] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0166] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0167] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0168] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0169] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0170] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0171] The present application also provides a computer program product, including a computer program, which implements the method in any of the above embodiments when executed by a processor.

[0172] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method in any of the above embodiments is implemented.

[0173] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0174] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0175] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0177] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0178] If the function is implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0179] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0180] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0181] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0182] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0183] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.

[0184] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, 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. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0185] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0186] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0187] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. An image recognition method, characterized in that: The steps include: Acquire an image to be identified corresponding to the document to be identified, and preprocess the image to be identified, wherein the preprocessing includes noise reduction processing; Extracting a character block from the preprocessed image to be recognized, wherein the character block is used to represent an image containing a single character; Extracting text information from the character block, wherein the text information includes document items and content information corresponding to each document item; Based on the text information, recognition result data is generated and uploaded.

2. The method according to claim 1, characterized in that The step of obtaining an image to be identified corresponding to the document to be identified and preprocessing the image to be identified includes: Obtaining an image to be identified corresponding to the document to be identified; Converting the image to be recognized into a grayscale image; Based on Otsu segmentation algorithm, converting the grayscale image into a black and white image; Based on a noise reduction algorithm, noise reduction processing is performed on the black and white image.

3. The method according to claim 2, characterized in that The step of converting the image to be recognized into a grayscale image comprises: Obtaining a color value corresponding to each pixel in the image to be identified, wherein the color value includes a red component value, a green component value, and a blue component value; Determine the grayscale value of the pixel point as a weighted average of the color value and the weight corresponding to each color; Based on the grayscale value of each pixel in the image to be identified, the image to be identified is converted into a grayscale image.

4. The method according to claim 1, characterized in that: The step of extracting character blocks from the preprocessed image to be recognized includes: Extracting the contour information corresponding to the text in the preprocessed image to be recognized; Based on the contour information, a target area containing text in the preprocessed image to be recognized is identified, and the target area is segmented into character blocks.

5. The method according to claim 1, characterized in that The extracting text information from the character block includes: Based on the text recognition algorithm, the text in each character tile is extracted; Based on a pre-configured form template, identifying a document item in the text; Based on a pre-configured content information dictionary, content information in the text is identified.

6. The method according to claim 5, characterized in that The document items include document name, document type and form item name; The identifying the document items in the text based on the pre-configured form template includes: Based on the shortest path word segmentation algorithm, identifying the document name in the text; Based on a keyword matching algorithm, a result of matching the text with a preset table item name in a preset template is determined as a table item name; Based on the table item name and the form type corresponding to the preset table item name in the preset template, the form type corresponding to the document to be identified is determined.

7. The method according to claim 5, characterized in that The content information includes identity information and non-identity information; The identifying the content information in the text based on a pre-configured content information dictionary includes: Based on a word segmentation processing algorithm, performing word segmentation processing on the text; The result of the word segmentation processing is matched with the content information dictionary, and the content information is determined based on the matching result.

8. The method according to claim 7, characterized in that The step of matching the word segmentation result with the content information dictionary and determining the content information based on the matching result includes: If there is a first-category word in the content information dictionary that completely matches the result of the word segmentation processing, determining the first-category word as the content information corresponding to the result of the word segmentation processing; If there is no first-category vocabulary in the content information dictionary that completely matches the result of the word segmentation processing, and there is a second-category vocabulary whose similarity to the result of the word segmentation processing is greater than a set threshold, the second-category vocabulary is determined as the content information corresponding to the word segmentation processing result.

9. The method according to claim 8, characterized in that After matching the result of the word segmentation processing with the content information dictionary and determining the content information based on the matching result, the method further includes: If there is no first-category word in the content information dictionary that completely matches the result of the word segmentation processing, and there is no second-category word whose similarity to the result of the word segmentation processing is greater than a set threshold, an alarm message is generated based on the word segmentation processing result.

10. The method according to any one of claims 1 to 9, characterized in that Before generating and uploading the recognition result data based on the text information, the method further includes: Based on the set verification rules, it is determined that the characters and numbers in the text information pass the corresponding checks.

11. An image recognition device, characterized in that: include: An acquisition module, used for acquiring an image to be recognized corresponding to the document to be recognized, and preprocessing the image to be recognized, wherein the preprocessing includes noise reduction processing; An extraction module, used for extracting character blocks from the preprocessed image to be recognized, wherein the character blocks are used to represent an image containing a single character; A recognition module, used to extract text information from the character block, wherein the text information includes document items and content information corresponding to each document item; The output module is used to generate and upload recognition result data based on the text information.

12. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.

Citation Information

Cited By

  • Fund position picture recognition method and device, computer equipment and storage medium

    CN120375391A

  • Fund holding picture identification method and device, computer device, and storage medium

    CN120375391B