A digital watermark image generation method and system
By generating an image coding mask to differentially embed watermarks in the frequency domain, the problem of low watermark extraction rate in existing technologies is solved, and efficient watermark extraction and stability are achieved in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHOUPU DATA TECH NANJING CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-26
AI Technical Summary
Existing digital watermarking image generation technologies have low success rates and accuracy in watermark extraction when faced with nonlinear distortion or complex attacks, and it is difficult to maintain stability in complex image changes.
By generating an image coding mask based on the complexity of the original image, the watermark is embedded into the low-frequency components of the image in the frequency domain. Differentiated embedding intensity is used to match the watermark with the image content features, and the trained model is used for decoding, thereby improving the success rate and accuracy of extraction.
In the face of complex distortion, it significantly improves the success rate and accuracy of watermark extraction, and enhances the stability and anti-interference ability of watermarks.
Smart Images

Figure CN122288964A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and system for generating digital watermarked images. Background Technology
[0002] Digital watermarking is a technology that embeds information into multimedia files. Adding an invisible digital watermark to an image can effectively prevent the illegal dissemination and theft of data, ensuring information security without affecting the use of the data. Digital watermarking is widely used on images; adding a digital watermark to an image generates a digital watermarked image, which can be used to identify the perpetrator in the event of a leak.
[0003] Current digital watermarking image generation techniques typically employ a fixed embedding strength for full-image watermark embedding. This globally fixed embedding strength is determined based on a linear model, assuming a simple proportional relationship between the watermark and image pixels. In real-world scenarios, when the image is subjected to non-linear distortion (such as taking a screenshot) or complex attacks (such as cropping and adjusting contrast), the watermark information cannot be accurately recovered, resulting in a significant drop in watermark extraction success rate. Summary of the Invention
[0004] This invention provides a method and system for generating digital watermarked images, which can improve the success rate and accuracy of watermark extraction.
[0005] According to one aspect of the present invention, an embodiment of the present invention provides a method for generating a digital watermarked image, the method comprising: Obtain the original image to which the watermark will be added; Based on the image complexity of the original image, an image coding mask is generated; The original image is decomposed in the frequency domain to obtain the low-frequency component image; According to the embedding strength value corresponding to the mask in the image coding mask, the initial watermark image is embedded into the low-frequency component image to obtain the low-frequency watermark image; different masks in the image coding mask correspond to different embedding strength values; The low-frequency watermark image is subjected to inverse frequency domain transformation to obtain a synthetic watermark image.
[0006] According to another aspect of the present invention, embodiments of the present invention also provide a digital watermark image generation system, the system comprising: The image acquisition module is used to acquire the original image to which the watermark is to be added; A mask generation module is used to generate an image encoding mask based on the image complexity of the original image; The frequency domain decomposition module is used to decompose the original image in the frequency domain to obtain a low-frequency component image; The watermark embedding module is used to embed the initial watermark image into the low-frequency component image according to the embedding strength value corresponding to the mask in the image coding mask, so as to obtain a low-frequency watermark image; different masks in the image coding mask correspond to different embedding strength values; The frequency domain reconstruction module is used to perform inverse frequency domain transformation on the low-frequency watermark image to obtain a synthetic watermark image.
[0007] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the digital watermark image generation method according to any embodiment of the present invention.
[0008] The technical solution of this invention generates an image coding mask based on the complexity of the original image, embeds the watermark into the low-frequency components of the image in the frequency domain, and achieves differentiated embedding of the watermark according to the embedding strength value corresponding to different masks in the image coding mask, so that the embedding strength of the watermark in the image matches the content features of the image itself; when faced with complex distortions in reality, decoding can be performed according to different embedding strengths, thereby improving the success rate and accuracy of watermark extraction.
[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart of a digital watermark image generation method provided by an embodiment of the present invention; Figure 2A This is a flowchart of a digital watermark image generation method provided by an embodiment of the present invention; Figure 2B This is a flowchart of a digital watermark image generation method provided by an embodiment of the present invention; Figure 3 This is a structural diagram of a digital watermark image generation system provided according to an embodiment of the present invention. Detailed Implementation
[0012] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, or product comprising a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, or products.
[0014] The acquisition, storage, and application of watermarks and original images involved in the technical solutions of this invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0015] Figure 1 This is a flowchart illustrating a digital watermark image generation method provided in an embodiment of the present invention. This embodiment is applicable to the generation of digital watermark images, and the method can be executed by a digital watermark image generation system, which can be implemented in software. This digital watermark image generation system can be configured in a server.
[0016] See Figure 1 The digital watermark image generation method shown includes: S101. Obtain the original image to be watermarked.
[0017] The original image can be the image to which the watermark needs to be added.
[0018] In some embodiments, image data is read from a storage location programmatically. For example, an image can be loaded into memory from a local path using functions such as Image.open() or imread(). In some embodiments, software tools can be used to directly select an image from the computer using the "open file" or "import" functions.
[0019] S102. Generate an image coding mask based on the image complexity of the original image.
[0020] Image complexity can refer to the complexity of the image content in the original image. An image coding mask can be a mask used for region filtering in the original image.
[0021] Dividing the image into regions based on the complexity of the original image content is essentially dividing the image into regions based on visual sensitivity in the visual dimension.
[0022] If a certain area of an image is complex, such as containing a large number of subjects or rich colors, the human eye usually cannot detect changes in the complex area because it contains a lot of information. Therefore, the human eye is relatively insensitive to changes in this area. Such complex areas are called visually insensitive areas.
[0023] If a certain area in an image has relatively simple content, such as a large area of sky or a solid color background, the human eye can easily detect changes in it because simple areas contain little information. The human eye is more sensitive to changes in this area, and such simple areas are called visually sensitive areas.
[0024] Create an initial image coding mask of the same size as the original image. Assign values to the initial image coding mask according to the image complexity of the original image. Assign the same value to regions with the same image complexity to generate the image coding mask.
[0025] In some embodiments, the mask can be a two-dimensional array, where the element values determine whether the corresponding pixel is processed. The mask value can be binary, i.e., 0 or 255. 0 indicates that the corresponding pixel is not processed, and 255 indicates that the corresponding pixel is processed.
[0026] Create a mask of the same size as the original image and initialize it to all zeros. Update the values of the positions corresponding to the visually insensitive areas to 255 to obtain the image encoding mask.
[0027] S103. Perform frequency domain decomposition on the original image to obtain a low-frequency component image.
[0028] Among them, the low-frequency component image can be the image of the low-frequency part.
[0029] The original image is decomposed in the frequency domain into low-frequency and high-frequency components. The high-frequency components represent the details of the image, while the low-frequency components represent its contours.
[0030] In some embodiments, the original image is frequency-decomposed using Discrete Wavelet Transform (DWT). Specifically, a two-dimensional Discrete Wavelet Transform can be used, as follows: ① First, perform a one-dimensional discrete wavelet transform on each row of the original image to obtain low-frequency row signals and high-frequency row signals: the low-frequency row signals retain the contour information of the row direction, and the high-frequency row signals retain the edge or detail information of the row direction.
[0031] ② Then perform a one-dimensional discrete wavelet transform on each column of the row transform result, which decomposes the image into four components: Low-frequency component (LL): Contains overall image contour information Low-frequency to high-frequency component (LH): contains horizontal edge information High-frequency to low-frequency component (HL): contains vertical edge information High-frequency component (HH): Contains diagonal texture and noise information. The low-frequency component LL is used as the low-frequency component image.
[0032] S104. According to the embedding strength value corresponding to the mask in the image coding mask, the initial watermark image is embedded into the low-frequency component image to obtain the low-frequency watermark image; different masks in the image coding mask correspond to different embedding strength values.
[0033] Here, the mask refers to the numerical values at each position within the mask. The embedding strength value represents the watermark embedding strength. The initial watermark image can be the watermarked image itself. The low-frequency watermark image can be the low-frequency component image with the watermark.
[0034] The higher the embedding strength value, the deeper the watermark is embedded, and the greater the change in the pixels of the original image; the lower the embedding strength value, the shallower the watermark is embedded, and the smaller the change in the pixels of the original image.
[0035] In image coding masks, the mask can reflect visual sensitivity. In areas of high visual sensitivity, a smaller embedding strength value is used for watermark embedding, resulting in minimal pixel changes to the original image. In areas of low visual sensitivity, a larger embedding strength value is used for watermark embedding. Although this results in significant pixel changes to the original image, the lack of visual sensitivity makes the changes almost imperceptible.
[0036] After transform domain decomposition, the low-frequency components of an image correspond to its contours. Conventional image processing operations (such as compression, filtering, or scaling) typically weaken or discard high-frequency components, having little impact on low-frequency components. Therefore, embedding a watermark into the low-frequency components of the image can enhance its resistance to conventional image processing. Furthermore, the human visual system is relatively insensitive to changes in image contour structure, and modifications to low-frequency components are less likely to cause significant visual distortion, thus improving the watermark's stability while maintaining its concealment.
[0037] The watermark is embedded into the low-frequency component image according to the embedding strength value corresponding to the mask. For example, the image coding mask is a binary image coding mask of 0 and 255. At mask positions of 0, no watermark is embedded, or a smaller embedding strength value is used. At mask positions of 255, a larger embedding strength value is used to embed the watermark.
[0038] S105. Perform frequency domain inverse transform on the low-frequency watermark image to obtain a synthetic watermark image.
[0039] Among them, the inverse frequency domain transform, also known as frequency domain reconstruction, is a transformation that synthesizes a low-frequency watermark image into a full-frequency image.
[0040] The low-frequency watermark image is synthesized into a full-frequency image by combining the approximation coefficients and detail coefficients through cascaded low-pass and high-pass filters, thus ensuring the integrity of the image and obtaining the synthesized watermark image.
[0041] In an optional embodiment, after performing frequency domain inverse transform on the low-frequency watermark image to obtain a synthetic watermark image, the method further includes: using a watermark extraction model to analyze the synthetic watermark image and determine the target watermark image; the watermark extraction model is trained using watermark image samples; the watermark image samples include: a ground truth watermark image and an added watermark image formed by adding the ground truth watermark image.
[0042] The watermark extraction model can be a model for extracting watermarks. The watermark image sample can be an image sample used as input to train the model. The target watermark image is the image with the extracted watermark. The ground truth watermark image can be an image representing the real watermark. The added watermark image can be a synthetic watermark image with the ground truth watermark image added.
[0043] The synthesized watermark image is input into the watermark extraction model for watermark extraction.
[0044] The watermark extraction model is trained under supervised training, with labeled samples serving as input for training. The ground truth watermark image acts as the label, used to determine the model's extraction accuracy and optimize model parameters.
[0045] As can be seen, by analyzing the synthetic watermark image through the watermark extraction model trained on watermark image samples, the target watermark image can be automatically restored from the synthetic watermark image without the need to manually set complex extraction rules and thresholds, thus improving the efficiency of watermark extraction.
[0046] In an optional embodiment, the watermarked image is obtained by adding a watermark to the ground truth watermarked image and then processing it for distortion.
[0047] The watermarked image is then fed into a noise layer. This noise layer simulates color shifts and moiré patterns that occur during physical media transformations. These physical media transformations include, but are not limited to, printing, photocopying, taking photos of a screen, photographing a printed document, or photographing a photocopy. The distorted watermarked image enriches the distribution of training samples, completes the model's feature learning in real-world physical scenarios, and thus improves the watermark extraction model's adaptability and accuracy in complex practical applications.
[0048] It is evident that by training the watermark extraction model using distorted watermarked images during the training process, the model can fully learn the image distortion features in real-world scenarios, effectively expanding the diversity and coverage of training samples. This significantly improves the model's extraction accuracy and generalization ability in practical application environments, ensuring that the model can still stably and accurately extract watermarks even in complex physical scenarios.
[0049] In an optional embodiment, the step of using a watermark extraction model to parse the synthesized watermark image and determine the target watermark image includes: using a watermark extraction model to parse the synthesized watermark image to obtain at least one candidate watermark image; generating an image decoding mask based on the image complexity of the synthesized watermark image; and filtering each of the candidate watermark images based on the image decoding mask to obtain the target watermark image.
[0050] Here, the candidate watermark image refers to the image of the watermark to be confirmed obtained through parsing. The image decoding mask can be a mask generated during the watermark extraction stage. The image decoding mask is used to quantify the confidence level of the watermark extracted from each region.
[0051] A composite watermarked image can contain multiple watermarks. During the parsing of the composite watermarked image, multiple watermarks are extracted and identified as candidate watermark images. Based on the image complexity of the composite watermarked image, an image decoding mask is generated, using the same method as generating the image encoding mask. Based on the mask in the image decoding mask and the candidate watermark images extracted from the corresponding regions, different candidate watermarks are selected for optimal results. Finally, the target watermark image is determined.
[0052] Understandably, the mask values in the image decoding mask correspond to the embedding strength during the watermark embedding stage. Higher embedding strength results in stronger noise resistance for the watermark, while lower embedding strength leads to weaker noise resistance. When determining the target watermark image, a weighted decision is made on each candidate watermark image based on the image decoding mask. This ensures that candidate watermark images corresponding to areas with higher embedding strength have a higher decision weight, while candidate watermark images corresponding to areas with lower embedding strength have a lower decision weight. This makes the decoding result more reliant on the watermark component with stronger anti-interference capabilities, further improving the accuracy and stability of the target watermark image.
[0053] For example, there are three alternative watermark images: Alternative watermark A: [+1, +1, -1] Alternative watermark B: [+1, -1, -1] Alternative watermark C: [+1, -1, +1] The weights obtained from the corresponding mask transformation are Alternative watermark A: 0.9, Alternative watermark B: 0.4, Alternative watermark C: 0.3.
[0054] Weighted voting is performed for each encoded position: Encoding position 1: +1 scores 0.9 + 0.4 + 0.3, -1 scores 0; Encoding position 2: +1 scores 0.9, -1 scores 0.4 + 0.3; Encoding position 3: +1 scores 0.3, -1 scores 0.9 + 0.4; The highest score value is taken from each encoding position, and the binary image of the target watermark is determined as: [+1, +1, -1].
[0055] It is evident that by generating an image decoding mask based on the complexity of the synthesized watermark image, and using this mask to filter the candidate watermark images output by the watermark extraction model, the reliability of information in different regions of the image can be distinguished during the decoding process. Watermark information from high-confidence regions is prioritized, effectively reducing noise interference with the watermark extraction results and thus improving the extraction accuracy of the target watermark image.
[0056] The technical solution of this invention generates an image coding mask based on the complexity of the original image, embeds the watermark into the low-frequency components of the image in the frequency domain, and achieves differentiated embedding of the watermark according to the embedding strength value corresponding to different masks in the image coding mask, so that the embedding strength of the watermark in the image matches the content features of the image itself; when faced with complex distortions in reality, decoding can be performed according to different embedding strengths, thereby improving the success rate and accuracy of watermark extraction.
[0057] Figure 2A This is a flowchart of a digital watermark image generation method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment of the present invention further defines the step of generating an image coding mask based on the original image as follows: extracting texture features from the original image to obtain texture features; performing semantic segmentation based on the texture features to divide the original image into multiple image regions with different semantics; generating an image coding mask based on the mapping relationship between the image complexity of the semantics corresponding to the image regions and the mask; the same mask is used for the same image region.
[0058] It should be noted that for parts not described in detail in the embodiments of the present invention, please refer to the descriptions in other embodiments.
[0059] See Figure 2A The digital watermark image generation method shown includes: S201. Obtain the original image to be watermarked.
[0060] S202. Extract texture features from the original image to obtain texture features.
[0061] Texture features can be those that reflect the complexity of textures in an image.
[0062] Texture features can be obtained by calculating the local pixel distribution patterns, such as the contrast of the gray-level co-occurrence matrix or the binary encoding histogram of the local binary pattern.
[0063] In some embodiments, a pre-trained model can be used to extract texture features. For example, the ResNet-50 deep residual model.
[0064] In an optional embodiment, the step of extracting texture features from the original image to obtain texture features includes: The original image is input into a convolutional layer for shallow feature extraction to obtain shallow features; The shallow features are input into the residual layer for deep feature extraction to obtain deep features; The deep features are input into a fully connected layer for feature integration to obtain texture features.
[0065] Shallow features can describe basic information about an image, while deep features can describe complex information about an image.
[0066] The original image is input into the convolutional layer of the model network. The convolutional layer slides across the image using multiple convolutional kernels of different sizes and performs dot product operations to generate a set of feature maps. The convolutional layer mainly extracts shallow features of the image, such as simple texture primitives like horizontal or vertical lines, which are equivalent to the outlines that the human eye first distinguishes when viewing an image.
[0067] The shallow feature map obtained in the first step is input into multiple stacked residual blocks. Each residual block typically contains several convolutional layers and a "shortcut connection." The skip connection directly adds the layer's input to the output, solving the gradient vanishing and performance degradation problems caused by increasing network depth. The residual blocks extract deep features from the image.
[0068] The deep features are then input into the fully connected layer. Each neuron in the fully connected layer is connected to all neurons in the previous layer. Through weighted summation and non-linear activation functions, these features are analyzed and combined globally and comprehensively. The final output is a texture feature that can represent the texture attributes of the entire image.
[0069] As can be seen, by sequentially using convolutional layers for shallow edge texture extraction, residual layers for deep complex pattern abstraction, and fully connected layers for global feature integration, we can extract texture feature vectors with rich layers and complete semantics from the original image, making subsequent semantic segmentation more accurate.
[0070] S203. Perform semantic segmentation based on the texture features to divide the original image into multiple image regions with different semantics.
[0071] In this process, the obtained texture features are input into an image classifier, which groups together pixels with the same texture pattern, thereby segmenting the image into image regions with different semantics.
[0072] S204. Generate an image coding mask based on the mapping relationship between the image complexity and the mask corresponding to the semantics of the image region; the masks corresponding to the same image region are the same.
[0073] In this process, a correspondence between semantics and masks is established beforehand based on the image complexity of the semantics. For example, when the semantics are "sky," the image complexity can be 1, indicating that the region has little information and low complexity. The corresponding mask can be 0, indicating that a smaller embedding strength value is used for that region. The established relationship is: semantics: sky, mask: 0.
[0074] For the obtained image regions, semantic labels are acquired, and mapping relationships are queried based on the semantic labels to obtain the mask of the image region. Based on the masks of each image region, an image coding mask is generated.
[0075] For all pixels in an image belonging to the same semantic meaning, they need to be assigned a consistent mask in the image coding mask to ensure that each image region is logically treated as an independent processing unit. This achieves the goal of embedding watermarks with the same embedding strength value within the same image region and with different embedding strength values for different image regions, allowing for different embedding strength values for watermarked images across image regions, thus realizing adaptive configuration of watermark embedding strength.
[0076] S205. Perform frequency domain decomposition on the original image to obtain a low-frequency component image.
[0077] S206. According to the embedding strength value corresponding to the mask in the image coding mask, the initial watermark image is embedded into the low-frequency component image to obtain the low-frequency watermark image; different masks in the image coding mask correspond to different embedding strength values.
[0078] In an optional embodiment, it further includes; Obtain the user's identity identifier; The identity identifier is subjected to error correction encoding and pixel scrambling encryption to obtain the encoding result; The encoded result is determined as the initial watermark image.
[0079] The identity identifier can be a identifier formed from a user's identity information. The identity identifier is used to uniquely identify a user.
[0080] Based on error-correcting coding algorithms, redundant check bits are inserted into the user's identity identifier according to the algorithm's mathematical rules. When the identity identifier's code is extracted, a verification algorithm can be used to check whether the data matches the redundant check bits, thus determining whether the identity identifier's code is corrupted.
[0081] If the encoding of an identity identifier is damaged, the original encoding of the damaged part of the identity identifier can be inferred based on the redundancy check bits and the verification algorithm, so as to calculate the correct identity identifier encoding.
[0082] After error correction encoding of the identity identifier, a scrambling sequence is generated through chaotic mapping or a pseudo-random number generator. Based on this sequence, the image pixel coordinates of the identity identifier containing redundant check bits are rearranged to complete spatial domain encryption and obtain the initial watermark image.
[0083] It is evident that by introducing error-correcting coding, the identity identifier can be verified and restored when subjected to noise interference or partial damage. At the same time, pixel scrambling encryption combined with chaotic mapping or pseudo-random sequences destroys the spatial correlation of the original image and disrupts the pixel distribution pattern, greatly enhancing the confidentiality and anti-attack capability of the data, thereby constructing an initial watermark image with both high reliability and high security.
[0084] S207. Perform frequency domain inverse transform on the low-frequency watermark image to obtain a synthetic watermark image.
[0085] The technical solution of this invention extracts texture features from the original image and performs semantic segmentation to divide it into multiple image regions. Then, it generates an image coding mask based on the mapping relationship between the image complexity corresponding to the semantics of each region and the mask. This allows the image coding mask to reflect the texture and complexity features of the original image. Image regions with different complexities correspond to different masks, while the masks within the same region remain consistent. This enables the watermark embedding strength value to be adjusted according to the mask based on the image region features, ensuring the adaptability of watermark embedding to image features.
[0086] In one specific embodiment, the steps for generating a digital watermark image are as follows: Figure 2B As shown, see Figure 2B .
[0087] The user's traceability information is obtained, and after error correction coding and obfuscation, an obfuscated binary code is generated. This obfuscated binary code is then used as the watermark image.
[0088] A residual neural network based on residual learning extracts features from the original image and forms a mask based on the extracted features. A second-order discrete wavelet transform is then used to perform frequency domain decomposition on the original image to obtain its low-frequency components.
[0089] Obfuscated binary codes are embedded in low-frequency components, where the embedding position and intensity are determined by a mask. Finally, an inverse frequency domain transform is performed to obtain the synthesized watermark image.
[0090] Figure 3 This is a schematic diagram of a digital watermark image generation system provided in an embodiment of the present invention. This embodiment of the present invention is applicable to the generation of digital watermark images. The system can execute a digital watermark image generation method and can be implemented in hardware and / or software.
[0091] See Figure 3 The digital watermark image generation system shown includes: Image acquisition module 301 is used to acquire the original image to which a watermark is to be added; The mask generation module 302 is used to generate an image encoding mask based on the image complexity of the original image; The frequency domain decomposition module 303 is used to perform frequency domain decomposition on the original image to obtain a low-frequency component image. The watermark embedding module 304 is used to embed the initial watermark image into the low-frequency component image according to the embedding intensity value corresponding to the mask in the image coding mask, so as to obtain a low-frequency watermark image; different masks in the image coding mask correspond to different embedding intensity values; The frequency domain reconstruction module 305 is used to perform frequency domain inverse transformation on the low-frequency watermark image to obtain a synthetic watermark image.
[0092] The technical solution of this invention generates an image coding mask based on the complexity of the original image, embeds the watermark into the low-frequency components of the image in the frequency domain, and achieves differentiated embedding of the watermark according to the embedding strength value corresponding to different masks in the image coding mask, so that the embedding strength of the watermark in the image matches the content features of the image itself; when faced with complex distortions in reality, decoding can be performed according to different embedding strengths, thereby improving the success rate and accuracy of watermark extraction.
[0093] In an optional embodiment, the mask generation module 302 includes: The feature extraction unit is used to extract texture features from the original image to obtain texture features; A semantic segmentation unit is used to perform semantic segmentation based on the texture features, dividing the original image into multiple image regions with different semantics; The mask generation unit is used to generate an image coding mask based on the mapping relationship between the image complexity of the semantics corresponding to the image region and the mask; the masks corresponding to the same image region are the same.
[0094] In an optional embodiment, the feature extraction unit includes: The shallow feature extraction unit is used to input the original image into the convolutional layer to extract shallow features and obtain shallow features; The deep feature extraction unit is used to input the shallow features into the residual layer for deep feature extraction to obtain deep features; The feature integration unit is used to input the deep features into the fully connected layer for feature integration to obtain texture features.
[0095] In an optional embodiment, it further includes: The identifier acquisition unit is used to acquire the user's identity identifier; An identification encoding unit is used to perform error correction encoding and pixel scrambling encryption on the identity identifier to obtain an encoding result; The watermark determination unit is used to determine the encoding result as the initial watermark image.
[0096] In an optional embodiment, it further includes: The watermark extraction module is used to analyze the synthesized watermark image using a watermark extraction model to determine the target watermark image; the watermark extraction model is obtained through training on watermark image samples; the watermark image samples include: ground truth watermark images and watermarked images formed by adding the ground truth watermark images.
[0097] In an optional embodiment, the watermark extraction module includes: The alternative watermark acquisition unit is used to parse the synthesized watermark image using a watermark extraction model to obtain at least one alternative watermark image. A decoding mask generation unit is used to generate an image decoding mask based on the image complexity of the synthesized watermark image; The watermark determination unit is used to filter each of the candidate watermark images according to the image decoding mask to obtain the target watermark image.
[0098] In an optional embodiment, the watermarked image is obtained by adding a watermark to the ground truth watermarked image and then processing it for distortion.
[0099] The digital watermark image generation system provided in this embodiment of the invention can execute the digital watermark image generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the digital watermark image generation method.
[0100] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0101] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for generating digital watermarked images, characterized in that, The method includes: Obtain the original image to which the watermark will be added; Based on the image complexity of the original image, an image coding mask is generated; The original image is decomposed in the frequency domain to obtain the low-frequency component image; According to the embedding strength value corresponding to the mask in the image coding mask, the initial watermark image is embedded into the low-frequency component image to obtain the low-frequency watermark image; different masks in the image coding mask correspond to different embedding strength values; The low-frequency watermark image is subjected to inverse frequency domain transformation to obtain a synthetic watermark image.
2. The method according to claim 1, characterized in that, The step of generating an image coding mask based on the original image includes: Texture features are extracted from the original image to obtain texture features; Based on the texture features, semantic segmentation is performed to divide the original image into multiple image regions with different semantics; An image coding mask is generated based on the mapping relationship between the semantic complexity of the image region and the mask; the mask is the same for the same image region.
3. The method according to claim 2, characterized in that, The process of extracting texture features from the original image to obtain texture features includes: The original image is input into a convolutional layer for shallow feature extraction to obtain shallow features; The shallow features are input into the residual layer for deep feature extraction to obtain deep features; The deep features are input into a fully connected layer for feature integration to obtain texture features.
4. The method according to claim 1, characterized in that, Also includes; Obtain the user's identity identifier; The identity identifier is subjected to error correction encoding and pixel scrambling encryption to obtain the encoding result; The encoded result is determined as the initial watermark image.
5. The method according to claim 1, characterized in that, After performing an inverse frequency domain transform on the low-frequency watermark image to obtain the synthesized watermark image, the process further includes: A watermark extraction model is used to analyze the synthesized watermark image to determine the target watermark image; the watermark extraction model is trained using watermark image samples; the watermark image samples include: ground truth watermark images and watermarked images formed by adding the ground truth watermark images.
6. The method according to claim 5, characterized in that, The watermarked image is obtained by adding a watermark to the ground truth watermarked image and then processing it for distortion.
7. The method according to claim 5, characterized in that, The step of using a watermark extraction model to analyze the synthesized watermark image and determine the target watermark image includes: A watermark extraction model is used to analyze the synthesized watermark image to obtain at least one candidate watermark image; Based on the image complexity of the synthesized watermark image, an image decoding mask is generated; Based on the image decoding mask, the candidate watermark images are filtered to obtain the target watermark image.
8. A digital watermark image generation system, characterized in that, The system includes: The image acquisition module is used to acquire the original image to which the watermark is to be added; A mask generation module is used to generate an image encoding mask based on the image complexity of the original image; The frequency domain decomposition module is used to decompose the original image in the frequency domain to obtain a low-frequency component image; The watermark embedding module is used to embed the initial watermark image into the low-frequency component image according to the embedding strength value corresponding to the mask in the image coding mask, so as to obtain a low-frequency watermark image; different masks in the image coding mask correspond to different embedding strength values; The frequency domain reconstruction module is used to perform inverse frequency domain transformation on the low-frequency watermark image to obtain a synthetic watermark image.