Intelligent file content identification and comparison method based on feature extraction

Through feature extraction and edge detection of the ONNX model, the table or seal area is magnified and processed, which solves the problem of low recognition accuracy in the existing technology and improves the accuracy of file content recognition in document images.

CN120673434APending Publication Date: 2025-09-19JIANGSU SUNBOON INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510127982.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

When processing documents containing forms or seals, the existing technology has a low accuracy rate in file content recognition.

Method used

Using a feature extraction method based on the ONNX model, through edge detection and magnification processing, the table area or seal area is identified and magnified until the influence of lines is eliminated, thereby achieving accurate recognition of file content.

Benefits of technology

Improved the accuracy of file content recognition in the table area and seal area of ​​document images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673434A_ABST
    Figure CN120673434A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and particularly discloses an intelligent file content recognition and comparison method based on feature extraction, and the method comprises the steps: obtaining a to-be-recognized original image and a to-be-recognized accessory image; an ONNX model is constructed, and the ONNX model is trained, so that the trained ONNX model is obtained; performing file content identification on the original image to be identified and the accessory image to be identified through the trained ONNX model to obtain a file content identification result of the original image to be identified and a file content identification result of the accessory image to be identified; and comparing the file content identification result of the original image to be identified with the file content identification result of the accessory image to be identified through the trained ONNX model so as to output a file content comparison result between the original image to be identified and the accessory image to be identified. According to the invention, the file content identification accuracy of the document image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and more specifically, to an intelligent method for file content recognition and comparison based on feature extraction. Background Art

[0002] With the development of information and the widespread dissemination of graphic and textual materials, image-based text recognition has gained widespread application. Computer vision-based OCR (Optical Character Recognition) document recognition has been widely used in the commercial sector, such as for common identification cards, bank cards, driver's licenses, and book text recognition. It uses optical and computer technologies to read text printed or written on paper and convert it into a format that is both computer-readable and human-understandable.

[0003] In the existing technology, document recognition generally includes two steps: text detection and text recognition. Text detection mainly detects the text area in the image through methods such as deep learning or machine learning, providing the initial image for the subsequent text recognition module. Text recognition mainly recognizes and processes the text content in the text area.

[0004] However, when processing documents containing tables or seals, the existing technology has a relatively low accuracy rate in identifying the file content in the tables or seals. Therefore, how to further improve the accuracy rate in identifying the file content of documents has become a technical problem that needs to be urgently solved by those skilled in the art. Summary of the Invention

[0005] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide an intelligent method for file content recognition and comparison based on feature extraction, which can improve the accuracy of file content recognition of document images.

[0006] As a first aspect of the present invention, a method for intelligently identifying and comparing file content based on feature extraction is provided, wherein the method comprises the following steps: Step S1: obtaining an original image to be identified and a copy image to be identified; Step S2: constructing an ONNX model and training the ONNX model to obtain a trained ONNX model; Step S3: performing file content recognition on the original image to be recognized and the copy image to be recognized using the trained ONNX model to obtain a file content recognition result of the original image to be recognized and a file content recognition result of the copy image to be recognized; Step S4: Compare the file content recognition result of the original image to be identified and the file content recognition result of the copy image to be identified using the trained ONNX model to output a file content comparison result between the original image to be identified and the copy image to be identified.

[0007] Furthermore, the constructing of the ONNX model and training the ONNX model to obtain the trained ONNX model further includes: Collect sample images of various fonts, numbers, symbols, and uppercase and lowercase English characters, and construct the sample images into a benchmark sample set; Build an ONNX model for file content recognition and comparison; The constructed ONNX model is trained according to the benchmark sample set to obtain a trained ONNX model.

[0008] Furthermore, the performing file content recognition on the original image to be identified by using the trained ONNX model to obtain a file content recognition result of the original image to be identified further includes: Performing edge detection processing on the original image to be identified using the trained ONNX model to obtain an original edge image; Calculating an edge density of the original edge image, wherein the edge density is a ratio of an average value of a horizontal projection to an average value of a vertical projection of the original edge image; When the edge density of the original edge image is greater than a preset value, it is determined that a table area or a seal area exists in the original image to be identified; then, the table area or the seal area is amplified, and the process is repeated until no lines exist in the table area or the seal area; finally, document content recognition is performed on the amplified table area or the amplified seal area to obtain a document content recognition result of the original image to be identified; wherein the amplification process is implemented by a decreasing amplification factor or a fixed amplification factor; When the edge density of the original edge image is not greater than the preset value, it is determined that there is no table area or seal area in the original image to be identified; then, file content recognition is directly performed on the original image to be identified to obtain a file content recognition result of the original image to be identified.

[0009] Furthermore, the performing file content recognition on the to-be-recognized copy image by using the trained ONNX model to obtain a file content recognition result of the to-be-recognized copy image further includes: Performing edge detection processing on the to-be-identified copy image using the trained ONNX model to obtain a copy edge image; Calculating the edge density of the secondary piece edge image, wherein the edge density is the ratio of the average value of the horizontal projection to the average value of the vertical projection of the secondary piece edge image; When the edge density of the copy edge image is greater than a preset value, it is determined that a table area or a seal area exists in the copy image to be identified; the table area or the seal area is then magnified, and the process is repeated until no lines exist in the table area or the seal area; finally, document content recognition is performed on the magnified table area or the magnified seal area to obtain a document content recognition result for the copy image to be identified; wherein the magnification process is implemented by a decreasing magnification factor or a fixed magnification factor; When the edge density of the copy edge image is not greater than the preset value, it is determined that there is no table area or seal area in the copy image to be identified; then, the document content recognition is directly performed on the copy image to be identified to obtain a document content recognition result of the copy image to be identified.

[0010] Furthermore, the edge detection processing method adopts Soble, Canny or Laplacian.

[0011] Furthermore, a straight line detection method is used to detect the lines in the table area or the lines in the seal area, wherein the straight line detection method adopts Hough transform, Freeman or LSD.

[0012] Furthermore, the preset value ranges from 2 to 4, and the magnification factor ranges from 1.05 to 1.2.

[0013] As a second aspect of the present invention, there is provided an intelligent device for file content recognition and comparison based on feature extraction, comprising: An acquisition module, used for acquiring an original image to be identified and a copy image to be identified; A training module, used to build an ONNX model and train the ONNX model to obtain a trained ONNX model; an identification module, configured to perform file content identification on the original image to be identified and the copy image to be identified respectively using the trained ONNX model, so as to obtain a file content identification result of the original image to be identified and a file content identification result of the copy image to be identified; A comparison module is configured to compare the file content recognition result of the original image to be identified and the file content recognition result of the copy image to be identified using the trained ONNX model to output a file content comparison result between the original image to be identified and the copy image to be identified.

[0014] As a third aspect of the present invention, a computer device is provided, 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 intelligent method for identifying and comparing file content based on feature extraction as described above is implemented.

[0015] As a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the intelligent method for file content recognition and comparison based on feature extraction as described above is implemented.

[0016] The intelligent method for file content recognition and comparison based on feature extraction provided by the present invention has the following advantages: the table area or seal area in the document image is magnified to an appropriate position, eliminating the influence of the lines in the table area or the seal area on the recognition, thereby improving the accuracy of file content recognition in the table area or the seal area in the document image. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention, but do not constitute a limitation of the present invention.

[0018] Figure 1 This is a flow chart of the intelligent method for file content recognition and comparison based on feature extraction provided by the present invention.

[0019] Figure 2A-2F A schematic diagram of a template for the circular seal area provided by the present invention.

[0020] Figure 3A-Figure 3B Schematic diagram of the template of the elliptical seal area provided by the present invention.

[0021] Figures 4A-4F A schematic diagram of a template for the square seal area provided by the present invention.

[0022] Figure 5A-5B A schematic diagram of the template for the diamond-shaped seal area provided by the present invention.

[0023] Figure 6A-Figure 6B A schematic diagram of the template for the triangular seal area provided by the present invention.

[0024] Figures 7A-7D This is a schematic diagram of the hand signature recognition and comparison template provided by the present invention. DETAILED DESCRIPTION

[0025] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of an intelligent method for file content recognition and comparison based on feature extraction proposed by the present invention. It should be understood that the described embodiments are only a subset of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.

[0026] In this embodiment, an intelligent method for file content recognition and comparison based on feature extraction is provided. Figure 1 As shown, the intelligent method for file content recognition and comparison based on feature extraction includes the following steps: Step S1: obtaining an original image to be identified and a copy image to be identified; Step S2: constructing an ONNX model and training the ONNX model to obtain a trained ONNX model; Preferably, the constructing of the ONNX model and training the ONNX model to obtain the trained ONNX model further includes: Collect sample images of various fonts, numbers, symbols, and uppercase and lowercase English characters, and construct the sample images into a benchmark sample set; Build an ONNX model for file content recognition and comparison; The constructed ONNX model is trained according to the benchmark sample set to obtain a trained ONNX model.

[0027] Step S3: performing file content recognition on the original image to be recognized and the copy image to be recognized using the trained ONNX model to obtain a file content recognition result of the original image to be recognized and a file content recognition result of the copy image to be recognized; Preferably, the performing file content recognition on the original image to be identified by using the trained ONNX model to obtain a file content recognition result of the original image to be identified further includes: Performing edge detection processing on the original image to be identified using the trained ONNX model to obtain an original edge image; Calculating an edge density of the original edge image, wherein the edge density is a ratio of an average value of a horizontal projection to an average value of a vertical projection of the original edge image; When the edge density of the original edge image is greater than a preset value, it is determined that a table area or a seal area exists in the original image to be identified; then, the table area or the seal area is amplified, and the process is repeated until no lines exist in the table area or the seal area; finally, document content recognition is performed on the amplified table area or the amplified seal area to obtain a document content recognition result of the original image to be identified; wherein the amplification process is implemented by a decreasing amplification factor or a fixed amplification factor; When the edge density of the original edge image is not greater than the preset value, it is determined that there is no table area or seal area in the original image to be identified; then, file content recognition is directly performed on the original image to be identified to obtain a file content recognition result of the original image to be identified.

[0028] Preferably, the performing file content recognition on the copy image to be identified by using the trained ONNX model to obtain a file content recognition result of the copy image to be identified further includes: Performing edge detection processing on the to-be-identified copy image using the trained ONNX model to obtain a copy edge image; Calculating the edge density of the secondary piece edge image, wherein the edge density is the ratio of the average value of the horizontal projection to the average value of the vertical projection of the secondary piece edge image; When the edge density of the copy edge image is greater than a preset value, it is determined that a table area or a seal area exists in the copy image to be identified; the table area or the seal area is then magnified, and the process is repeated until no lines exist in the table area or the seal area; finally, document content recognition is performed on the magnified table area or the magnified seal area to obtain a document content recognition result for the copy image to be identified; wherein the magnification process is implemented by a decreasing magnification factor or a fixed magnification factor; When the edge density of the copy edge image is not greater than the preset value, it is determined that there is no table area or seal area in the copy image to be identified; then, the document content recognition is directly performed on the copy image to be identified to obtain a document content recognition result of the copy image to be identified.

[0029] Specifically, the edge detection processing method adopts Soble, Canny or Laplacian.

[0030] Specifically, a straight line detection method is used to detect the lines in the table area or the lines in the seal area, wherein the straight line detection method adopts Hough transform, Freeman or LSD.

[0031] Specifically, the preset value ranges from 2 to 4, and the magnification factor ranges from 1.05 to 1.2.

[0032] Step S4: Using the trained ONNX model, the document content recognition results of the original image to be identified and the document content recognition results of the copy image to be identified are compared to output a document content comparison result between the original image to be identified and the copy image to be identified. The differences between the original image to be identified and the copy image to be identified are identified and highlighted with color boxes in the copy image to be identified.

[0033] like Figure 2A-2F As shown, Figure 2A The content identified is the test seal 2201051214542 of XX Technology Co., Ltd.; Figure 2B The content identified in the test is the special seal of XX Bank Co., Ltd. Figure 2C The content identified in the article is from Building Information Decoration Engineering Technology Co., Ltd. Figure 2D The content identified in the test is XXX Zhenchezhimei Automobile Maintenance Test Seal. Figure 2E The content identified is the XX District Rural Credit Cooperative Union and 2207020003035. Figure 2F The content identified is the Jianghu special seal of the Saiwai Daoke Mongolian Seal Engraving Studio.

[0034] like Figure 3A-Figure 3B As shown, Figure 3A The content identified is the XX City Automation Equipment Diagram Test Seal 44200865948821, Figure 3B The content identified is the electronic seal verification system test special seal and the financial special seal.

[0035] like Figures 4A-4F As shown, Figure 4A The content identified is the test user seal 2101050121815, Figure 4B The content identified in the code is Edison print. Figure 4C The content identified in the test is a special seal for the public redemption verification system of a certain commercial bank. Figure 4D The content identified in the code is the financial seal of a certain Impression Seal Co., Ltd. Figure 4E The content identified is the test seal 3205896015563 of XXX City System Integration Co., Ltd. Figure 4F The content identified in the report is translated into various ethnic languages ​​in Urumqi, Xinjiang Uyghur Autonomous Region.

[0036] like Figure 5A-5B As shown, Figure 5A The content identified in the report was forwarded by Jiujiang Test on December 29, 2018. Figure 5B The content identified is the testing seal of Jiangsu Shangbo Information Technology Co., Ltd.

[0037] like Figure 6A-Figure 6B As shown, Figure 6A The content identified in the transfer is for Shangbo application software testing only. The transfer was completed on April 18, 2018. Figure 6B The content identified is cash of XX Co., Ltd. on 2015.08.08.

[0038] like Figures 7A-7D As shown, handwritten signature recognition and comparison requirements in documents require that each signature, location, or page in a document must be unique and identical. To prevent forgery, impersonation, or proxy signing, the signature's shape and handwriting must be recognized and compared (regardless of the content or name). Each unique signature, location, or page must be recognized and compared as "correct" or "incorrect." Figure 7A Sign the original in the original image, Figure 7B is the signature 1 in the copy image, Figure 7C is the signature 2 in the copy image, Figure 7D It is signature 3 in the copy image, among which, the recognition comparison result of signature 1 and the original signature is "correct", the recognition comparison result of signature 2 and the original signature is "wrong" (forged signature), and the recognition comparison result of signature 3 and the original signature is "wrong" (forged signature / signature on behalf of others).

[0039] In an embodiment of the present invention, the original image is identified and compared with the copy image with slight changes, for example, the customer's ID number and name, as well as important information such as the document number and date are identified and compared, in order to prevent property loss caused by human tampering with important information.

[0040] As another embodiment of the present invention, there is provided an intelligent device for identifying and comparing file content based on feature extraction, the intelligent device for identifying and comparing file content based on feature extraction comprising: An acquisition module, used for acquiring an original image to be identified and a copy image to be identified; A training module, used to build an ONNX model and train the ONNX model to obtain a trained ONNX model; an identification module, configured to perform file content identification on the original image to be identified and the copy image to be identified respectively using the trained ONNX model, so as to obtain a file content identification result of the original image to be identified and a file content identification result of the copy image to be identified; A comparison module is configured to compare the file content recognition result of the original image to be identified and the file content recognition result of the copy image to be identified using the trained ONNX model to output a file content comparison result between the original image to be identified and the copy image to be identified.

[0041] As another embodiment of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the intelligent method for identifying and comparing file content based on feature extraction described above is implemented.

[0042] As another embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the intelligent method for file content recognition and comparison based on feature extraction described above is implemented.

[0043] The present invention provides an intelligent method for file content recognition and comparison based on feature extraction, which magnifies the table area or seal area in the document image to a suitable position, eliminates the influence of the lines in the table area or the seal area on the recognition, and thus improves the accuracy of file content recognition in the table area or the seal area in the document image.

[0044] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Any technician familiar with the present profession can make some changes or modifications to equivalent embodiments of the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. An intelligent method for file content recognition and comparison based on feature extraction, characterized in that: The intelligent method for file content identification and comparison based on feature extraction includes the following steps: Step S1: obtaining an original image to be identified and a copy image to be identified; Step S2: constructing an ONNX model and training the ONNX model to obtain a trained ONNX model; Step S3: performing file content recognition on the original image to be recognized and the copy image to be recognized using the trained ONNX model to obtain a file content recognition result of the original image to be recognized and a file content recognition result of the copy image to be recognized; Step S4: Compare the file content recognition result of the original image to be identified and the file content recognition result of the copy image to be identified using the trained ONNX model to output a file content comparison result between the original image to be identified and the copy image to be identified.

2. The intelligent method for file content recognition and comparison based on feature extraction according to claim 1 is characterized in that: The constructing of the ONNX model and training the ONNX model to obtain a trained ONNX model further includes: Collect sample images of various fonts, numbers, symbols, and uppercase and lowercase English characters, and construct the sample images into a benchmark sample set; Build an ONNX model for file content recognition and comparison; The constructed ONNX model is trained according to the benchmark sample set to obtain a trained ONNX model.

3. The intelligent method for file content recognition and comparison based on feature extraction according to claim 1 is characterized in that: The performing file content recognition on the original image to be recognized by using the trained ONNX model to obtain a file content recognition result of the original image to be recognized further includes: Performing edge detection processing on the original image to be identified using the trained ONNX model to obtain an original edge image; Calculating an edge density of the original edge image, wherein the edge density is a ratio of an average value of a horizontal projection to an average value of a vertical projection of the original edge image; When the edge density of the original edge image is greater than a preset value, it is determined that a table area or a seal area exists in the original image to be identified; then, the table area or the seal area is amplified, and the process is repeated until no lines exist in the table area or the seal area; finally, document content recognition is performed on the amplified table area or the amplified seal area to obtain a document content recognition result of the original image to be identified; wherein the amplification process is implemented by a decreasing amplification factor or a fixed amplification factor; When the edge density of the original edge image is not greater than the preset value, it is determined that there is no table area or seal area in the original image to be identified; then, file content recognition is directly performed on the original image to be identified to obtain a file content recognition result of the original image to be identified.

4. The intelligent method for file content recognition and comparison based on feature extraction according to claim 1 is characterized in that: The performing file content recognition on the to-be-recognized copy image by using the trained ONNX model to obtain a file content recognition result of the to-be-recognized copy image further includes: Performing edge detection processing on the to-be-identified copy image using the trained ONNX model to obtain a copy edge image; Calculating the edge density of the secondary piece edge image, wherein the edge density is the ratio of the average value of the horizontal projection to the average value of the vertical projection of the secondary piece edge image; When the edge density of the copy edge image is greater than a preset value, it is determined that a table area or a seal area exists in the copy image to be identified; the table area or the seal area is then magnified, and the process is repeated until no lines exist in the table area or the seal area; finally, document content recognition is performed on the magnified table area or the magnified seal area to obtain a document content recognition result for the copy image to be identified; wherein the magnification process is implemented by a decreasing magnification factor or a fixed magnification factor; When the edge density of the copy edge image is not greater than the preset value, it is determined that there is no table area or seal area in the copy image to be identified; then, the document content recognition is directly performed on the copy image to be identified to obtain a document content recognition result of the copy image to be identified.

5. The intelligent method for file content recognition and comparison based on feature extraction according to claim 3 or 4, characterized in that: The edge detection processing method adopts Soble, Canny or Laplacian.

6. The intelligent method for file content recognition and comparison based on feature extraction according to claim 3 or 4, characterized in that: The lines in the table area or the lines in the seal area are detected using a straight line detection method, wherein the straight line detection method adopts Hough transform, Freeman or LSD.

7. The intelligent method for file content recognition and comparison based on feature extraction according to claim 3 or 4, characterized in that: The preset value ranges from 2 to 4, and the magnification ranges from 1.05 to 1.

2.

8. An intelligent device for identifying and comparing file contents based on feature extraction, used to implement the intelligent method for identifying and comparing file contents based on feature extraction according to any one of claims 1 to 7, characterized in that: The intelligent device for identifying and comparing file contents based on feature extraction includes: An acquisition module, used for acquiring an original image to be identified and a copy image to be identified; A training module, used to build an ONNX model and train the ONNX model to obtain a trained ONNX model; an identification module, configured to perform file content identification on the original image to be identified and the copy image to be identified respectively using the trained ONNX model, so as to obtain a file content identification result of the original image to be identified and a file content identification result of the copy image to be identified; A comparison module is configured to compare the file content recognition result of the original image to be identified and the file content recognition result of the copy image to be identified using the trained ONNX model to output a file content comparison result between the original image to be identified and the copy image to be identified.

9. 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 intelligent method for identifying and comparing file content based on feature extraction according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the intelligent method for file content recognition and comparison based on feature extraction according to any one of claims 1 to 7.