Seal identification method and device, computer equipment and medium

By performing text and seal recognition on images in text files, using multi-modal models to extract entity names and seal contents, and calculating similarity to correct the recognition results, the problem of low seal recognition accuracy is solved and the recognition accuracy is improved.

CN118570824APending Publication Date: 2024-08-30BEIJING UNISOUND INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410780030.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing seal recognition technology suffers from low recognition accuracy due to factors such as background interference, noise occlusion, and abnormal use of seals. In particular, the detailed patterns of anti-counterfeiting seals are easily dried up and filled with dust, making it difficult to distinguish authenticity from fakes.

Method used

By separately identifying text and seals from images in text files, using intelligent document analysis models, OCR detection and recognition models, and seal recognition models, we can extract entity names and seal contents, convert the recognition results into vector representations, and calculate the similarity to determine Seal content, correct recognition results to improve accuracy.

Benefits of technology

It effectively improves the accuracy of seal recognition, reduces recognition errors caused by background interference and noise occlusion, and enhances the accuracy of the seal content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570824A
    Figure CN118570824A
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a seal recognition method and device, computer equipment and a medium, and the method comprises the steps: determining an image of a text file of a current to-be-recognized seal as a target image; the text and the seal in the target image are recognized respectively, all entity names contained in the text of the target image are alternative entity names, and characters contained in the seal of the target image are recognized seal content; and comparing the identified seal content with each alternative entity name, and if the similarity between any alternative entity name and the identified seal content is greater than a preset similarity threshold, determining that any alternative entity name is the content of the seal in the target image, and if the similarity between any alternative entity name and the identified seal content is greater than the preset similarity threshold, determining that any alternative entity name is the content of the seal in the target image. And completing seal identification of the target image. Therefore, the accuracy of seal identification can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method, device, computer equipment and medium for seal recognition. Background Art

[0002] To perform seal recognition in a text file, you first need to detect the position of the seal and then recognize the characters in the seal.

[0003] However, in actual scenarios, seals are often disturbed by background interference, such as bill background, oil stains, signatures, etc. These factors may affect the recognition effect of the characters in the seal; at the same time, the characters in the seal may be blocked to varying degrees, such as being covered by other text or patterns, making the recognition of the characters in the seal more difficult; in addition, the diversity of ink use and abnormal use of the seal will affect the clarity and recognition of the characters in the seal; in addition, the detailed texture of the anti-counterfeiting seal is easily filled with dried ink and dust residue, making it difficult to distinguish the authenticity, further increasing the difficulty of recognition. The above factors ultimately lead to a low accuracy rate in seal recognition. Summary of the invention

[0004] In view of this, the present invention provides a seal recognition method, apparatus, computer equipment and medium to solve the problem of low accuracy in existing seal recognition technical solutions.

[0005] In a first aspect, the present invention provides a method for seal recognition, the method comprising:

[0006] Determine the image of the text file of the current seal to be recognized as the target image;

[0007] Recognize the text and seal in the target image respectively, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content;

[0008] The identified seal content is compared with each of the candidate entity names respectively. If there is any candidate entity name whose similarity with the identified seal content is greater than a preset similarity threshold, it is determined that any of the candidate entity names is the content of the seal in the target image, and the seal recognition of the target image is completed.

[0009] The seal recognition method provided by the present invention has the following advantages:

[0010] In the technical solution of the present invention, for an image of a text file that needs to be recognized by a seal, the text and the seal are recognized respectively on the image to obtain the entity names and seal contents contained therein, and then the entity name that is sufficiently similar to the recognized seal content is selected as the actual content of the seal to complete the seal recognition. Since the entity name in a general seal will be mentioned in the text of the corresponding text file, and the seal content has a low recognition accuracy rate due to background interference, noise shielding and other factors, but the text content often rarely has the above situation, and its recognition accuracy rate is relatively high, the technical solution of the present invention compares the recognized seal content with the entity name in the text. For example, if it is found that the seal content is sufficiently similar to a certain entity name, the actual content of the seal is corrected to the similar entity name, thereby effectively improving the accuracy rate of seal recognition.

[0011] In an optional implementation, the text and the seal in the target image are respectively recognized, and each entity name contained in the text of the target image is obtained as a candidate entity name, and the characters contained in the seal of the target image are obtained as the recognized seal content, including:

[0012] Analyze and identify the text and seal of the target image using a pre-created intelligent document analysis model, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are the identified seal content;

[0013] Among them, the intelligent document analysis model is obtained by fine-tuning a preset multimodal large model of intelligent document understanding based on images and corresponding text tags of multiple text files, and the text tags contain information on text content, entity names and seal contents in the corresponding text files.

[0014] In an optional implementation, the text and the seal in the target image are respectively recognized, and each entity name contained in the text of the target image is obtained as a candidate entity name, and the characters contained in the seal of the target image are obtained as the recognized seal content, including:

[0015] Performing text recognition on the target image using a pre-built OCR detection and recognition model to obtain text content contained in the target image;

[0016] Using a pre-built information extraction model, extracting from the text content of the target image, each entity name contained in the text of the target image is a candidate entity name;

[0017] Performing seal recognition on the target image using a pre-built seal recognition model, and obtaining characters contained in the seal of the target image as recognized seal content;

[0018] Among them, the OCR detection and recognition model is trained based on the images and corresponding text contents of multiple text files, the information extraction model is trained based on the text contents and corresponding entity names of multiple text files, and the seal recognition model is trained based on the images and corresponding seal contents of multiple seals.

[0019] In an optional implementation, comparing the identification stamp content with each candidate entity name respectively includes:

[0020] Determine each candidate entity name as the current entity name in turn;

[0021] The identification seal content and the current entity name are respectively converted into corresponding vector representations, and the cosine value of the angle between the vectors corresponding to the identification seal content and the current entity name is calculated to obtain the similarity between the identification seal content and the current entity name.

[0022] In an optional implementation, converting the identification seal content and the current entity name into corresponding vector representations respectively includes:

[0023] Use a preset bag-of-words model, a machine learning model or a word vector model to convert the identified seal content and the current entity name into corresponding vector representations respectively.

[0024] In an optional implementation, after comparing the identification stamp content with each candidate entity name, the method further includes:

[0025] If the similarity between each candidate entity name and the identified seal content is not greater than a preset similarity threshold, the identified seal content is determined to be the content of the seal in the target image, and a prompt is outputted that the target image may have text content and seal content that do not correspond.

[0026] In an optional implementation, if there is any candidate entity name whose similarity with the identified seal content is greater than a preset similarity threshold, determining that any candidate entity name is the content of the seal in the target image includes:

[0027] If there are multiple candidate entity names whose similarity to the identified seal content is greater than a preset similarity threshold, the candidate entity name with the highest similarity to the identified seal content is selected as the content of the seal in the target image.

[0028] In a second aspect, the present invention provides a seal recognition device, the device comprising:

[0029] A determination module is used to: determine that the image of the text file of the current seal to be recognized is the target image;

[0030] The recognition module is used to: respectively recognize the text and the seal in the target image, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content;

[0031] The comparison module is used to compare the identified seal content with each of the candidate entity names respectively. If the similarity between any of the candidate entity names and the identified seal content is greater than a preset similarity threshold, the any of the candidate entity names is determined to be the content of the seal in the target image, thereby completing the seal recognition of the target image.

[0032] The seal recognition device provided by the present invention has the following advantages:

[0033] In the technical solution of the present invention, for an image of a text file that needs to be recognized by a seal, the text and the seal are recognized respectively on the image to obtain the entity names and seal contents contained therein, and then the entity name that is sufficiently similar to the recognized seal content is selected as the actual content of the seal to complete the seal recognition. Since the entity name in a general seal will be mentioned in the text of the corresponding text file, and the seal content has a low recognition accuracy rate due to background interference, noise shielding and other factors, but the text content often rarely has the above situation, and its recognition accuracy rate is relatively high, the technical solution of the present invention compares the recognized seal content with the entity name in the text. For example, if it is found that the seal content is sufficiently similar to a certain entity name, the actual content of the seal is corrected to the similar entity name, thereby effectively improving the accuracy rate of seal recognition.

[0034] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the seal recognition method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the seal recognition method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 is a flow chart of a seal recognition method provided according to an embodiment of the present invention;

[0038] Figure 2 It is a schematic diagram of realizing text and seal recognition by a single model in a seal recognition method provided by an embodiment of the present invention;

[0039] Figure 3 It is a schematic diagram of realizing text and seal recognition by multiple models in a seal recognition method provided by an embodiment of the present invention;

[0040] Figure 4 is a structural block diagram of a seal recognition device according to an embodiment of the present invention;

[0041] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0043] A seal is a stamp printed on a document to indicate identification or signature. In order to achieve electronic transmission or storage, it is usually necessary to perform character recognition on the seal on the paper document to obtain the content of the seal.

[0044] Due to background interference, noise blocking, abnormal use of seals and the blocking of anti-counterfeiting seals by foreign objects, the accuracy of seal recognition seems to be low.

[0045] To solve the above problems, an embodiment of the present invention provides an embodiment of seal recognition. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system (computer device) including a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0046] In this embodiment, a seal recognition method is provided, which can be used in terminal devices such as mobile phones, tablet computers, etc. Figure 1 is a flow chart of a method for seal recognition according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0047] S11: Determine the image of the text file of the seal to be recognized as the target image.

[0048] If it is necessary to identify a seal in a text file, an image of a page of the text file can be obtained, and the image can be used as a target image for subsequent identification operations. The text file can be understood as a file containing text content and seal content.

[0049] S12: Recognize the text and seal in the target image respectively, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content.

[0050] By performing text recognition on the target image, we can obtain the text content in the target image and the names of the entities contained in the text content. The entities can be companies, institutions, individuals, etc.; by performing seal recognition on the target image, we can obtain the characters contained in the seal in the target image (usually the entity name), that is, the seal content.

[0051] In actual scenarios, in text files such as contracts and documents that contain seals, the seal usually needs to be printed on an entity in the text file, that is, the entity name on the seal is usually mentioned in the text, specifically the name of an entity in the text file; and the seal content is affected by background interference, noise occlusion, abnormal seal use, and anti-counterfeiting seals being filled with foreign objects, so the recognition accuracy is low, but text content usually rarely has this situation, and its recognition accuracy is high. Based on this, the embodiment of the present invention recognizes and obtains the entity name and seal content in the target image respectively, and then more accurately determines the actual content of the seal by comparing the two in the subsequent steps.

[0052] S13: Compare the identified seal content with each of the candidate entity names respectively. If the similarity between any of the candidate entity names and the identified seal content is greater than a preset similarity threshold, determine that any of the candidate entity names is the content of the seal in the target image, and complete the seal recognition of the target image.

[0053] The seal content in the target image identified and obtained in step S12 is compared with each entity name in the target image respectively. If any entity name is found to be sufficiently similar to the seal content (the similarity between the two is greater than the similarity threshold set in advance according to actual needs), it means that the seal is likely to be the name of the entity with the entity name, so the entity name is the actual content of the seal, and the seal recognition in the target image is completed.

[0054] In the technical solution of the present invention, for an image of a text file that needs to be recognized by a seal, the text and the seal are recognized respectively on the image to obtain the entity names and seal contents contained therein, and then the entity name that is sufficiently similar to the recognized seal content is selected as the actual content of the seal to complete the seal recognition. Since the entity name in a general seal will be mentioned in the text of the corresponding text file, and the seal content has a low recognition accuracy rate due to background interference, noise shielding and other factors, but the text content often rarely has the above situation, and its recognition accuracy rate is relatively high, the technical solution of the present invention compares the recognized seal content with the entity name in the text. For example, if it is found that the seal content is sufficiently similar to a certain entity name, the actual content of the seal is corrected to the similar entity name, thereby effectively improving the accuracy rate of seal recognition.

[0055] In a specific implementation, the text and the seal in the target image are respectively recognized, and each entity name contained in the text of the target image is obtained as a candidate entity name, and the characters contained in the seal of the target image are obtained as the recognized seal content, which may include:

[0056] Analyze and identify the text and seal of the target image using a pre-created intelligent document analysis model, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are the identified seal content;

[0057] Among them, the intelligent document analysis model is obtained by fine-tuning a preset multimodal large model of intelligent document understanding based on images and corresponding text tags of multiple text files, and the text tags contain information on text content, entity names and seal contents in the corresponding text files.

[0058] In another specific implementation, the text and the seal in the target image are respectively recognized, and each entity name contained in the text of the target image is obtained as a candidate entity name, and the characters contained in the seal of the target image are obtained as the recognized seal content, which may include:

[0059] Performing text recognition on the target image using a pre-built OCR detection and recognition model to obtain text content contained in the target image;

[0060] Using a pre-built information extraction model, extracting from the text content of the target image, each entity name contained in the text of the target image is a candidate entity name;

[0061] Performing seal recognition on the target image using a pre-built seal recognition model, and obtaining characters contained in the seal of the target image as recognized seal content;

[0062] Among them, the OCR detection and recognition model is trained based on the images and corresponding text contents of multiple text files, the information extraction model is trained based on the text contents and corresponding entity names of multiple text files, and the seal recognition model is trained based on the images and corresponding seal contents of multiple seals.

[0063] In order to obtain the model, training data can be prepared in advance. The training data is mainly presented in the form of image and text pairs, such as the following:

[0064] {Text file image:[

[0065] {prompt about the image text content: corresponding text content},

[0066] {About the prompt of the entity mentioned in the text: the output of the prompt word corresponding to the entity name},

[0067] {Prompt about the seal content: the prompt word corresponds to the output of the seal content}

[0068] ]}

[0069] Among them, prompts about the text content of the image include but are not limited to: perform OCR on the text in the image, what is the text content in the image, please help identify the text content in the image, etc.; prompts for entities mentioned in the text include but are not limited to: which companies are mentioned in the image, which institutions are mentioned in the image, which individuals are mentioned in the article, etc.; prompts for seal content include but are not limited to: is there a seal in the image, what is the seal in the image, please identify what the seal content in the image is, etc.

[0070] Then build a model. The model mentioned in the embodiment of the present invention can be a single model or a combination of multiple models. The model is fine-tuned based on the training data prepared in the above steps to build a model that meets the task requirements.

[0071] If a multimodal large model is used, a multimodal large model for intelligent document understanding (Donut, SCOB, BLIP2, etc.) can be selected, and the training data (the text pairs are text tags) can be used to fine-tune it to obtain an intelligent document analysis model. Then, the image of the text file is input into the intelligent document analysis model to obtain the output entity name and seal content, such as Figure 2 shown.

[0072] like Figure 3As shown, if a combination of multiple models is selected, an OCR detection and recognition model, an information extraction model, and a seal recognition model are required; wherein, the OCR detection and recognition model can detect and recognize the characters in the image to obtain the text content therein, and then send the text content to a large multimodal model such as ChatGPT (i.e., an information extraction model) to extract the required key information (i.e., the entity name), and finally use the seal recognition model to perform seal content recognition to obtain the recognized seal content. Among them, the OCR detection and recognition model can be trained based on the image of the text file and the corresponding text content, which is the same as the corresponding concept meaning in the prior art and will not be repeated here; the information extraction model can be trained based on the text content and the entity name therein, or a dedicated information extraction model can be trained using the above training data or a large language model (such as a large multimodal model such as ChatGPT) can be fine-tuned; the seal recognition model can be trained based on the image of the seal and the corresponding seal content, such as end-to-end seal recognition and two-stage seal recognition, wherein end-to-end seal recognition generally trains a text recognition model for curved text recognition. Types, such as PGNet, annotate the seal image data set and train a curved text recognition model. After training, it can input seal images and output recognized character results. Two-stage seal recognition includes seal character detection and seal character recognition. Seal character detection uses a character detection model (such as DBNet, DBNet++, etc.) to detect the position of characters in the seal image, generally the curved area (such as round seals, elliptical seals, etc.), and then flatten the annular character area, and then send the flattened character image to the character recognition model (such as CRNN, TrOCR, etc.) to recognize the character content.

[0073] It can be seen that the embodiments of the present invention use generative models in a comprehensive manner. Generative models usually have stronger generalization capabilities. Since they work by learning statistical laws in a large amount of data, they can make effective inferences and predictions based on existing knowledge even when faced with new and unseen complex scenes; this enables generative models to show better performance when processing complex text information such as curved and covered text. Therefore, the use of it for seal recognition is more robust than ordinary methods, especially for recognition of complex backgrounds, occlusions, and unclear handwriting.

[0074] A seal recognition method provided in this embodiment, comparing the recognized seal content with each candidate entity name respectively, may include:

[0075] Determine each candidate entity name as the current entity name in turn;

[0076] The identification seal content and the current entity name are respectively converted into corresponding vector representations, and the cosine value of the angle between the vectors corresponding to the identification seal content and the current entity name is calculated to obtain the similarity between the identification seal content and the current entity name.

[0077] Converting the identification seal content and the current entity name into corresponding vector representations respectively may specifically include:

[0078] Use a preset bag-of-words model, a machine learning model or a word vector model to convert the identified seal content and the current entity name into corresponding vector representations respectively.

[0079] It should be noted that the method for calculating the similarity between the seal content and the entity name can be set according to actual needs, and the cosine value is used to represent it in the embodiment of the present invention. Specifically, a preset bag-of-words model, a machine learning model, or a word vector model can be used to obtain the vector representation of the seal content and the entity name, and then the cosine value of the angle between the two vectors is calculated, which is the similarity between the seal content and the entity name, so that the similarity calculation between the seal content and the entity name can be realized quickly and accurately, and then the subsequent similarity judgment and other steps can be realized.

[0080] A seal recognition method provided in this embodiment may further include, after comparing the recognized seal content with each candidate entity name respectively:

[0081] If the similarity between each candidate entity name and the identified seal content is not greater than a preset similarity threshold, the identified seal content is determined to be the content of the seal in the target image, and a prompt is outputted that the target image may have text content and seal content that do not correspond.

[0082] If there is any candidate entity name whose similarity with the identified seal content is greater than a preset similarity threshold, determining that the candidate entity name is the content of the seal in the target image may include:

[0083] If there are multiple candidate entity names whose similarity to the identified seal content is greater than a preset similarity threshold, the candidate entity name with the highest similarity to the identified seal content is selected as the content of the seal in the target image.

[0084] It should be noted that if the seal content is not similar to each entity name (the similarity is not greater than the preset similarity threshold), it means that the wrong seal is used or the incorrect document is printed. Therefore, it can be temporarily assumed that the recognized seal content is the content of the seal in the target image, and at the same time, a prompt is output to the outside world that the text content of the target image may not correspond to the seal content, reminding the outside world to verify the correspondence between the seal and the file. If the seal content is similar to multiple entity names, the entity name with the highest similarity is selected as the actual content of the seal, further improving the accuracy of seal recognition.

[0085] In a specific implementation, a seal recognition method provided in this embodiment may specifically include the following steps:

[0086] 1. Data preparation: Large model training data is mainly presented in the form of image and text pairs.

[0087] 2. Constructing a model: The model mentioned in the embodiment of the present invention can be a single model or a combination of multiple models.

[0088] 3. Get the entity name in the target image.

[0089] 4. Get the seal content in the target image.

[0090] 5. Compare the similarity between each entity name and the seal content, set a threshold α, and if the similarity is greater than α, the entity name is determined to be the actual content of the seal.

[0091] In the present embodiment, a device for seal recognition is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and contemplated.

[0092] This embodiment provides a seal recognition device, such as Figure 4 may include:

[0093] The determination module 11 is used to: determine the image of the text file of the current seal to be recognized as the target image;

[0094] The recognition module 12 is used to: respectively recognize the text and the seal in the target image, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal contents;

[0095] The comparison module 13 is used to compare the identified seal content with each of the candidate entity names respectively. If the similarity between any of the candidate entity names and the identified seal content is greater than a preset similarity threshold, then the any of the candidate entity names is determined to be the content of the seal in the target image, thereby completing the seal recognition of the target image.

[0096] The seal recognition device in this embodiment is presented in the form of a functional module, where the module refers to an application specific integrated circuit (ASIC), a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0097] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0098] The embodiment of the present invention also provides a computer device having the above Figure 4 The seal recognition device is shown.

[0099] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0100] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0101] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0102] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0103] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0104] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0105] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0106] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0107] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for seal recognition, It is characterized in that include: Determine the image of the text file of the current seal to be recognized as the target image; Recognize the text and seal in the target image respectively, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content; The identified seal content is compared with each of the candidate entity names respectively. If there is any candidate entity name whose similarity with the identified seal content is greater than a preset similarity threshold, it is determined that any of the candidate entity names is the content of the seal in the target image, and the seal recognition of the target image is completed.

2. The method according to claim 1, It is characterized in that Recognize the text and seal in the target image respectively, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content, including: Analyze and identify the text and seal of the target image using a pre-created intelligent document analysis model, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are the identified seal content; Among them, the intelligent document analysis model is obtained by fine-tuning a preset multimodal large model of intelligent document understanding based on images and corresponding text tags of multiple text files, and the text tags contain information on text content, entity names and seal contents in the corresponding text files.

3. The method according to claim 1, It is characterized in that Recognize the text and seal in the target image respectively, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content, including: Performing text recognition on the target image using a pre-built OCR detection and recognition model to obtain text content contained in the target image; Using a pre-built information extraction model, extracting from the text content of the target image, each entity name contained in the text of the target image is a candidate entity name; Performing seal recognition on the target image using a pre-built seal recognition model, and obtaining characters contained in the seal of the target image as recognized seal content; Among them, the OCR detection and recognition model is trained based on the images and corresponding text contents of multiple text files, the information extraction model is trained based on the text contents and corresponding entity names of multiple text files, and the seal recognition model is trained based on the images and corresponding seal contents of multiple seals.

4. The method according to claim 2 or 3, It is characterized in that Comparing the identification stamp content with each candidate entity name respectively includes: Determine each candidate entity name as the current entity name in turn; The identification seal content and the current entity name are respectively converted into corresponding vector representations, and the cosine value of the angle between the vectors corresponding to the identification seal content and the current entity name is calculated to obtain the similarity between the identification seal content and the current entity name.

5. The method according to claim 4, It is characterized in that The identification seal content and the current entity name are converted into corresponding vector representations, including: Use a preset bag-of-words model, a machine learning model or a word vector model to convert the identified seal content and the current entity name into corresponding vector representations respectively.

6. The method according to claim 5, It is characterized in that After comparing the identification stamp content with each candidate entity name, the method further includes: If the similarity between each candidate entity name and the identified seal content is not greater than a preset similarity threshold, the identified seal content is determined to be the content of the seal in the target image, and a prompt is outputted that the target image may have text content and seal content that do not correspond.

7. The method according to claim 6, It is characterized in that If there is any candidate entity name whose similarity with the identified seal content is greater than a preset similarity threshold, determining that any candidate entity name is the content of the seal in the target image includes: If there are multiple candidate entity names whose similarity to the identified seal content is greater than a preset similarity threshold, the candidate entity name with the highest similarity to the identified seal content is selected as the content of the seal in the target image.

8. A seal recognition device, It is characterized in that include: A determination module is used to: determine that the image of the text file of the current seal to be recognized is the target image; The recognition module is used to: respectively recognize the text and the seal in the target image, obtain that each entity name contained in the text of the target image is a candidate entity name, and obtain that the characters contained in the seal of the target image are recognized seal content; The comparison module is used to compare the identified seal content with each of the candidate entity names respectively. If the similarity between any of the candidate entity names and the identified seal content is greater than a preset similarity threshold, the any of the candidate entity names is determined to be the content of the seal in the target image, thereby completing the seal recognition of the target image.

9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the seal recognition method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the seal recognition method according to any one of claims 1 to 7.