Manufacturing method of electronic seal
By generating a basic seal image and combining it with a multi-scale neural style transfer model and a conditional generative network to embed a digital watermark, the security and uniqueness issues of the electronic seal are solved, and high-reliability electronic seal image generation and verification are achieved.
Patent Information
- Application Number
- CN202510672467.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing electronic seals have deficiencies in security, uniqueness and verifiability, and lack the distributed evidence storage mechanism of blockchain technology, making it difficult to meet the needs of high-trust scenarios such as government affairs, notarization and finance.
By receiving the seal customization parameters and identity information input by the user, the basic seal image is generated, and the multi-scale neural style transfer model and conditional generation network are used to construct an anti-counterfeiting style image, embed a digital watermark, and combine the timestamp and identity information to generate an electronic seal with strong anti-counterfeiting ability, high image uniqueness and verifiability.
It realizes the personalized image generation of electronic seals, improves the uniqueness and traceability of images, enhances anti-counterfeiting capabilities and credibility, supports image authenticity verification and traceability, and is suitable for high-credibility electronic signature scenarios.
Smart Images

Figure CN120634826A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic seal anti-counterfeiting, and in particular to a method for producing an electronic seal. Background Art
[0002] In today's evolving digital office and paperless business environment, electronic seals, as an extension of traditional physical seals in electronic document environments, have been widely adopted in various scenarios, including government, business, and finance. Existing methods for generating and using electronic seals primarily rely on template design and image overlay technology. This involves combining user-provided seal text, font, border style, and other information using a preset stamp graphic template to generate an image file for signing or marking electronic documents. This approach is simple to operate and deploy, but it has certain limitations in terms of security, uniqueness, and verifiability.
[0003] From the perspective of existing technologies, most electronic seal images are static layer composite structures, usually composed of background, border, text and logo layers. Their anti-counterfeiting capabilities mainly rely on image resolution, watermark logos or format restrictions. Some solutions have introduced digital watermark or QR code technology for information embedding and logo verification, but the embedded data is fixed, lacks image-level style change control, and is easily damaged by compression, resampling or cropping, making it difficult to effectively verify the authenticity and integrity of the image in actual scenarios. In addition, traditional stamp systems are rarely bound to user identity information and generation time, making it difficult to trace the source of the seal image and posing a certain risk of forgery and abuse.
[0004] Furthermore, existing electronic seal systems generally lack a distributed evidence storage mechanism based on blockchain technology. This means they fail to establish a trusted timestamp and ensure data immutability throughout the entire process of seal image generation, use, and verification. Since electronic seal images are typically stored locally or on a single system, if an image is illegally copied or tampered with, even if a watermark or identity data is embedded, there is no cross-platform verification mechanism, making it impossible to effectively trace the seal image's origin and audit its use.
[0005] Blockchain technology, with its characteristics of immutable data, network-wide consensus, and timestamp-based authentication, has been gradually applied in recent years to fields such as electronic contracts, anti-counterfeiting and traceability, and digital copyright. However, existing electronic seal production and verification technologies still lack a complete solution that integrates image-level anti-counterfeiting structures with on-chain registration mechanisms. This leads to loopholes in seal authenticity verification and makes it difficult to meet the needs of high-trust scenarios such as government affairs, notarization, and finance.
[0006] Therefore, how to provide a method for making an electronic seal is an urgent problem that those skilled in the art need to solve. Summary of the Invention
[0007] One purpose of the present invention is to propose a method for making an electronic seal. The present invention fully integrates user identity information, anti-counterfeiting attack samples, conditional generative networks and multi-scale neural style transfer structures, and describes in detail the complete process of constructing a seal base image, generating an anti-counterfeiting style image, fusing and generating a target seal image and embedding a verifiable digital watermark. The method has the advantages of strong anti-counterfeiting ability, high image uniqueness and strong verifiability.
[0008] A method for making an electronic seal according to an embodiment of the present invention includes the following steps:
[0009] S1, receiving seal customization parameters and identity information data input by the user, and generating a seal basic image based on the seal customization parameters;
[0010] S2. Input the identity information data and historical anti-counterfeiting attack samples into the style image generation sub-model to control the output of the anti-counterfeiting style image;
[0011] S3, using the seal base image as the content image and the anti-counterfeiting style image as the style image, inputting them into a neural style transfer model, performing a style transfer operation, and outputting a style fusion image, wherein the neural style transfer model includes an encoder module, an adaptive normalization module, a multi-scale fusion module, and a decoder module, wherein the multi-scale fusion module includes a parallel shallow style injection path and a deep style injection path;
[0012] S4. Based on the style fusion image, extract the style perturbation feature vector as style signature data, and combine the style signature data with the identity information data, the current timestamp, and the hash value of the style fusion image to generate a watermark vector;
[0013] S5, embedding the watermark vector into the style fusion image to generate a target seal image embedded with the watermark;
[0014] S6. Output the target seal image embedded with the watermark into a standard image format that supports a transparent background, and perform image authenticity verification based on the style signature data.
[0015] Optionally, the seal customization parameters include a text content field, a graphic type field, a font style field, a border style field, a color setting field, and an organization identification field; and the identity information data includes an account identification, an organization name, a certification certificate summary, and a registration timestamp.
[0016] Optionally, the electronic seal basic image includes a background layer, a frame layer, a text layer, and an organization logo layer, and the multi-layer structure is synthesized into a four-channel image;
[0017] The background layer is set to transparent or uniform fill color; the border layer constructs a regular path graphic according to the graphic type and border style, and uses vector drawing to generate a closed boundary; the text layer contains central text and circular text, which are respectively generated by font style and text content rendering, and the arrangement method is polar coordinate mapping based on the graphic type; the organization identification layer contains organization identification information, which is embedded in the designated area of the image in the form of a graphic or a QR code.
[0018] Optionally, the S2 specifically includes:
[0019] S21, jointly constructing an anti-counterfeiting feature vector by combining identity information data with historical anti-counterfeiting attack samples;
[0020] S22, inputting the anti-counterfeiting feature vector into an anti-counterfeiting style image generation model constructed based on a conditional generative adversarial network, wherein the anti-counterfeiting style image generation model includes an input encoder module and a conditional image decoder module;
[0021] S23, the generator includes an input encoder module and a conditional image decoder module, the input encoder module receives the anti-counterfeiting feature vector, performs an embedding mapping operation, and outputs a conditional feature vector;
[0022] S24. The conditional image decoder module receives the conditional feature vector and generates an anti-counterfeiting style image.
[0023] Optionally, the anti-counterfeiting style image includes at least one of the following disturbance structures: a channel noise disturbance map, a local interference color block matrix, and a grid disturbance layer;
[0024] The perturbation structure of the grid perturbation layer:
[0025] G f (x,y)=sin(ω x x+φ x )+cos(ω y y+φ y );
[0026] Among them, G f (x, y) is the perturbation value of the grid perturbation layer at the image coordinate position (x, y), x is the horizontal coordinate of the current image pixel, y is the vertical coordinate of the current image pixel, ω x is the frequency factor of the grid perturbation in the lateral direction, φ x is the initial phase of the grid perturbation in the transverse direction, ω y is the frequency factor of the grid perturbation in the longitudinal direction, φ y is the initial phase of the grid perturbation in the longitudinal direction.
[0027] Optionally, the S3 specifically includes:
[0028] S31, taking the seal base image as the content image and the anti-counterfeiting style image as the style image, and inputting them into the neural style transfer model;
[0029] S32, the neural style transfer model includes a content encoder module, a style encoder module, an adaptive normalization module, a multi-scale fusion module and an image decoder module;
[0030] S33, the content encoder module extracts the content feature tensor F from the seal base image c , the style encoder module extracts the style feature tensor F from the anti-counterfeiting style image s ;
[0031] S34. The adaptive normalization module performs channel normalization processing on the content feature tensor to align the statistical distribution of the content feature tensor with the style feature tensor, and generates an aligned feature tensor:
[0032]
[0033] Among them, F ada To align the feature tensor, F c is the content feature tensor, F s is the style feature tensor, σ(F s ) is the style feature tensor F s The channel standard deviation tensor of μ(F s ) is the style feature tensor F s The channel mean tensor of μ(F c ) is the content feature tensor F c The mean tensor in the channel dimension, σ(F c ) is the content feature tensor F c The standard deviation tensor in the channel dimension;
[0034] S35, the multi-scale fusion module includes a shallow fusion path and a deep fusion path, which fuses the normalized features and style features at multiple scales and outputs a fused feature tensor;
[0035] S36, the image decoder module receives the fused feature tensor and generates a style fusion image I fusion The style fusion image maintains the structural information of the seal base image and superimposes the disturbance features in the anti-counterfeiting style image.
[0036] Optionally, the step 35 specifically includes:
[0037] S351, align the feature tensor F ada and style feature tensor F s Input into the shallow fusion path and deep fusion path in the multi-scale fusion module respectively;
[0038] S352, the shallow fusion path performs feature combination operations under the local receptive field, and aligns the feature tensor F ada and style feature tensor F s Perform channel-by-channel convolution and splicing to generate a shallow fusion feature tensor F shallow :
[0039] F shallow =Concat(Conv 3×3 (F ada ),Conv 3×3 (F s ));
[0040] Among them, F shallow is a shallow fusion feature tensor, Concat(·,·) represents the concatenation of two tensors in the channel dimension, Conv 3×3 (·) indicates a two-dimensional convolution operation with a convolution kernel size of 3×3, F ada To align the feature tensor, F s is the style feature tensor;
[0041] S353: The deep fusion path aligns the feature tensor F ada and style feature tensor F s Perform downsampling, channel compression and global feature interaction to generate a deep fusion feature tensor F deep ;
[0042] S354, shallow fusion feature tensor F shallow Fusion with deep feature tensor F deep Perform feature alignment and dimension upscaling, and fuse the output to form the final fused feature tensor.
[0043] Optionally, the S4 specifically includes:
[0044] S41, style fusion image I fusion Extract style fusion feature tensor F fusion , and construct the style perturbation feature vector based on the channel perturbation distribution, texture change map and grid perturbation layer;
[0045] S42, style fusion image I fusion Perform hash operation to generate image hash value;
[0046] S43, obtaining the current timestamp, and combining the style perturbation feature vector, identity information data, image hash value and timestamp to construct a digital watermark information structure W;
[0047] S44, perform structured encoding and vector compression on the digital watermark information structure W to generate a watermark vector V wm .
[0048] Optionally, the S5 specifically includes:
[0049] S51, set watermark embedding position mapping function f map , the watermark embedding position mapping function f map Map the image spatial position and channel to the watermark vector index k;
[0050] S52, constructing an embedding position set P according to the watermark embedding position mapping function;
[0051] S53, in style fusion image I fusion , embed the watermark vector into the corresponding position element by element to generate the perturbed image tensor:
[0052] I embed =I fusion (x k ,y k ,c k )+α·V wm (k);
[0053] Among them, I embed is the perturbed image tensor, I fusion is the watermark vector, k is the watermark vector index, x k Indicates the horizontal coordinate position of the image selected when the kth watermark component is embedded, y k Indicates the vertical coordinate position of the image selected when the kth watermark component is embedded, c k represents the image channel index corresponding to the kth watermark component when it is embedded, α is the embedding perturbation intensity control coefficient, V wm (k) is the k-th watermark vector component;
[0054] S54, performing channel range truncation processing on the embedded image tensor, so that the pixel value of the embedded image tensor is limited to the legal range [0, 1] or [0, 255], and obtaining the target seal image I embedded with the watermark target .
[0055] Optionally, the S6 specifically includes:
[0056] S61, receiving the target seal image and watermark vector embedded with watermark, setting the image export format identifier F type ∈{PNG,WebP,TIFF};
[0057] S62, performing format conversion and transparent channel preservation processing on the target seal image, and exporting it as a standard image file with an alpha channel;
[0058] S63, performing image authenticity verification initialization based on the exported standard image file, extracting the embedded disturbance information area and timestamp mark, and recovering the embedding index k through the inverse watermark embedding position mapping function to reconstruct the watermark vector;
[0059] S64, decoding the reconstructed watermark vector into a verification watermark structure, and parsing the style signature data, identity information, image hash, and timestamp contained in the verification watermark structure;
[0060] S65. Compare the current hash value of the standard image file with the image hash, and verify whether the style signature data matches the original signature data in the reserved signature database. If a match is established, the standard image file is determined to be an authenticity seal image, and a verification result label is output.
[0061] The beneficial effects of the present invention are:
[0062] The present invention proposes a method for producing an electronic seal. By constructing a neural generation mechanism that takes user identity information and anti-counterfeiting perturbation samples as input, the present invention realizes an electronic seal image generation method with personalized style perturbation, overcoming the defects of traditional electronic seals being templated and static. In the seal basic image construction stage, the present invention generates a four-channel image structure based on the parameter vector and the identity information vector, and realizes the structured arrangement of the seal text through polar coordinate mapping, so that the image has a high degree of expression consistency and recognizability. In the style image generation stage, an anti-counterfeiting perturbation image generation model based on a conditional generator is introduced, which not only comprehensively utilizes the variation information of historical attack samples, but also makes the generated image form randomness and irreversibility in terms of texture, lines, color blocks and grid perturbations, effectively improving the uniqueness and anti-counterfeiting ability of the stamp image.
[0063] Furthermore, a neural style transfer model is used to fuse the seal base image with the anti-counterfeiting style image. A multi-path strategy of content feature normalization and style feature fusion is adopted to inject anti-counterfeiting perturbation features while maintaining the original structure, so that the target image has significant visual individual differences. The present invention also extracts local and global style features through a multi-scale fusion mechanism, enhancing the perturbation complexity of the image while maintaining detail clarity. Finally, a digital watermark composed of a style signature, identity data, image hash, and timestamp is embedded in the fused image, and a recoverable embedding operation is completed in the form of vector perturbation, constructing a target seal image with traceability and verifiability.
[0064] Through the above technical solution, the present invention not only realizes personalization and dynamic anti-counterfeiting at the image generation level, but also solves technical problems such as the lack of traceable identification of electronic seal images, easy copying and forgery, and difficulty in verifying authenticity, thereby enhancing the credibility and legal effect of electronic seals in government affairs, judicial, contractual and bill scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0066] Figure 1 This is a flow chart of a method for making an electronic seal proposed by the present invention;
[0067] Figure 2 This is a schematic diagram of the structure of the neural style transfer model in the method for making an electronic seal proposed in the present invention;
[0068] Figure 3 This is a flow chart of watermark embedding and verification in the method for making an electronic seal proposed by the present invention. DETAILED DESCRIPTION
[0069] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0070] refer to Figure 1-3 A method for making an electronic seal comprises the following steps:
[0071] S1, receiving seal customization parameters and identity information data input by the user, and generating a seal basic image based on the seal customization parameters;
[0072] S2. Input the identity information data and historical anti-counterfeiting attack samples into the style image generation sub-model to control the output of the anti-counterfeiting style image;
[0073] S3, using the seal base image as the content image and the anti-counterfeiting style image as the style image, inputting them into a neural style transfer model, performing a style transfer operation, and outputting a style fusion image, wherein the neural style transfer model includes an encoder module, an adaptive normalization module, a multi-scale fusion module, and a decoder module, wherein the multi-scale fusion module includes a parallel shallow style injection path and a deep style injection path;
[0074] S4. Based on the style fusion image, extract the style perturbation feature vector as style signature data, and combine the style signature data with the identity information data, the current timestamp, and the hash value of the style fusion image to generate a watermark vector;
[0075] S5, embedding the watermark vector into the style fusion image to generate a target seal image embedded with the watermark;
[0076] S6. Output the target seal image embedded with the watermark into a standard image format that supports a transparent background, and perform image authenticity verification based on the style signature data.
[0077] The present invention provides a method for producing an electronic seal, which generates a basic seal image with a personalized structure by receiving seal customization parameters and identity information data, and fuses the anti-counterfeiting style image to realize image style transfer and construct a seal pattern with strong uniqueness. Based on the style fusion image, a perturbation feature vector is extracted, and a watermark vector is constructed by combining the identity information, timestamp and image hash, and embedded into the image, and finally a standard image file with a transparent background is output. The authenticity verification and traceability of the seal image are supported by the style signature data, which effectively solves the problem that traditional electronic seals lack anti-counterfeiting capabilities and are unverifiable. This method has the advantages of strong anti-counterfeiting, high image uniqueness and strong verification reliability, and is suitable for electronic signature scenarios with high requirements for image security and non-tamperability.
[0078] In this embodiment, the seal customization parameters include text content field, graphic type field, font style field, border style field, color setting field and organization identification field; the identity information data includes account identification, organization name, certification certificate summary, and registration timestamp.
[0079] The present invention introduces structured seal customization parameters and multi-dimensional identity information data to generate an electronic seal image with visual personalization and identity binding features, thereby improving the uniqueness and traceability of the seal and significantly enhancing the anti-counterfeiting ability and image credibility.
[0080] In this embodiment, the electronic seal basic image includes a background layer, a frame layer, a text layer and an organization identification layer, and the multi-layer structure is synthesized into a four-channel image;
[0081] The background layer is set to transparent or uniform fill color; the border layer constructs a regular path graphic according to the graphic type and border style, and uses vector drawing to generate a closed boundary; the text layer contains central text and circular text, which are respectively generated by font style and text content rendering, and the arrangement method is polar coordinate mapping based on the graphic type; the organization identification layer contains organization identification information, which is embedded in the designated area of the image in the form of a graphic or a QR code.
[0082] This invention constructs a multi-layered electronic seal base image consisting of a background layer, a border layer, a text layer, and an organization logo layer, forming a structured four-channel image representation. This allows for clear separation and flexible control of the seal's visual elements. By drawing the border using vector paths, arranging the text using polar coordinate mapping, and visually embedding the organization logo, the generated image possesses higher graphic quality, compatibility, and customization capabilities. This enhances the expressive richness and standardization of the seal image, providing a sound image foundation for the subsequent integration of anti-counterfeiting features.
[0083] In this embodiment, S2 specifically includes:
[0084] S21, jointly constructing an anti-counterfeiting feature vector by combining identity information data with historical anti-counterfeiting attack samples;
[0085] S22, inputting the anti-counterfeiting feature vector into an anti-counterfeiting style image generation model constructed based on a conditional generative adversarial network, wherein the anti-counterfeiting style image generation model includes an input encoder module and a conditional image decoder module;
[0086] S23, the generator includes an input encoder module and a conditional image decoder module, the input encoder module receives the anti-counterfeiting feature vector, performs an embedding mapping operation, and outputs a conditional feature vector;
[0087] S24. The conditional image decoder module receives the conditional feature vector and generates an anti-counterfeiting style image.
[0088] The present invention introduces a modeling method based on conditional generative adversarial networks during the anti-counterfeiting style image generation phase, combining identity information data with historical anti-counterfeiting attack samples to construct an anti-counterfeiting feature vector, thereby enhancing the controllability and security relevance of the style image. An embedding mapping operation is performed by the input encoder module to extract deep features driven by identity. The conditional image decoder module then generates an anti-counterfeiting style image with individual characteristics, thus binding the image perturbation style to the user's identity. This method improves the uniqueness and unforgeability of the generated image, providing a diversified, anti-overlapping basic style support for electronic seal images, significantly enhancing the image's anti-counterfeiting capabilities and identity traceability value.
[0089] In this embodiment, the anti-counterfeiting style image includes at least one of the following disturbance structures: a channel noise disturbance map, a local interference color block matrix, and a grid disturbance layer;
[0090] The perturbation structure of the grid perturbation layer:
[0091] G f (x,y)=sin(ω x x+φ x )+cos(ω y y+φ y );
[0092] Among them, G f (x, y) is the perturbation value of the grid perturbation layer at the image coordinate position (x, y), x is the horizontal coordinate of the current image pixel, y is the vertical coordinate of the current image pixel, ω x is the frequency factor of the grid perturbation in the lateral direction, φ x is the initial phase of the grid perturbation in the transverse direction, ω y is the frequency factor of the grid perturbation in the longitudinal direction, φ y is the initial phase of the grid perturbation in the longitudinal direction.
[0093] This method enhances the complexity and security of anti-counterfeiting style images by introducing various perturbation structures, including channel noise, local color blocks, and grid perturbations. The grid perturbation layer constructs periodic perturbations on image coordinates based on sine and cosine functions, dynamically adjusting frequency and phase parameters to achieve an irreversible and identity-linked perturbation pattern. This method improves the image's security stability under various compression and cropping conditions, effectively preventing the stamp image from being copied or imitated.
[0094] In this embodiment, S3 specifically includes:
[0095] S31, taking the seal base image as the content image and the anti-counterfeiting style image as the style image, and inputting them into the neural style transfer model;
[0096] S32, the neural style transfer model includes a content encoder module, a style encoder module, an adaptive normalization module, a multi-scale fusion module and an image decoder module;
[0097] S33, the content encoder module extracts the content feature tensor F from the seal base image c , the style encoder module extracts the style feature tensor F from the anti-counterfeiting style image s ;
[0098] S34. The adaptive normalization module performs channel normalization processing on the content feature tensor to align the statistical distribution of the content feature tensor with the style feature tensor, and generates an aligned feature tensor:
[0099]
[0100] Among them, F ada To align the feature tensor, F c is the content feature tensor, F s is the style feature tensor, σ(F s ) is the style feature tensor F s The channel standard deviation tensor of μ(F s ) is the style feature tensor F s The channel mean tensor of μ(F c ) is the content feature tensor F c The mean tensor in the channel dimension, σ(F c ) is the content feature tensor F c The standard deviation tensor in the channel dimension;
[0101] S35, the multi-scale fusion module includes a shallow fusion path and a deep fusion path, which fuses the normalized features and style features at multiple scales and outputs a fused feature tensor;
[0102] S36, the image decoder module receives the fused feature tensor and generates a style fusion image I fusion The style fusion image maintains the structural information of the seal base image and superimposes the disturbance features in the anti-counterfeiting style image.
[0103] The present invention achieves high-quality fusion of a seal base image and an anti-counterfeiting style image by constructing a neural style transfer model comprising a content encoder, a style encoder, adaptive normalization, multi-scale fusion, and an image decoder. The adaptive normalization module performs channel normalization on content features to align their statistical distribution with style features. The perturbation information is then fused at multiple scales through shallow and deep paths, ultimately generating a style-fused image that preserves the seal structure while incorporating identity-related perturbations. This method significantly improves the personalization, anti-counterfeiting, and consistency of image synthesis, providing core support for the generation of unique, identifiable, and traceable electronic seal images.
[0104] In this embodiment, the 35 specifically includes:
[0105] S351, align the feature tensor F ada and style feature tensor F s Input into the shallow fusion path and deep fusion path in the multi-scale fusion module respectively;
[0106] S352, the shallow fusion path performs feature combination operations under the local receptive field, and aligns the feature tensor F ada and style feature tensor F s Perform channel-by-channel convolution and splicing to generate a shallow fusion feature tensor F shallow :
[0107] F shallow =Concat(Conv 3×3 (F ada ),Conv 3×3 (F s ));
[0108] Among them, F shallow is a shallow fusion feature tensor, Concat(·,·) represents the concatenation of two tensors in the channel dimension, Conv 3×3 (·) indicates a two-dimensional convolution operation with a convolution kernel size of 3×3, F ada To align the feature tensor, F s is the style feature tensor;
[0109] S353: The deep fusion path aligns the feature tensor F ada and style feature tensor F s Perform downsampling, channel compression and global feature interaction to generate a deep fusion feature tensor F deep ;
[0110] S354, shallow fusion feature tensor F shallow Fusion with deep feature tensor F deep Perform feature alignment and dimension upscaling, and fuse the output to form the final fused feature tensor.
[0111] This paper introduces a multi-scale fusion module into the neural style transfer model and establishes shallow and deep fusion paths to achieve multi-level feature integration of the alignment feature tensor and the style feature tensor. The shallow path captures local texture and boundary features through convolution and channel splicing, while the deep path extracts global style semantics through global downsampling and compression. Finally, a complete feature tensor is output through feature alignment and dimensionality-increasing fusion. This structure effectively improves the expression accuracy and disturbance control capabilities of image style fusion, providing support for the authenticity of details and overall style consistency in anti-counterfeiting images, and enhancing the anti-counterfeiting and visual credibility of the generated seal images.
[0112] In this embodiment, the S4 specifically includes:
[0113] S41, style fusion image I fusion Extract style fusion feature tensor F fusion , and construct the style perturbation feature vector based on the channel perturbation distribution, texture change map and grid perturbation layer;
[0114] S42, style fusion image I fusion Perform hash operation to generate image hash value;
[0115] S43, obtaining the current timestamp, and combining the style perturbation feature vector, identity information data, image hash value and timestamp to construct a digital watermark information structure W;
[0116] S44, perform structured encoding and vector compression on the digital watermark information structure W to generate a watermark vector V wm .
[0117] This method extracts a fusion feature tensor from a style-fusion image, combines channel perturbations, texture changes, and grid perturbations to construct a style perturbation feature vector, and then fuses identity information, timestamps, and image hash values to generate a structured digital watermark. This method ultimately compresses and generates a watermark vector. This method achieves a deep binding of image style features and identity data, enhancing the uniqueness and verifiability of electronic seal images. It provides effective support for image anti-counterfeiting, tamper detection, and traceability, and strengthens the security and trustworthiness of image content.
[0118] In this embodiment, the S5 specifically includes:
[0119] S51, set watermark embedding position mapping function f map, the watermark embedding position mapping function f map Map the image spatial position and channel to the watermark vector index k;
[0120] S52, constructing an embedding position set P according to the watermark embedding position mapping function;
[0121] S53, in style fusion image I fusion , embed the watermark vector into the corresponding position element by element to generate the perturbed image tensor:
[0122] I embed =I fusion (x k ,y k ,c k )+α·V wm (k);
[0123] Among them, I embed is the perturbed image tensor, I fusion is the watermark vector, k is the watermark vector index, x k Indicates the horizontal coordinate position of the image selected when the kth watermark component is embedded, y k Indicates the vertical coordinate position of the image selected when the kth watermark component is embedded, c k represents the image channel index corresponding to the kth watermark component when it is embedded, α is the embedding perturbation intensity control coefficient, V wm (k) is the k-th watermark vector component;
[0124] S54, performing channel range truncation processing on the embedded image tensor, so that the pixel value of the embedded image tensor is limited to the legal range [0, 1] or [0, 255], and obtaining the target seal image I embedded with the watermark target .
[0125] This method implements a perturbation-based watermark embedding mechanism by mapping the watermark vector to image spatial locations and channels by index, setting a watermark embedding position mapping function. This method generates a perturbation image tensor by element-by-element superimposing perturbation values within the style-fusion image. Channel truncation is then performed to ensure pixel legitimacy, ultimately yielding the target seal image embedded with the watermark. This method offers advantages such as high embedding concealment, controllable position, and high compression resistance. It ensures stable storage of watermark information without compromising image visual quality, effectively enhancing the tamper-resistance and verifiability of the seal image.
[0126] In this embodiment, S6 specifically includes:
[0127] S61, receiving the target seal image and watermark vector embedded with watermark, setting the image export format identifier F type ∈{PNG,WebP,TIFF};
[0128] S62, performing format conversion and transparent channel preservation processing on the target seal image, and exporting it as a standard image file with an alpha channel;
[0129] S63, performing image authenticity verification initialization based on the exported standard image file, extracting the embedded disturbance information area and timestamp mark, and recovering the embedding index k through the inverse watermark embedding position mapping function to reconstruct the watermark vector;
[0130] S64, decoding the reconstructed watermark vector into a verification watermark structure, and parsing the style signature data, identity information, image hash, and timestamp contained in the verification watermark structure;
[0131] S65. Compare the current hash value of the standard image file with the image hash, and verify whether the style signature data matches the original signature data in the reserved signature database. If a match is established, the standard image file is determined to be an authenticity seal image, and a verification result label is output.
[0132] The present invention receives a watermarked target seal image and watermark vector, converts the image format, preserves the transparent channel, and exports it as a standard image file. During the verification process, the disturbed region is extracted and the embedding index is restored. The watermark vector is reconstructed and parsed into a verification structure, and a consistency comparison is performed using the image hash and style signature data. This method supports image-level authenticity verification, boasts high accuracy, strong traceability, and good compatibility. It effectively prevents tampering or forgery of electronic seal images during transmission and storage, enhancing the credibility and security of image data.
[0133] Based on the above-mentioned electronic seal image generation and verification mechanism, in order to further enhance the verifiability and judicial credibility of seal images, the present invention preferably introduces a blockchain-based image evidence storage and seal traceability mechanism. Specifically, after the seal image is generated, key metadata such as the image hash value, style signature data, user identity summary, and generation timestamp can be constructed into a digital signature summary, which is then registered in a blockchain system such as a consortium chain or a private chain, achieving a trusted timestamp record of the seal generation behavior and multi-node consensus confirmation of ownership.
[0134] This blockchain enhancement mechanism can serve as an optional extension to the electronic seal system of the present invention, suitable for scenarios requiring strong anti-counterfeiting and traceability, such as notarized signatures and financial contracts. By leveraging the immutable nature of on-chain data, a dual verification path for seal images can be implemented during subsequent verification: a perturbation-based digital watermark verification mechanism embedded in the image itself, and a blockchain data consistency check based on the image hash and signature digest, thereby establishing a collaborative on-chain and off-chain verification mechanism for electronic seal images.
[0135] It is worth noting that the blockchain mechanism is a non-essential module in the overall solution of the present invention. Its introduction or not does not affect the basic generation process and local verification logic of the electronic seal image. It only serves as an enhanced implementation path for high-trust application requirements, reflecting the engineering advantages of the present invention in terms of scalability, security and reliability in actual deployment.
[0136] Example 1:
[0137] To verify the feasibility of the present invention, it was applied to an electronic document processing system to generate electronic seal images with personalized anti-counterfeiting features and a verifiable watermark structure. This system primarily serves the electronic signature processing of key documents such as contracts, business vouchers, and approval records. In the original system, electronic seals were generated using fixed templates, resulting in a single image style and high reproducibility. This system lacked anti-counterfeiting mechanisms and could not provide effective tamper detection capabilities during operations such as document copying, image compression, and format conversion. It also could not confirm the true source of the seal image, posing a risk of malicious duplication and forgery.
[0138] After introducing the present invention, the system first receives the seal customization parameters submitted by the user organization, including the seal text content, font style, border style, and color settings. It also obtains user identity data such as organization code, department ID, and role attributes. This information is then uniformly modeled to generate an identity vector. This vector, along with a collection of historical anti-counterfeiting attack samples, is then fed into a conditional generative model to produce an anti-counterfeiting style image with a unique perturbation structure. The generated image incorporates channel noise perturbation, local color block perturbation, and grid perturbation layers, resulting in an overall style that is impossible to visually detect and replicate.
[0139] The system then uses a neural style transfer model to fuse this anti-counterfeiting style image with the base seal image. Through normalized alignment and multi-scale fusion of content and style features, it achieves a deep coupling of the seal structure and perturbation style. Furthermore, it extracts the perturbation feature vector from the fused image and constructs a digital watermark information structure based on the identity information, image hash value, and current timestamp. This is ultimately encoded as a watermark vector and embedded into the image pixel space, resulting in a watermarked target seal image. This image visually preserves the original seal design while implicitly embedding a verifiable unique signature within its pixel structure, providing strong anti-tampering and traceability capabilities.
[0140] To verify the actual effect, the electronic seal generated by this method was systematically tested in multiple typical scenarios, covering operations such as image compression, format transcoding, lossy cropping, and tampering attempts. The results were compared with traditional static seal generation methods. The following are the results:
[0141] Table 1 Comparison between the electronic seal of the present invention and the traditional static seal
[0142]
[0143]
[0144] As can be seen from the above table, the present invention demonstrates significant advantages over traditional static template generation methods in multiple key performance indicators during the generation and verification of electronic seal images. First, in terms of verification success rate after image compression and format conversion, the seal images generated by the present invention maintained verification success rates of 97.3% and 95.6% after 85% PNG compression and JPG to WebP conversion, respectively. These rates are significantly higher than those found difficult to verify using traditional methods, demonstrating the robustness of the watermark structure in compression and re-encoding scenarios.
[0145] Secondly, in terms of tampering detection accuracy, the present invention uses a combined verification mechanism of style perturbation features and watermark structure, enabling the system to maintain an accuracy rate of over 90.3% even after local image tampering (such as 10% lossy cropping). It also achieves a 100% recognition rate in a counterfeit stamp attack scenario, fully demonstrating the style signature mechanism's strong ability to discern image authenticity. Traditional methods, lacking feature comparison mechanisms and signature matching strategies, struggle to effectively identify changes in image details.
[0146] Again, in terms of the integrity of the embedded watermark, the vector perturbation embedding mechanism proposed in the present invention ensures that the embedding process has minimal impact on the image content, while the integrity rate after embedding remains above 97.4%, and even reaches 100% in the original image scene, which is significantly better than the existing global modulation or QR code embedding methods that are prone to data distortion after image processing. In addition, the average image generation time is controlled between 41 and 44ms, which meets the real-time requirements in the electronic signature scenario, and the user satisfaction score is generally higher than 9 points, indicating that the solution has a good user experience in the actual business system, and the visual effect and technical security are effectively unified. In summary, the present invention has substantial technical advantages in terms of image uniqueness, security, embedding robustness and usage efficiency.
[0147] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A method for making an electronic seal, characterized in that: The steps include: S1, receiving seal customization parameters and identity information data input by the user, and generating a seal basic image based on the seal customization parameters; S2. Input the identity information data and historical anti-counterfeiting attack samples into the style image generation sub-model to control the output of the anti-counterfeiting style image; S3, using the seal base image as the content image and the anti-counterfeiting style image as the style image, inputting them into a neural style transfer model, performing a style transfer operation, and outputting a style fusion image, wherein the neural style transfer model includes an encoder module, an adaptive normalization module, a multi-scale fusion module, and a decoder module, wherein the multi-scale fusion module includes a parallel shallow style injection path and a deep style injection path; S4. Based on the style fusion image, extract the style perturbation feature vector as style signature data, and combine the style signature data with the identity information data, the current timestamp, and the hash value of the style fusion image to generate a watermark vector; S5, embedding the watermark vector into the style fusion image to generate a target seal image embedded with the watermark; S6. Output the target seal image embedded with the watermark into a standard image format that supports a transparent background, and perform image authenticity verification based on the style signature data.
2. The method for making an electronic seal according to claim 1, wherein: The seal customization parameters include a text content field, a graphic type field, a font style field, a border style field, a color setting field, and an organization identification field; the identity information data includes an account identification, an organization name, a certification certificate summary, and a registration timestamp.
3. The method for making an electronic seal according to claim 1, wherein: The electronic seal basic image includes a background layer, a frame layer, a text layer and an organization logo layer, and the multi-layer structure is synthesized into a four-channel image; The background layer is set to transparent or uniform fill color; the border layer constructs a regular path graphic according to the graphic type and border style, and uses vector drawing to generate a closed boundary; the text layer contains central text and circular text, which are respectively generated by font style and text content rendering, and the arrangement method is polar coordinate mapping based on the graphic type; the organization identification layer contains organization identification information, which is embedded in the designated area of the image in the form of a graphic or a QR code.
4. The method for making an electronic seal according to claim 1, wherein: The S2 specifically includes: S21, jointly constructing an anti-counterfeiting feature vector by combining identity information data with historical anti-counterfeiting attack samples; S22, inputting the anti-counterfeiting feature vector into an anti-counterfeiting style image generation model constructed based on a conditional generative adversarial network, wherein the anti-counterfeiting style image generation model includes an input encoder module and a conditional image decoder module; S23, the generator includes an input encoder module and a conditional image decoder module, the input encoder module receives the anti-counterfeiting feature vector, performs an embedding mapping operation, and outputs a conditional feature vector; S24. The conditional image decoder module receives the conditional feature vector and generates an anti-counterfeiting style image.
5. The method for making an electronic seal according to claim 4, characterized in that: The anti-counterfeiting style image includes at least one of the following disturbance structures: a channel noise disturbance map, a local interference color block matrix, and a grid disturbance layer; The perturbation structure of the grid perturbation layer: G f (x,y)=sin(ω x x+φ x )+cos(ω y y+φ y ); Among them, G f (x, y) is the perturbation value of the grid perturbation layer at the image coordinate position (x, y), x is the horizontal coordinate of the current image pixel, y is the vertical coordinate of the current image pixel, ω x is the frequency factor of the grid perturbation in the lateral direction, φ x is the initial phase of the grid perturbation in the transverse direction, ω y is the frequency factor of the grid perturbation in the longitudinal direction, φ y is the initial phase of the grid perturbation in the longitudinal direction.
6. The method for making an electronic seal according to claim 1, wherein: The S3 specifically includes: S31, taking the seal base image as the content image and the anti-counterfeiting style image as the style image, and inputting them into the neural style transfer model; S32, the neural style transfer model includes a content encoder module, a style encoder module, an adaptive normalization module, a multi-scale fusion module and an image decoder module; S33, the content encoder module extracts the content feature tensor F from the seal base image c , the style encoder module extracts the style feature tensor F from the anti-counterfeiting style image s ; S34. The adaptive normalization module performs channel normalization processing on the content feature tensor to align the statistical distribution of the content feature tensor with the style feature tensor, and generates an aligned feature tensor: Among them, F ada To align the feature tensor, F c is the content feature tensor, F s is the style feature tensor, σ(F s ) is the style feature tensor F s The channel standard deviation tensor of μ(F s ) is the style feature tensor F s The channel mean tensor, μ(F c ) is the content feature tensor F c The mean tensor in the channel dimension, σ(F c ) is the content feature tensor F c The standard deviation tensor in the channel dimension; S35, the multi-scale fusion module includes a shallow fusion path and a deep fusion path, which fuses the normalized features and style features at multiple scales and outputs a fused feature tensor; S36, the image decoder module receives the fused feature tensor and generates a style fusion image I fusion The style fusion image maintains the structural information of the seal base image and superimposes the disturbance features in the anti-counterfeiting style image.
7. The method for making an electronic seal according to claim 6, characterized in that: The S35 specifically includes: S351, align the feature tensor F ada and the style feature tensor F s Input into the shallow fusion path and deep fusion path in the multi-scale fusion module respectively; S352, the shallow fusion path performs feature combination operations under the local receptive field, and aligns the feature tensor F ada and the style feature tensor F s Perform channel-by-channel convolution and splicing to generate a shallow fusion feature tensor F shallow : F shallow =Concat(Conv 3×3 (F ada ),Conv 3×3 (F s )); Among them, F shallow is a shallow fusion feature tensor, Concat(,) represents the concatenation of two tensors in the channel dimension, Conv 3×3 (·) indicates a two-dimensional convolution operation with a convolution kernel size of 3×3, F ada To align the feature tensor, F s is the style feature tensor; S353: The deep fusion path aligns the feature tensor F ada and the style feature tensor F s Perform downsampling, channel compression and global feature interaction to generate a deep fusion feature tensor F deep ; S354, shallow fusion feature tensor F shallow Fusion with deep feature tensor F deep Perform feature alignment and dimension upscaling, and fuse the output to form the final fused feature tensor.
8. The method for making an electronic seal according to claim 1, wherein: The S4 specifically includes: S41, style fusion image I fusion Extract style fusion feature tensor F fusion , and construct the style perturbation feature vector based on the channel perturbation distribution, texture change map and grid perturbation layer; S42, style fusion image I fusion Perform hash operation to generate image hash value; S43, obtaining the current timestamp, and combining the style perturbation feature vector, identity information data, image hash value and timestamp to construct a digital watermark information structure W; S44, perform structured coding and vector compression on the digital watermark information structure W to generate a watermark vector V wm .
9. The method for making an electronic seal according to claim 1, wherein: The S5 specifically includes: S51, set watermark embedding position mapping function f map , the watermark embedding position mapping function f map Map the image spatial position and channel to the watermark vector index k; S52, constructing an embedding position set P according to the watermark embedding position mapping function; S53, in style fusion image I fusion , embed the watermark vector element by element into the corresponding position to generate the perturbed image tensor: I embed =I fusion (x k ,y k ,c k )+α·V wm (k); Among them, I embed is the perturbed image tensor, I fusion is the watermark vector, k is the watermark vector index, x k Indicates the horizontal coordinate position of the image selected when the kth watermark component is embedded, y k Indicates the vertical coordinate position of the image selected when the kth watermark component is embedded, c k represents the image channel index corresponding to the kth watermark component when it is embedded, α is the embedding perturbation intensity control coefficient, V wm (k) is the k-th watermark vector component; S54, performing channel range truncation processing on the embedded image tensor, so that the pixel value of the embedded image tensor is limited to the legal range [0, 1] or [0, 255], and obtaining the target seal image I embedded with the watermark target .
10. The method for making an electronic seal according to claim 1, characterized in that: The S6 specifically includes: S61, receiving the target seal image and watermark vector embedded with watermark, setting the image export format identifier F type ∈{PNG,WebP,TIFF}; S62, performing format conversion and transparent channel preservation processing on the target seal image, and exporting it as a standard image file with an alpha channel; S63, performing image authenticity verification initialization based on the exported standard image file, extracting the embedded disturbance information area and timestamp mark, and recovering the embedding index k through the inverse watermark embedding position mapping function to reconstruct the watermark vector; S64, decoding the reconstructed watermark vector into a verification watermark structure, and parsing the style signature data, identity information, image hash, and timestamp contained in the verification watermark structure; S65. Compare the current hash value of the standard image file with the image hash, and verify whether the style signature data matches the original signature data in the reserved signature database. If a match is established, the standard image file is determined to be an authenticity seal image, and a verification result label is output.