Image watermarking method and system based on self-supervised visual model-guided decoding
By using a self-supervised visual model to guide the decoding method and leveraging semantic understanding capabilities to replace traditional geometric synchronization, the problem of dependence on positioning masks in existing technologies is solved, and robust decoding under complex distortion is achieved, improving the robustness and invisibility of image watermarks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGSHA YIYUE TECHNOLOGY CO LTD
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-21
AI Technical Summary
Existing anti-printing image watermarking technologies rely too heavily on location masks, resulting in poor decoding robustness when mask prediction is inaccurate, especially decoding failure under complex geometric distortions.
A self-supervised visual model-guided decoding method is adopted, which utilizes the semantic understanding capability of deep visual models. Through the distortion-guided heatmap generated by self-supervised training and the pre-trained self-supervised semantic feature extraction network, end-to-end robust decoding without correction is achieved.
Completely eliminating the reliance on positioning masks improves the system's robustness and reliability in real-world printing and shooting scenarios, enabling it to resist complex asynchronous distortions and enhancing the robustness and invisibility of image watermarks.
Smart Images

Figure CN121504703B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital information security and image processing, and specifically relates to an image watermarking method and system based on self-supervised visual model-guided decoding. Background Technology
[0002] With the widespread use of smartphones and printing devices, the problem of printed content leakage caused by print-shooting is becoming increasingly serious, posing a significant threat to digital rights management and confidential data security. Print-shooting is characterized by unpredictable viewing angles, a wide variety of devices (such as smartphones and tablets), and ambient light interference, which can introduce asynchronous geometric distortions (such as perspective, rotation, and scaling) and pixel-level distortions (such as moiré patterns, sensor noise, optical blur, and exposure differences) into the image. These distortions are non-linear, highly complex, and difficult to describe precisely with simple mathematical models. Therefore, print-shooting resistant image watermarking technology has become particularly important in the fields of digital rights management and confidential data security. Existing print-shooting resistant image watermarking technologies include localization masking techniques that rely on explicit (such as visible bounding boxes) and implicit (such as invisible positioning markers). Their core idea is to solve the synchronization problem caused by asynchronous geometric distortions in print-shooting scenarios. These methods typically require a two-stage process: first, estimating a localization mask or key point in the distorted image; then, performing geometric correction (such as perspective transformation) based on the estimated location information to "straighten" the distorted image; finally, decoding the watermark information on the corrected image. Existing anti-printing image watermarking techniques suffer from fundamental vulnerabilities. Their effectiveness is highly dependent on the accuracy of the localization mask estimation. Accurately locating the mask or key point under complex printing distortion is extremely difficult. Even slight deviations in mask prediction can be amplified during subsequent geometric correction, leading to pixel misalignment in the corrected image, ultimately causing confusion in the decoder's input information and resulting in decoding failure. Therefore, how to eliminate reliance on this error-prone and sensitive localization mask and geometric correction steps is a critical technical challenge that urgently needs to be addressed in current anti-printing image watermarking technologies. Summary of the Invention
[0003] The technical problem to be solved by this invention is to provide an image watermarking method and system based on self-supervised visual model-guided decoding, which addresses the above-mentioned problems in the prior art. This invention aims to solve the problem that existing anti-printing and shooting watermarking technologies rely too much on positioning masks, resulting in poor decoding robustness when mask prediction is inaccurate (especially under complex geometric distortion). This invention utilizes the semantic understanding capability of deep visual models to replace traditional geometric synchronization, achieving end-to-end, correction-free robust decoding.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0005] An image watermarking method based on self-supervised visual model-guided decoding includes the following steps:
[0006] S101, obtain the watermark information m and the original image I of each data sample in the training dataset;
[0007] S102, for each data sample, the watermark information m is preprocessed to generate a message tensor M, and the original image I is degraded and distorted to generate a distorted guided heatmap DGH, thus obtaining the preprocessed training dataset.
[0008] S103, the self-supervised visual model is trained using the preprocessed training dataset. The self-supervised visual model includes an encoder, a printing noise layer, a decoder, and a pre-trained self-supervised semantic feature extraction network. The processing for each data sample in the self-supervised training includes: ① Encoding the message tensor M, the distortion guide heatmap DGH, and the original image I of the data sample using the encoder to obtain the corresponding watermark image. ② Use printing to capture the noise layer to remove the watermark image. Degradation and distortion processing is performed to generate distorted images. ;Utilizing a pre-trained self-supervised semantic feature extraction network to extract watermark images Extracting spatial attention maps ③ Use a decoder to convert the distorted image Decode to generate watermark information ④ Optimize and update the model parameters of the self-supervised visual model according to a preset loss function, wherein the preset loss function includes the watermark information m of the training samples and the decoded watermark information. The loss between them is calculated; finally, a self-supervised visual model is obtained after training, which is used in the inference stage to encode the corresponding watermark image based on the input message tensor M, the distortion-guided heatmap DGH, and the original image I. .
[0009] Optionally, in step S102, preprocessing the watermark information m to generate the message tensor M includes: mapping the watermark information m of length L bits to a high-dimensional vector through a fully connected layer and reshaping it into a spatial grid shape of a specified size, and then upsampling the reshaped features to the resolution size required by the encoder input to serve as the generated message tensor M.
[0010] Optionally, in step S102, generating a distorted guided heatmap DGH from the original image I includes:
[0011] S201, the original image Degradation processing is performed to generate distorted images. ;
[0012] S202, for the original image and distorted images Using horizontal gradient operators respectively With vertical gradient operator Convolution operation is performed to obtain the coordinates of each pixel in the original image I. Horizontal and vertical gradient responses at:
[0013] ; ;
[0014] ; ;
[0015] in, and Original images Pixel coordinates The horizontal and vertical gradient responses at each pixel coordinate The horizontal and vertical gradient responses at the location; and Distorted images Pixel coordinates The horizontal and vertical gradient responses at each pixel coordinate The horizontal and vertical gradient responses at the location;
[0016] S203, calculate the original image at the pixel level. and distorted images Differences in gradient response between them:
[0017] ;
[0018] in, Original image and distorted images pixel coordinates Difference in gradient response at location, The type or configuration of the gradient operator used in the convolution operation to calculate the difference in gradient responses;
[0019] S204, the original image Divide into several window sets according to the preset window size. and for each window The gradient response differences within each window are statistically analyzed, and the average value of the pixel gradient response differences within each window is calculated:
[0020] ;
[0021] in, For the first The average value of pixel gradient response differences within a window. For the first The number of pixels within a window;
[0022] S205, the average value of the pixel gradient response difference in each window is processed by spatial smoothing and normalization, so as to obtain the distortion guided heatmap DGH composed of the normalized processing results of each window.
[0023] Optionally, in step S205, the function expression for the normalization process is:
[0024] ;
[0025] in, For the first The normalization result of each window. The constant coefficients, For the first Pixels within a window Gradient response differences The average value is obtained by spatial smoothing.
[0026] Optionally, the encoder is used to encode the message tensor M, the distorted guided heatmap DGH, and the original image I of the data sample to obtain the corresponding watermark image. include:
[0027] S301, concatenate the message tensor M, the distortion-guided heatmap DGH and the original image I in the channel dimension into an input tensor;
[0028] S302, perform a two-dimensional Fourier transform on the input tensor to obtain the frequency features;
[0029] S303 multiplies the frequency characteristic by the gain To enhance high-frequency components, among which These are the weighting coefficients. For smooth gated functions, The radial frequency is the frequency magnitude in the two-dimensional frequency domain, extending from the center of the spectrum outwards along the radial direction.
[0030] S304, perform a two-dimensional inverse Fourier transform on the frequency characteristics after enhancing the high-frequency components to obtain the frequency-enhanced tensor.
[0031] S305, calculate the difference between the input tensor and the frequency-enhanced tensor; use the difference to obtain the residual perturbation of the original image I using a pre-trained U-Net or ResNet network;
[0032] S306, the residual perturbation is fused with the original image I according to the following formula to obtain the watermark image corresponding to the original image I:
[0033] ;
[0034] in, This is the watermark image corresponding to the original image I. To integrate weights, It is the hyperbolic tangent function. This is the residual disturbance.
[0035] Optionally, the loss in the preset loss function includes image loss and message loss, wherein the message loss includes the watermark information m of the training samples and the decoded watermark information. The loss between the training samples; the image loss includes the original image I and its watermark image. The pixel loss, structural similarity loss, and semantic loss are partially or fully included.
[0036] Optionally, the degradation distortion processing includes randomly performing some or all of the following: perspective distortion, lighting distortion, moiré simulation, motion or Gaussian blur, Gaussian noise, and JPEG compression.
[0037] The present invention also provides an image watermarking system based on self-supervised visual model guided decoding, comprising a microprocessor and a memory interconnected thereto, wherein the microprocessor is programmed or configured to execute the image watermarking method based on self-supervised visual model guided decoding.
[0038] The present invention also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the image watermarking method based on self-supervised visual model guided decoding by a processor.
[0039] The present invention also provides a computer program product, including a computer program or instructions that are programmed or configured to execute the image watermarking method based on self-supervised visual model guided decoding via a processor.
[0040] Compared with existing technologies, the present invention mainly achieves the following beneficial effects: To solve the problem that existing anti-printing watermarking technologies rely too heavily on positioning masks, resulting in poor decoding robustness when mask prediction is inaccurate (especially under complex geometric distortion), the present invention implements a mask-free anti-printing robust image watermarking technology, which has the following advantages:
[0041] 1. Mask-Free and Robust: This invention completely eliminates the reliance on explicit or implicit location masks, fundamentally avoiding decoding failures caused by mask prediction errors and amplified geometric correction errors. This invention can directly process images with severe geometric distortion, significantly improving the system's robustness and reliability in real-world printing and shooting scenarios.
[0042] 2. Semantic guidance can resist complex asynchronous distortion: This invention uses a pre-trained self-supervised semantic feature extraction network to extract a spatial attention map from the watermark image as a viewpoint-stabilized semantic prior to guide decoding. This is a novel approach that replaces "geometric alignment" with "semantic alignment", which is more resistant to complex asynchronous distortion than traditional geometric coordinate-based correction methods.
[0043] 3. Superior Encoding Performance: This invention proactively enhances the robustness and invisibility of the watermark during the encoding stage through a noise-aware encoding module (distortion-guided heatmap DGH and frequency enhancement) and semantic consistency constraints. This makes the embedded watermark inherently more resistant, further improving end-to-end system performance. The combination of these technologies allows the semantic understanding capabilities of deep vision models to replace traditional geometric synchronization, achieving robust, end-to-end decoding without correction. This can be widely applied to image processing in fields such as copyright tracking, leak tracing, and legal evidence collection. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the basic process of the method in an embodiment of the present invention.
[0045] Figure 2 This is a schematic diagram of the network structure of the self-supervised visual model in an embodiment of the present invention. Detailed Implementation
[0046] The core insight of this invention is that although the geometry of an image changes drastically after printing and photography, its core semantic content (such as the main object in the image) remains consistent "to" humans or powerful visual models. This invention utilizes a pre-trained self-supervised semantic feature extraction network to extract spatial attention maps from the watermark image as a view-stable semantic prior, which identifies the most important content regions in the image. This invention uses this prior to guide the decoder to directly recover the watermark information from the original, geometrically distorted image without any form of localization masking or geometric correction. To enable those skilled in the art to better understand the technical solution of this invention, the following will provide a more detailed description of the technical solution of this invention in conjunction with the accompanying drawings of the embodiments.
[0047] like Figure 1 As shown, the image watermarking method based on self-supervised visual model-guided decoding in this embodiment includes the following steps:
[0048] S101, obtain the watermark information m and the original image I of each data sample in the training dataset;
[0049] S102, for each data sample, the watermark information m is preprocessed to generate a message tensor M, and the original image I is degraded and distorted to generate a distortion-guided heatmap DGH, thus obtaining the preprocessed training dataset.
[0050] S103, Self-supervised training of the self-supervised visual model is performed using the preprocessed training dataset;
[0051] like Figure 2 As shown, the self-supervised vision model includes an encoder, a printing and shooting noise layer, a decoder, and a pre-trained self-supervised semantic feature extraction network. The processing for each data sample during self-supervised training includes:
[0052] ① The message tensor M, the distortion-guided heatmap DGH, and the original image I of the data sample are encoded using an encoder to obtain the corresponding watermark image. ;
[0053] ② Use printing to capture the noise layer to remove the watermark image Degradation and distortion processing is performed to generate distorted images. ;Utilizing a pre-trained self-supervised semantic feature extraction network to extract watermark images Extracting spatial attention maps ;
[0054] ③ Use a decoder to convert the distorted image Decode to generate watermark information ;
[0055] ④ Optimize and update the model parameters of the self-supervised visual model according to a preset loss function, wherein the preset loss function includes the watermark information m of the training samples and the decoded watermark information. The losses between;
[0056] The final trained self-supervised visual model is used to encode the corresponding watermark image based on the input message tensor M, the distortion-guided heatmap DGH, and the original image I during the inference phase. .
[0057] The encoder is used for noise-aware encoding to efficiently and robustly embed watermark information into the original image, giving it an "active defense" against distortion during the embedding stage.
[0058] In step S102 of this embodiment, preprocessing the watermark information m to generate a message tensor M includes: mapping the L-bit watermark information m into a high-dimensional vector through a fully connected layer and reshaping it into a spatial grid shape of a specified size; then upsampling the reshaped features to the resolution required for the encoder input to use as the generated message tensor M. This spatialization process helps the subsequent encoder to align and fuse the message bits with the spatial features of the image (such as texture and edges). Specifically, in this embodiment, the L-bit binary message... The vector is mapped to a high-dimensional vector through a fully connected layer and then reshaped into a spatial grid (size 1). The data is then upsampled to a resolution that matches the encoder input, forming the message tensor M.
[0059] In this embodiment, the original image I undergoes degradation and distortion processing to generate a Distortion-Guided Heatmap (DGH). By simulating pixel-level degradation common in printing and shooting (such as JPEG compression, blurring, and noise) in advance, the Distortion-Guided Heatmap (DGH) is used to identify areas in the image that are highly resistant to these distortions (usually high-frequency edges and textured areas, rather than flat color blocks). The encoder uses the Distortion-Guided Heatmap (DGH) as spatial weighting to adaptively embed more watermark information into these stable areas, thereby improving the robustness of the watermark at the source. Specifically, in step S102 of this embodiment, generating the Distortion-Guided Heatmap (DGH) from the original image I includes:
[0060] S201, the original image Degradation processing is performed to generate distorted images. ; the original image Degradation processing is performed to generate distorted images. It can be utilized through a differentiable distortion operator. To synthesize its degenerate version, it can be represented as:
[0061] ;
[0062] The distortion operator The simulation included some or all of the following: perspective distortion (simulating angle), lighting distortion (simulating ambient light), moiré pattern simulation, motion or Gaussian blur, Gaussian noise, and JPEG compression. Distortion operation configured;
[0063] S202, for the original image and distorted images Using horizontal gradient operators respectively With vertical gradient operator Convolution operation is performed to obtain the coordinates of each pixel in the original image I. Horizontal and vertical gradient responses at:
[0064] ; ;
[0065] ; ;
[0066] in, and Original images Pixel coordinates The horizontal and vertical gradient responses at each pixel coordinate The horizontal and vertical gradient responses at the location; and Distorted images Pixel coordinates The horizontal and vertical gradient responses at each pixel coordinate The horizontal and vertical gradient responses at the location;
[0067] S203, calculate the original image at the pixel level. and distorted images Differences in gradient response between them:
[0068] ;
[0069] in, Original image and distorted images pixel coordinates Difference in gradient response at location, The type or configuration of the gradient operator used in the convolution operation to calculate gradient response differences; by calculating the original image and distorted images Difference in gradient response between To quantify the robustness of each pixel, intuitively, regions with small gradient response differences (such as strong edges and complex textures) mean that the structural information of the region can still be preserved after distortion, making them ideal locations for embedding watermarks; while regions with large differences (such as flat regions) are more susceptible to noise.
[0070] S204, the original image Divide into several window sets according to the preset window size. and for each window The gradient response differences within each window are statistically analyzed, and the average value of the pixel gradient response differences within each window is calculated:
[0071] ;
[0072] in, For the first The average value of pixel gradient response differences within a window. For the first The number of pixels within a window;
[0073] S205, the average value of the pixel gradient response difference in each window is processed by spatial smoothing and normalization to obtain the distortion guided heatmap DGH composed of the normalized processing results of each window. Pixels (edges and textures) with high scores in the distortion guided heatmap DGH represent regions that are more stable under distortion.
[0074] In step S205 of this embodiment, the function expression for the normalization process is:
[0075] ;
[0076] in, For the first The normalization result of each window. The constant coefficients, For the first Pixels within a window Gradient response differences The average value is obtained by spatial smoothing (such as Gaussian filtering).
[0077] In this embodiment, an encoder is used to encode the message tensor M, the distorted guided heatmap DGH, and the original image I of the data sample to obtain the corresponding watermark image. Specifically, this is achieved through a Frequency Enhancement Module (FEM). The FEM leverages the human visual system's (HVS) insensitivity to high-frequency signals (such as fine textures) but its high sensitivity to subtle perturbations in low-frequency signals (such as large color blocks). This module actively directs the energy of the watermark signal to the high-frequency components of the image. This not only makes the watermark less perceptible to the naked eye (improving its invisibility) but also makes it more resilient to blurring (a low-pass filtering effect) common in printing and photography. Specifically, the message tensor M of the data sample, the distortion-guided heatmap DGH, and the original image I are encoded to obtain the corresponding watermark image. include:
[0078] S301, concatenate the message tensor M, the distortion-guided heatmap DGH, and the original image I along the channel dimension to form the input tensor. , can be represented as: ,in" "This is a splicing operation." Distortionate guide heatmap DGH;
[0079] S302, input tensor Perform two-dimensional Fourier transform Obtain frequency characteristics ;
[0080] S303 multiplies the frequency characteristic by the gain To enhance high-frequency components, among which These are the weighting coefficients. For smooth gating functions (such as the Sigmoid function). The radial frequency is the frequency magnitude in the two-dimensional frequency domain, extending from the center of the spectrum outwards along the radial direction.
[0081] S304 performs a two-dimensional inverse Fourier transform on the frequency characteristics after enhancing the high-frequency components. The frequency-enhanced tensor can be represented as: This allows the watermark energy to be directed to the high-frequency region in a controlled manner, rather than being embedded "flatly" across all frequencies;
[0082] S305: Calculate the difference between the input tensor and the frequency-enhanced tensor; use the difference to obtain the residual perturbation of the original image I using a pre-trained U-Net network (or ResNet network); the U-Net network extracts features through downsampling paths and fuses multi-scale features through upsampling paths and skip connections to finally generate the residual perturbation; it should be noted that the U-Net network is an existing network model, so its implementation details will not be described in detail here.
[0083] S306, the residual perturbation is fused with the original image I according to the following formula to obtain the watermark image corresponding to the original image I:
[0084] ;
[0085] in, This is the watermark image corresponding to the original image I. To integrate weights, It is the hyperbolic tangent function. This is the residual disturbance.
[0086] In this embodiment, a print shooting noise layer is used to mask the watermark image. A series of random and differentiable transformations are applied to simulate real-world printing distortion, generating distorted images. The printed imaging noise layer acts as a bridge between the encoder and decoder, randomly applying a series of complex distortion operations, including:
[0087] Perspective Distortion: Simulates different shooting angles;
[0088] Illumination Variation: Simulates uneven brightness between ambient light and printed materials;
[0089] Moiré pattern simulation: Simulating the interference between printed materials and camera sensor meshes;
[0090] Motion or Gaussian blur: simulates camera shake or defocus;
[0091] Gaussian noise: analog sensor noise;
[0092] JPEG compression: Analog image storage;
[0093] These actions bridge the gap between simulation training and the real physical world (i.e., the "sim-to-real" gap), forcing the encoder to generate more robust watermarks and training the decoder to extract information from heavily distorted images. During training, the intensity of these distortions is controlled by a scheduling function with each training step (t). (in The "curricular learning" strategy, which gradually increases the length of the model (which is set to a preset value), helps stabilize the training process. The model first learns to fight against minor distortions and then gradually transitions to fighting against more severe compound distortions.
[0094] The self-supervised semantic feature extraction network and the decoder together constitute the decoding module (DINOv2-GuidedDecoding Module), used to extract semantic features from distorted images. Recover the decoded watermark information This module is the core of the method in this embodiment, responsible for extracting watermarks "mask-independently" from distorted images obtained through printing. To obtain viewpoint-stable semantic priors, this embodiment utilizes a pre-trained and frozen (not participating in training) self-supervised semantic feature extraction network to extract features (spatial attention maps) from the distorted images. The self-supervised semantic feature extraction network learns through self-distillation and other methods, generating attention maps with strong viewpoint consistency. Even with drastic changes in shooting angle and lighting, its highly attentional regions (usually the semantic subjects of the image) remain stable. This embodiment completely abandons the traditional "localization-correction-decoding" paradigm. Instead, it uses the attention map generated by the self-supervised semantic feature extraction network (as a semantic prior) and the original distorted image as input to the decoder (e.g., concatenating them along the channel dimension). The decoder is guided (e.g., through attention mechanisms or direct feature fusion) to focus on semantically stable regions (i.e., spatial attention maps). The high-resolution regions in the image are used to decode the watermark information. The implicit assumption is that the watermark signal embedded in these semantic entities by the encoder is most likely to be preserved and recognized after distortion. The self-supervised semantic feature extraction network can adopt the desired network model as needed; for example, as an optional implementation, the DINOv2 model is used in this embodiment to extract the spatial attention map. Used as deep features. Distorted images The input is fed into a pre-trained, parameter-frozen DINOv2 model. The DINOv2 model learns its attention mechanism to focus on the truly semantically meaningful parts of the image through self-supervised learning (such as self-distillation). Its final self-attention map is extracted and processed into a single-channel spatial attention map. This spatial attention map This represents the semantically most salient and stable region in the image, unaffected by severe geometric distortion. This embodiment does not perform any geometric correction based on the four-corner coordinates. Instead, it compares the attention map A generated by DINOv2 with the distorted image. Concatenate along the channel dimension to form a four-channel tensor. This 4-channel tensor serves as the input to the decoder. It simultaneously provides the decoder with information about "what the image looks like" ( ) and "Where should we focus our attention?" (spatial attention map) The information is as follows. In this embodiment, the decoder D is a layered CNN network (e.g., composed of multiple ResBlock+CBAM modules stacked together). This network processes the input tensor fused with semantic prior IOR, progressively downsampling and extracting features. Attention modules such as CBAM can use the A channel of the input to dynamically adjust the spatial weights of subsequent feature maps. Finally, through a global average pooling layer, a fully connected layer (DenseLayer), and a sigmoid activation function, the L-bit recovery message probability is output. By using attention map A as input, the decoder network learns during training to utilize this "semantic guide" and automatically pay more attention to regions that retain more information after distortion (especially geometric distortion) (i.e., regions that the DINOv2 model considers important), thereby achieving robust decoding.
[0095] To ensure semantic consistency during the encoding process, this embodiment employs a loss function to guarantee that watermark embedding does not compromise the semantic consistency of the original image. This prevents the encoder from generating visual artifacts that could interfere with the understanding of the self-supervised semantic feature extraction network (DINOv2 model) in order to embed information. Specifically, the loss function in this embodiment includes image loss and message loss, which can be expressed as:
[0096] ;
[0097] in, To obtain the total loss, To balance the weights, For the loss of information, Image loss.
[0098] In this embodiment, the message loss includes the watermark information m of the training samples and the decoded watermark information. The loss between; as an optional implementation, in this embodiment, the watermark information m and the decoded watermark information The specific loss between them is the binary cross-entropy (BCE) loss. :
[0099] ;
[0100] in, For the sample size, For the watermark information m of sample i, Decoding watermark information for sample i .
[0101] To ensure invisibility, the image loss in this embodiment includes the original image I of the training samples and its watermark image. The pixel loss, structural similarity loss, and semantic loss between them are:
[0102] ;
[0103] ;
[0104] ;
[0105] in, It is a pixel-level L2 loss used to ensure that the absolute difference in pixel values is small. For structural similarity loss, Structural similarity is used to ensure that the brightness, contrast, and structure of images are perceptually similar. For semantic loss, For cosine similarity, This is a self-supervised semantic feature extraction network. The computation is performed using a self-supervised semantic feature extraction network. Extract the original image I and its watermark image. Features and The cosine similarity between the watermarks ensures that the watermark does not alter the deep semantics of the image, which is crucial for the decoder to utilize self-supervised semantic feature extraction network guidance. Training employs a phased scheduling: the early stages (e.g., 0-5k steps) primarily optimize the message loss. Ensure the network learns encoding and decoding first; gradually introduce balancing weights in the mid-term (e.g., 5k-20k steps). A weaker noise layer balances the invisibility; in later stages (>20k steps), the strength of the noise layer is gradually increased, forcing the network to learn robustness.
[0106] To verify the effectiveness of the image watermarking method based on self-supervised visual model-guided decoding in this embodiment, extensive experiments were conducted. The experiments primarily evaluated the method from two dimensions: invisibility (visual quality) and robustness (resistance to attacks), and verified the performance of each core module (semantic loss). The contributions of the Distortion Guided Heatmap (DGH) and the Frequency Enhancement Module (FEM) are shown in Tables 1 to 7. The FEM is the functional module of step S303 above.
[0107] Table 1: Comparison of visual quality under different module configurations (ablation experiment)
[0108]
[0109] Table 1 presents the results of the ablation experiments, comparing the results in removing semantic guidance. The visual quality of the image changes when the Distortion Guided Heatmap (DGH) or Frequency Enhancement Module (FEM) is removed. Data shows that the complete configuration in this embodiment achieves the best visual effect, with a peak signal-to-noise ratio (PSNR) of 38.8 dB and a structural similarity loss (SSIM) of 0.985. Removing the Distortion Guided Heatmap (DGH) has the greatest impact on visual quality, causing the PSNR to drop to 30.2 dB, demonstrating the importance of the collaborative work of each module in maintaining high image quality.
[0110] Table 2: Whether to use semantic loss removal Robustness comparison at different shooting distances
[0111]
[0112] Table 2 analyzes semantic loss. The impact of different shooting distances (20cm to 60cm) on decoding accuracy. Results show that using semantic loss... It can significantly improve robustness, maintaining accuracy above 99.2% across all distances; without semantic loss. The accuracy fluctuated between 91.7% and 95.1%, indicating the effectiveness of semantic priors in resisting changes in distance.
[0113] Table 3: Whether semantic loss was used Robustness comparison under different shooting angles
[0114]
[0115] Table 3 tests the anti-interference capability of the semantic guidance module at different shooting angles from 0° to 40°. The data highlights the key role of this module in dealing with perspective distortion: when shooting at a large angle of 40°, the accuracy rate drops sharply to 77.1% without using the module, while the accuracy rate remains at a high level of 97.6% after using it.
[0116] Table 4: Robustness comparison of DGH at different shooting distances with and without distortion-guided thermal imaging at different shooting distances
[0117]
[0118] Table 4 compares the decoding performance of DGH with and without distortion guide at different shooting distances. The results show that the system is more stable after introducing distortion guide DGH, and the accuracy at all distances is improved to over 99.2%, which is better than the lowest performance of 95.1% without distortion guide DGH. This verifies that DGH can enhance the robustness of watermarks in both close-range and long-range shooting.
[0119] Table 5: Robustness comparison of different shooting angles with and without DGH
[0120]
[0121] Table 5 evaluates the contribution of Distortion Guided Heatmap (DGH) in dealing with shooting angle variations from 0° to 40°. Experiments show that Distortion Guided Heatmap (DGH) helps maintain information integrity when the angle is tilted. The accuracy rate of the scheme using Distortion Guided Heatmap (DGH) at 40° is 97.6%, higher than the 96.8% without it, demonstrating its auxiliary defensive role under complex geometric distortions.
[0122] Table 6: Robustness comparison of FEM with and without frequency enhancement module at different shooting distances
[0123]
[0124] Table 6 shows the robustness gain of the frequency enhancement module (FEM) at different shooting distances. The data shows that the FEM improves the system's performance at all distances, maintaining an accuracy of over 99%. Removing the FEM reduces the accuracy (down to a minimum of 97.7%), indicating that enhancing the high-frequency signal helps resist signal attenuation caused by shooting.
[0125] Table 7: Robustness comparison of FEM with and without frequency enhancement module at different shooting angles
[0126]
[0127] Table 7 focuses on the performance of the frequency enhancement module (FEM) at different shooting angles. The results show that the frequency enhancement module is crucial for resisting large-angle perspective distortion. At a shooting angle of 40°, the accuracy drops to 87.7% without the frequency enhancement module, while the accuracy significantly recovers to 97.6% after using the frequency enhancement module.
[0128] Furthermore, this embodiment also provides an image watermarking system based on self-supervised visual model-guided decoding, including a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to execute the image watermarking method based on self-supervised visual model-guided decoding. This embodiment also provides a computer-readable storage medium storing a computer program or instructions programmed or configured to execute the image watermarking method based on self-supervised visual model-guided decoding via a processor. This embodiment also provides a computer program product including a computer program or instructions programmed or configured to execute the image watermarking method based on self-supervised visual model-guided decoding via a processor.
[0129] Those skilled in the art will understand that the technical solutions provided by this invention may take the form of a method, system, or computer program product. Therefore, this invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this invention may take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce an implementation of the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0130] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. An image watermarking method based on self-supervised visual model-guided decoding, characterized in that, Includes the following steps: S101, obtain the watermark information m and the original image I of each data sample in the training dataset; S102, for each data sample, the watermark information m is preprocessed to generate a message tensor M, and the original image I is degraded and distorted to generate a distorted guided heatmap DGH, thus obtaining the preprocessed training dataset. S103, the self-supervised visual model is trained using the preprocessed training dataset. The self-supervised visual model includes an encoder, a printing noise layer, a decoder, and a pre-trained self-supervised semantic feature extraction network. The processing for each data sample in the self-supervised training includes: ① Encoding the message tensor M, the distortion guide heatmap DGH, and the original image I of the data sample using the encoder to obtain the corresponding watermark image. ② Use printing to capture the noise layer of the watermark image Degradation and distortion processing is performed to generate distorted images. ;Utilizing a pre-trained self-supervised semantic feature extraction network to extract watermark images Extracting spatial attention maps ③ Use a decoder to convert the distorted image Decode to generate watermark information ④ Optimize and update the model parameters of the self-supervised visual model according to a preset loss function, wherein the preset loss function includes the watermark information m of the training samples and the decoded watermark information. The loss between them is calculated; finally, a self-supervised visual model is obtained after training, which is used in the inference stage to encode the corresponding watermark image based on the input message tensor M, the distortion-guided heatmap DGH, and the original image I. ; In step S102, generating a distorted guided heatmap DGH from the original image I includes: S201, the original image Degradation processing is performed to generate distorted images. ; S202, for the original image and distorted images Using horizontal gradient operators respectively With vertical gradient operator Convolution operation is performed to obtain the coordinates of each pixel in the original image I. Horizontal and vertical gradient responses at: ; ; ; ; in, and Original images Pixel coordinates The horizontal and vertical gradient responses at each pixel coordinate The horizontal and vertical gradient responses at the location; and Distorted images Pixel coordinates The horizontal and vertical gradient responses at each pixel coordinate The horizontal and vertical gradient responses at the location; S203, calculate the original image at the pixel level. and distorted images Differences in gradient response between them: ; in, Original image and distorted images pixel coordinates Difference in gradient response at location, The type or configuration of the gradient operator used in the convolution operation to calculate the difference in gradient responses; S204, the original image Divide into several window sets according to the preset window size. and for each window The gradient response differences within each window are statistically analyzed, and the average value of the pixel gradient response differences within each window is calculated: ; in, For the first The average value of pixel gradient response differences within a window. For the first The number of pixels within a window; S205, the average value of the pixel gradient response difference in each window is processed by spatial smoothing and normalization, so as to obtain the distortion guided heatmap DGH composed of the normalized processing results of each window.
2. The image watermarking method based on self-supervised visual model-guided decoding according to claim 1, characterized in that, In step S102, the preprocessing of the watermark information m to generate the message tensor M includes: mapping the watermark information m of length L bits to a high-dimensional vector through a fully connected layer and reshaping it into a spatial grid shape of a specified size, and then upsampling the reshaped features to the resolution size required by the encoder input as the generated message tensor M.
3. The image watermarking method based on self-supervised visual model-guided decoding according to claim 1, characterized in that, In step S205, the function expression for the normalization process is: ; in, For the first The normalization result of each window. The constant coefficients, For the first Pixels within a window Gradient response differences The average value is obtained by spatial smoothing.
4. The image watermarking method based on self-supervised visual model-guided decoding according to claim 1, characterized in that, The encoder is used to encode the message tensor M, the distorted guided heatmap DGH, and the original image I of the data sample to obtain the corresponding watermark image. include: S301, concatenate the message tensor M, the distortion-guided heatmap DGH and the original image I in the channel dimension into an input tensor; S302, perform a two-dimensional Fourier transform on the input tensor to obtain the frequency features; S303 multiplies the frequency characteristic by the gain To enhance high-frequency components, among which These are the weighting coefficients. For smooth gated functions, The radial frequency is the frequency magnitude in the two-dimensional frequency domain, extending from the center of the spectrum outwards along the radial direction. S304, perform a two-dimensional inverse Fourier transform on the frequency characteristics after enhancing the high-frequency components to obtain the frequency-enhanced tensor. S305, calculate the difference between the input tensor and the frequency-enhanced tensor; use the difference to obtain the residual perturbation of the original image I using a pre-trained U-Net or ResNet network; S306, the residual perturbation is fused with the original image I according to the following formula to obtain the watermark image corresponding to the original image I: ; in, This is the watermark image corresponding to the original image I. To integrate weights, It is the hyperbolic tangent function. This is the residual disturbance.
5. The image watermarking method based on self-supervised visual model-guided decoding according to claim 1, characterized in that, The preset loss function includes image loss and message loss, whereby the message loss includes the watermark information m of the training samples and the decoded watermark information. The loss between the training samples; the image loss includes the original image I and its watermark image. The pixel loss, structural similarity loss, and semantic loss are partially or fully included.
6. The image watermarking method based on self-supervised visual model-guided decoding according to claim 5, characterized in that, The degradation distortion processing includes randomly performing some or all of the following: perspective distortion, lighting distortion, moiré simulation, motion or Gaussian blur, Gaussian noise, and JPEG compression.
7. An image watermarking system based on self-supervised visual model-guided decoding, comprising a microprocessor and a memory interconnected, characterized in that, The microprocessor is programmed or configured to execute the image watermarking method based on self-supervised visual model guided decoding as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the image watermarking method based on self-supervised visual model guided decoding as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute, via a processor, the image watermarking method based on self-supervised visual model guided decoding as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and device based on cross-domain feature alignment, equipment and medium
CN120543992A
Diffusion model robust watermarking method based on affine coupling flow accurate coding
CN120746810A