Watermark model training method and system based on multi-scale texture complexity guidance
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-11
AI Technical Summary
这类方法仅聚焦单一模型单项性能提升,无法同时兼容通用鲁棒水印、人脸取证水印、可逆水印等不同架构,不具备普适优化价值
Smart Images

Figure CN122551101A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network and information security technology, specifically to a watermarking model training method and system based on multi-scale texture complexity guidance. Background Technology
[0002] The rapid popularization of generative AI technology has triggered a series of information security issues, including deepfake facial forgery, illegal multimedia tampering, and copyright infringement. Digital watermarking, as a key technology for proactive forensics, embeds invisible identity information into original content, enabling functions such as source tracing, evidence collection, and detection. The deep watermarking framework is basically composed of an encoder, a noise layer, and a decoder to recover the watermark information. With its advantages of end-to-end joint optimization, controllable robustness, and strong scenario adaptability, it is gradually replacing traditional manual feature watermarking and has become the mainstream technology.
[0003] However, whether for general natural scenes or face-specific forensics scenarios, existing deep watermarking methods generally use the mean square error (MSE) of the carrier image before and after watermark embedding and the watermarked image as the core loss function. They ensure the visual invisibility of the watermark by constraining pixel-level embedding distortion and adopt a uniform embedding intensity, ignoring the multi-scale characteristics of image texture. The core problem arising from this is that it is difficult to balance watermark concealment and robustness: a single global intensity cannot simultaneously meet the visual quality requirements of smooth areas and the robustness requirements of complex areas—smooth areas are sensitive to pixel perturbations, and excessive embedding can easily lead to visual distortion; complex areas are not sensitive to perturbations, and insufficient embedding will reduce the robustness of the watermark.
[0004] For texture-aware watermarking, existing preliminary attempts include traditional methods like HUGO for high-dimensional image models, ABDH based on attention mechanisms, ARWGAN which improves watermarking performance through feature fusion and attention masks, and IGA based on inverse gradient attention. However, these methods still lack explicit definitions of texture complexity and multi-scale, multi-dimensional texture modeling, failing to meet the requirements of interpretability.
[0005] In terms of performance optimization for deep watermarking, existing research often redesigns the core network modules for specific scenarios. Examples include the classic end-to-end baseline model HiDDeN, CIN which considers reversibility, MBRS which optimizes JPEG robustness, FaceSigns which implements semi-fragile watermarking for forensics, SepMark which balances detection and source tracing, LampMark which detects facial structure consistency, TSDL which improves robustness against black-box noise, AdvMark which introduces adversarial fine-tuning, and MEA which resists watermark overlay damage. These methods only focus on improving the performance of a single model and cannot simultaneously accommodate different architectures such as general robust watermarking, face forensics watermarking, and reversible watermarking, thus lacking universal optimization value.
[0006] Therefore, designing an optimization strategy that can adaptively adjust the embedding strength, improve the concealment and robustness of watermarks, and has universal plug-and-play capabilities is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0007] In contrast to existing technologies, this invention provides a watermark model training method and system based on multi-scale texture complexity guidance. The aim is to achieve adaptive optimization of the watermark model, thereby simultaneously improving the concealment and robustness of the watermark, and possessing universal plug-and-play capabilities.
[0008] A watermarking model training method based on multi-scale texture complexity guidance includes the following steps: Step 1: Obtain the original carrier image and extract its multi-scale, multi-dimensional texture features; Step 2: Fuse the multi-scale, multi-dimensional texture features to generate a continuous texture complexity distribution map with the same spatial dimensions as the original carrier image. ,in, Indicates the texture complexity at a pixel; Step 3: Based on the texture complexity distribution map An embedding intensity map is generated, such that the embedding intensity map and the texture complexity distribution map have a negative correlation mapping relationship; Step 4: Construct the texture-weighted encoder to reconstruct the loss term Its form is: in, Total number of pixels in the image For image pixel domain, Indicates the embedding intensity map at position The value, The watermarked image output by the encoder is located at... pixel values, The pixel value of the original carrier image at position (x,y); Step 5: Reconstruct the loss term from the texture-weighted encoder. The original encoder reconstruction loss term in the end-to-end watermarking model is replaced, while keeping the network structure of the encoder, decoder and noise layer of the watermarking model unchanged. The watermarking model is then trained using the replaced texture-weighted encoder reconstruction loss term.
[0009] Further, step 1, which extracts multi-scale texture features, specifically includes: using at least two convolutional kernels of different sizes to calculate the multi-scale local variance feature maps of the original carrier image.
[0010] Furthermore, the convolution kernel size includes 3×3, 5×5, and 7×7.
[0011] Further, step 1, which extracts multi-dimensional texture features, specifically includes extracting the Laplacian sharpness feature and the Sobel gradient feature of the original carrier image.
[0012] Furthermore, in step 2, a texture complexity distribution map is generated. Specifically, it includes: Equal-weight fusion of multi-scale local variance feature maps yields multi-scale fused features. ; The multi-scale fusion features, Laplacian sharpness features, and Sobel gradient features are weighted and fused to obtain multi-dimensional fusion features. ; For the multi-dimensional fusion features The texture complexity distribution map is obtained by performing smoothing processing. .
[0013] Furthermore, the weight configuration of the weighted fusion is as follows: the multi-scale fusion features The weight of the Laplacian sharpness feature is 0.5, the weight of the Sobel gradient feature is 0.3, and the weight of the Sobel gradient feature is 0.2.
[0014] Furthermore, the negative correlation mapping relationship for generating the embedded intensity map in step 3 is specifically as follows: according to the formula... Calculate the original intensity map Then, the original intensity map is clamped. The value is limited to a preset range to obtain the final embedding intensity map; where, For a full 1 tensor, This is the texture adaptive intensity coefficient.
[0015] Furthermore, the end-to-end watermarking model is any one of HiDDeN, MBRS, CIN, LampMark, or SepMark.
[0016] Furthermore, after training the watermark model using the replaced texture-weighted encoder to reconstruct the loss term, the inference stage directly uses the trained encoder to generate the watermarked image without calculating the texture complexity distribution map and embedding intensity map.
[0017] An adaptive watermark embedding system guided by multi-scale texture complexity includes a watermark model, which includes at least an encoder, a decoder, and a noise layer for performing end-to-end watermark embedding and extraction; a lightweight plugin is integrated on the encoder side of the original watermark model to guide the encoder to achieve pixel-wise adaptive watermark embedding during the training phase. The lightweight plugins include: The texture complexity adaptive embedding module is used to receive the original carrier image and extract its multi-scale and multi-dimensional texture features; The texture complexity fusion module, connected to the texture complexity adaptive embedding module, is used to fuse the multi-scale, multi-dimensional texture features to generate a continuous texture complexity distribution map with the same spatial size as the original carrier image. ,in, Indicates the texture complexity at a pixel; An adaptive embedding module, connected to the texture complexity fusion module, is used to perform tasks based on the texture complexity distribution map. An embedding intensity map is generated, such that the embedding intensity map and the texture complexity distribution map are negatively correlated, and the embedding intensity map is output to the encoder reconstruction loss term of the watermark model. The encoder reconstruction loss term of the watermark model is replaced with a texture-weighted encoder reconstruction loss term. Its form is: in, This represents the total number of pixels in the image. For image pixel domain, Indicates the embedding intensity map at position The value, The watermarked image output by the encoder is located at... pixel values, The pixel value of the original carrier image at position (x,y); The adaptive watermark embedding system based on multi-scale texture complexity guides the parameter update of the encoder during the training phase by reconstructing the loss term of the texture-weighted encoder. During the inference phase, the lightweight plugin does not participate in the calculation, and the watermarked image is directly generated by the encoder of the watermark model.
[0018] The beneficial effects of this invention are: Balancing concealment and robustness: By calculating multi-scale and multi-dimensional texture complexity, a pixel-by-pixel continuous texture map is generated, and an adaptive embedding intensity map is generated based on negative correlation mapping. This achieves dynamic adjustment of "weak embedding in smooth areas and strong embedding in complex areas," fundamentally solving the contradiction between visual distortion and insufficient robustness caused by globally uniform embedding intensity. High interpretability: The proposed texture complexity fusion method integrates 3×3 / 5×5 / 7×7 multi-scale local variance, Laplacian sharpness and Sobel gradient features. The physical meaning of each feature is clear and the quantification results of texture complexity are highly consistent with human visual perception. Plug and play, highly versatile: It can be adapted to any end-to-end watermarking model (such as HiDDeN, MBRS, CIN, LampMark, SepMark, etc.) simply by replacing the encoder to reconstruct the loss term, without modifying any network structure, and takes effect during the training phase and has zero additional overhead during the inference phase. Significant performance improvement: Experiments show that, on multiple classic watermarking models, this invention significantly improves the peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) of watermarked images, with a maximum PSNR improvement of 1.21 dB in smooth regions and a maximum reduction in bit error rate (BER) of 5.41% in complex regions. Under various conventional attacks and Deepfake attacks, the BER is reduced across the board, and the cross-dataset test also shows excellent performance. Attached Figure Description
[0019] Figure 1 This is a flowchart of the watermark model training method in this invention; Figure 2 This is a flowchart for extracting multi-scale, multi-dimensional texture features in this invention; Figure 3 This is a flowchart of the process for generating a texture complexity distribution map in this invention; Figure 4 This is a flowchart illustrating the construction of the texture-weighted encoder reconstruction loss term in this invention; Figure 5 This is a block diagram of the adaptive watermark embedding system in the invention. Detailed Implementation
[0020] The present invention will now be described in detail with reference to the accompanying drawings. Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. The directional terms such as left, center, right, top, and bottom in the embodiments of the present invention are only relative concepts or referenced to the normal use state of the product, and should not be considered restrictive.
[0021] Example 1: A watermarking model training method guided by multi-scale texture complexity, such as Figure 1 As shown, it includes the following steps: Step 1: Obtain the original carrier image and extract its multi-scale, multi-dimensional texture features; Specifically, such as Figure 2 As shown, the original carrier image is first converted into a grayscale image. Then, in order to capture texture information of different granularities, three sizes of uniform mean convolution kernels (3×3, 5×5, 7×7) are used to calculate multi-scale local variance feature maps to capture fine-grained, medium-grained, and coarse-grained texture information. Local variance is the core indicator for characterizing the texture fluctuation in the neighborhood of an image. The higher the variance value, the greater the fluctuation of pixel gray values in that neighborhood, and the more complex the corresponding texture. For any scale First, define the size as Uniform mean convolution kernel ,in The kernel is a k×k matrix of all 1s, and the sum of all elements in the kernel is 1, ensuring that the mean gray level of the image remains stable after the convolution operation. The mean gray level of the neighborhood is calculated through two convolution operations. The mean of the squared gray levels of the neighborhood : Among them, settings This ensures that the spatial dimensions of the feature map after the convolution operation are completely consistent with the input grayscale image. This leads to the local variance feature map at this scale: in, The operation avoids the negative variance problem caused by numerical calculation errors, and finally obtains local variance feature maps at three scales. These correspond to texture information of different granularities; (k=3): Capture fine-grained texture features, corresponding to visually sensitive micro-textures such as facial skin pores, fine wrinkles, and pixel-level noise; (k=5): Capture medium-grained texture features, corresponding to facial contours, local shadows, and medium-sized image structures; (k=7): Captures coarse-grained texture features, corresponding to large-area structures such as hair blocks, clothing textures, and large-area background textures.
[0022] Simultaneously, Laplacian sharpness features (Lap) and Sobel gradient features (Grad) are extracted. These two auxiliary features, highly correlated with human visual perception, supplement the dimensions of texture representation, resulting in a higher degree of matching between the final feature output and visual sensitivity. All feature maps undergo sample-by-sample min-max normalization and are mapped to... The interval eliminates the numerical magnitude differences between different features, ensuring the fairness and rationality of subsequent feature fusion. The normalization formula is as follows: in, , These are the minimum and maximum values within a single feature map, 1e 8 is the minimum value to avoid numerical errors caused by a denominator of 0; after normalization, the value range of all feature maps is unified to [0,1]. The higher the value, the more likely it is to correspond to The higher the texture complexity, the better.
[0023] Step 2: As Figure 3 As shown, the multi-scale, multi-dimensional texture features are fused to generate a continuous texture complexity distribution map with the same spatial size as the original carrier image. ,in, Indicates the texture complexity at a pixel; Although multi-scale local variance, Laplacian sharpness, and Sobel gradient features have characterized image texture from different dimensions, each feature is still independent and lacks a unified quantitative index to represent the overall texture complexity. At the same time, simple splicing of single or multiple features is easily affected by noise, resulting in block artifacts in the texture distribution and insufficient spatial continuity.
[0024] The above problems will be addressed in three phases: Step 2.1 Multi-scale equal-weight fusion: To integrate texture information at three granular levels—fine, medium, and coarse—the normalized multi-scale local variance features are first processed. Preliminary equal-weight fusion is performed; the three scales correspond to different levels of visual perception characteristics, with no clear priority difference. Equal weighting ensures the balanced preservation of information at each granularity, avoiding texture depiction deviations caused by the dominance of single-scale features; thus, multi-scale fused features are obtained. : in, A higher value indicates more severe overall texture fluctuations in the region across multiple scales; Step 2.2 Multi-dimensional weighted fusion: Multi-scale fusion features Building upon this foundation, we further introduce Laplacian sharpness features (Lap) and Sobel gradient features (Grad), integrating the advantages of these three types of features through weighted fusion: multi-scale local variance carries core texture density information and has the highest weight; Laplacian supplements local sharpness details, and Sobel enhances edge contour information, with relatively lower weights; weight allocation ( , , Preliminary experiments have verified that an optimal balance can be achieved between texture rendering accuracy and watermark embedding performance; multi-dimensional fusion features for: Since the three types of features have been pre-normalized to [0,1], the multi-dimensional fusion features The value range remains in the [0,1] interval, and no additional normalization is required; Step 2.3 Smoothing: To eliminate blocky artifacts that may be introduced by multi-feature fusion and improve the spatial continuity of texture complexity distribution, multi-dimensional fused features are... Perform a 3×3 uniform mean smoothing process; the core logic of the smoothing operation is to weaken the abnormal fluctuations of single pixels through neighborhood averaging, making the transition of texture complexity more consistent with the visual continuity of natural images; smoothing convolution kernel. for: in, For a 3×3 matrix of all ones, set during convolution... This ensures that the spatial dimensions of the smoothed feature map are consistent with the input; the final texture complexity distribution map. for: in, The clamping operation ensures the texture complexity distribution map The value range is strictly limited to the interval [0,1] to avoid out-of-bounds issues caused by numerical calculation errors; ultimately The texture complexity of the image at position (x,y) is represented: the closer the value is to 1, the more complex the texture; the closer the value is to 0, the smoother the texture. The texture complexity distribution generated by multi-stage fusion not only achieves unified quantification of multi-dimensional texture information, but also ensures spatial continuity, providing an interpretable and highly accurate quantification basis for subsequent adaptive embedding. Step 3: Based on the texture complexity distribution map An embedding intensity map is generated, such that the embedding intensity map and the texture complexity distribution map have a negative correlation mapping relationship; Existing watermarking models typically use globally uniform embedding weights for different regions of the original image. The choice of embedding position largely depends on the model's training iterations, neglecting the significant texture spatial heterogeneity inherent in the image itself: smooth regions are highly sensitive to pixel perturbations, and overly strong embedding can easily lead to visual distortion; complex regions are insensitive to perturbations, and insufficient embedding reduces watermark robustness, ultimately resulting in decreased image quality and inefficient watermark embedding. To address these issues, this module is based on a texture complexity distribution map... An embedding strategy was designed using a dynamic intensity mapping method of "weak embedding in smooth regions and strong embedding in complex regions," which enabled adaptive adjustment of embedding intensity guided by texture-weighted loss during the training phase. The core logic of converting the texture complexity distribution T into an embedding intensity map is: high-texture regions ( This allows for greater embedding strength in low-texture areas. To limit the embedding strength and avoid training instability caused by extreme strength, a texture-adaptive strength coefficient is introduced. The intervention intensity of the texture module is controlled, and the intensity range is clamped to ensure a smooth transition of the embedded intensity. The specific negative correlation mapping relationship is as follows: 1. Define "embedding friendliness" as High-texture areas Smaller size corresponds to greater potential for improved embedding strength; low-texture areas Larger sizes require a corresponding reduction in embedding strength; 2. Introduce the all-1 basic tensor base(and) (Isomorphic) smooth transitions are achieved through linear combination. To avoid extreme intensity, a smoothing coefficient is introduced. The original intensity map was generated using a linear combination. : in, It degenerates into a globally uniform embedding; Intensity is allocated entirely based on texture complexity; this invention provides a unified setting. Achieving a balance between robustness and stealth; 3. For the original intensity map Clamping is applied to avoid extreme values and limit the intensity within a preset range: Final embedding strength map Among them: high texture area The penalty for embedding differences is smaller; low-texture areas The penalty for embedding differences is relatively large, resulting in the final dynamic strength result; Step 4: As Figure 4As shown, a texture-weighted encoder is constructed to reconstruct the loss term. Its form is: in, This represents the total number of pixels in the image. For image pixel domain, Indicates the embedding intensity map at position The value, The watermarked image output by the encoder is located at... pixel values, The pixel value at position (x,y) of the original carrier image; the texture-weighted encoder reconstruction loss term is weighted pixel-by-pixel, making the encoder more efficient in high-texture regions ( Smaller embedding errors allow for larger embedding errors to improve robustness, especially in low-texture regions. (Large) Limit embedding error to protect visual quality, thereby achieving spatially adaptive penalty allocation; Step 5: Reconstruct the loss term from the texture-weighted encoder. Replace the original encoder reconstruction loss term in the end-to-end watermarking model, while keeping the network structure of the encoder, decoder and noise layer of the watermarking model unchanged, and train the watermarking model using the replaced encoder reconstruction loss term. Specifically, for any watermarking model to be improved (such as HiDDeN, MBRS, CIN, LampMark, SepMark, etc.), there is no need to modify the network structure and forward logic of its encoder, decoder, and noise layer. Only the encoder visual fidelity loss (usually global MSE) in the original training process is replaced with the texture-weighted encoder reconstruction loss term. Other loss terms (such as decoder loss, discriminator loss, etc.) and training hyperparameters remain consistent with the original model.
[0025] Total loss during training phase for: Based on total loss Backpropagation updates model parameters; Indicates decoder loss, Indicates discriminator loss; Inference phase: Since the improvement only occurs in the loss calculation during the training phase, there is no need to calculate texture complexity and embedding strength map during the inference phase. The watermarked image is directly generated using the trained encoder, ensuring that the inference efficiency is not affected in any way.
[0026] This invention has the following characteristics: Steps 1-3 extract multi-scale and multi-dimensional texture features to generate a texture complexity distribution map, which is then converted into an embedding intensity map negatively correlated with the texture complexity distribution map. This achieves pixel-level dynamic adaptive adjustment of "weak embedding in smooth areas and strong embedding in complex areas," thereby ensuring both the visual quality of smooth areas and the watermark robustness of complex areas. Steps 1-2 fuse 3×3 / 5×5 / 7×7 multi-scale local variance, Laplacian sharpness, and Sobel gradient features to generate a continuous and interpretable texture complexity distribution map, providing accurate quantitative basis for adaptive embedding. Steps 4-5 construct a texture-weighted encoder reconstruction loss term and replace the original encoder loss term while keeping the encoder, decoder, and noise layer network structures unchanged. This achieves "plug-and-play" optimization that can adapt to any end-to-end watermarking model simply by replacing the encoder reconstruction loss term, with zero additional overhead during the inference stage.
[0027] Example 2: An adaptive watermark embedding system guided by multi-scale texture complexity, such as Figure 5 As shown, it includes: A watermarking model, comprising at least an encoder, a decoder, and a noise pool, for performing end-to-end watermark embedding and extraction; A lightweight plugin, seamlessly integrated into the encoder side of the original watermarking model, is used to guide the encoder to achieve pixel-by-pixel adaptive watermark embedding during the training phase; the lightweight plugin includes: The texture complexity adaptive embedding module receives the original carrier image and extracts its multi-scale, multi-dimensional texture features. Specifically, this module uses 3×3, 5×5, and 7×7 convolutional kernels to calculate multi-scale local variance feature maps. The Laplacian sharpness feature (Lap) and Sobel gradient feature (Grad) are extracted, and all feature maps are output after normalization. The texture complexity fusion module, connected to the texture complexity adaptive embedding module, is used to fuse the multi-scale, multi-dimensional texture features to generate a continuous texture complexity distribution map with the same spatial size as the original carrier image. ,in, Indicates the texture complexity at a pixel; An adaptive embedding module, connected to the texture complexity fusion module, is used to perform tasks based on the texture complexity distribution map. An embedding intensity map is generated, such that the embedding intensity map and the texture complexity distribution map have a negative correlation mapping relationship (see step 3 for the specific mapping formula), and the embedding intensity map is output to the encoder reconstruction loss term of the watermark model; The encoder reconstruction loss term of the watermark model is replaced with a texture-weighted encoder reconstruction loss term. Its form is: in, This represents the total number of pixels in the image. For image pixel domain, Indicates the embedding intensity map at position The value, The watermarked image output by the encoder is located at... pixel values, The pixel value of the original carrier image at position (x,y); The adaptive watermark embedding system based on multi-scale texture complexity guides the parameter update of the encoder through the reconstruction loss term of the texture weighted encoder during the training phase. During the inference phase, the lightweight plugin does not participate in the calculation and the watermarked image is directly generated by the encoder of the watermark model. The system in this embodiment can achieve "plug-and-play" adaptive embedding without modifying the core network structure of the original watermarking model, significantly improving the concealment and robustness of the watermark.
[0028] Experimental verification: To comprehensively verify the effectiveness, universality, and engineering practicality of the proposed multi-scale texture complexity-guided watermarking model training method, this invention embeds the strategy into current mainstream end-to-end deep watermarking architectures in a plug-and-play manner, and conducts systematic comparative experiments and ablation analysis. The experiments cover two major application scenarios: face-specific and general natural image processing. Full-dimensional verification was completed on five classic deep watermarking networks (HiDDeN, MBRS, CIN, LampMark, and SepMark). From multiple dimensions such as global performance, regional characteristics, and attack robustness, the universal optimization effect of the proposed strategy on different watermarking network architectures was demonstrated. Simultaneously, through comparative analysis of subdivided scenarios, the core advantages of this method—visual fidelity in smooth regions and robustness enhancement in textured regions—are highlighted, resolving the inherent contradiction between "visual concealment" and "watermark robustness" in traditional fixed-strength watermark embedding.
[0029] 1. Global performance comparison Table 2 shows the global performance comparison of the five baseline models and the improved model after embedding the strategy of this invention on the CelebA-HQ test set at different resolutions; where represents the improved version obtained by adding the adaptive embedding strategy to the baseline watermarking network. The results show that the adaptive embedding strategy proposed in this invention achieves consistent performance optimization for watermarking networks with different architectures, effectively improving the robustness of the watermark while ensuring the watermark's concealment, and verifying the strong versatility of the solution. Table 2 Comparison of global performance before and after improvement of different watermarking models The test results show that the improved watermarking models tested have achieved effective improvements in both image quality and bit error rate of watermark information compared to the baseline model. They have effectively alleviated the problem of artifacts that are easy to occur when embedding the current watermarking model, and the bit error rate has also been effectively reduced, indicating that the improvement is not at the expense of invisibility and robustness.
[0030] 2. Regional Performance Analysis Regional performance is key to verifying the core innovative value of the method of this invention. Table 3 shows the comparison of specific indicators of the four types of models before and after the improvement in smooth regions and complex texture regions. The results clearly show that the core advantages of the strategy of this invention are concentrated in the visually sensitive smooth regions and the robustness-critical complex texture regions, solving the core pain points of traditional fixed-strength embedding: "large distortion in smooth regions and insufficient robustness in complex regions".
[0031] Table 3. Performance comparison of smooth and complex regions before and after improvement of different watermarking models. Specifically, in smooth regions where the human eye is highly sensitive, the improved PSNR of the four models significantly outpaced the overall improvement: LampMark, MBRS, CIN, and HiDDeN saw PSNR improvements of 1.19dB, 1.21dB, 0.82dB, and 0.07dB in smooth regions, respectively. This demonstrates that the adaptive strategy effectively eliminates visual artifacts in smooth regions such as facial skin, sky, and solid-color backgrounds by reducing the embedding strength, achieving a qualitative improvement in visual concealment. In complex texture regions, the improved model reduced its BER by 5.41% compared to HiDDeN's slightly higher BER, while the BER remained unchanged under Identity, effectively ensuring robustness.
[0032] 3. Robustness verification against attacks To verify that the strategy of this invention does not sacrifice the robustness of the watermark, but rather complements the robustness design of the original network, the performance of the improved model under common attacks in real-world scenarios was tested, and the results are shown in Table 4.
[0033] Table 4 compares the bit error rate of different watermarks under conventional and Deepfake attacks. The upper part is at 128 resolution, and the lower part is at 256 resolution.
[0034] Table 4 Comparison of robustness against attacks on the CelebA-HQ dataset before and after improvements to different watermarking models. The results show that the adaptive watermarking embedding model maintains excellent robustness under various attacks, achieving a near-complete BER reduction compared to the baseline model across all scenarios. Dense watermark embedding in textured regions reduces the impact of local information loss on overall extraction, significantly improving robustness. For attacks like StarGAN, the improved version shows a slightly higher BER than the baseline, but this does not affect the robustness of the decoder. The main reason for the increased BER is that the adaptive watermarking embeds the watermark in areas of high image texture complexity, while StarGAN primarily introduces strong nonlinear transformations in facial texture and local structural details through attribute transfer, mainly rewriting areas of high texture complexity, such as changing hair color, but this is compatible with the image quality improvement achieved by the adaptive watermarking embedding. The results also show that this embedding strategy reduces visual artifacts, and the BER is significantly better than the baseline model under various attacks, effectively balancing the trade-off between watermark concealment and robustness.
[0035] 4. Cross-dataset testing To verify that the adaptive embedding strategy proposed in this invention does not depend on the distribution characteristics of a specific dataset and has good cross-scene generalization ability, a baseline model and an improved model that are fully trained on the CelebA-HQ training set were used without any fine-tuning and the global performance was directly tested on the FFHQ test set. The results are shown in Table 5.
[0036] Table 5 Comparison of robustness against attacks on the FFHQ dataset before and after improvements to different watermarking models. The results show that even with entirely new datasets, the adaptive embedding watermark performs exceptionally well, achieving a reduction in BER across virtually all scenarios compared to the baseline model.
[0037] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for watermark model training based on multi-scale texture complexity guidance, characterized in that, Includes the following steps: Step 1: Obtain the original carrier image and extract its multi-scale, multi-dimensional texture features; Step 2: fusing the multi-scale, multi-dimensional texture features to generate a continuous texture complexity distribution map consistent with the spatial size of the original carrier image wherein, represents the texture complexity at the pixel point; Step 3: generating an embedding strength map according to the texture complexity map such that the embedding strength map is in a negative correlation mapping relationship with the texture complexity map; Step 4: Construct the texture-weighted encoder to reconstruct the loss term Its form is: in, The total number of pixels in the image. For image pixel domain, Indicates the embedding intensity map at position The value, The watermarked image output by the encoder is located at... pixel values, The pixel value of the original carrier image at position (x,y); Step 5: Reconstruct the loss term from the texture-weighted encoder. The original encoder reconstruction loss term in the end-to-end watermarking model is replaced, while keeping the network structure of the encoder, decoder and noise layer of the watermarking model unchanged. The watermarking model is then trained using the replaced texture-weighted encoder reconstruction loss term.
2. The watermarking model training method based on multi-scale texture complexity as described in claim 1, characterized in that: The extraction of multi-scale texture features in step 1 specifically includes: using at least two convolution kernels of different sizes to calculate the multi-scale local variance feature maps of the original carrier image.
3. The watermarking model training method based on multi-scale texture complexity as described in claim 2, characterized in that: The convolution kernel sizes include 3×3, 5×5, and 7×7.
4. The watermarking model training method based on multi-scale texture complexity as described in claim 1, characterized in that: The extraction of multi-dimensional texture features in step 1 specifically includes: extracting the Laplacian sharpness feature and the Sobel gradient feature of the original carrier image.
5. The watermarking model training method based on multi-scale texture complexity as described in claim 4, characterized in that: In step 2, a texture complexity distribution map is generated. Specifically, it includes: Equal-weight fusion of multi-scale local variance feature maps yields multi-scale fused features. ; The multi-scale fusion features, Laplacian sharpness features, and Sobel gradient features are weighted and fused to obtain multi-dimensional fusion features. ; For the multi-dimensional fusion features The texture complexity distribution map is obtained by performing smoothing processing. .
6. The watermarking model training method based on multi-scale texture complexity as described in claim 5, characterized in that: The weight configuration for the weighted fusion is as follows: the multi-scale fusion features The weight of the Laplacian sharpness feature is 0.5, the weight of the Sobel gradient feature is 0.3, and the weight of the Sobel gradient feature is 0.
2.
7. The watermarking model training method based on multi-scale texture complexity as described in claim 1, characterized in that: The negative correlation mapping relationship generated in step 3 for the embedded intensity map is specifically as follows: according to the formula Calculate the original intensity map Then, the original intensity map is clamped. The value is limited to a preset range to obtain the final embedding intensity map; where, For a full 1 tensor, This is the texture adaptive intensity coefficient.
8. The watermarking model training method based on multi-scale texture complexity as described in claim 1, characterized in that: The end-to-end watermarking model is any one of HiDDeN, MBRS, CIN, LampMark, or SepMark.
9. The watermarking model training method based on multi-scale texture complexity as described in claim 1, characterized in that: After training the watermark model using the replaced texture-weighted encoder to reconstruct the loss term, the watermarked image is directly generated using the trained encoder during the inference stage, without needing to calculate the texture complexity distribution map and embedding intensity map.
10. An adaptive watermark embedding system guided by multi-scale texture complexity, comprising a watermark model, wherein the watermark model includes at least an encoder, a decoder, and a noise layer, for performing end-to-end watermark embedding and extraction; characterized in that: A lightweight plugin is integrated into the encoder side of the original watermarking model to guide the encoder to achieve pixel-by-pixel adaptive watermark embedding during the training phase. The lightweight plugins include: The texture complexity adaptive embedding module is used to receive the original carrier image and extract its multi-scale and multi-dimensional texture features; The texture complexity fusion module, connected to the texture complexity adaptive embedding module, is used to fuse the multi-scale, multi-dimensional texture features to generate a continuous texture complexity distribution map with the same spatial size as the original carrier image. ,in, Indicates the texture complexity at a pixel; An adaptive embedding module, connected to the texture complexity fusion module, is used to perform tasks based on the texture complexity distribution map. An embedding intensity map is generated, such that the embedding intensity map and the texture complexity distribution map are negatively correlated, and the embedding intensity map is output to the encoder reconstruction loss term of the watermark model. The encoder reconstruction loss term of the watermark model is replaced with a texture-weighted encoder reconstruction loss term. Its form is: in, The total number of pixels in the image. For image pixel domain, Indicates the embedding intensity map at position The value, The watermarked image output by the encoder is located at... pixel values, The pixel value of the original carrier image at position (x,y); The adaptive watermark embedding system based on multi-scale texture complexity guides the parameter update of the encoder during the training phase by reconstructing the loss term of the texture-weighted encoder. During the inference phase, the lightweight plugin does not participate in the calculation, and the watermarked image is directly generated by the encoder of the watermark model.