Electronic verification method and system
By accurately locating the seal area using the recognition model and combining trimodal image recognition and enhancement technologies, the segmentation model separates the seal from the background, and the feature comparison model automatically compares the seals. This solves the problem of low efficiency and accuracy of electronic seal verification in complex scenarios, and achieves high efficiency and high accuracy in automated seal verification.
Patent Information
- Application Number
- CN202511957878.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-10
AI Technical Summary
Existing electronic seal verification systems suffer from low efficiency and accuracy in complex and interference-prone scenarios, mainly due to inaccurate seal positioning and poor seal image quality, leading to frequent manual intervention.
The system employs a recognition model to accurately identify target detection positions and uses trimodal image recognition and image enhancement technologies. It combines a segmentation model to separate the target electronic seal image from the background image and performs automatic comparison through a feature comparison model, replacing the manual seal verification process.
It improves the efficiency and accuracy of electronic seal verification in complex and interference-prone scenarios, reduces manual intervention, and enhances the automation accuracy and efficiency of seal verification.
Smart Images

Figure CN121837671A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more specifically, to an electronic seal verification method and system. Background Technology
[0002] Electronic seal verification is a technology that uses electronic means to verify the seals on documents. It uses image processing, intelligent technology, and information processing to compare the seal on the document with a pre-reserved standard seal image stored in a database by the client, thus verifying the authenticity of the seal.
[0003] In existing electronic seal verification systems, the traditional image comparison method using traditional image algorithms has several shortcomings. For example, when verifying the correctness of a seal, traditional image algorithms first locate the seal's position and then perform a similarity check. Errors in seal location frequently occur at this stage, leading to a decrease in overall accuracy. Furthermore, when comparing seal similarity using traditional image algorithms, the poor image quality caused by inconsistent seal color, creases on the document, or background patterns on the document often results in very low accuracy, necessitating manual verification. Therefore, this significantly impacts the efficiency and accuracy of the seal verification process in complex and interference-prone scenarios. Summary of the Invention
[0004] This application provides an electronic seal verification method and system, which at least solves the problem of low efficiency and accuracy in the seal verification process under complex interference scenarios in related technologies.
[0005] According to one embodiment of this application, an electronic seal verification method is provided, comprising:
[0006] The recognition model is used to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal file; and the three-modal image recognition and image enhancement operations are performed on the image to be recognized to obtain the image to be processed within the outer rectangle coordinates.
[0007] The target electronic seal image and the background image are segmented from the image to be processed using a segmentation model;
[0008] The target electronic seal image is compared with a pre-stored seal image using a feature comparison model to generate a comparison result.
[0009] In one embodiment, performing trimodal image recognition and image enhancement operations on the image to be recognized includes:
[0010] The image to be identified is converted into a trimodal feature map based on a trimodal feature embedding layer, wherein the trimodal features include: RGB mode, HSV mode, and grayscale mode;
[0011] An adaptive enhancement sub-network layer dynamically adjusts the enhancement parameters based on the image quality of the image to be identified to obtain updated enhancement parameters. Based on the updated enhancement parameters, an image enhancement operation is performed on the trimodal feature map to obtain the image to be processed.
[0012] In one implementation, a recognition model is used to identify the outer rectangular coordinates of the target detection position and the image to be recognized within the outer rectangular coordinates from the seal file, including:
[0013] Interference factors in the seal file are detected and identified based on the interference mask layer to generate a pixel-level interference mask image, wherein the interference factors include: fixed interference, random interference, and crease interference.
[0014] The coordinates of the outer rectangle of the target detection position and the image to be identified within the coordinates of the outer rectangle are obtained by combining the interference mask image.
[0015] In one implementation, interference factors in the signature file are detected and identified based on an interference mask layer to generate a pixel-level interference mask image, wherein the interference factors include: fixed interference, random interference, and crease interference, including:
[0016] A binary mask image is generated based on an interference mask generation subnetwork, wherein the binary mask image includes: interference region and non-interference region;
[0017] The interference feature suppression module fuses the binary mask image with the image within the coordinates of the outer truncated rectangle to obtain the image to be identified.
[0018] In one embodiment, the method of using a recognition model to identify the outer rectangular coordinates of the target detection position and the image to be recognized within the outer rectangular coordinates from the seal document further includes:
[0019] Based on the layout features of the seal document, target regions are selected to output initial candidate boxes;
[0020] Based on the image within the initial candidate box, extract the pre-feature vector and region validity label;
[0021] The interference mask layer generates the outer rectangle coordinates and quality feature vector based on the initial candidate box, the pre-feature vector, and the region validity label, so as to obtain the image to be identified within the outer rectangle coordinates based on the outer rectangle coordinates and the quality feature vector.
[0022] In one implementation, the interference mask layer generates the outer rectangle coordinates and quality feature vector based on the initial candidate box, the pre-feature vector, and the region validity label, including:
[0023] The interference mask generation subnetwork generates an interference type mask, an interference intensity map, an interference dominant type, and high interference region coordinates based on the initial candidate box, the pre-feature vector, and the region validity label. The interference type mask, the interference intensity map, the interference dominant type, and the high interference region coordinates are then sent to the trimodal feature embedding layer.
[0024] Based on the interference type mask, high interference regions and low interference regions are filtered out, and the confidence level of the high interference regions is reduced while the confidence level of the low interference regions is increased.
[0025] Based on the pre-feature vector, the stamp region and the non-stamp region are filtered out in the low-interference region to obtain the quality feature vectors of the stamp region and the non-stamp region, and the quality feature vectors are sent to the adaptive enhancement sub-network layer.
[0026] In one implementation, a segmentation model is used to segment the target electronic seal image and the background image from the image to be processed, including:
[0027] Based on the coding layer, the image to be processed and the trimodal feature map are fused across scales to generate a trimodal fused feature map. The cross-scale fusion operation includes: superimposing the high-resolution features of the image to be processed with the color features of the RGB mode, the hue features of the HSV mode, and the edge features of the grayscale mode in the trimodal feature map according to weights.
[0028] The three-modal fusion feature map is upsampled and reconstructed based on the decoding layer to generate an initial segmentation mask, wherein the initial segmentation mask includes: pixel-level probability distributions of the stamp candidate region and the background candidate region;
[0029] Based on the initial segmentation mask, region correction is performed to obtain an optimized segmentation mask, and the probability threshold of the optimized segmentation mask is calculated.
[0030] Based on the probability threshold, the target electronic seal image and the background image are segmented from the image to be processed, and a segmentation quality feature vector is generated, wherein the segmentation quality feature vector includes seal edge integrity and background separation.
[0031] The segmentation quality feature vector is sent to the trimodal feature embedding layer and the adaptive enhancement sub-network layer to correct the image to be processed.
[0032] In one implementation, the segmentation quality feature vector is sent to the trimodal feature embedding layer and the adaptive enhancement sub-network layer to correct the image to be processed, including:
[0033] When the integrity of the seal edge is less than or equal to a first preset threshold, the feature weight of the grayscale mode is increased in the three-modal feature embedding layer, and the edge sharpening parameter is increased in the adaptive enhancement sub-network layer.
[0034] When the background separation is less than or equal to the second preset threshold, the saturation channel weight of the HSV mode is increased in the trimodal feature embedding layer, and the color contrast parameter is increased in the adaptive enhancement sub-network layer.
[0035] According to another embodiment of this application, an electronic seal verification system is provided, comprising:
[0036] The recognition model is used to identify the outer rectangular coordinates of the target detection position and the image to be recognized within the outer rectangular coordinates from the seal file; and to perform trimodal image recognition and image enhancement operations on the image to be recognized to obtain the image to be processed within the outer rectangular coordinates.
[0037] A segmentation model is used to segment the target electronic seal image and the background image from the image to be processed;
[0038] A feature comparison model is used to compare the target electronic seal image with a pre-stored seal image to generate a comparison result.
[0039] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0040] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0041] According to yet another embodiment of this application, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the steps in any of the above method embodiments.
[0042] In one embodiment of this application, firstly, the recognition model accurately identifies the coordinates of the outer rectangle of the target detection position and the corresponding image to be recognized from the seal document to avoid positioning errors. Simultaneously, it uses trimodal image recognition to combat inconsistent color depth and background interference. Image enhancement then repairs crease damage and improves image clarity, providing a high-quality image for subsequent processing. Next, the segmentation model takes the image to be processed and segments it into the target electronic seal image and the background image, eliminating background interference to obtain a high-purity seal image, laying the foundation for accurate comparison. Finally, the feature comparison model automatically compares the high-purity target electronic seal image with the pre-stored seal image to generate a result, replacing the manual verification process. These three models are interconnected, with each step providing high-quality input for the next, ultimately solving the problem of low efficiency and accuracy in verification work under complex interference scenarios, and improving the efficiency and accuracy of electronic seal verification in complex scenarios. Attached Figure Description
[0043] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0044] Figure 1 This is a hardware structure block diagram of the electronic seal verification method according to an embodiment of this application;
[0045] Figure 2 This is a flowchart of an electronic seal verification method according to an embodiment of this application;
[0046] Figure 3 This is a flowchart of a method for performing three-modal image recognition and image enhancement operations on an image to be recognized according to an embodiment of this application;
[0047] Figure 4 This is a flowchart of another method for performing trimodal image recognition and image enhancement operations on an image to be recognized according to an embodiment of this application;
[0048] Figure 5 This is a flowchart of a method for generating a pixel-level interference mask map based on an interference mask layer detection and identification of interference factors in a seal file according to an embodiment of this application.
[0049] Figure 6 This is a flowchart of a method for identifying the outer rectangle coordinates of a target detection position and the image to be identified within the outer rectangle coordinates from a seal document using a recognition model, according to an embodiment of this application.
[0050] Figure 7This is a flowchart of a method for generating truncated rectangle coordinates and quality feature vectors based on an initial candidate box, pre-feature vector, and region validity label using an interference mask layer, according to an embodiment of this application.
[0051] Figure 8 This is a flowchart of a method for segmenting a target electronic seal image and a background image from an image to be processed using a segmentation model, according to an embodiment of this application.
[0052] Figure 9 This is a flowchart of a method for sending segmentation quality feature vectors to a three-modal feature embedding layer and an adaptive enhancement sub-network layer, according to an embodiment of this application, to correct the image to be processed;
[0053] Figure 10 This is a structural block diagram of an electronic seal verification system according to an embodiment of this application. Detailed Implementation
[0054] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0056] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0057] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.
[0058] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of the electronic seal verification method according to an embodiment of this application, as shown below. Figure 1 As shown, a hardware board may include one or more ( Figure 1Only one is shown in the diagram. A processor 12 (which may include, but is not limited to, a microprocessor MCU or programmable logic device, etc.) and a memory 14 for storing data are also shown. The computer terminal may further include a transmission device 16 for communication functions and an input / output device 18. 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 computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0059] The memory 14 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the electronic seal verification method in this embodiment. The processor 12 executes various functional applications and implements the above-described methods by running the computer programs stored in the memory 14. The memory 14 may include high-speed random access memory and may also include 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 14 may further include memory remotely located relative to the processor 12, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0060] The transmission device 16 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a telecommunications provider. In one example, the transmission device 16 includes a Network Interface Controller (NIC), which can connect to other network devices via a gateway to communicate with the Internet. In another example, the transmission device 16 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0061] This application provides an electronic seal verification method. Figure 2 This is a flowchart of an electronic seal verification method according to an embodiment of this application, such as... Figure 2 As shown, the process includes:
[0062] Step S201: Use the recognition model to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal file; and perform three-modal image recognition and image enhancement operations on the image to be recognized to obtain the image to be processed within the outer rectangle coordinates.
[0063] In one exemplary implementation, a recognition model is used to process the input seal document. On one hand, the coordinates of the outer truncated rectangle of the target detection position are accurately identified from the seal document, and the image within that coordinate range is extracted and processed as the image to be recognized. On the other hand, a trimodal image recognition operation is performed on the image to be recognized, combined with image enhancement operations, to finally obtain the image within the outer truncated rectangle coordinates that meets the requirements for subsequent processing. Therefore, by using a recognition model to locate the seal target area and perform image preprocessing, the problem of inaccurate seal location in traditional methods is solved, and the quality of the image to be recognized is improved through trimodal recognition and image enhancement, providing a clear and accurate input image for subsequent seal segmentation steps. The seal document can be electronic bills, electronic contracts, or other documents received by the bank.
[0064] Step S202: Use a segmentation model to segment the target electronic seal image and the background image from the image to be processed;
[0065] In one exemplary implementation, the image to be processed obtained in step S201 is input into a segmentation model, which analyzes and processes the image to separate the target electronic seal image from the background image. Therefore, the segmentation model effectively distinguishes the seal from the background, eliminating interference from the background (such as document patterns, irrelevant designs, etc.) in subsequent comparisons, obtaining a clean image of the target electronic seal, thus eliminating irrelevant interference factors in subsequent feature comparison steps and laying the foundation for accurate comparison.
[0066] Step S203: Use a feature comparison model to compare the target electronic seal image with the pre-stored seal image to generate a comparison result.
[0067] In one exemplary implementation, a feature comparison model is invoked to first extract features from the target electronic seal image segmented in step S202. These features are then compared with features from pre-stored standard seal images in the database. Based on the comparison results, clear comparison results such as "consistent" or "inconsistent" are generated. Therefore, the verification of seal authenticity is automated, eliminating the need for manual intervention and significantly reducing manual operation costs and time consumption. Simultaneously, the accurate feature comparison based on the model reduces the misjudgment rate of traditional manual comparison, improving the reliability of the verification results.
[0068] Through steps S201 to S203, firstly, the recognition model accurately identifies the coordinates of the outer rectangle of the target detection position and the corresponding image to be recognized from the seal file to avoid positioning errors. Simultaneously, it uses trimodal image recognition to combat inconsistent color depth and background interference. Image enhancement then repairs crease damage and improves image clarity, providing a high-quality image for subsequent processing. Next, the segmentation model takes the image to be processed and segments it into the target electronic seal image and the background image, eliminating background interference to obtain a high-purity seal image, laying the foundation for accurate comparison. Finally, the feature comparison model automatically compares the high-purity target electronic seal image with the pre-stored seal image to generate a result, replacing the manual verification process. These three models are interconnected, with each step providing high-quality input for the next, ultimately solving the problem of low efficiency and accuracy in verification work under complex interference scenarios, and improving the efficiency and accuracy of electronic seal verification in complex scenarios.
[0069] Figure 3 This is a flowchart illustrating a method for performing trimodal image recognition and image enhancement operations on an image to be recognized according to an embodiment of this application, such as... Figure 3 As shown, in one embodiment, performing trimodal image recognition and image enhancement operations on the image to be recognized includes:
[0070] Step S301: Based on the trimodal feature embedding layer, the image to be identified is converted into a trimodal feature map, wherein the trimodal features include: RGB mode, HSV mode, and grayscale mode;
[0071] In one exemplary implementation, based on a trimodal feature embedding layer, the image to be identified is converted into feature maps corresponding to RGB, HSV, and grayscale modalities, respectively. The RGB modal feature map captures the image's color information, the HSV modal feature map focuses on color attribute details such as hue and saturation, and the grayscale modal feature map extracts structural information such as edges and contours, ultimately forming a trimodal feature map containing multi-dimensional image features. Therefore, by extracting multimodal features, the limitations of a single modality (such as RGB only) in capturing comprehensive image information are overcome. It can retain color-related features to address the problem of inconsistent color depth in stamps, and strengthen edge features through the grayscale modality to resist crease interference, providing a more comprehensive and accurate feature foundation for subsequent image enhancement.
[0072] Step S302: The enhancement parameters are dynamically adjusted based on the image quality of the image to be identified by the adaptive enhancement sub-network layer to obtain the updated enhancement parameters. The three-modal feature map is then enhanced based on the updated enhancement parameters to obtain the image to be processed.
[0073] In one exemplary implementation, an adaptive enhancement sub-network layer first analyzes the image quality of the image to be identified (e.g., sharpness, contrast, noise level, crease range, etc.), and then dynamically adjusts the enhancement parameters (e.g., edge sharpening intensity, contrast gain, color saturation adjustment coefficient, etc.) based on the quality analysis results to obtain updated enhancement parameters adapted to the current image quality. Subsequently, the updated enhancement parameters are used to perform targeted enhancement operations on the three-modal feature map, and finally output the image to be processed with optimized image quality. Therefore, it avoids the problems of "insufficient enhancement of some images (e.g., light-colored stamps are still not clear) and excessive enhancement of some images (e.g., noise amplification)" caused by traditional fixed parameter enhancement, and achieves personalized optimization for images to be identified of different qualities. It effectively repairs crease damage, improves the edge sharpness and color recognition of the stamp, and lays a high-quality image foundation for the subsequent segmentation model to accurately separate the stamp from the background.
[0074] Through steps S301 to S302, a three-modal feature embedding layer comprehensively captures key information such as image color, hue, and edges, solving the problem of missing single-modal information. Furthermore, a dynamic image quality adjustment enhancement strategy addresses the limitations of fixed-parameter enhancement. The combination of these two approaches effectively resists image quality issues in complex interference scenarios (such as uneven seal color, document creases, and background interference), optimizing the image to be identified into a clear and stable image. This provides core support for subsequent segmentation models to accurately segment the target electronic seal and feature comparison models to accurately verify the seal's authenticity, ensuring the accuracy of the entire electronic seal verification process from the image preprocessing stage.
[0075] Figure 4 This is a flowchart of another method for performing trimodal image recognition and image enhancement operations on an image to be recognized according to an embodiment of this application, such as... Figure 4 As shown, in one embodiment, a recognition model is used to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal document, including:
[0076] Step S401: Based on the interference mask layer, detect and identify interference factors in the seal file to generate a pixel-level interference mask image, wherein the interference factors include: fixed interference, random interference, and crease interference.
[0077] In one exemplary implementation, based on the interference mask layer in the recognition model, the seal document is first scanned pixel-level by an interference mask generation sub-network to accurately detect and identify fixed interference (such as fixed background patterns on the document, preset watermarks), random interference (such as local stains, ink smudges), and crease interference (such as lines caused by folding the document). These interference areas are then distinguished from non-interference areas in binary form, generating a pixel-level interference mask image containing "interference areas (marked with a specific value) and non-interference areas (marked with another value)". Therefore, this method overcomes the limitation of traditional methods in accurately identifying multiple types of interference. The pixel-level mask image clearly marks all interference locations and types, laying the foundation for subsequent interference elimination and seal positioning, and preventing interference factors from causing subsequent seal positioning offsets or misjudgments.
[0078] Step S402: Combine the interference mask image to obtain the coordinates of the outer rectangle of the target detection position and the image to be identified within the coordinates of the outer rectangle.
[0079] In one exemplary implementation, the pixel-level interference mask generated in step S401 is fused with the original image of the seal document. The interference area marked in the mask is masked by the interference feature suppression module, focusing on the area in the non-interference region where the seal may exist. Then, combining the layout pattern of the seal document (such as the layout feature that the seal is usually located in a specific area), the coordinates of the outer truncated rectangle of the target detection position are accurately determined within the non-interference region, and the image within this coordinate range that is free of interference (or has low interference) is extracted as the image to be identified. Therefore, the influence of fixed, random, and crease-related interference on seal positioning is effectively eliminated, solving the core problem of seal positioning errors caused by interference in traditional methods. This ensures that the outer truncated rectangle coordinates accurately correspond to the area where the seal is located, while obtaining a less interference-laden, higher-quality image to be identified, providing high-quality input for subsequent three-modal recognition and image enhancement.
[0080] Through steps S401 to S402, pixel-level interference masking is used to comprehensively identify and label various types of interference, thus combining different interference factors. Furthermore, interference is eliminated and the seal is accurately located based on the masking image, resolving the problem of positioning errors caused by interference. The combination of these two methods eliminates the impact of complex interference on seal positioning at its source, significantly improving the accuracy of the outer rectangle coordinates of the target detection position and the purity of the image to be identified. This provides a reliable foundation for subsequent three-modal image recognition, image enhancement, and final seal segmentation and comparison.
[0081] Figure 5 This is a flowchart of a method for generating a pixel-level interference mask map based on an interference mask layer detection and identification of interference factors in a seal file, according to an embodiment of this application. Figure 5As shown, in one embodiment, interference factors in the seal file are detected and identified based on the interference mask layer to generate a pixel-level interference mask image. The interference factors include: fixed interference, random interference, and crease interference.
[0082] Step S501: Generate a binary mask image based on the interference mask generation sub-network, wherein the binary mask image includes: interference region and non-interference region;
[0083] In one exemplary implementation, a pixel-level scan and analysis of the seal document is performed based on an interference mask generation sub-network (which can be pre-trained with seal samples containing fixed interference, random interference, and crease interference, and has the ability to identify the three types of interference). The identified areas of fixed interference (such as standard background patterns on invoices), random interference (such as localized stains), and crease interference (such as fold lines) are marked with specific values (e.g., marked as "1"), while normal areas without interference are marked with another value (e.g., marked as "0"). Finally, a binary mask map containing only the interference and non-interference areas is generated. Therefore, by using binary processing, complex multi-type interference is transformed into clearly distinguishable pixel-level markers, avoiding confusion between different interference types, accurately locating the spatial position of all interference, and providing an intuitive and clear interference map for subsequent targeted interference removal, thus solving the problem of traditional methods' difficulty in accurately marking multiple types of interference.
[0084] Step S502: Based on the interference feature suppression module, the binary mask image is fused with the image within the coordinates of the outer truncated rectangle to obtain the image to be identified.
[0085] In one exemplary implementation, based on the interference feature suppression module, the binary mask image generated in step S501 is fused with the original image within the previously acquired outer rectangular coordinates. The interference feature suppression module suppresses pixel information in interference regions (e.g., regions marked "1") according to the markings in the binary mask image (e.g., reducing pixel weight or masking invalid information), retaining only valid image information in non-interference regions (e.g., regions marked "0"), and finally outputs the image to be recognized within the outer rectangular coordinates after interference removal. Therefore, it accurately filters fixed, random, and crease-related interference within the outer rectangular coordinates, preventing interference information from being mixed into the image to be recognized, ensuring that the image retains only valid content related to the seal, significantly improving the purity of the image to be recognized, providing interference-free, high-quality image input for the subsequent three-modal image recognition in step S301, and reducing the impact of interference on subsequent feature extraction.
[0086] Through steps S501 to S502, the problem of identifying and locating interference is solved using a binary mask image, and the problem of eliminating interference is solved using feature suppression. The combined effect of these two methods can completely remove the three types of core interference within the rectangular area outside the seal document. This process overcomes the limitations of traditional methods, such as vague interference identification and incomplete interference elimination, ensuring that the image to be identified is free of interference contamination. This lays a high-quality image foundation for subsequent steps such as three-modal feature extraction and adaptive image enhancement, directly improving the accuracy of subsequent seal segmentation and feature comparison.
[0087] Figure 6 This is a flowchart illustrating a method for identifying the outer rectangle coordinates of a target detection position and the image to be identified within those outer rectangle coordinates from a seal document using a recognition model, according to an embodiment of this application. Figure 6 As shown, in one embodiment, the method of using a recognition model to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal document further includes:
[0088] Step S601: Based on the format features of the seal document, filter out the target region to output the initial candidate box;
[0089] In one exemplary implementation, the model first learns the layout patterns of seal documents (such as bills, contracts, etc.) (e.g., the standard positions of seals in different types of seal documents, such as the lower right corner of a check, next to a specific column on a business document, etc.). Then, the input seal document is analyzed for layout to identify areas that meet the layout characteristics of "high probability of containing a seal" (e.g., excluding plain text columns, blank columns, etc., which obviously do not contain seals). These areas are designated as target areas, and initial candidate boxes (rectangles) surrounding these areas are generated. Therefore, there is no need to perform an indiscriminate search of the entire seal document. The layout features quickly narrow down the seal location range, significantly reducing the amount of redundant data in subsequent processing and reducing the interference of irrelevant areas on the location, laying the foundation for "range filtering" for accurate seal location.
[0090] Step S602: Extract pre-feature vectors and region validity labels based on the images within the initial candidate boxes;
[0091] In one exemplary implementation, the image within the initial candidate box output in step S601 is processed by modules such as a convolutional neural network to extract basic features (such as color distribution features, edge density features, and texture features) to form a pre-feature vector for subsequent analysis. Simultaneously, a preset classifier (trained based on historical seal samples) is used to determine the "probability of containing a seal" within the candidate box based on the pre-feature vector, generating a region validity label (e.g., "valid" indicates a high probability of containing a seal, "invalid" indicates a high probability of not containing a seal). Therefore, initial candidate boxes that clearly do not contain seals (e.g., regions labeled "invalid") are further filtered out, reducing the amount of unnecessary work in subsequent interference processing. At the same time, the extracted pre-feature vector provides key feature support for subsequent interference identification and coordinate optimization, improving the processing accuracy of subsequent steps.
[0092] Step S603: The interference mask layer generates the outer rectangle coordinates and quality feature vector based on the initial candidate box, pre-feature vector, and region validity label, so as to obtain the image to be identified within the outer rectangle coordinates based on the outer rectangle coordinates and quality feature vector.
[0093] In one exemplary implementation, the interference mask layer first combines the position information of the initial candidate box, the pre-feature vector from step S602 (used to identify interference factors within the candidate box, such as creases and background textures), and the region validity label (focusing on optimizing the "valid" label region), and corrects the coordinates of the initial candidate box through pixel-level interference detection. Interference regions within the candidate box are eliminated, and the selection range is adjusted to cover only areas with a "high probability of containing a stamp and low interference," generating accurate outer rectangle coordinates. Simultaneously, quality feature vectors (e.g., high-quality vectors corresponding to "low interference, high clarity") are generated based on information such as the degree of interference and image clarity within the candidate box. Finally, the image within this range is extracted based on the outer rectangle coordinates, and the quality feature vectors are combined to ensure the image is free of significant interference, resulting in the image to be recognized. Therefore, this solves the problem of "inaccurate selection range and interference regions" that may exist in the initial candidate box, generating accurate outer rectangle coordinates and a high-quality image to be recognized, providing high-quality input with "accurate positioning and low interference" for subsequent three-modal image recognition and image enhancement operations, directly reducing the sources of error in subsequent steps.
[0094] Through steps S601 to S603, the positioning range is narrowed by using layout features to solve the problem of "low efficiency in full-image search"; the effective area is selected by feature extraction and label judgment to solve the problem of "redundant processing of invalid areas"; and the coordinates and image quality are optimized by using an interference mask layer to solve the problems of "inaccurate positioning and interference". These three aspects work synergistically to completely overcome the pain points of "wide range, many interferences, and low accuracy" in traditional seal positioning, achieving efficient and accurate positioning of the seal's targeted detection position in the seal document. Simultaneously, it outputs a high-quality image to be recognized, providing crucial pre-processing support for subsequent three-modal recognition, image enhancement, and final seal segmentation and comparison. This supports the improvement of the efficiency and accuracy of the entire electronic seal verification solution in complex interference scenarios.
[0095] Figure 7 This is a flowchart illustrating a method for generating truncated rectangle coordinates and quality feature vectors based on an initial candidate box, pre-feature vector, and region validity labels using an interference mask layer, according to an embodiment of this application. Figure 7 As shown, in one implementation, the interference mask layer generates the circumscribed rectangle coordinates and quality feature vector based on the initial candidate box, pre-feature vector, and region validity labels, including:
[0096] Step S701: The interference mask generation subnetwork generates an interference type mask, interference intensity map, interference dominant type, and high interference region coordinates based on the initial candidate box, pre-feature vector, and region validity label, and sends the interference type mask, interference intensity map, interference dominant type, and high interference region coordinates to the three-modal feature embedding layer.
[0097] In one exemplary implementation, the interference mask generation subnetwork in the interference mask layer takes as input an initial candidate bounding box (limiting the processing range), a pre-feature vector (providing basic image features such as color and edge information), and region validity labels (prioritizing "valid" labeled regions). It then uses a preset algorithm (based on a model trained with interference samples) to identify interference details within the initial candidate bounding box. This generates interference type masks labeled with fixed interference types, random interference types, and crease interference types; interference intensity maps quantifying interference severity; interference dominant types indicating the main interference categories within the region; and coordinates of high-interference regions locating the most severely affected areas. This interference-related data is simultaneously sent to the trimodal feature embedding layer, providing interference reference for subsequent multimodal recognition. Therefore, it overcomes the limitations of traditional interference recognition that "only marks presence or absence without distinguishing details," accurately outputting key information such as the type, intensity, and location of interference. This provides a basis for subsequent region selection and pre-transmits interference information to the trimodal feature embedding layer, helping to avoid interference effects during subsequent multimodal feature extraction.
[0098] Step S702: Based on the interference type mask, high interference regions and low interference regions are filtered out, and the confidence of high interference regions is reduced and the confidence of low interference regions is increased.
[0099] In one exemplary implementation, based on the interference type mask generated in step S701, high-interference regions with high interference intensity and complex types (such as regions marked as "strong creases, background patterns" in the mask) and low-interference regions with less interference and clear features (such as regions marked as "no interference" or "weak random interference" in the mask) are selected. Subsequently, through the confidence adjustment mechanism within the model, the confidence of high-interference regions in subsequent seal recognition is reduced (reducing their misleading influence on seal location), while the confidence of low-interference regions is increased (strengthening their priority as potential seal regions). Therefore, through differential confidence adjustment, the interference of high-interference regions is actively shielded, focusing on effective low-interference regions, avoiding the impact of invalid features of high-interference regions on seal location accuracy, and significantly improving the accuracy of subsequent seal region selection.
[0100] Step S703: Based on the pre-feature vector, the stamp region and non-stamp region are selected in the low-interference region to obtain the quality feature vectors of the stamp region and non-stamp region, so as to send the quality feature vectors to the adaptive enhancement sub-network layer.
[0101] In one exemplary implementation, using the low-interference region determined in step S702 as the scope, the pre-feature vector extracted in step S602 (containing seal-related features such as color distribution and edge density) is used to filter out seal regions that meet the seal features and non-seal regions that do not, through a feature matching algorithm (comparing the similarity between the pre-feature vector and standard seal features). Simultaneously, based on indicators such as interference residue, image sharpness, and edge integrity of the seal region, a quantified quality feature vector (e.g., "interference residue 0.1, sharpness 0.9, edge integrity 0.85") is generated and sent to the adaptive enhancement sub-network layer, providing a basis for parameter adjustment in subsequent image enhancement. Therefore, the seal region within the low-interference region is accurately located, and redundant information from non-seal regions is eliminated. The generated quality feature vector allows the adaptive enhancement sub-network layer to "enhance as needed" (e.g., strengthening edge sharpening for insufficient edge integrity), ensuring that subsequent enhancement operations are more targeted and further improving the quality of the image to be processed.
[0102] Through the above steps S701 to S703, not only is the negative impact of high interference areas completely eliminated, but the seal area can also be accurately located and the image quality quantified. This provides interference reference for the trimodal feature embedding layer and enhancement basis for the adaptive enhancement sub-network layer, forming a closed loop of "interference processing, seal localization, and quality feedback". This provides the core input of "accurate localization and high quality" for subsequent image enhancement, seal segmentation, and feature comparison, directly supporting the high accuracy and high efficiency of the entire electronic seal verification scheme based on the combination of recognition model, segmentation model, and feature comparison model in complex interference scenarios.
[0103] Figure 8 This is a flowchart illustrating a method for segmenting a target electronic seal image and a background image from an image to be processed using a segmentation model, according to an embodiment of this application. Figure 8 As shown, in one embodiment, a segmentation model is used to segment the target electronic seal image and the background image from the image to be processed, including:
[0104] Step S801: Based on the coding layer, perform a cross-scale fusion operation on the image to be processed and the three-modal feature map to generate a three-modal fused feature map. The cross-scale fusion operation includes: superimposing the high-resolution features of the image to be processed with the color features of the RGB mode, the hue features of the HSV mode, and the edge features of the grayscale mode in the three-modal feature map according to weights.
[0105] In one exemplary implementation, based on a segmentation model (e.g., the encoding layer of Unet-ResNet), the pre-processed image to be processed (containing high-resolution detail information) is fused across scales with a trimodal feature map (RGB modal color features, HSV modal tone features, and grayscale modal edge features). First, high-resolution spatial features of the image to be processed are extracted through the encoding layer. Then, these features are superimposed on the features of each dimension of the trimodal feature map according to preset weights (e.g., dynamically allocated based on image quality, increasing the grayscale modal weight when edges are blurred). This ultimately generates a trimodal fusion feature map that integrates multi-scale and multimodal information. Therefore, it overcomes the limitations of single-feature or single-scale features, preserving the detailed information of the image to be processed (e.g., the subtle textures of a seal) while integrating trimodal features to address different interferences (e.g., RGB color distinguishes the seal from the background, and grayscale edges enhance the seal outline), providing comprehensive feature support for subsequent accurate segmentation.
[0106] Step S802: Based on the decoding layer, the three-modal fusion feature map is upsampled and reconstructed to generate an initial segmentation mask, wherein the initial segmentation mask includes: pixel-level probability distribution of the stamp candidate region and the background candidate region;
[0107] In one exemplary implementation, the decoding layer based on the segmentation model performs upsampling operations (such as bilinear interpolation) on the trimodal fused feature map, gradually restoring the feature map resolution to match the image to be processed. Simultaneously, a feature reconstruction module (such as convolution and normalization operations) transforms the fused features into pixel-level probability distributions. Each pixel in the image is assigned a probability of "belonging to a stamp candidate region" or "belonging to a background candidate region," ultimately generating an initial segmentation mask containing probability distributions for both types of regions. Therefore, by transforming abstract fused features into an intuitive region probability mask, the candidate ranges for stamps and backgrounds are clearly distinguished, providing a "probabilistic basis" for subsequent accurate segmentation and avoiding the "black-and-white" hard segmentation error of traditional segmentation.
[0108] Step S803: Perform region correction based on the initial segmentation mask to obtain an optimized segmentation mask, and calculate the probability threshold of the optimized segmentation mask;
[0109] In one exemplary implementation, the initial segmentation mask undergoes region correction. Morphological operations (such as dilation and erosion) are used to fill in tiny holes within the stamp candidate region, smooth edge burrs in the background candidate region, and remove excessively small "pseudo-stamp regions" (such as isolated noise points), resulting in an optimized segmentation mask with more complete edges and more regular regions. Then, based on the probability distribution of stamp and background pixels in the optimized mask, a probability threshold is calculated (e.g., the median of the probabilities of the two types of pixels or a critical value determined through cross-validation), which serves as the criterion for subsequent segmentation. Therefore, local errors in the initial mask are corrected, improving the accuracy and regularity of the mask, while a scientifically determined probability threshold avoids problems such as "missed stamp segmentation" or "mis-segmentation of the background" caused by inappropriate thresholds.
[0110] Step S804: Based on a probability threshold, segment the target electronic seal image and the background image from the image to be processed, and generate a segmentation quality feature vector, wherein the segmentation quality feature vector includes seal edge integrity and background separation degree.
[0111] In one exemplary implementation, the probability value of each pixel in the image to be processed is compared with the probability threshold calculated in step S803. Pixels with probability values higher than the probability threshold are classified as the stamp region, and those lower than the probability threshold are classified as the background region, thereby segmenting the target electronic stamp image and the background image from the image to be processed. Simultaneously, the segmentation is quantified by an algorithm; therefore, the overlap between the stamp edge and the standard stamp edge (i.e., stamp edge integrity) and the proportion of background pixels mixed in the stamp region (i.e., background separation degree) are calculated, and these two indicators are integrated into a segmentation quality feature vector. Thus, accurate separation of the stamp and background is achieved, resulting in a clean target electronic stamp image, eliminating background interference for subsequent feature comparison; the segmentation quality feature vector quantifies the segmentation effect, providing data support for subsequent optimization.
[0112] Step S805: The segmentation quality feature vector is sent to the trimodal feature embedding layer and the adaptive enhancement sub-network layer to correct the image to be processed.
[0113] In one exemplary implementation, the segmentation quality feature vector is simultaneously sent to the trimodal feature embedding layer and the adaptive enhancement sub-network layer. This feedback mechanism corrects the generation process of subsequent images to be processed. Therefore, a closed loop of "segmentation effect feedback and pre-processing optimization" is constructed, dynamically adjusting the pre-processing feature extraction and image enhancement strategies to address current segmentation deficiencies (such as incomplete edges and poor background separation), continuously improving the quality and segmentation accuracy of subsequent images to be processed.
[0114] Through steps S801 to S805, steps S801 to S802 address the issues of "incomplete features and low resolution," step S803 addresses the "mask error" problem, step S804 addresses the "segmentation execution and effect quantification" problem, and step S805 addresses the "continuous optimization" problem. The overall process effectively resists complex interference (such as background patterns, light-colored seals, and blurred edges), achieving high-precision separation of the seal from the background and outputting a clean, edge-complete target electronic seal image. Simultaneously, closed-loop feedback continuously improves segmentation stability, providing core input for subsequent feature comparison models to accurately verify the authenticity of the seal.
[0115] Figure 9 This is a flowchart illustrating a method for correcting an image by sending a segmentation quality feature vector to a three-modal feature embedding layer and an adaptive enhancement sub-network layer, according to an embodiment of this application. Figure 9 As shown, in one embodiment, the segmentation quality feature vector is sent to a three-modal feature embedding layer and an adaptive enhancement sub-network layer to correct the image to be processed, including:
[0116] Step S901: When the integrity of the stamp edge is less than or equal to the first preset threshold, increase the feature weight of the grayscale mode in the three-modal feature embedding layer and increase the edge sharpening parameter in the adaptive enhancement sub-network layer.
[0117] In one exemplary implementation, for example, a first preset threshold for the integrity of the stamp edge is set (e.g., an edge overlap threshold set based on historical high-quality segmentation samples, assumed to be 85%). When the integrity of the stamp edge in the segmentation quality feature vector is less than or equal to this first preset threshold (indicating that the stamp edge in the current image to be processed is blurry or incomplete), the system automatically increases the feature weight of the grayscale mode in the trimodal feature embedding layer (because the grayscale mode is more sensitive to capturing image edge and contour information, increasing the weight can strengthen edge feature extraction). At the same time, the edge sharpening parameter is increased in the adaptive enhancement sub-network layer (e.g., increasing the response intensity of the edge detection algorithm and enhancing the pixel difference between the stamp edge and the surrounding area). Therefore, the problem of incomplete and blurry stamp edges is specifically addressed by strengthening grayscale mode edge feature extraction and enhancing edge sharpening, making the stamp edge in the subsequently generated image to be processed clearer and more complete, providing a high-quality feature foundation for the segmentation model to accurately segment the stamp edge, and reducing segmentation errors caused by edge blurring.
[0118] In step S902, if the background separation is less than or equal to the second preset threshold, increase the saturation channel weight of the HSV mode in the trimodal feature embedding layer and increase the color contrast parameter in the adaptive enhancement sub-network layer.
[0119] In one exemplary implementation, for example, a second preset threshold for background separation is set (e.g., a background pixel infiltration rate threshold set based on historical high-quality segmentation samples, assumed to be 5%). When the background separation in the segmentation quality feature vector is less than or equal to this second preset threshold (indicating that the boundary between the seal and the background in the current image to be processed is blurred, and there are background pixels mixed into the seal area), the system automatically increases the weight of the saturation channel of the HSV modality in the trimodal feature embedding layer (the HSV saturation channel can highlight the difference in the vividness of colors in the image; increasing the weight can enhance the color distinction between the seal and the background, such as the difference between the red of the seal and the light-colored background texture). At the same time, the color contrast parameter is increased in the adaptive enhancement sub-network layer (further widening the color brightness difference between the seal and the background, making the boundary between them more obvious). Therefore, the problem of poor background separation effect is accurately improved by strengthening the HSV saturation feature and increasing the color contrast, making the color difference between the seal and the background in the subsequently generated image to be processed more significant, reducing the impact of background interference on segmentation, and ensuring that the segmented target electronic seal image is purer.
[0120] Through steps S901 and S902, the two core problems of "incomplete stamp edges" and "poor background separation" during segmentation are addressed respectively. By dynamically adjusting the modal weights of the trimodal feature embedding layer and the enhancement parameters of the adaptive enhancement sub-network layer, targeted optimization of the image generation process is achieved. This mechanism avoids the limitations of traditional fixed-parameter processing, which adopts a "one-size-fits-all" approach. It continuously iterates and optimizes the quality of the image to be processed based on the actual segmentation results, providing stable support for the efficient and accurate segmentation of subsequent segmentation models, thereby ensuring the accuracy of the final feature comparison model.
[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by adding necessary general-purpose hardware platforms with the aid of software. Of course, they can also be implemented using hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0122] This application also provides an electronic seal verification system for implementing the above embodiments and preferred embodiments; details already described will not be repeated. The term "module" as used below refers to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0123] Figure 10 This is a structural block diagram of an electronic seal verification system according to an embodiment of this application, such as... Figure 10 As shown, the system includes:
[0124] The recognition model 101 is used to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal document; and to perform three-modal image recognition and image enhancement operations on the image to be recognized to obtain the image to be processed within the outer rectangle coordinates.
[0125] Segmentation model 102 is used to segment the target electronic seal image and the background image from the image to be processed;
[0126] Feature comparison model 103 is used to compare the target electronic seal image with the pre-stored seal image to generate comparison results.
[0127] By employing the above technical solutions, the recognition model 101 accurately identifies the coordinates of the outer rectangle of the target detection position and the corresponding image to be recognized from the seal document, thus avoiding positioning errors. Simultaneously, it uses trimodal image recognition to combat inconsistent color depth and background interference. Image enhancement then repairs crease damage and improves image clarity, providing a high-quality image for subsequent processing. The segmentation model 102 takes the image to be processed, segmenting the target electronic seal image and the background image, eliminating background interference to obtain a high-purity seal image, laying the foundation for accurate comparison. The feature comparison model 103 automatically compares the high-purity target electronic seal image with the pre-stored seal image to generate results, replacing the manual verification process. These three models are interconnected, with each step providing high-quality input for the next, ultimately solving the problem of low efficiency and accuracy in verification work under complex interference scenarios, and improving the efficiency and accuracy of electronic seal verification in complex scenarios.
[0128] In one implementation, the identification model 101 includes:
[0129] The trimodal feature embedding layer is used to convert the image to be recognized into a trimodal feature map, wherein the trimodal features include: RGB mode, HSV mode, and grayscale mode.
[0130] An adaptive enhancement sub-network layer is used to dynamically adjust the enhancement parameters based on the image quality of the image to be identified, so as to obtain updated enhancement parameters. Based on the updated enhancement parameters, image enhancement operations are performed on the three-modal feature map to obtain the image to be processed.
[0131] In one embodiment, the recognition model 101 further includes:
[0132] An interference mask layer is used to detect and identify interference factors in the seal document to generate a pixel-level interference mask image. The interference factors include: fixed interference, random interference, and crease interference. The layer also includes a layer for combining the interference mask image to obtain the outer rectangle coordinates of the target detection position and the image to be identified within the outer rectangle coordinates.
[0133] In one implementation, the interference masking layer includes:
[0134] An interference mask generation sub-network is used to generate a binary mask image, which includes: interference regions and non-interference regions.
[0135] The interference feature suppression module is used to fuse the binary mask image with the image within the coordinates of the outer rectangle to obtain the image to be identified.
[0136] In one embodiment, the recognition model 101 further includes:
[0137] The filtering module is used to filter out target regions based on the layout features of the seal document in order to output initial candidate boxes;
[0138] The extraction module is used to extract pre-feature vectors and region validity labels based on the image within the initial candidate bounding box;
[0139] The interference mask layer is also used to generate truncated rectangle coordinates and quality feature vectors based on the initial candidate box, pre-feature vector, and region validity label, so as to obtain the image to be identified within the truncated rectangle coordinates based on the truncated rectangle coordinates and quality feature vectors.
[0140] In one implementation, the interference mask generation subnetwork is further configured to: generate an interference type mask, an interference intensity map, an interference dominant type, and high interference region coordinates based on the initial candidate box, pre-feature vector, and region validity labels; and send the interference type mask, interference intensity map, interference dominant type, and high interference region coordinates to the trimodal feature embedding layer; and filter out high interference regions and low interference regions based on the interference type mask, and reduce the confidence of high interference regions and increase the confidence of low interference regions; and filter out stamped regions and non-stamped regions within the low interference regions based on the pre-feature vector to obtain the quality feature vectors of the stamped regions and non-stamped regions, and send the quality feature vectors to the adaptive enhancement subnetwork layer.
[0141] In one implementation, segmentation model 102 includes:
[0142] The encoding layer is used to perform a cross-scale fusion operation between the image to be processed and the trimodal feature map to generate a trimodal fused feature map. The cross-scale fusion operation includes: superimposing the high-resolution features of the image to be processed with the color features of the RGB mode, the hue features of the HSV mode, and the edge features of the grayscale mode in the trimodal feature map according to weights.
[0143] The decoding layer is used to perform upsampling and feature reconstruction operations on the trimodal fusion feature map to generate an initial segmentation mask, which includes the pixel-level probability distribution of the stamp candidate region and the background candidate region.
[0144] The correction layer is used to perform region correction based on the initial segmentation mask to obtain an optimized segmentation mask, and to calculate the probability threshold of the optimized segmentation mask;
[0145] The segmentation layer is used to segment the target electronic seal image and the background image from the image to be processed based on a probability threshold, and to generate a segmentation quality feature vector, wherein the segmentation quality feature vector includes seal edge integrity and background separation.
[0146] The execution layer is used to send the segmentation quality feature vector to the trimodal feature embedding layer and the adaptive enhancement sub-network layer to correct the image to be processed.
[0147] In one implementation, the execution layer is further configured to: increase the feature weight of the grayscale mode in the trimodal feature embedding layer and increase the edge sharpening parameter in the adaptive enhancement sub-network layer when the seal edge integrity is less than or equal to a first preset threshold; or, increase the saturation channel weight of the HSV mode in the trimodal feature embedding layer and increase the color contrast parameter in the adaptive enhancement sub-network layer when the background separation is less than or equal to a second preset threshold.
[0148] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0149] This application also provides a computer-readable storage medium storing a computer program configured to execute the steps in any of the above method embodiments when running.
[0150] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0151] This application also provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0152] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0153] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0154] Specific examples in the embodiments of this application can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0155] Obviously, those skilled in the art should understand that the modules or steps of this application 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 presented here, 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, this application is not limited to any particular combination of hardware and software.
[0156] 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 principles of this application should be included within the protection scope of this application.
Claims
1. An electronic seal verification method, characterized in that, include: The recognition model is used to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal file; and the three-modal image recognition and image enhancement operations are performed on the image to be recognized to obtain the image to be processed within the outer rectangle coordinates. The target electronic seal image and the background image are segmented from the image to be processed using a segmentation model; The target electronic seal image is compared with a pre-stored seal image using a feature comparison model to generate a comparison result.
2. The method according to claim 1, characterized in that, Performing trimodal image recognition and image enhancement operations on the image to be recognized includes: The image to be identified is converted into a trimodal feature map based on a trimodal feature embedding layer, wherein the trimodal features include: RGB mode, HSV mode, and grayscale mode; An adaptive enhancement sub-network layer dynamically adjusts the enhancement parameters based on the image quality of the image to be identified to obtain updated enhancement parameters. Based on the updated enhancement parameters, an image enhancement operation is performed on the trimodal feature map to obtain the image to be processed.
3. The method according to claim 2, characterized in that, The recognition model is used to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal file, including: Interference factors in the seal file are detected and identified based on the interference mask layer to generate a pixel-level interference mask image, wherein the interference factors include: fixed interference, random interference, and crease interference. The coordinates of the outer rectangle of the target detection position and the image to be identified within the coordinates of the outer rectangle are obtained by combining the interference mask image.
4. The method according to claim 3, characterized in that, Interference factors in the seal file are detected and identified based on the interference mask layer to generate a pixel-level interference mask image. The interference factors include: fixed interference, random interference, and crease interference. A binary mask image is generated based on an interference mask generation subnetwork, wherein the binary mask image includes: interference region and non-interference region; The interference feature suppression module fuses the binary mask image with the image within the coordinates of the outer truncated rectangle to obtain the image to be identified.
5. The method according to claim 4, characterized in that, The method of using a recognition model to identify the outer rectangle coordinates of the target detection position and the image to be recognized within the outer rectangle coordinates from the seal file also includes: Based on the layout features of the seal document, target regions are selected to output initial candidate boxes; Based on the image within the initial candidate box, extract the pre-feature vector and region validity label; The interference mask layer generates the outer rectangle coordinates and quality feature vector based on the initial candidate box, the pre-feature vector, and the region validity label, so as to obtain the image to be identified within the outer rectangle coordinates based on the outer rectangle coordinates and the quality feature vector.
6. The method according to claim 5, characterized in that, The interference mask layer generates the outer rectangle coordinates and quality feature vector based on the initial candidate box, the pre-feature vector, and the region validity label, including: The interference mask generation subnetwork generates an interference type mask, an interference intensity map, an interference dominant type, and high interference region coordinates based on the initial candidate box, the pre-feature vector, and the region validity label. The interference type mask, the interference intensity map, the interference dominant type, and the high interference region coordinates are then sent to the trimodal feature embedding layer. Based on the interference type mask, high interference regions and low interference regions are filtered out, and the confidence level of the high interference regions is reduced while the confidence level of the low interference regions is increased. Based on the pre-feature vector, the stamp region and the non-stamp region are filtered out in the low-interference region to obtain the quality feature vectors of the stamp region and the non-stamp region, and the quality feature vectors are sent to the adaptive enhancement sub-network layer.
7. The method according to claim 2, characterized in that, The target electronic seal image and the background image are segmented from the image to be processed using a segmentation model, including: Based on the coding layer, the image to be processed and the trimodal feature map are fused across scales to generate a trimodal fused feature map. The cross-scale fusion operation includes: superimposing the high-resolution features of the image to be processed with the color features of the RGB mode, the hue features of the HSV mode, and the edge features of the grayscale mode in the trimodal feature map according to weights. The three-modal fusion feature map is upsampled and reconstructed based on the decoding layer to generate an initial segmentation mask, wherein the initial segmentation mask includes: pixel-level probability distributions of the stamp candidate region and the background candidate region; Based on the initial segmentation mask, region correction is performed to obtain an optimized segmentation mask, and the probability threshold of the optimized segmentation mask is calculated. Based on the probability threshold, the target electronic seal image and the background image are segmented from the image to be processed, and a segmentation quality feature vector is generated, wherein the segmentation quality feature vector includes seal edge integrity and background separation. The segmentation quality feature vector is sent to the trimodal feature embedding layer and the adaptive enhancement sub-network layer to correct the image to be processed.
8. The method according to claim 7, characterized in that, Sending the segmentation quality feature vector to the trimodal feature embedding layer and the adaptive enhancement sub-network layer to correct the image to be processed includes: When the integrity of the seal edge is less than or equal to a first preset threshold, the feature weight of the grayscale mode is increased in the three-modal feature embedding layer, and the edge sharpening parameter is increased in the adaptive enhancement sub-network layer. When the background separation is less than or equal to the second preset threshold, the saturation channel weight of the HSV mode is increased in the trimodal feature embedding layer, and the color contrast parameter is increased in the adaptive enhancement sub-network layer.
9. An electronic seal verification system, characterized in that, include: The recognition model is used to identify the outer rectangular coordinates of the target detection position and the image to be recognized within the outer rectangular coordinates from the seal file; and to perform trimodal image recognition and image enhancement operations on the image to be recognized to obtain the image to be processed within the outer rectangular coordinates. A segmentation model is used to segment the target electronic seal image and the background image from the image to be processed; A feature comparison model is used to compare the target electronic seal image with a pre-stored seal image to generate a comparison result.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is executed by a processor to perform the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method of any one of claims 1 to 8.
12. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method of any one of claims 1 to 8.