Method for identifying authenticity of seal, identification device, storage medium and electronic device
By extracting image and text features of seals using deep learning models and combining similarity matching and edit distance calculation, the problem of inaccurate seal authentication in existing technologies has been solved, achieving more efficient and accurate seal authentication.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中国邮政储蓄银行股份有限公司
- Filing Date
- 2023-04-20
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for authenticating seals mainly rely on the feature representation of the entire seal image area, which makes the text area features easily affected by other areas of the seal, resulting in inaccurate identification.
A deep learning model is used to extract image and text features of the seal. By combining coarse features of the image and fine features of the text region through similarity matching and edit distance calculation, the authenticity of the seal is accurately determined.
It improves the accuracy of seal authenticity identification by combining image and text feature matching, reducing the influence of the overall seal structure and background area on text features, thus improving identification efficiency and accuracy.
Smart Images

Figure CN116503720B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of seal authenticity, and more specifically, to a method for identifying the authenticity of a seal, a device for identifying the authenticity of a seal, a readable storage medium, and an electronic device. Background Technology
[0002] With the rapid development of today's society, the use of seals is ubiquitous. Especially in recent years, with the rapid development of the financial industry and the flourishing of various financial services, seals play a crucial role in financial services, primarily represented by banks. Therefore, ensuring the authenticity of seals in business operations has become particularly important.
[0003] There are many types of seals available, with round seals being the most commonly used in corporate banking transactions. Current methods for authenticating seals primarily extract features from the overall seal image area, representing the seal's overall structure and composition. However, the crucial text area typically occupies only a small portion of the seal's total area, making it easily affected by the rest of the seal. This distortion of key features leading to authenticity results in inaccurate seal authentication. Summary of the Invention
[0004] The main objective of this application is to provide a method, device, readable storage medium, and electronic device for identifying the authenticity of seals, so as to at least solve the problem that existing methods for identifying the authenticity of seals are inaccurate.
[0005] To achieve the above objectives, according to one aspect of this application, a method for identifying the authenticity of a seal is provided, comprising: acquiring an image of a seal to be identified, and extracting a target image feature vector and a target text feature vector from the image of the seal to be identified, wherein the image of the seal to be identified is an image of a seal to be detected; acquiring multiple standard seal images, and extracting standard image feature vectors and standard text feature vectors from each of the standard seal images; performing similarity matching between the target image feature vector and each of the standard image feature vectors to obtain multiple first similarity results, and then... The first similarity result is used to construct a first set of standard seal images within the first similarity range; the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first set of standard seals are matched for similarity to obtain multiple second similarity results, and the second similarity result is used to construct a second set of standard seal images within the second similarity range; if the second set of standard seals is not empty, the seal to be detected is determined to be a genuine seal, and if the second set of standard seals is empty, the seal to be detected is determined to be a fake seal.
[0006] Optionally, before performing similarity matching between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results, the method further includes: obtaining the standard text image of the standard seal image; obtaining the target text image of the seal image to be identified using a second-order Bézier curve; performing similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and constructing a third standard seal set from the standard seal images whose third similarity results are within the third similarity range.
[0007] Optionally, the target text image of the seal image to be identified is obtained by using a second-order Bézier curve, including: fitting an initial text image of the seal image to be identified based on Bézier coefficients, wherein the initial text image is a circular image; and converting the initial text image into the target text image using a linear interpolation algorithm, wherein the target text image is a rectangular image.
[0008] Optionally, similarity matching is performed between the target text image and each of the standard text images to obtain multiple third similarity results, including: calculating the edit distance between the target text image and each of the standard text images to obtain multiple edit distances, wherein a larger edit distance value indicates a smaller similarity between the target text image and the standard text image, and a smaller edit distance value indicates a larger similarity between the target text image and the standard text image; determining the third standard seal set based on the multiple edit distances, wherein the edit distance between each standard seal image in the third standard seal set and the target text image is within a first distance range, and the third standard seal set includes the first standard seal set.
[0009] Optionally, the third set of standard seals includes multiple standard seal images. Similarity matching is performed between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results. This includes: calculating the cosine distance between the feature vector of the target image and the feature vector of each standard seal image in the third set of standard seals, respectively, to obtain multiple cosine distances; and determining the first set of standard seals based on the multiple cosine distances, wherein the cosine distance between each standard seal image in the first set of standard seals and the feature vector of the target image is within a second distance range.
[0010] Optionally, extracting the target text feature vector from the seal image to be identified includes: constructing a first neural network model, wherein the first neural network model is trained on multiple sets of training data using triplet loss, each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image, wherein the historical target text image is an image containing the target text; and determining the target text feature vector based on the first neural network model and the seal image to be identified.
[0011] Optionally, extracting the target image feature vector from the image of the seal to be identified includes: constructing a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss, and each set of training data includes historical seal images and historical image feature vectors corresponding to the seal images acquired within a historical time period; and determining the target image feature vector based on the second neural network model and the image of the seal to be identified.
[0012] According to another aspect of this application, a device for identifying the authenticity of a seal is provided, comprising: a first acquisition unit, configured to acquire an image of a seal to be identified, and extract a target image feature vector and a target text feature vector from the image of the seal to be identified, wherein the image of the seal to be identified is an image of a seal to be detected; a second acquisition unit, configured to acquire multiple standard seal images, and extract standard image feature vectors and standard text feature vectors from each of the standard seal images; and a first matching unit, configured to perform similarity matching between the target image feature vector and each of the standard image feature vectors to obtain multiple first similarity results, and to... The first similarity result constructs a first standard seal set from the standard seal images within the first similarity range; the second matching unit is used to perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and constructs a second standard seal set from the standard seal images within the second similarity range from the second similarity result; the determining unit is used to determine that the seal to be detected is a genuine seal when the second standard seal set is not empty, and to determine that the seal to be detected is a fake seal when the second standard seal set is empty.
[0013] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the aforementioned methods for identifying the authenticity of a seal.
[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the methods for authenticating the authenticity of a seal.
[0015] Applying the technical solution of this application, the above-mentioned method for identifying the authenticity of a seal firstly acquires an image of the seal to be identified, and extracts the target image feature vector and the target text feature vector from the image of the seal to be identified, wherein the image of the seal to be identified is the image of the seal to be detected; acquires multiple standard seal images, and extracts the standard image feature vector and the standard text feature vector from each standard seal image; then, performs similarity matching between the target image feature vector and the feature vectors of each standard image to obtain multiple first similarity results, and constructs a first standard seal set from the standard seal images whose first similarity results are within the first similarity range; performs similarity matching between the target text feature vector and the standard text feature vectors corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and constructs a second standard seal set from the standard seal images whose second similarity results are within the second similarity range; finally, if the second standard seal set is not empty, the seal to be detected is determined to be a genuine seal, and if the second standard seal set is empty, the seal to be detected is determined to be a fake seal. By combining the coarse feature matching results of the image and the fine feature matching results of the text region, the authenticity of the seal is determined in a cascaded manner. This approach not only considers the structural and compositional characteristics of the complete seal but also takes into account the most crucial text region features, thus solving the problem of inaccurate seal authentication methods in existing systems. Attached Figure Description
[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 A hardware structure block diagram of a mobile terminal for performing a method for authenticating the authenticity of a seal, according to an embodiment of this application, is shown.
[0018] Figure 2 A flowchart illustrating a method for authenticating a seal according to an embodiment of this application is shown.
[0019] Figure 3 A flowchart illustrating another method for authenticating a seal according to an embodiment of this application is shown.
[0020] Figure 4 A structural block diagram of a seal authenticity verification device provided according to an embodiment of this application is shown. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0025] Electronic seal verification: Electronic seal verification is a process that uses electronic means to verify the seals required in a specific business account against the seals on an image of a document. It primarily uses graphical data and background algorithms to simulate the manual verification of documents at a counter. Electronic seal verification can assist banks or other institutions in verifying the authenticity of seals on documents, speeding up the review process and reducing the error rate.
[0026] Optical character recognition (OCR) refers to the process of examining characters on paper materials on electronic devices and then translating the shapes into computer text using character recognition methods; that is, scanning text documents and then analyzing and processing image files to obtain text and layout information.
[0027] As described in the background section, ensuring the authenticity of seals is crucial in current business operations. Common methods for authenticating seals include: 1. Manual verification; 2. Using traditional computer vision technology; and 3. Using artificial intelligence technology. Manual verification has a high technical threshold for practitioners, typically requiring solid professional skills and extensive experience, and necessitates significant manpower, resulting in low efficiency. Traditional computer vision technology for seal verification is limited by the insufficient representation capabilities of traditional image features, which are inadequate for comprehensively verifying seal authenticity. Artificial intelligence-based methods effectively address the issues of low efficiency and feature representation.
[0028] As mentioned above, the method of verifying the authenticity of a seal based on manual verification mainly relies on professionals to verify various aspects such as the font, color, shape, and angle of the seal.
[0029] Traditional computer vision techniques for authenticating seals refer to a comprehensive approach to seal image verification, including image binarization, image enhancement, and manually designed feature extraction. SIFT (Scale Invariant Feature Transform) is one of the most commonly used manually designed features, possessing rotation, scale, and brightness invariance; therefore, these feature points can be used for seal verification. Binarization and image enhancement techniques are primarily used for preprocessing the seal image.
[0030] In recent years, with the rapid development of big data, cloud computing, and artificial intelligence (AI) algorithms, especially deep learning algorithms, AI technology has been gradually and extensively applied to various industries, including seal verification. AI-based seal verification methods mainly include two applications: one is using deep learning-based OCR (Optical Character Recognition) technology to recognize the seal text, verifying the authenticity of the seal at the character level; the other is using deep learning models to extract feature vectors from the seal image, comparing and verifying the seal through strong representational features. The main steps are as follows:
[0031] (1) Perform stamp detection on the input image and delineate the stamp image area;
[0032] (2) A deep learning model is used to perform text detection and recognition on the seal image region;
[0033] (3) Use a deep learning model to extract feature vectors from the seal image region;
[0034] (4) Combining text similarity and feature vector similarity to identify the authenticity of seals.
[0035] The current method has the drawback that features extracted from the overall seal image region mainly represent the overall structure and composition of the seal, while the more critical text region is easily affected by the rest of the seal, resulting in distortion of key features that characterize the authenticity of the seal.
[0036] To address the problem that existing methods for authenticating seals are inaccurate, embodiments of this application provide a method for authenticating seals, a device for authenticating seals, a readable storage medium, and an electronic device.
[0037] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0038] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of identifying the authenticity of a seal according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0039] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the seal authenticity authentication method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one instance, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0040] This embodiment provides a method that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0041] Figure 2 This is a flowchart of a method for identifying the authenticity of a seal according to an embodiment of this application. For example... Figure 2 As shown, the method includes the following steps:
[0042] Step S201: Obtain the image of the seal to be identified, and extract the target image feature vector and the target text feature vector from the image of the seal to be identified. The image of the seal to be identified is the image of the seal to be detected.
[0043] Specifically, the process typically involves scanning the image of the seal to be identified into the identification controller. The input image supports common image formats such as JPG, BMP, and PNG, and must contain at least one circular seal. A Yolov4 deep learning model is then used to locate the seal, and the circumscribed square region of the seal is extracted as the target region. Since seals are relatively easy to detect, the high-performance Yolov4 deep learning model is generally used for seal detection and localization, improving efficiency and predictive performance while maintaining good results. Alternatively, other deep learning models can be used for training.
[0044] The specific steps for extracting the target image feature vector from the image of the seal to be identified are as follows:
[0045] Step S2011: Construct a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss. Each set of training data includes historical seal images and historical image feature vectors corresponding to the seal images, obtained within a historical time period.
[0046] Step S2012: Determine the feature vector of the target image based on the second neural network model and the image of the seal to be identified.
[0047] Specifically, the ResNet50 convolutional neural network model is used for extraction. This model is trained using TripletLoss, which results in higher accuracy. It ensures that the features of two images of the same seal are as similar as possible (high similarity) while the feature differences between different seals are as large as possible (low similarity), thus enabling more accurate identification of the authenticity of the seal.
[0048] Step S202: Obtain multiple standard seal images, and extract the standard image feature vector and the standard text feature vector from each of the above standard seal images.
[0049] Specifically, due to the diverse angles of circular seals, feature matching is affected by different rotation angles. Secondly, the text region typically occupies only a small portion of the entire circular seal, making feature matching based on the complete seal easily influenced by irrelevant content such as the background. Text region feature extraction, on the other hand, can extract only the most important seal features to avoid introducing more noise due to an excessively large Region of Interest (ROI).
[0050] After step S202 is executed and before step S203 is executed, the following steps are also included:
[0051] Step S301: Obtain the standard text image of the standard seal image mentioned above;
[0052] Step S302: Use a second-order Bézier curve to obtain the target text image of the seal image to be identified.
[0053] The specific implementation steps of step S302 are as follows:
[0054] Step S3021: Fit the initial text image of the above-mentioned seal image to be identified based on the Bessel coefficients. The initial text image is a circular image.
[0055] Step S3022: The initial text image is converted into the target text image using a linear interpolation algorithm. The target text image is a rectangular image.
[0056] Specifically, the text detection method based on second-order Bézier curves involves regressing Bézier coefficients through a model to fit an initial text image. Then, a linear interpolation method is used to align the initial text image, thus mapping the curved circular text region to a rectangular text region. Finally, a CRNN (Convolutional Recurrent Neural Network) model is used to recognize the text in the rectangular text region. This method can effectively solve the problem of inaccurate detection of curved text, and the alignment of the text region image can map the curved text to a rectangular text box, which to some extent eliminates the problem of inconsistent text features caused by different rotation angles.
[0057] The specific implementation steps for extracting the target text feature vector from the above-mentioned seal image to be identified also include:
[0058] Step S2013: Construct a first neural network model, wherein the first neural network model is obtained by training multiple sets of training data using triplet loss. Each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image. The historical target text image is an image containing the target text.
[0059] Step S2014: Determine the target text feature vector based on the first neural network model and the image of the seal to be identified.
[0060] Specifically, the ResNet50 convolutional neural network model is used to extract the target text feature vectors from the rectangular target text image. This model is also trained using TripletLoss, which ensures that the features between two images of the same seal are as similar as possible (high similarity) while the feature differences between different seals are as large as possible (low similarity).
[0061] Step S303: Perform similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and construct a third standard seal set by the standard seal images whose third similarity results are within the third similarity range.
[0062] Specifically, when the third standard seal set is empty, it proves that the seal to be identified is a fake seal. However, by first comparing the target text image with each standard text image to obtain the third standard seal set, the problem of inconsistent text features caused by different rotation angles can be eliminated to a certain extent.
[0063] The specific implementation steps of step S303 are as follows:
[0064] Step S3031: Calculate the edit distance between the target text image and each of the standard text images to obtain multiple edit distances. The larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image. The smaller the value of the edit distance, the greater the similarity between the target text image and the standard text image.
[0065] Step S3032: Based on the multiple edit distances mentioned above, determine the third standard stamp set, wherein the edit distances between each standard stamp image and the target text image in the third standard stamp set are all within the first distance range, and the third standard stamp set includes the first standard stamp set.
[0066] Specifically, the similarity between the target text image and each standard text image is represented by the edit distance. Assuming the edit distance between text A and text B is ED(A, B), the similarity can be expressed as: Therefore, the edit distance mentioned in the text refers to the normalized distance, which is usually set to 0 to 0.2. At this time, the corresponding similarity range is 0.8 to 1. That is, the first distance range can be 0 to 0.2, which can eliminate the influence of other areas of the seal on the key text area, making the seal identification more accurate.
[0067] Step S203: Perform similarity matching between the feature vector of the target image and the feature vector of each of the standard images to obtain multiple first similarity results, and construct a first standard seal set by the standard seal images within the first similarity range of the first similarity results.
[0068] Specifically, under normal circumstances, it is only necessary to perform similarity matching between the feature vector of the target image and the standard image feature vector of each standard seal image in the third standard seal set. Furthermore, if the first standard seal set is empty, the seal to be identified is confirmed to be a fake seal. This can improve the identification speed and save identification costs.
[0069] The aforementioned third set of standard seals includes multiple images of the aforementioned standard seals. The specific implementation steps of step S203 are as follows:
[0070] Step S2031: Calculate the cosine distance between the feature vector of the target image and the feature vector of the standard image corresponding to each of the standard seal images in the third set of standard seals, and obtain multiple cosine distances.
[0071] Step S2032: Based on the multiple cosine distances mentioned above, determine the first set of standard seals, wherein the cosine distances between the feature vectors of each standard seal image and the target image in the first set of standard seals are all within the second distance range.
[0072] Specifically, the second distance range is generally 0 to 0.2. First, a coarse feature matching is performed based on the image feature vector. Based on the coarse feature matching result, a portion of the standard seal images can be excluded. Then, a fine feature matching of the text region is performed on the selected standard seal images, which can save identification costs while ensuring accuracy.
[0073] Step S204: Perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and construct the standard seal images within the second similarity range of the second similarity results into a second standard seal set.
[0074] Specifically, under normal circumstances, it is only necessary to perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first set of standard seals. This can improve the identification speed and save identification costs.
[0075] Step S205: If the second set of standard seals is not empty, determine that the seal to be tested is a genuine seal; if the second set of standard seals is empty, determine that the seal to be tested is a fake seal.
[0076] Specifically, the authenticity of the seal is determined by combining the character-level verification results based on OCR (Optical Character Recognition), the coarse feature matching results of the complete seal, and the fine feature matching results of the text region. This approach considers not only the structure and composition of the complete seal but also the most crucial text region features.
[0077] The method for identifying the authenticity of a seal as described in this application first acquires an image of the seal to be identified and extracts the target image feature vector and the target text feature vector from the image. The image of the seal to be identified is the image of the seal to be detected. Then, multiple standard seal images are acquired, and the standard image feature vector and the standard text feature vector are extracted from each standard seal image. Next, the target image feature vector and the feature vectors of each standard image are matched for similarity to obtain multiple first similarity results. The standard seal images whose first similarity results are within the first similarity range are then used to construct a first standard seal set. Finally, the target text feature vector and the corresponding standard text feature vectors of each standard seal image in the first standard seal set are matched for similarity to obtain multiple second similarity results. The standard seal images whose second similarity results are within the second similarity range are then used to construct a second standard seal set. Finally, if the second standard seal set is not empty, the seal to be detected is determined to be a genuine seal; if the second standard seal set is empty, the seal to be detected is determined to be a fake seal. By combining the coarse feature matching results of the image and the fine feature matching results of the text region, the authenticity of the seal is determined in a cascaded manner. This approach not only considers the structural and compositional characteristics of the complete seal but also takes into account the most crucial text region features, thus solving the problem of inaccurate seal authentication methods in existing systems.
[0078] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the seal authentication method of this application will be described in detail below with reference to specific embodiments.
[0079] This embodiment relates to a specific method for identifying the authenticity of a seal, such as... Figure 3 As shown, it includes the following steps:
[0080] Step S1: Input image supports common image formats such as jpg, bmp, and png. The input image must contain at least one circular stamp.
[0081] Step S2: Seal Detection. Since seals are relatively easy to detect, this solution uses the high-performance Yolov4 deep learning model for seal detection and localization, improving the model's prediction performance while ensuring good results.
[0082] Step S3: Text Region Detection. To better address the detection of curved text, this solution employs a text detection method based on second-order Bézier curves, which involves regressing Bézier coefficients through a model to fit the curved text regions.
[0083] Step S4: Seal text alignment. A linear interpolation method is used to align the seal text obtained in step S3, thereby mapping and transforming the curved text area into a rectangular text area.
[0084] Step S5: Text Recognition. The rectangular text image obtained in Step S4 is used to perform text recognition using a CRNN model.
[0085] Step S6: Calculate the similarity between the text information obtained in Step S5 and the text information of the standard seal in the base library. This similarity can be represented by calculating the edit distance between the texts, and the larger the edit distance, the smaller the similarity. Set a certain threshold to select a candidate set of seals that meet the conditions. If the candidate set is empty, return a verification failure result; otherwise, continue to the following steps.
[0086] Step S7: Seal Feature Extraction. For the complete seal target area obtained in Step S2, a ResNet50 convolutional neural network model is used for feature extraction. This model is trained with TripletLoss, which ensures that the features between two images of the same seal are as similar as possible (high similarity) while the feature differences between different seals are as large as possible (low similarity).
[0087] Step S8: Coarse Feature Matching. Calculate the similarity between the seal features obtained in Step S7 and the features of the seal candidate set obtained in Step S6. This similarity can be represented by calculating the cosine distance. Set a certain threshold to select the seal candidate set that meets the conditions. If the candidate set is empty, return a verification failure result; otherwise, continue to the following steps.
[0088] Step S9: Text Region Feature Extraction. For the aligned text image obtained in Step S4, a convolutional neural network model trained with ResNet50+TripletLoss is used for feature extraction.
[0089] Step S10: Fine Feature Matching. Calculate the similarity between the seal features obtained in Step S9 and the features of the seal candidate set obtained in Step S8. Set a certain threshold to select the seal candidate set that meets the conditions. If the candidate set is empty, return a verification failure result; otherwise, it means the verification passed.
[0090] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0091] This application also provides a device for identifying the authenticity of a seal. It should be noted that this device can be used to execute the seal authenticity identification method provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0092] The following describes the seal authenticity identification device provided in the embodiments of this application.
[0093] Figure 4 This is a schematic diagram of a seal authenticity verification device according to an embodiment of this application. Figure 4 As shown, the device includes a first acquisition unit 10, a second acquisition unit 20, a first matching unit 30, a second matching unit 40, and a determination unit 50. The first acquisition unit 10 is used to acquire an image of a seal to be identified and extract target image feature vectors and target text feature vectors from the image of the seal to be identified. The image of the seal to be identified is the image of the seal to be detected. The second acquisition unit 20 is used to acquire multiple standard seal images and extract standard image feature vectors and standard text feature vectors from each of the standard seal images. The first matching unit 30 is used to perform similarity matching between the target image feature vectors and the standard image feature vectors to obtain multiple... The first similarity result is obtained, and the standard seal images within the first similarity range of the first similarity result are constructed into a first standard seal set; the second matching unit 40 is used to perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and construct the standard seal images within the second similarity range of the second similarity result into a second standard seal set; the determining unit 50 is used to determine that the seal to be detected is a genuine seal when the second standard seal set is not empty, and to determine that the seal to be detected is a fake seal when the second standard seal set is empty.
[0094] The seal authenticity identification device of this application includes a first acquisition unit, a second acquisition unit, a first matching unit, a second matching unit, and a determination unit. The first acquisition unit is used to acquire an image of the seal to be identified and extract target image feature vectors and target text feature vectors from the image of the seal to be identified, wherein the image of the seal to be identified is an image of the seal to be detected. The second acquisition unit is used to acquire multiple standard seal images and extract standard image feature vectors and standard text feature vectors from each of the standard seal images. The first matching unit is used to perform similarity matching between the target image feature vectors and the standard image feature vectors to obtain multiple... The system calculates a first similarity result and constructs a first set of standard seals from the standard seal images within the first similarity range. A second matching unit performs similarity matching between the target text feature vector and the corresponding standard text feature vectors of each standard seal image in the first set of standard seals, obtaining multiple second similarity results. The system then constructs a second set of standard seals from the standard seal images within the second similarity range from the second similarity results. A determination unit determines the seal to be detected as genuine if the second set of standard seals is not empty, and as fake if the second set of standard seals is empty. By combining the coarse feature matching results of the image and the fine feature matching results of the text region, the authenticity of the seal is determined in a cascaded manner. This approach considers not only the structure and composition of the complete seal but also the crucial text region features, solving the problem of inaccurate seal authentication in existing methods.
[0095] As an optional solution, the above-mentioned device further includes a third acquisition unit, a fourth acquisition unit, and a third matching unit. The third acquisition unit is used to acquire the standard text image of the standard seal image before performing similarity matching between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results. The fourth acquisition unit is used to acquire the target text image of the seal image to be identified using a second-order Bézier curve. The third matching unit is used to perform similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and to construct a third standard seal set from the standard seal images whose third similarity results are within the third similarity range. This can, to a certain extent, eliminate the problem of inconsistent text features caused by different rotation angles.
[0096] For example, the fourth acquisition unit includes a fitting subunit and a transformation subunit. The fitting subunit is used to fit an initial text image of the seal image to be identified based on Bessel coefficients. The initial text image is a circular image. The transformation subunit is used to convert the initial text image into the target text image using a linear interpolation algorithm. The target text image is a rectangular image. This can effectively solve the problem of inaccurate detection of curved text, and the alignment of the text region image can map the curved text to a rectangular text box, thus eliminating the problem of inconsistent text features caused by different rotation angles to a certain extent.
[0097] In an optional example, the third matching unit includes a first calculation subunit and a second determination subunit. The first calculation subunit is used to calculate the edit distances between the target text image and each of the standard text images, obtaining multiple edit distances. A larger edit distance value indicates a lower similarity between the target text image and the standard text image, while a smaller edit distance value indicates a higher similarity. The second determination subunit is used to determine the third standard seal set based on the multiple edit distances. The edit distances between each standard seal image in the third standard seal set and the target text image are all within a first distance range. The third standard seal set includes the first standard seal set. This eliminates the influence of other areas of the seal on key text areas, resulting in higher accuracy in seal identification.
[0098] In an optional embodiment, the third set of standard seals includes multiple standard seal images. The first matching unit includes a second calculation subunit and a second determination subunit. The second calculation subunit is used to calculate the cosine distance between the feature vector of the target image and the feature vector of the standard image corresponding to each of the standard seal images in the third set of standard seals, respectively, to obtain multiple cosine distances. The second determination subunit is used to determine the first set of standard seals based on the multiple cosine distances, wherein the cosine distance between each of the standard seal images in the first set of standard seals and the feature vector of the target image is within a second distance range. This can save identification costs while ensuring accuracy.
[0099] In one optional scheme, the first acquisition unit includes a first construction subunit and a third determination subunit. The first construction subunit is used to construct a first neural network model, wherein the first neural network model is trained on multiple sets of training data using triplet loss. Each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image. The historical target text image is an image containing the target text. The third determination subunit determines the target text feature vector based on the first neural network model and the seal image to be identified. This ensures that the features between two images of the same seal are as similar as possible (high similarity), while the feature differences between different seals are as large as possible (low similarity).
[0100] For example, the first acquisition unit includes a second construction subunit and a fourth determination subunit. The second construction subunit is used to construct a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss. Each set of training data includes historical seal images and historical image feature vectors corresponding to the seal images acquired within a historical time period. The fourth determination subunit is used to determine the target image feature vector based on the second neural network model and the seal image to be identified. This ensures that the features between two images of the same seal are as similar as possible (high similarity) while the feature differences between different seals are as large as possible (low similarity), enabling more accurate identification of the authenticity of seals.
[0101] The aforementioned seal authentication device includes a processor and a memory. The first acquisition unit and other components are stored as program units in the memory, and the processor executes these program units to perform the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0102] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; adjusting kernel parameters can address the inaccuracy of existing seal authentication methods.
[0103] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0104] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the method for identifying the authenticity of a seal.
[0105] Specifically, methods for authenticating seals include:
[0106] Step S201: Obtain the image of the seal to be identified, and extract the target image feature vector and the target text feature vector from the image of the seal to be identified. The image of the seal to be identified is the image of the seal to be detected.
[0107] Specifically, the process typically involves scanning the image of the seal to be identified into the identification controller. The input image supports common image formats such as JPG, BMP, and PNG, and must contain at least one circular seal. A Yolov4 deep learning model is then used to locate the seal, and the circumscribed square region of the seal is extracted as the target region. Since seals are relatively easy to detect, the high-performance Yolov4 deep learning model is generally used for seal detection and localization, improving efficiency and predictive performance while maintaining good results. Alternatively, other deep learning models can be used for training.
[0108] Step S202: Obtain multiple standard seal images, and extract the standard image feature vector and the standard text feature vector from each of the above standard seal images.
[0109] Specifically, due to the diverse angles of circular seals, feature matching is affected by different rotation angles. Secondly, the text region typically occupies only a small portion of the entire circular seal, making feature matching based on the complete seal easily influenced by irrelevant content such as the background. Text region feature extraction, on the other hand, can extract only the most important seal features to avoid introducing more noise due to an excessively large Region of Interest (ROI).
[0110] Step S203: Perform similarity matching between the feature vector of the target image and the feature vector of each of the standard images to obtain multiple first similarity results, and construct a first standard seal set by the standard seal images within the first similarity range of the first similarity results.
[0111] Specifically, under normal circumstances, it is only necessary to perform similarity matching between the feature vector of the target image and the standard image feature vector of each standard seal image in the third standard seal set. Furthermore, if the first standard seal set is empty, the seal to be identified is confirmed to be a fake seal. This can improve the identification speed and save identification costs.
[0112] Step S204: Perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and construct the standard seal images within the second similarity range of the second similarity results into a second standard seal set.
[0113] Specifically, under normal circumstances, it is only necessary to perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first set of standard seals. This can improve the identification speed and save identification costs.
[0114] Step S205: If the second set of standard seals is not empty, determine that the seal to be tested is a genuine seal; if the second set of standard seals is empty, determine that the seal to be tested is a fake seal.
[0115] Specifically, the authenticity of the seal is determined by combining the character-level verification results based on OCR (Optical Character Recognition), the coarse feature matching results of the complete seal, and the fine feature matching results of the text region. This approach considers not only the structure and composition of the complete seal but also the most crucial text region features.
[0116] Optionally, before performing similarity matching between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results, the method further includes: obtaining the standard text image of the standard seal image; obtaining the target text image of the seal image to be identified using a second-order Bézier curve; performing similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and constructing the standard seal images whose third similarity results are within the third similarity range as a third standard seal set.
[0117] Optionally, the target text image of the seal image to be identified is obtained by using a second-order Bézier curve, including: fitting an initial text image of the seal image to be identified based on Bézier coefficients, wherein the initial text image is a circular image; and converting the initial text image into the target text image using a linear interpolation algorithm, wherein the target text image is a rectangular image.
[0118] Optionally, the target text image and each of the standard text images are subjected to similarity matching to obtain multiple third similarity results, including: calculating the edit distance between the target text image and each of the standard text images respectively to obtain multiple edit distances, wherein the larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image, and the smaller the value of the edit distance, the larger the similarity between the target text image and the standard text image; determining the third standard seal set based on the multiple edit distances, wherein the edit distance between each of the standard seal images in the third standard seal set and the target text image is within a first distance range, and the third standard seal set includes the first standard seal set.
[0119] Optionally, the aforementioned third standard seal set includes multiple standard seal images. Similarity matching is performed between the feature vector of the target image and the feature vectors of each of the aforementioned standard images to obtain multiple first similarity results. This includes: calculating the cosine distance between the feature vector of the target image and the feature vector of each of the aforementioned standard seal images in the aforementioned third standard seal set, respectively, to obtain multiple cosine distances; and determining the aforementioned first standard seal set based on the multiple cosine distances, wherein the cosine distance between each of the aforementioned standard seal images in the aforementioned first standard seal set and the feature vector of the aforementioned target image is within a second distance range.
[0120] Optionally, extracting the target text feature vector from the above-mentioned seal image to be identified includes: constructing a first neural network model, wherein the first neural network model is trained on multiple sets of training data using triplet loss, each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image, wherein the historical target text image is an image containing the target text; and determining the target text feature vector based on the first neural network model and the above-mentioned seal image to be identified.
[0121] Optionally, extracting the target image feature vector from the above-mentioned seal image to be identified includes: constructing a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss, and each set of training data includes: historical seal images and historical image feature vectors corresponding to the seal images acquired within a historical time period; and determining the target image feature vector based on the second neural network model and the above-mentioned seal image to be identified.
[0122] This invention provides a processor for running a program, wherein the program executes the method for identifying the authenticity of a seal.
[0123] Specifically, methods for authenticating seals include:
[0124] Step S201: Obtain the image of the seal to be identified, and extract the target image feature vector and the target text feature vector from the image of the seal to be identified. The image of the seal to be identified is the image of the seal to be detected.
[0125] Specifically, the process typically involves scanning the image of the seal to be identified into the identification controller. The input image supports common image formats such as JPG, BMP, and PNG, and must contain at least one circular seal. A Yolov4 deep learning model is then used to locate the seal, and the circumscribed square region of the seal is extracted as the target region. Since seals are relatively easy to detect, the high-performance Yolov4 deep learning model is generally used for seal detection and localization, improving efficiency and predictive performance while maintaining good results. Alternatively, other deep learning models can be used for training.
[0126] Step S202: Obtain multiple standard seal images, and extract the standard image feature vector and the standard text feature vector from each of the above standard seal images.
[0127] Specifically, due to the diverse angles of circular seals, feature matching is affected by different rotation angles. Secondly, the text region typically occupies only a small portion of the entire circular seal, making feature matching based on the complete seal easily influenced by irrelevant content such as the background. Text region feature extraction, on the other hand, can extract only the most important seal features to avoid introducing more noise due to an excessively large Region of Interest (ROI).
[0128] Step S203: Perform similarity matching between the feature vector of the target image and the feature vector of each of the standard images to obtain multiple first similarity results, and construct a first standard seal set by the standard seal images within the first similarity range of the first similarity results.
[0129] Specifically, under normal circumstances, it is only necessary to perform similarity matching between the feature vector of the target image and the standard image feature vector of each standard seal image in the third standard seal set. Furthermore, if the first standard seal set is empty, the seal to be identified is confirmed to be a fake seal. This can improve the identification speed and save identification costs.
[0130] Step S204: Perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and construct the standard seal images within the second similarity range of the second similarity results into a second standard seal set.
[0131] Specifically, under normal circumstances, it is only necessary to perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first set of standard seals. This can improve the identification speed and save identification costs.
[0132] Step S205: If the second set of standard seals is not empty, determine that the seal to be tested is a genuine seal; if the second set of standard seals is empty, determine that the seal to be tested is a fake seal.
[0133] Specifically, the authenticity of the seal is determined by combining the character-level verification results based on OCR (Optical Character Recognition), the coarse feature matching results of the complete seal, and the fine feature matching results of the text region. This approach considers not only the structure and composition of the complete seal but also the most crucial text region features.
[0134] Optionally, before performing similarity matching between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results, the method further includes: obtaining the standard text image of the standard seal image; obtaining the target text image of the seal image to be identified using a second-order Bézier curve; performing similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and constructing the standard seal images whose third similarity results are within the third similarity range as a third standard seal set.
[0135] Optionally, the target text image of the seal image to be identified is obtained by using a second-order Bézier curve, including: fitting an initial text image of the seal image to be identified based on Bézier coefficients, wherein the initial text image is a circular image; and converting the initial text image into the target text image using a linear interpolation algorithm, wherein the target text image is a rectangular image.
[0136] Optionally, the target text image and each of the standard text images are subjected to similarity matching to obtain multiple third similarity results, including: calculating the edit distance between the target text image and each of the standard text images respectively to obtain multiple edit distances, wherein the larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image, and the smaller the value of the edit distance, the larger the similarity between the target text image and the standard text image; determining the third standard seal set based on the multiple edit distances, wherein the edit distance between each of the standard seal images in the third standard seal set and the target text image is within a first distance range, and the third standard seal set includes the first standard seal set.
[0137] Optionally, the aforementioned third standard seal set includes multiple standard seal images. Similarity matching is performed between the feature vector of the target image and the feature vectors of each of the aforementioned standard images to obtain multiple first similarity results. This includes: calculating the cosine distance between the feature vector of the target image and the feature vector of each of the aforementioned standard seal images in the aforementioned third standard seal set, respectively, to obtain multiple cosine distances; and determining the aforementioned first standard seal set based on the multiple cosine distances, wherein the cosine distance between each of the aforementioned standard seal images in the aforementioned first standard seal set and the feature vector of the aforementioned target image is within a second distance range.
[0138] Optionally, extracting the target text feature vector from the above-mentioned seal image to be identified includes: constructing a first neural network model, wherein the first neural network model is trained on multiple sets of training data using triplet loss, each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image, wherein the historical target text image is an image containing the target text; and determining the target text feature vector based on the first neural network model and the above-mentioned seal image to be identified.
[0139] Optionally, extracting the target image feature vector from the above-mentioned seal image to be identified includes: constructing a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss, and each set of training data includes: historical seal images and historical image feature vectors corresponding to the seal images acquired within a historical time period; and determining the target image feature vector based on the second neural network model and the above-mentioned seal image to be identified.
[0140] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0141] Specifically, methods for authenticating seals include:
[0142] Step S201: Obtain the image of the seal to be identified, and extract the target image feature vector and the target text feature vector from the image of the seal to be identified. The image of the seal to be identified is the image of the seal to be detected.
[0143] Step S202: Obtain multiple standard seal images, and extract the standard image feature vector and the standard text feature vector from each of the above standard seal images.
[0144] Step S203: Perform similarity matching between the feature vector of the target image and the feature vector of each of the standard images to obtain multiple first similarity results, and construct a first standard seal set by the standard seal images within the first similarity range of the first similarity results.
[0145] Step S204: Perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and construct the standard seal images within the second similarity range of the second similarity results into a second standard seal set.
[0146] Step S205: If the second set of standard seals is not empty, determine that the seal to be tested is a genuine seal; if the second set of standard seals is empty, determine that the seal to be tested is a fake seal.
[0147] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0148] Optionally, before performing similarity matching between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results, the method further includes: obtaining the standard text image of the standard seal image; obtaining the target text image of the seal image to be identified using a second-order Bézier curve; performing similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and constructing the standard seal images whose third similarity results are within the third similarity range as a third standard seal set.
[0149] Optionally, the target text image of the seal image to be identified is obtained by using a second-order Bézier curve, including: fitting an initial text image of the seal image to be identified based on Bézier coefficients, wherein the initial text image is a circular image; and converting the initial text image into the target text image using a linear interpolation algorithm, wherein the target text image is a rectangular image.
[0150] Optionally, the target text image and each of the standard text images are subjected to similarity matching to obtain multiple third similarity results, including: calculating the edit distance between the target text image and each of the standard text images respectively to obtain multiple edit distances, wherein the larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image, and the smaller the value of the edit distance, the larger the similarity between the target text image and the standard text image; determining the third standard seal set based on the multiple edit distances, wherein the edit distance between each of the standard seal images in the third standard seal set and the target text image is within a first distance range, and the third standard seal set includes the first standard seal set.
[0151] Optionally, the aforementioned third standard seal set includes multiple standard seal images. Similarity matching is performed between the feature vector of the target image and the feature vectors of each of the aforementioned standard images to obtain multiple first similarity results. This includes: calculating the cosine distance between the feature vector of the target image and the feature vector of each of the aforementioned standard seal images in the aforementioned third standard seal set, respectively, to obtain multiple cosine distances; and determining the aforementioned first standard seal set based on the multiple cosine distances, wherein the cosine distance between each of the aforementioned standard seal images in the aforementioned first standard seal set and the feature vector of the aforementioned target image is within a second distance range.
[0152] Optionally, extracting the target text feature vector from the above-mentioned seal image to be identified includes: constructing a first neural network model, wherein the first neural network model is trained on multiple sets of training data using triplet loss, each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image, wherein the historical target text image is an image containing the target text; and determining the target text feature vector based on the first neural network model and the above-mentioned seal image to be identified.
[0153] Optionally, extracting the target image feature vector from the above-mentioned seal image to be identified includes: constructing a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss, and each set of training data includes: historical seal images and historical image feature vectors corresponding to the seal images acquired within a historical time period; and determining the target image feature vector based on the second neural network model and the above-mentioned seal image to be identified.
[0154] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0155] Step S201: Obtain the image of the seal to be identified, and extract the target image feature vector and the target text feature vector from the image of the seal to be identified. The image of the seal to be identified is the image of the seal to be detected.
[0156] Step S202: Obtain multiple standard seal images, and extract the standard image feature vector and the standard text feature vector from each of the above standard seal images.
[0157] Step S203: Perform similarity matching between the feature vector of the target image and the feature vector of each of the standard images to obtain multiple first similarity results, and construct a first standard seal set by the standard seal images within the first similarity range of the first similarity results.
[0158] Step S204: Perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and construct the standard seal images within the second similarity range of the second similarity results into a second standard seal set.
[0159] Step S205: If the second set of standard seals is not empty, determine that the seal to be tested is a genuine seal; if the second set of standard seals is empty, determine that the seal to be tested is a fake seal.
[0160] Optionally, before performing similarity matching between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results, the method further includes: obtaining the standard text image of the standard seal image; obtaining the target text image of the seal image to be identified using a second-order Bézier curve; performing similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and constructing the standard seal images whose third similarity results are within the third similarity range as a third standard seal set.
[0161] Optionally, the target text image of the seal image to be identified is obtained by using a second-order Bézier curve, including: fitting an initial text image of the seal image to be identified based on Bézier coefficients, wherein the initial text image is a circular image; and converting the initial text image into the target text image using a linear interpolation algorithm, wherein the target text image is a rectangular image.
[0162] Optionally, the target text image and each of the standard text images are subjected to similarity matching to obtain multiple third similarity results, including: calculating the edit distance between the target text image and each of the standard text images respectively to obtain multiple edit distances, wherein the larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image, and the smaller the value of the edit distance, the larger the similarity between the target text image and the standard text image; determining the third standard seal set based on the multiple edit distances, wherein the edit distance between each of the standard seal images in the third standard seal set and the target text image is within a first distance range, and the third standard seal set includes the first standard seal set.
[0163] Optionally, the aforementioned third standard seal set includes multiple standard seal images. Similarity matching is performed between the feature vector of the target image and the feature vectors of each of the aforementioned standard images to obtain multiple first similarity results. This includes: calculating the cosine distance between the feature vector of the target image and the feature vector of each of the aforementioned standard seal images in the aforementioned third standard seal set, respectively, to obtain multiple cosine distances; and determining the aforementioned first standard seal set based on the multiple cosine distances, wherein the cosine distance between each of the aforementioned standard seal images in the aforementioned first standard seal set and the feature vector of the aforementioned target image is within a second distance range.
[0164] Optionally, extracting the target text feature vector from the above-mentioned seal image to be identified includes: constructing a first neural network model, wherein the first neural network model is trained on multiple sets of training data using triplet loss, each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image, wherein the historical target text image is an image containing the target text; and determining the target text feature vector based on the first neural network model and the above-mentioned seal image to be identified.
[0165] Optionally, extracting the target image feature vector from the above-mentioned seal image to be identified includes: constructing a second neural network model, wherein the second neural network model is trained on multiple sets of training data using triplet loss, and each set of training data includes: historical seal images and historical image feature vectors corresponding to the seal images acquired within a historical time period; and determining the target image feature vector based on the second neural network model and the above-mentioned seal image to be identified.
[0166] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0167] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0168] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0169] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0170] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0171] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0172] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0173] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0174] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0175] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0176] 1) The method for identifying the authenticity of a seal as described in this application firstly acquires an image of the seal to be identified, and extracts the target image feature vector and the target text feature vector from the image of the seal to be identified, wherein the image of the seal to be identified is the image of the seal to be detected; acquires multiple standard seal images, and extracts the standard image feature vector and the standard text feature vector from each standard seal image; then performs similarity matching between the target image feature vector and the feature vectors of each standard image to obtain multiple first similarity results, and constructs a first standard seal set from the standard seal images whose first similarity results are within the first similarity range; performs similarity matching between the target text feature vector and the standard text feature vectors corresponding to each standard seal image in the first standard seal set to obtain multiple second similarity results, and constructs a second standard seal set from the standard seal images whose second similarity results are within the second similarity range; finally, if the second standard seal set is not empty, the seal to be detected is determined to be a genuine seal, and if the second standard seal set is empty, the seal to be detected is determined to be a fake seal. By combining the coarse feature matching results of the image and the fine feature matching results of the text region, the authenticity of the seal is determined in a cascaded manner. This approach not only considers the structural and compositional characteristics of the complete seal but also takes into account the most crucial text region features, thus solving the problem of inaccurate seal authentication methods in existing systems.
[0177] 2) The seal authenticity identification device of this application includes a first acquisition unit, a second acquisition unit, a first matching unit, a second matching unit, and a determination unit. The first acquisition unit is used to acquire an image of a seal to be identified and extract target image feature vectors and target text feature vectors from the image of the seal to be identified, wherein the image of the seal to be identified is an image of the seal to be detected. The second acquisition unit is used to acquire multiple standard seal images and extract standard image feature vectors and standard text feature vectors from each of the standard seal images. The first matching unit is used to perform similarity matching between the target image feature vectors and the standard image feature vectors to obtain multiple... The system generates a first similarity result and constructs a first standard seal set by matching the standard seal images within the first similarity range of the first similarity result. A second matching unit performs similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set, obtaining multiple second similarity results. The system then constructs a second standard seal set by matching the standard seal images within the second similarity range of the second similarity results. A determination unit determines the seal to be detected as genuine if the second standard seal set is not empty, and determines it as fake if the second standard seal set is empty. By combining the coarse feature matching results of the image and the fine feature matching results of the text region, the authenticity of the seal is determined in a cascade manner. This approach considers not only the structure and composition characteristics of the complete seal but also the most crucial text region features, solving the problem of inaccurate seal authenticity identification in existing methods.
[0178] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for identifying the authenticity of a seal, characterized in that, include: Obtain an image of the seal to be identified, and extract the target image feature vector and the target text feature vector from the image of the seal to be identified, wherein the image of the seal to be identified is the image of the seal to be detected; Acquire multiple standard seal images, and extract the standard image feature vector and the standard text feature vector from each of the standard seal images; The feature vector of the target image and the feature vector of each of the standard images are matched for similarity to obtain multiple first similarity results, and the standard seal images within the first similarity range of the first similarity results are constructed into a first standard seal set. The target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set are matched for similarity to obtain multiple second similarity results, and the standard seal images within the second similarity range of the second similarity results are constructed into a second standard seal set. If the second set of standard seals is not empty, the seal to be tested is determined to be a genuine seal; if the second set of standard seals is empty, the seal to be tested is determined to be a fake seal. Before performing similarity matching between the target image feature vector and each of the standard image feature vectors to obtain multiple first similarity results, the method further includes: Obtain the standard text image of the standard seal image; The target text image of the seal to be identified is obtained by using a second-order Bézier curve. The target text image and each of the standard text images are matched for similarity to obtain multiple third similarity results, and the standard seal images whose third similarity results are within the third similarity range are constructed into a third standard seal set. The process of obtaining the target text image of the seal image to be identified using a second-order Bézier curve includes: An initial text image is obtained by fitting the image of the seal to be identified based on Bessel coefficients. The initial text image is a circular image. The initial text image is converted into the target text image using a linear interpolation algorithm, and the target text image is a rectangular image; The target text image and each of the standard text images are matched for similarity to obtain multiple third similarity results, including: The edit distance between the target text image and each of the standard text images is calculated to obtain multiple edit distances. The larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image. The smaller the value of the edit distance, the greater the similarity between the target text image and the standard text image. The third set of standard stamps is determined based on multiple edit distances, wherein the edit distance between each standard stamp image and the target text image in the third set of standard stamps is within a first distance range, and the third set of standard stamps includes the first set of standard stamps.
2. The identification method according to claim 1, characterized in that, The third set of standard seals includes multiple standard seal images. Similarity matching is performed between the feature vector of the target image and the feature vectors of each of the standard images to obtain multiple first similarity results, including: Calculate the cosine distance between the feature vector of the target image and the feature vector of the standard image corresponding to each standard seal image in the third set of standard seals, and obtain multiple cosine distances; Based on multiple cosine distances, the first set of standard seals is determined, wherein the cosine distance between each standard seal image in the first set of standard seals and the feature vector of the target image is within the second distance range.
3. The identification method according to claim 1 or 2, characterized in that, Extracting the target text feature vector from the image of the seal to be identified includes: A first neural network model is constructed, wherein the first neural network model is trained on multiple sets of training data using triplet loss. Each set of training data includes a historical target text image of a historical seal image acquired within a historical time period and a historical text feature vector corresponding to the historical target text image. The historical target text image is an image that includes the target text. The target text feature vector is determined based on the first neural network model and the image of the seal to be identified.
4. The identification method according to claim 1 or 2, characterized in that, Extracting the target image feature vector from the image of the seal to be identified includes: A second neural network model is constructed, wherein the second neural network model is trained on multiple sets of training data using triplet loss. Each set of training data includes historical seal images and historical image feature vectors corresponding to the seal images, which were acquired within a historical time period. The feature vector of the target image is determined based on the second neural network model and the image of the seal to be identified.
5. A device for identifying the authenticity of a seal, characterized in that, include: The first acquisition unit is used to acquire an image of a seal to be identified, and to extract the target image feature vector and the target text feature vector from the image of the seal to be identified, wherein the image of the seal to be identified is an image of a seal to be detected. The second acquisition unit is used to acquire multiple standard seal images and extract the standard image feature vector and the standard text feature vector from each of the standard seal images. The first matching unit is used to perform similarity matching between the feature vector of the target image and the feature vector of each of the standard images to obtain multiple first similarity results, and to construct a first standard seal set by the standard seal images of the first similarity results within the first similarity range. The second matching unit is used to perform similarity matching between the target text feature vector and the standard text feature vector corresponding to each standard seal image in the first standard seal set, to obtain multiple second similarity results, and to construct a second standard seal set by constructing the standard seal images within the second similarity range of the second similarity results. The determining unit is configured to determine that the seal to be detected is a genuine seal when the second set of standard seals is not empty, and to determine that the seal to be detected is a fake seal when the second set of standard seals is empty. The device further includes: The third acquisition unit is used to acquire the standard text image of the standard seal image before performing similarity matching between the feature vector of the target image and the feature vectors of each standard image to obtain multiple first similarity results. The fourth acquisition unit is used to acquire the target text image of the seal image to be identified using a second-order Bézier curve; The third matching unit is used to perform similarity matching between the target text image and each of the standard text images to obtain multiple third similarity results, and to construct a third standard seal set by the standard seal images whose third similarity results are within the third similarity range. The fourth acquisition unit includes: A fitting subunit is used to fit an initial text image of the seal image to be identified based on Bessel coefficients. The initial text image is a circular image. A conversion subunit is used to convert the initial text image into the target text image using a linear interpolation algorithm, wherein the target text image is a rectangular image; The third matching unit includes: The first calculation subunit is used to calculate the edit distance between the target text image and each of the standard text images respectively, and obtain multiple edit distances, wherein the larger the value of the edit distance, the smaller the similarity between the target text image and the standard text image, and the smaller the value of the edit distance, the larger the similarity between the target text image and the standard text image; The second determining subunit is used to determine the third standard stamp set based on multiple editing distances, wherein the editing distance between each standard stamp image and the target text image in the third standard stamp set is within a first distance range, and the third standard stamp set includes the first standard stamp set.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the method for identifying the authenticity of a seal as described in any one of claims 1 to 4.
7. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a method for performing the authentication of a seal as described in any one of claims 1 to 4.