Template-based localization-based robust image watermarking network method and system against screen capture
By adopting a template-based localization-based robust image watermarking network method, the problem of watermark region misalignment and loss in complex screen capture scenarios is solved, achieving a balance between visual imperceptibility and robustness, and improving the watermark extraction accuracy.
Patent Information
- Application Number
- CN202611618782.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing image watermarking technologies are prone to misalignment and loss of watermark areas when faced with complex screen capture scenarios (such as cropping, viewpoint shift, image compression, and other composite distortions), and the extraction accuracy is low, making them unable to effectively resist various screen capture attacks.
A template-based robust image watermarking network method for screen capture is adopted. By generating a structured template and fusing it with the carrier image, combined with a screen capture degradation simulation layer and a dual-branch decoder, independent localization and decoding of multiple cropping is achieved. Robustness and accuracy are improved through a two-stage training strategy and adaptive watermark intensity adjustment.
It achieves accurate identification and complete extraction of watermark areas in complex screen capture scenarios, improves anti-screen capture capabilities, and ensures a balance between visual imperceptibility and robustness.
Smart Images

Figure CN123118338A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for robust image watermarking networks against screen capture, specifically a method and system for robust image watermarking networks against screen capture based on template localization, belonging to the field of information security technology. Background Technology
[0002] As global enterprises accelerate their digital transformation, the use of digital conferencing systems for cross-domain presentations of trade secrets is becoming increasingly common, leading to a growing problem of information leaks caused by screen capture. According to Verizon's 2023 Data Breach Investigations Report, 11% of physical security breaches were caused by the illegal act of photographing screens with mobile devices. Against this backdrop, robust watermarking technology, with its excellent traceability capabilities, has become a core technical means to combat screen capture leaks and protect digital content copyrights. This technology embeds encrypted identifier information into the carrier image, ensuring that the watermark information can still be completely extracted even after presentation images have undergone multiple complex scenarios such as screen capture and social media dissemination, thus establishing a proactive security defense system that allows for traceability of leaks.
[0003] Currently, robust watermarking technology has yielded numerous research results, with traditional implementation schemes mainly falling into two categories: spatial domain techniques and transform domain techniques. In spatial domain schemes, the least significant bit modification algorithm is widely used due to its excellent visual imperceptibility; however, this algorithm has significant shortcomings in resisting screen capture attacks and various types of image noise. Mainstream transform domain-based methods include singular value decomposition, discrete wavelet transform, and discrete cosine transform (DCT). These techniques simultaneously improve the concealment and anti-interference capabilities of the watermark by adjusting the statistical characteristics of the transform domain coefficients. However, traditional transform domain methods heavily rely on manually designed features and cannot adaptively mine the energy distribution patterns of images. When facing complex textures and high-frequency image regions, their feature representation capabilities are significantly limited, easily causing misalignment between the watermark embedding area and the effective area of the captured image, ultimately greatly reducing the overall robustness of the watermark.
[0004] The mature application of convolutional neural networks in computer vision has propelled watermarking technology into the deep learning development stage. Relying on the network's autonomous feature learning capabilities, deep learning watermarking schemes can uncover the inherent representational patterns of data, construct multi-scale feature systems, and effectively improve the anti-screen capture performance of watermarking systems. However, current mainstream deep watermarking schemes still face many problems that urgently need to be addressed: on the one hand, the redundancy of watermark information is too high, and the fusion of watermark features and carrier image features is insufficient, resulting in weak semantic association; on the other hand, most existing schemes do not design dedicated watermark localization mechanisms, making them prone to watermark region loss and decoding failure when screen capture causes image cropping or viewpoint shifts. Simultaneously, various non-differentiable noises and image distortions accompanying the screen capture process can also severely interfere with the normal extraction of watermarks.
[0005] Current mainstream end-to-end watermarking frameworks still have significant shortcomings in watermark redundancy control and cross-feature fusion. Most schemes use mechanical watermark replication to achieve global watermark distribution, lacking an adaptive redundancy control mechanism. This results in poor fusion of watermark features and image ontology features, further weakening anti-screen capture capabilities. In the feature fusion stage, most existing methods use simple channel splicing to complete shallow fusion, making it difficult to establish a deep association between watermark semantic features and image structural features. Moreover, traditional schemes have fixed watermark embedding strength, failing to dynamically balance visual concealment and robustness based on training status, nor can they adaptively adjust the watermark state according to image content, ultimately leading to a continuous decline in the watermark's performance against screen capture attacks. In addition, most network architectures couple multiple tasks such as watermark localization and decoding into a single network, causing interference between multiple tasks and further reducing localization and extraction accuracy.
[0006] In addition, most existing watermarking schemes focus on spatial domain feature operations, failing to fully leverage the advantages of frequency domain techniques. Frequency domain methods, relying on the image energy compression characteristics and the laws of human visual sensitivity, possess stronger robustness against attacks such as image compression, blurring, and color distortion caused by screen capture. At the noise simulation level, existing models only simulate a single type of noise, unable to reproduce real-world screen capture distortions such as perspective distortion, screen reflections, and moiré patterns. Furthermore, the JPEG compression operations inherent in social media and shooting devices can disrupt the backpropagation path of the neural network through discrete cosine transform and quantization operations, hindering the encoder from optimizing parameters based on decoding loss. Although existing simulation training schemes use differentiable DCT to approximate JPEG compression to ensure gradient propagation, performance bottlenecks remain prominent in extreme scenarios with high compression ratios. Summary of the Invention
[0007] To address the technical problems of existing image watermarking technologies, which are prone to watermark region misalignment, loss, and low extraction accuracy when facing complex screen capture scenarios (such as cropping, viewpoint shift, image compression, and other composite distortions), this invention provides a template-based, screen capture-resistant robust image watermarking network method and system.
[0008] The technical solution of this invention is implemented sequentially according to the following process: First, the generated structured template (including positioning units and message units) is fused and embedded with the carrier image; second, the watermarked image is subjected to composite noise simulation processing through a screen capture degradation simulation layer; then, the degraded image is subjected to adaptive cropping preprocessing; next, a dual-branch network composed of decoupled locator and decoder branches is used to perform multi-cropping independent positioning and decoding of the cropped image; finally, the decoding results are processed through a voting fusion module to output the final watermark information. Furthermore, a two-stage training strategy and an adaptive watermark strength adjustment mechanism are employed to achieve an optimal balance between visual imperceptibility and screen capture robustness.
[0009] To achieve the above objectives, this invention provides a template-based method for robust image watermarking networks against screen capture, comprising the following steps:
[0010] Step 1: Fuse the carrier image with the structured template output by the template watermark generator to obtain a watermarked image;
[0011] Step 2: Input the watermarked image into the screen capture degradation simulation layer for processing to obtain the screen capture degradation image;
[0012] Step 3: Preprocess the degraded screen capture image to obtain images of each cropped region;
[0013] Step 4: Input the images of each cropped region into the corresponding dual-branch decoder for independent multi-cropping decoding to obtain the decoding results;
[0014] Step 5: Input each decoding result into the voting fusion module for processing to obtain the final watermark information.
[0015] Further, step 1 includes:
[0016] Define the template structure parameters and set the coordinates of the positioning unit and the message unit;
[0017] The positioning unit is generated using a distance modulation mode, and the calculation formula is as follows:
[0018] ;
[0019] in, The modulation coefficient, This is a matrix of pixel values for a single positioning unit. The horizontal coordinates of the current pixel within the positioning unit. The vertical coordinates of the current pixel within the positioning unit; This is the Euclidean distance from the pixel to the center of the positioning unit; The modulation variables for the positioning unit are calculated based on Euclidean distance; It is a positive modulation vector. It is a negative modulation vector;
[0020] The binary message is expanded into a spatial feature map, and the red, green and blue channels are encoded by positive / negative modulation to generate message units;
[0021] The positioning unit and message unit are combined into a template tensor according to their coordinates. Then, the template tensor is fused with the carrier image using the template tiling mode to generate a watermarked image. The formula is as follows: ,
[0022] in For template tensors, For carrier image, denoted as the watermark strength coefficient, and S is the encoded watermarked image.
[0023] Further, step 2 includes:
[0024] A perspective transformation simulation is performed on the watermarked image to obtain the image after perspective transformation;
[0025] The image after perspective transformation, the illumination mask generated by illumination distortion simulation, and the moiré mask generated by moiré simulation are weighted and combined, and Gaussian noise is added to the weighted and combined image to obtain a noisy image.
[0026] A JPEG compression simulation is performed on a noisy image, and the JPEG compressed image is obtained by adjusting the quality factor.
[0027] A cropping attack simulation was performed on a JPEG compressed image, and the cropped image was obtained by adjusting the cropping ratio.
[0028] Pixel loss simulation is performed on the cropped image to obtain a screen capture degraded image.
[0029] Furthermore, in step 4, the dual-branch decoder includes a locator branch and a decoder branch, and the process of the dual-branch decoder processing the image includes:
[0030] The input image is fed into the locator branch, where feature processing is performed to obtain the localization probability map.
[0031] The input image is cropped using the localization probability map to obtain a localization region cropped image;
[0032] The cropped image of the localized region is input into the decoder branch, where it undergoes feature processing by the watermark decoder to obtain a binary message.
[0033] Furthermore, the training process of the dual-branch decoder adopts a two-stage training strategy, specifically as follows:
[0034] In the locator stage, the locator is trained using Dice loss to identify the watermark template location, and a segmented adjustment strategy is used to dynamically adjust the watermark strength coefficient; when the locator Dice coefficient reaches the threshold, the process switches to the decoder stage.
[0035] During the decoder stage, the locator parameters are frozen, the decoder is trained using binary cross-entropy loss to extract watermark messages from the location area, and the watermark strength coefficient is dynamically adjusted according to the bit error rate.
[0036] Further, step 5 includes:
[0037] Obtain the decoding results and the corresponding localization probability map;
[0038] The cropping amount and adaptive majority voting threshold are adaptively determined based on the size of the input image;
[0039] The confidence level of the decoding results for each clipping region is filtered using the localization probability map output by the locator branch.
[0040] Perform bit-by-bit majority voting on the set of valid binary messages retained after confidence filtering, and count the total number of votes where each bit value is 1 in all valid cropped regions;
[0041] The total number of votes for each person is compared with the adaptive majority voting threshold. If the total number of votes is greater than or equal to the adaptive majority voting threshold, the value of that bit in the final extracted watermark information is determined to be 1; otherwise, it is determined to be 0.
[0042] After traversing the message sequence, the final merged watermark information is output.
[0043] A template-based localization-based robust image watermarking network system against screen capture includes:
[0044] The template fusion unit is used to fuse the carrier image with the structured template output by the template watermark generator to obtain a watermarked image;
[0045] The screen capture degradation unit is used to input the watermarked image into the screen capture degradation simulation layer for processing to obtain the screen capture degradation image;
[0046] The cropping processing unit is used to preprocess the screen-captured degraded image to obtain images of each cropping region;
[0047] The dual-branch decoding unit is used to input the images of each cropped region into the corresponding dual-branch decoder for independent multi-cropping decoding to obtain each decoding result.
[0048] The voting fusion output unit is used to input the various decoding results into the voting fusion module for processing to obtain the final watermark information.
[0049] The present invention also provides an electronic device, including a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method.
[0050] The present invention also provides a storage medium storing a computer program or instructions that, when the computer program or instructions are run on a computer, execute the steps of the method described.
[0051] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0052] This invention utilizes a template positioning mechanism to achieve accurate watermark location recognition, effectively addressing cropping and viewing angle changes after screen capture. This is because the invention encodes binary messages into a structured template containing four corner positioning units and internal message units, and constructs specific visual features through positive and negative modulation based on Euclidean distance. This allows the model to quickly locate the effective watermark area using the remaining positioning unit features even when faced with viewing angle shifts or local image cropping.
[0053] This invention is based on a dual-branch decoding architecture, decoupling localization and decoding to improve the robustness of the overall system. This is because traditional single-network multi-task coupling is prone to mutual interference during feature extraction; while this invention uses an independent locator branch to generate a probability map to guide accurate cropping of the target region, which is then fed into an independent watermark decoder branch to extract binary messages, effectively avoiding semantic conflicts and greatly offsetting the impact of perspective distortion.
[0054] This invention employs a two-stage training strategy, reducing training difficulty and improving convergence speed. The principle is as follows: in the first stage, Dice loss is used to specifically train the locator; once a preset threshold is reached, the locator parameters are frozen. Then, in the second stage, binary cross-entropy loss is used to specifically train the decoder to extract messages. This strategy of breaking down complex tasks and optimizing them step-by-step avoids gradient conflicts during joint training, ensuring that each branch network achieves optimal performance.
[0055] This invention designs an adaptive watermark strength adjustment mechanism to maximize robustness while ensuring imperceptibility. This is achieved by dynamically adjusting the watermark strength coefficient during training based on the localization loss value and the real-time bit error rate: increasing the watermark strength coefficient to resist strong attacks when the extraction bit error rate is high, and decreasing the watermark strength coefficient to improve visual concealment when the bit error rate is low, thus achieving an adaptive optimal balance between visual quality and extraction accuracy.
[0056] This invention constructs a comprehensive screen capture degradation simulation layer, enabling the model to perform excellently in real-world screen capture scenarios. Compared to existing technologies that only simulate single digital noise, this invention comprehensively utilizes a weighted combination of multiple non-differentiable and differentiable noises, including perspective transformation, illumination distortion masking, moiré interference generation, JPEG compression, and cropping distortion. This greatly enriches the diversity of training data and accurately approximates the real-world cross-device composite distortion environment.
[0057] This invention improves the reliability of message extraction through an adaptive voting cropping mechanism. Specifically, this mechanism can adaptively determine the number of odd-numbered croppings based on the size of the input image, and through independent decoding using non-grid sampling and bit-by-bit majority voting rules, it greatly suppresses local pixel loss and severe regional distortion caused by screen capture, ensuring the complete recovery of the final watermark information. Attached Figure Description
[0058] Figure 1 This is a general framework diagram of the method of the present invention;
[0059] Figure 2 This is a schematic diagram of the template watermark structure;
[0060] Figure 3 This is a diagram of a dual-branch decoder architecture;
[0061] Figure 4 This is a diagram of the template generation and embedding process;
[0062] Figure 5 This is the flowchart for adaptive voting pruning and decoding;
[0063] Figure 6 This is a flowchart of the screen capture degradation simulation process. Detailed Implementation
[0064] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0065] Example 1:
[0066] like Figure 1 As shown, this embodiment provides a template-based robust image watermarking network method against screen capture, which specifically includes the following steps:
[0067] Step 1: Fuse the carrier image with the structured template output by the template watermark generator to obtain a watermarked image;
[0068] Step 2: Input the watermarked image into the screen capture degradation simulation layer for processing to obtain the screen capture degradation image;
[0069] Step 3: Preprocess the degraded screen capture image to obtain images of each cropped region;
[0070] Step 4: Input the images of each cropped region into the corresponding dual-branch decoder for independent multi-cropping decoding to obtain the decoding results;
[0071] Step 5: Input each decoding result into the voting fusion module for processing to obtain the final watermark information.
[0072] Combination Figure 2 and Figure 4 As shown, step 1 includes:
[0073] Step 1-1, combined Figure 2 As shown, the three-dimensional tensor parameters of the template structure are defined as follows: the overall template size is set to width W = 64 pixels, height H = 64 pixels, and number of channels C = 3 (corresponding to RGB three channels), that is, the template tensor dimension is... The dimensions of a single structured unit are set to width w = 8 pixels, height h = 8 pixels, and number of channels c = 3. The template is composed of these structured units arranged in a two-dimensional grid, with the number of columns and rows of the grid being W / w = 8 and H / h = 8 respectively. Therefore, the total number of units contained in the template is [missing information]. indivual;
[0074] Step 1-2, Setting the coordinates of the positioning units: Set 4 positioning units at each of the four corners of the template, for a total of 16 positioning units. The coordinate set is {(0,0),(0,1),(1,0),(1,1),(0,6),(0,7),(1,6),(1,7),(6,0),(6,1),(7,0),(7,1),(6,6),(6,7),(7,6),(7,7)};
[0075] Steps 1-3, setting message unit coordinates: 48 message units are set in the middle area of the template to carry binary watermark information. The coordinates of the message units are the remaining positions after removing the coordinates of the positioning units.
[0076] Steps 1-4, Positioning Unit Generation: A single positioning unit is generated using distance modulation mode. The calculation formula is as follows:
[0077] ,
[0078] Where D is the Euclidean distance from the pixel to the center;
[0079] ,
[0080] in, The modulation coefficient is set to 0.4; The localization unit modulation variable is calculated based on the distance from the pixel to the center of the localization unit. When the distance D is less than the threshold 3.2... =0 otherwise = ;
[0081] ,
[0082] ,
[0083] in, For positive value modulation of three-dimensional vectors, The three-dimensional vector is modulated with negative values; the constant 0.5 represents the normalized base pixel offset value; the addition operation between the constant and the vector in the formula adopts the element-wise addition rule for scalars and vectors, that is, the constant 0.5 is independently added to each element of the subsequent vector. and The three elements in the image, from left to right, uniquely correspond to the red (R) channel, green (G) channel, and blue (B) channel, respectively.
[0084] That is: after element-by-element addition, the final positive modulation three-dimensional vector is actually: The final generated negative modulation three-dimensional vector is actually This means that both the red and blue channels use the corresponding signs based on a base offset of 0.5. Symmetrical modulation is performed; while the modulation increment of the green channel remains 0, and its final channel value remains constant at the base offset value of 0.5.
[0085] ,
[0086] When the distance D is less than the boundary threshold 4, positive modulation is used. Otherwise, negative modulation is used. ; This is a pixel value matrix for a single positioning unit, with a size of... Here, the 3 represents that the matrix contains three color channels: red, green, and blue. The two 8s represent that the pixel height of the positioning unit is 8 pixels and the pixel width is 8 pixels, respectively.
[0087] Steps 1-5, Message Unit Generation: Generate message units based on the binary message. First, expand the binary message into a spatial feature map, calculated using the following formula: ,
[0088] in, It is a binary message vector. For message length, To map a binary message to a sign vector that takes a range of positive and negative values;
[0089] To achieve a center peak feature distribution where the modulation intensity is higher closer to the cell center, the distance modulation variable of the message cell is calculated based on the pixel position. The calculation formula is: ,
[0090] in, The distance from the current pixel within the message unit to the center of the message unit is the Euclidean distance. This is the maximum possible distance from the edge pixels within the message unit to the unit center, used for distance calculation. Perform normalization processing; For the distance modulation variable of the calculated message unit;
[0091] Finally, a single message unit is constructed by combining the symbol vector and the distance modulation variable, and the calculation formula is as follows:
[0092] ,
[0093] in, This is the RGB pixel value matrix for a single generated message unit; in channel assignment, the red channel value of this matrix is... The green channel value is The value of the blue channel is This enables symmetrical encoding of the red and blue channels, leveraging the complementary characteristics of the red and blue channels to enhance message extractability in complex degradation scenarios.
[0094] Steps 1-6, Template Tensor Construction: Create a template tensor with a total size of initial blank template tensor (Where 3 represents the RGB three channels), and the pre-generated positioning units and message units are filled into the two-dimensional spatial region corresponding to the tensor according to the preset grid coordinates to complete the spatial combination of the template. Among them, 16 positioning units are arranged in the four corner areas of the template, and 48 message units are arranged in the middle area of the template;
[0095] Steps 1-7, Template Tiling Mode: Supports both single template embedding and global tiling modes. In single template embedding mode, the template is randomly or fixedly placed at a location on the carrier image, and the offset is recorded for subsequent positioning. In global tiling mode, the template is periodically repeated on the carrier image; the formula for calculating the number of repetitions is:
[0096] ,
[0097] ,
[0098] in, and Here, represents the overall height and width of the carrier image, respectively; S is the original template tensor for a single tiling. The spatial side length dimension; The number of repeated tiling steps required in the vertical direction. The required number of repeated tiling steps in the horizontal direction; This is the floor function.
[0099] After obtaining the number of tiling operations, the original template tensor... Repeat tiling in the vertical direction Repeat the tiling process horizontally. Next, an extended tensor is formed by splicing; then, the first part of this extended tensor is truncated in the spatial dimension. Go forward This allows us to obtain a global tiled tensor with dimensions that are completely consistent with the carrier image.
[0100] Steps 1-8, Template Fusion: The template tensor is fused with the carrier image according to weights to generate the coded image. The calculation formula is as follows:
[0101] ,
[0102] in, This refers to the template tensor after the aforementioned construction or tiling process; For carrier images; An adaptive watermark strength coefficient; To encode the fused watermarked image, and then strictly limit the pixel values to a certain range after fusion using a numerical limiting operation. Within the valid range of values;
[0103] like Figure 6 As shown, the screen capture degradation simulation layer in step 2 includes:
[0104] Step 2-1, Perspective Transformation Simulation: Randomly adjust the positions of the four corner points to simulate changes in the shooting angle. Specifically, this is implemented as follows:
[0105] ,
[0106] ,
[0107] ,
[0108] ,
[0109] ,
[0110] ,
[0111] in, This is the coordinate matrix of the four corner vertices of the original image before perspective transformation, containing the coordinates of the top left, top right, bottom right, and bottom left corners in sequence; and These represent the width and height of the input watermarked image, respectively; `random` is a function that generates random values within a specified range. Indicates in Random values generated within the interval; , These represent the random offsets of the top-left corner on the X and Y axes, respectively. , These represent the random offsets of the upper right corner on the X and Y axes, respectively. , These represent the random offsets of the bottom right corner on the X and Y axes, respectively. , These represent the random offsets of the lower left corner on the X and Y axes, respectively. The target image after offset is defined by the coordinate matrix of the four corner vertices; d is the maximum distance parameter that controls the degree of perspective distortion. Its default value ranges from 2 to 8, which means that the displacement of each corner point in the horizontal or vertical direction is between 2 and 8 pixels.
[0112] Step 2-2, Illumination Distortion Simulation: Generate linear or radial illumination masks to simulate screen reflections and uneven brightness. Specifically, this is implemented as follows:
[0113] When control variables Setting it to 0 enables linear lighting mode, specifically:
[0114] ,
[0115] ,
[0116] ,
[0117] ,
[0118] Where a and b are the illumination coefficients; This represents a random decimal generated in the range of 0 to 0.2. The row pixel coordinate index of the image; Denotes the first step of the initial two-dimensional linear illumination mask matrix. Perform the entire row assignment operation; As a variable controlling the direction of illumination, This indicates the generation of a random integer between 1 and 4; This is a matrix rotation operation function, which rotates the matrix. A 90-degree angle is used to achieve lighting effects from four different directions; This is the final output linear lighting mask.
[0119] When control variables When set to 1, it is the radial lighting mode, specifically:
[0120] ,
[0121] ,
[0122] ,
[0123] ,
[0124] ,
[0125] in, The horizontal coordinate (x-axis) of the center of illumination. The vertical coordinate (ordinate) of the center of illumination; This represents the maximum possible distance from the center of illumination to the four vertex corners of the image; and This represents the two-dimensional horizontal and vertical coordinate grid matrix of pixels within the image region; This is the Euclidean distance matrix from each pixel grid point to the center of the illumination. This is the final output radial illumination mask.
[0126] Steps 2-3, Moiré pattern generation simulation: Periodic interference patterns are generated by superimposing cosine functions to simulate the interference between camera and screen pixels. The specific implementation is as follows:
[0127] ,
[0128] ,
[0129] ,
[0130] in For the moiré pattern angle, in a preferred embodiment of the present invention, the pattern size is... Adaptively set to the width of the current watermarked image. (or height) This ensures that the randomly generated moiré pattern center point can completely cover the entire area of the watermarked image; The horizontal coordinate (x-axis) of the center of the generated moiré pattern. The vertical coordinate (ordinate) of the center of the generated moiré pattern;
[0131] ,
[0132] ,
[0133] in, and These are the two-dimensional X-coordinate grid and Y-coordinate grid matrices of pixels within the image region, respectively; is the Euclidean distance from a pixel grid point to the center of the moiré pattern; cos and sin are the cosine and sine functions, respectively; Pi; To obtain the calculated radial interference components, a concentric circle interference pattern is realized;
[0134] ,
[0135] ,
[0136] in, The value of the moiré angle converted to radians; To calculate the directional interference components, a parallel line interference pattern is created; min is the operation of taking the minimum value pixel by pixel;
[0137] ,
[0138] To achieve a preliminary moiré mask after superimposing two interference components by taking the minimum value; Mapped to after normalization The final moiré mask after the range;
[0139] Steps 2-4, Screen Capture Composite Distortion Combination: The perspective-transformed image, illumination mask, and moiré mask are weighted and combined. Based on the physical laws of screen capture, uneven illumination is a multiplicative modulation of pixels, while moiré patterns are additive superposition. The combined calculation formula is as follows: ,
[0140] in, This is the superimposed image obtained after combining composite distortions; The image output in step 2-1 is the image after perspective transformation; This refers to the illumination mask generated in step 2-2; This represents the element-wise multiplication (Hadamard product) operation of matrices; The moiré mask generated in steps 2-3; constants 0.85 and 0.15 are empirical weighting parameters for balancing multiplicative illumination and additive moiré intensity, respectively;
[0141] Steps 2-5, Gaussian noise addition: To simulate sensor noise from the imaging device, add a Gaussian noise level with a standard deviation of [value missing] to the combined image. Gaussian noise is calculated using the following formula: ,
[0142] in, The noisy image output after adding Gaussian noise; This is the composite overlay image output from steps 2-4; The standard deviation in this embodiment is the preset Gaussian noise variance. ; The image must have the same dimensions as the input image and follow a standard normal distribution. The random noise matrix;
[0143] Steps 2-6, JPEG compression simulation: Simulate image compression in social media dissemination, with the quality factor Q ranging from [30, 90]. The smaller Q is, the higher the compression ratio and the greater the image quality loss.
[0144] Steps 2-7, Crop Attack Simulation: Simulate viewpoint shift and cropping ratio during screen capture. The range is [0.3, 0.9]. The smaller the size, the more data is cropped, and the smaller the remaining image area.
[0145] Steps 2-8, Pixel Loss Simulation: Randomly remove some pixels and replace them with pixels from the carrier image to simulate signal loss, loss ratio. The range is [0.1, 0.5]. The larger the size, the more it is lost.
[0146] Combination Figure 1 and Figure 5 As shown, step 3 includes the following preprocessing steps:
[0147] Step 3-1, Geometric correction preprocessing: such as Figure 1 As shown, the homography matrix is used to perform geometric correction and restoration on screen-captured degraded images containing perspective distortion, extracting aligned effective image regions. This step can be achieved using existing conventional geometric correction techniques such as corner detection or edge extraction.
[0148] Step 3-2, Image size analysis and spatial calculation: (e.g.) Figure 5 As shown, the width of the geometrically corrected image is obtained. With height And combined with preset cutting dimensions ,in Calculate the redundant spatial boundaries of the current image that can be used for cropping:
[0149] ,
[0150] ,
[0151] Thus, the minimum remaining space is obtained. The calculation formula is as follows: ,
[0152] in, The width of the geometrically corrected image. The height of the geometrically corrected image; The preset image cropping space size; The preset baseline watermark cycle size; This is a function to retrieve the maximum value. The calculated horizontal redundancy space boundary; The calculated vertical redundancy space boundary; This is a function that takes the minimum value. Minimize the remaining space of the final output image;
[0153] Step 3-3, Adaptive pruning quantity decision: Based on the calculated minimum remaining space Adaptively determines the amount of data to be cropped from the current image. Strictly adhere to the odd-numbered-part pruning mechanism. Based on the images from largest to smallest, they are mapped into 9 (large images), 7 (medium images), 5 (small images), or 3 (very small images) to ensure a valid majority voting basis for subsequent voting.
[0154] Steps 3-4, Non-Grid Random Cropping: After determining the number of cropping regions, multi-region random cropping is performed within the effective image area. When selecting the starting coordinates for cropping, a non-grid sampling strategy is used, intentionally introducing random spatial coordinate offsets. This design aims to avoid absolute alignment between the cropping window and the periodic grid boundaries during template tiling, thereby increasing the diversity of data features in the input network and ultimately improving the output... Each patch is a separate cropped region image for parallel processing by the dual-branch decoder.
[0155] like Figure 3 As shown, step 4 includes:
[0156] Step 4-1, Localizer Branch Construction: The UNet++ architecture is adopted, which includes three parts: encoder, nested skip connections and decoder. The input is a noisy image and the output is a localization probability map.
[0157] Step 4-2, Positioner encoder construction: It contains 4 convolutional blocks, each of which contains two 3×3 convolutional layers, a batch normalization layer and a ReLU activation function, with the number of channels being 32, 64, 128 and 256 respectively, and downsampling is performed by max pooling;
[0158] Step 4-3, locator nested skip connection construction: multi-layer nested skip connections are used to fuse encoder features from different levels;
[0159] Step 4-4, Localizer Decoder Construction: Upsampling is performed using bilinear interpolation, and channel concatenation is performed with encoder features to ultimately obtain the decoder. The convolution operation maps features to a single-channel localization probability map, calculated using the following formula:
[0160] ,
[0161] in, This is the output feature map of the highest resolution layer in the locator (UNet++ architecture) after multiple nested skip connections and feature fusion; Represents a two-dimensional convolution operation; The input is the number of basic channels for this convolutional layer; This indicates that the kernel size used is... ; This is the final output single-channel localization probability map;
[0162] Steps 4-5, Decoder Branch Construction: The UNet3+ architecture is adopted, comprising an encoder, multi-scale feature fusion decoding, and an output layer. The process for obtaining the localization region cropping image from the input decoder branch is as follows: using the single-channel localization probability map output in step 4-4, binarization activation is performed through a preset threshold, and the coordinates of the minimum bounding box of the effective response region are calculated. Based on this coordinate space, the corresponding cropping region image output in step 3-4 is precisely cropped and uniformly scaled to a fixed size to obtain the localization region cropping image; the output is a binary message vector.
[0163] Steps 4-6, Decoder encoder construction: It contains 4 convolutional blocks, each of which contains two 3×3 convolutional layers, a batch normalization layer and a ReLU activation function, with the number of channels being 32, 64, 128 and 256 respectively, and downsampling is performed by max pooling;
[0164] Steps 4-7, Decoder Multi-Scale Fusion Construction: Fuse features from all encoder layers at each decoding layer to achieve global feature interaction;
[0165] Steps 4-8, Decoder Output Layer Construction: The feature map is compressed into a global feature vector using adaptive average pooling, and then mapped into a binary message vector using a fully connected layer. The calculation formula is as follows:
[0166] ,
[0167] ,
[0168] ,
[0169] in, This is the multi-scale fused feature map output from the penultimate layer of the decoder; This represents a feature refinement operation consisting of two convolutional layers; This is the refined feature map; Indicates the output size is Adaptive two-dimensional average pooling operation; This represents the flattening operation that expands a multidimensional tensor into a one-dimensional vector. This is the global one-dimensional feature vector obtained after pooling and flattening. This represents a fully connected linear mapping operation, with its input dimension parameter set to... , The number of feature aggregation channels in the dual-branch decoder is set to [value], and the output dimension parameter is set to [value]. , The length of the binary watermark message is the length predefined in steps 1-5 above; This is the vector of original predicted logical values corresponding to each watermark information bit in the final output of the model.
[0170] The training process of the dual-branch decoder in step 4 adopts a two-stage training strategy, specifically as follows:
[0171] In the locator stage, the Dice loss is used to train the locator to identify the watermark template location, and a segmented adjustment strategy is used to dynamically adjust the watermark strength coefficient. When the locator's Dice coefficient reaches a threshold, the process switches to the decoder stage. In the decoder stage, the locator parameters are frozen, and the decoder is trained using binary cross-entropy loss to extract watermark messages from the location area. The watermark strength coefficient is then dynamically adjusted based on the bit error rate. .
[0172] Positioner training phase: The positioner is trained using the Dice loss function to optimize positioning accuracy. The Dice loss calculation formula is as follows: ,
[0173] in, This represents the Dice loss value during the training process of the locator branch. This is the localization probability map output by the locator, which is the probability map of the locator's prediction of the location of the localization unit in the cropped area image. This is a preset target label matrix; This represents the operation of summing all elements in the matrix; To prevent the occurrence of small smoothing constants in division-by-zero operations in formulas, its value is set to... ;
[0174] Decoder training phase: Freeze the locator parameters and train the decoder using the Binary Cross-Entropy (BCE) loss function to optimize message extraction accuracy. The BCE loss calculation formula is as follows:
[0175] ,
[0176] in, The binary cross-entropy (BCE) loss value is used to measure the difference between the predicted message probability and the true label during the process of optimizing the watermark message extraction accuracy. Let be the message probability vector output by the decoder, which satisfies This means that the message Predicted values after The probability value after activation function processing; This indicates the original message output by the decoder. The predicted values are normalized to a value between [0,1] to represent the probability that each watermark bit is 1; This is the original set of binary message tags; The Hadamard product represents the element-wise multiplication operation of a matrix or vector. This indicates a global mean calculation operation; To prevent logarithmic If a smoothing small constant with an argument of zero occurs during the calculation, its value is set to... .
[0177] Two-stage switching mechanism: When the locator Dice coefficient reaches the threshold of 0.95, it automatically switches to the decoder stage, or can be manually set. The parameter control switching is as follows: the first stage trains the locator to identify the watermark template position, and the second stage trains the decoder to extract the watermark message from the location area.
[0178] The adaptive watermark strength adjustment mechanism in step 4 includes:
[0179] Positioner stage adaptive adjustment: dynamically reduce the watermark strength coefficient based on positioning loss. A segmented adjustment strategy is adopted, initially... The value was gradually reduced to 0.005, thus reducing the watermark strength while maintaining positioning accuracy.
[0180] Decoder stage adaptive adjustment: dynamically adjusts the watermark strength coefficient based on the bit error rate. When the bit error rate is below the threshold Time reduction Enhance imperceptibility when the bit error rate exceeds a threshold. Increased time Enhance robustness;
[0181] Locking mechanism: Locking occurs when the bit error rate is too high. This value is used to prevent information loss due to insufficient watermark strength. Minimum value is ;
[0182] Scope limitations: The value range is To ensure a balance between the imperceptibility and robustness of the watermark, Too large an image will make the watermark very noticeable. Too small a size makes the watermark fragile;
[0183] This invention also proposes an adaptive voting pruning mechanism, such as... Figure 5 As shown. This mechanism employs a decoupled design in its architecture and works synergistically throughout the aforementioned preprocessing (step 3) and decoding fusion (step 5) stages: In the preprocessing stage (step 3), the mechanism adaptively determines the amount of pre-cropping based on the available spatial boundaries of the image. In the decoding and fusion stage (step 5), this mechanism performs a final bit-by-bit victory determination on the multi-region decoding results based on the corresponding adaptive majority voting threshold, thereby achieving a complete two-stage closed loop. The specific calculation formula for this mechanism is as follows:
[0184] ,
[0185] ,
[0186] ,
[0187] Based on minimum remaining available space The adaptive decision-making rules are as follows:
[0188] (1) When At that time, the adaptive majority voting threshold k is set to 5, and the number of presidents cuts is... Suitable for multiple cropping voting of large-sized images;
[0189] (2) When At that time, the adaptive majority voting threshold k is set to 4, and the number of presidents is cut. Suitable for cropping medium-sized images;
[0190] (3) When At that time, the adaptive majority voting threshold k is set to 3, and the number of presidents cuts is... Suitable for cropping small images;
[0191] (4) When At that time, the adaptive majority voting threshold k is set to 2, and the number of presidents cuts is... It is suitable for cropping images with the smallest size.
[0192] in, and These are the width and height of the geometrically corrected image, respectively. The preset cutting space size, and meets the requirements. ; The preset baseline watermark cycle size; This is a function to retrieve the maximum value. This represents the horizontal redundant space boundary. This represents a redundant space boundary in the vertical direction. This is a function that takes the minimum value. Minimize the remaining space of the final output image; Cut the quantity for the president.
[0193] The number of CEO cuts and the adaptive majority voting threshold strictly satisfy the majority-win relationship: Furthermore, the number of haircuts made by the president strictly adheres to an odd-number system. (in Positive integer placeholders are used to specify and distinguish voting thresholds. In addition, a non-mesh sampling strategy is used when obtaining the clipping coordinates to avoid mesh alignment between the clipping window boundary and the tiling cycle of the watermark template.
[0194] Combination Figure 3 and Figure 5 As shown, step 5 includes:
[0195] Step 5-1, Obtain decoding results and localization probability map: Receive a set of 48-bit binary messages independently output from multiple dual-branch decoders, and synchronously receive the corresponding localization probability map output from the locator branch (UNet++);
[0196] Step 5-2, Adaptive Voting Parameter Decision: Adaptively determine the number of cuts based on the size of the input image. and adaptive majority voting threshold The specific rules are as follows:
[0197] Calculate the minimum remaining space of the image ,when hour, , ;when hour, , ;when hour, , ;when hour , ;
[0198] Step 5-3, Confidence Assessment Based on the Localization Probability Map: The decoding results of each clipped region are filtered for confidence using the localization probability map output from the locator branch. The mean response of the localization probability map within each clipped region is calculated. If this mean is lower than a preset confidence threshold... If the area is severely affected by screen capture distortion or does not effectively contain the watermark template, it is determined to be an invalid result and removed before fusion, thereby avoiding high-noise decoding data from polluting the voting pool; in a preferred embodiment of the present invention, the confidence threshold is... The adaptive setting is 0.15.
[0199] Step 5-4, Bit-wise majority voting: Perform bit-wise majority voting on the set of valid binary messages retained after confidence filtering. For the 48-bit message sequence... The number of votes with a value of 1 for this bit in all valid cropped regions;
[0200] Step 5-5, Threshold Determination and Result Output: The threshold determination and result output will be... Total number of votes per bit and adaptive majority voting threshold Compare the total number of votes. Then determine the first watermark information extracted in the final step. The bit is 1; if the total number of votes is 1. If the result is zero, the result is determined to be 0. After traversing the complete 48-bit message sequence, the final fused 48-bit watermark information is output.
[0201] This invention conducts multi-dimensional experimental evaluations based on real-world screen shooting scenarios. Unlike traditional testing methods that only simulate single digital noise, this invention addresses issues such as image distortion, moiré interference, image quality degradation, and device differences that exist during actual screen shooting. The testing is conducted from four dimensions: image visual concealment, robustness at different shooting distances, robustness at different shooting angles, and effectiveness of core modules.
[0202] To ensure the fairness and rigor of the comparative experiments, all subsequent tests in this invention (i.e., all experimental tables) use the exact same test dataset and the same amount of data. Specifically, all tests are conducted independently on the same batch of publicly available datasets (such as the DIV2K dataset) containing 1000 standard test images, ensuring that the data benchmarks for evaluating each indicator are strictly consistent.
[0203] The experiment selected four current mainstream anti-screen capture image watermarking algorithms as comparison schemes, including:
[0204] The StegaStamp algorithm (see the literature: "StegaStamp: Invisible hyperlinks in physical photographs").
[0205] PIMoG algorithm (invisible screen-shooting watermark resilient to moiré pattern and geometric distortion, see reference: "PIMoG: An invisible screen-shooting watermark resilient to moiré pattern and geometric distortion").
[0206] SRWSS algorithm (Screen-Shooting Resilient Watermarking Scheme).
[0207] The rihoop algorithm (Robust invisible hyperlinks in physical photographs, see related literature).
[0208] Peak signal-to-noise ratio (PSNR), structural similarity (SSIM), bit error rate (BER), and watermark extraction accuracy are used as core evaluation indicators to comprehensively verify the overall performance of this invention in terms of visual imperceptibility, resistance to screen capture distortion, hardware adaptability, and module synergy.
[0209] Table 1 shows the PSNR and SSIM test results of watermarked images using various methods. PSNR and SSIM are two core indicators for evaluating visual imperceptibility in the field of image watermarking. A higher PSNR value indicates less pixel distortion in the image, while an SSIM value closer to 1 indicates stronger consistency between the image texture, structure, and color and the original image.
[0210] Experimental data shows that among traditional algorithms, SWRSS and PIMog have relatively superior visual effects, while StegaStamp exhibits the most significant visual distortion. The PSNR of this invention reaches 40.82dB, the highest among all compared algorithms, and its SSIM is 0.977, remaining within the excellent range. This indicates that the template embedding and adaptive watermark intensity adjustment mechanism designed in this invention can preserve the visual features of the original image to the maximum extent while embedding watermark information. The watermark's concealment is outstanding, making it difficult for the human eye to detect image tampering, thus achieving a good balance between watermark embedding and image quality.
[0211] Table 1. Test results of watermark extraction bit error rate at different shooting distances
[0212]
[0213] Table 2 shows the test results of watermark extraction bit error rate at different shooting distances. In real screen capture scenarios, shooting distance directly changes the intensity of screen moiré patterns, image clarity, and illumination distribution. The farther the distance, the lower the effective pixel ratio of the image, and the more difficult the watermark extraction. In this experiment, the shooting angle was fixed at a vertical frontal view (0°), and five sets of gradient shooting distances of 20cm, 30cm, 40cm, 50cm, and 60cm were set to simulate daily close-range, medium-range, and long-range screen capture behaviors.
[0214] Experimental results show that all comparison algorithms exhibit varying degrees of increase in bit error rate with increasing shooting distance. SWRSS shows a precipitous drop in performance at long distances, with a bit error rate as high as 13.9% at a distance of 60cm. Other algorithms also exhibit sporadic bit errors across the entire distance range. In contrast, this invention maintains a consistently low bit error rate below 0.1% (as low as 0.01%) across the entire shooting distance range from 20 to 60cm, allowing for near-lossless extraction of the watermark information. Thanks to the structured template localization mechanism and the optimized training of the screen capture degradation simulation layer, this invention effectively adapts to image quality degradation and moiré interference caused by different shooting distances, demonstrating strong robustness in screen capture scenarios across all distances.
[0215] Table 2. Test results of watermark extraction bit error rate at different shooting distances
[0216]
[0217] Table 3 shows the test results of watermark extraction bit error rate under different shooting angles. In actual screen capture, it is difficult for users to maintain a vertical shooting position at all times. Angle deviation can cause problems such as image perspective distortion, local cropping, and geometric deformation, which are the main sources of interference in watermark extraction. In this experiment, the shooting distance was fixed at 40cm, and multiple tilt angles of ±60°, ±45°, ±30°, and ±15° were set to cover all angle scenarios in daily shooting.
[0218] The data shows that all compared algorithms produce significant bit errors at tilt angles, with the error problem being particularly severe in large-angle (±60°) scenarios. SWRSS exhibits the worst overall resistance to angle distortion. This invention, however, achieves a near-zero bit error rate at normal tilt angles (-30° to 45°), exhibiting extremely low bit errors only in extreme large-angle (±60°) scenarios, demonstrating significantly better overall performance than the compared algorithms. This invention uses a UNet++ locator branch to accurately identify the position of the distorted watermark template, and combines this with a dual-branch decoding architecture to decouple the localization and decoding tasks, effectively offsetting perspective distortion caused by angle shifts and demonstrating excellent multi-angle screen capture adaptation capabilities.
[0219] Table 3. Test results of watermark extraction bit error rate under different shooting angles
[0220]
[0221] Table 4 presents the ablation experiments of the core functional modules, used to verify the effectiveness and synergistic effect of the two core modules of this invention: the template localization module (Locator) and the adaptive voting pruning module (Voting). The experiments tested the overall watermark extraction accuracy of the model by individually removing, retaining, and combining the two modules, clarifying the contribution of each module to the overall performance.
[0222] The experimental analysis is as follows: When only the basic network is retained without any additional modules, the model accuracy is only 51.93%, indicating that the original network cannot cope with screen capture distortion. Enabling the template localization module alone does not improve accuracy, demonstrating that a single localization module cannot independently solve complex screen capture interference. Enabling the adaptive voting cropping module alone significantly improves accuracy to 96.37%, proving that the odd-block cropping + bit-by-bit voting mechanism can effectively resist local pixel loss and regional distortion. When the localization module and the voting cropping module work together, the model extraction accuracy reaches 99.85%. Therefore, the template localization module is responsible for accurately locking the effective watermark area, while the adaptive voting cropping module further suppresses random distortion through multi-region voting. The two complement each other and are the core key to achieving high robustness in this invention.
[0223] Table 4 Ablation Experiments of Core Functional Modules
[0224]
[0225] Here is a supplementary explanation of the specific meanings of the symbols in Table 4: The symbols in the table… "" indicates that the corresponding core module or processing mechanism is included (or enabled) in the current comparative experimental group; "-" in the table indicates that the core module or processing mechanism is not included (or has been removed) in the current experimental group. This comparison verifies the specific contribution and impact of introducing each core module on the final performance of the system.
[0226] The combined experimental results demonstrate that the template-based robust image watermarking method proposed in this invention outperforms existing mainstream algorithms in all dimensions, including visual concealment, robustness to different shooting distances and angles, and module collaboration capabilities. Through structured templates, dual-branch decoding, two-stage training, adaptive watermark strength, and simulation of screen capture degradation, the solution perfectly balances the imperceptibility of the watermark with its resistance to screen capture distortion. It can be effectively applied to real-world scenarios such as digital content copyright protection, screen capture leak tracking, and multimedia source tracing, exhibiting high practical value and significant application potential.
[0227] This embodiment also provides a template-based anti-screen capture robust image watermarking network system, including: a template fusion unit, a screen capture degradation unit, a cropping processing unit, a dual-branch decoding unit, and a voting fusion output unit;
[0228] In this embodiment, the template fusion unit is used to fuse the carrier image with the structured template output by the template watermark generator to obtain a watermarked image;
[0229] In this embodiment, the screen capture degradation unit is used to input the watermarked image into the screen capture degradation simulation layer for processing to obtain the screen capture degradation image;
[0230] In this embodiment, the cropping processing unit is used to preprocess the screen capture degraded image to obtain images of each cropping region;
[0231] In this embodiment, the dual-branch decoding unit is used to input the images of each cropped region to the corresponding dual-branch decoder for independent multi-cropping decoding to obtain each decoding result;
[0232] In this embodiment, the voting fusion output unit is used to input each decoding result into the voting fusion module for processing to obtain the final watermark information.
[0233] The aforementioned system can implement the template-based robust image watermarking network method for screen capture resistance described in this invention. However, the implementation device of the template-based robust image watermarking network method for screen capture resistance described in this invention includes, but is not limited to, the template-based robust image watermarking network system for screen capture resistance described in this invention.
[0234] Example 2:
[0235] This invention provides an electronic device, including a processor and a memory. The memory stores program instructions for implementing the template-based, screen-capture-resistant robust image watermarking network method of Embodiment 1. The processor executes the program instructions stored in the memory to perform screen-capture-resistant robust image watermark extraction.
[0236] The processor can also be called a Central Processing Unit (CPU). A processor may be an integrated circuit chip with signal processing capabilities. A processor can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.
[0237] The methods described in Embodiment 1 of this invention are applicable to this electronic device embodiment. The specific functions implemented by this electronic device embodiment are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above methods.
[0238] Example 3:
[0239] This embodiment provides a storage medium storing a computer program or instructions capable of implementing the above-described template-based robust image watermarking network method for resisting screen capture. When the computer program or instructions are run on a computer, the steps of the above-described template-based robust image watermarking network method for resisting screen capture are executed.
[0240] The computer program or instructions can be stored in the aforementioned storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0241] The methods described in Embodiment 1 of this invention are all applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above methods.
[0242] This invention provides a template-based, screen-capture-resistant robust image watermarking network method and system. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A template-based robust image watermarking network method against screen capture, characterized in that, Includes the following steps: Step 1: Fuse the carrier image with the structured template output by the template watermark generator to obtain a watermarked image; Step 2: Input the watermarked image into the screen capture degradation simulation layer for processing to obtain the screen capture degradation image; Step 3: Preprocess the degraded screen capture image to obtain images of each cropped region; Step 4: Input the images of each cropped region into the corresponding dual-branch decoder for independent multi-cropping decoding to obtain the decoding results; Step 5: Input each decoding result into the voting fusion module for processing to obtain the final watermark information.
2. The template-based robust image watermarking network method for screen capture resistance according to claim 1, characterized in that, Step 1 includes: Define the template structure parameters and set the coordinates of the positioning unit and the message unit; The positioning unit is generated using a distance modulation mode, and the calculation formula is as follows: ; in, The modulation coefficient, A matrix of pixel values for a single localization unit. The horizontal coordinates of the current pixel within the positioning unit. The vertical coordinates of the current pixel within the positioning unit; This is the Euclidean distance from the pixel to the center of the positioning unit; The modulation variables for the positioning unit are calculated based on Euclidean distance; It is a positive modulation vector. It is a negative modulation vector; The binary message is expanded into a spatial feature map, and the red, green and blue channels are encoded by positive / negative modulation to generate message units; The positioning unit and message unit are combined into a template tensor according to their coordinates. Then, the template tensor is fused with the carrier image using the template tiling mode to generate a watermarked image. The formula is as follows: , in, For template tensors, For carrier image, denoted as the watermark strength coefficient, and S is the encoded watermarked image.
3. The template-based robust image watermarking network method for screen capture resistance according to claim 1, characterized in that, Step 2 includes: A perspective transformation simulation is performed on the watermarked image to obtain the image after perspective transformation; The image after perspective transformation, the illumination mask generated by illumination distortion simulation, and the moiré mask generated by moiré simulation are weighted and combined, and Gaussian noise is added to the weighted and combined image to obtain a noisy image. A JPEG compression simulation is performed on a noisy image, and the JPEG compressed image is obtained by adjusting the quality factor. A cropping attack simulation was performed on a JPEG compressed image, and the cropped image was obtained by adjusting the cropping ratio. Pixel loss simulation is performed on the cropped image to obtain a screen capture degraded image.
4. The template-based robust image watermarking network method for screen capture resistance according to claim 1, characterized in that, In step 4, the dual-branch decoder includes a locator branch and a decoder branch. The process of the dual-branch decoder processing the image includes: The input image is fed into the locator branch, where feature processing is performed to obtain the localization probability map. The input image is cropped using the localization probability map to obtain a localization region cropped image; The cropped image of the localized region is input into the decoder branch, where it undergoes feature processing by the watermark decoder to obtain a binary message.
5. The template-based robust image watermarking network method for screen capture resistance according to claim 1, characterized in that, The training process of the dual-branch decoder adopts a two-stage training strategy, specifically: In the locator stage, the locator is trained using Dice loss to identify the watermark template location, and a segmented adjustment strategy is used to dynamically adjust the watermark strength coefficient; when the locator Dice coefficient reaches the threshold, the process switches to the decoder stage. During the decoder stage, the locator parameters are frozen, the decoder is trained using binary cross-entropy loss to extract watermark messages from the location area, and the watermark strength coefficient is dynamically adjusted according to the bit error rate.
6. The template-based robust image watermarking network method for screen capture resistance according to claim 1, characterized in that, Step 5 includes: Obtain the decoding results and the corresponding localization probability map; The cropping amount and adaptive majority voting threshold are adaptively determined based on the size of the input image; The confidence level of the decoding results for each clipping region is filtered using the localization probability map output by the locator branch. Perform bit-by-bit majority voting on the set of valid binary messages retained after confidence filtering, and count the total number of votes where each bit value is 1 in all valid cropped regions; The total number of votes for each person is compared with the adaptive majority voting threshold. If the total number of votes is greater than or equal to the adaptive majority voting threshold, the value of that bit in the final extracted watermark information is determined to be 1; otherwise, it is determined to be 0. After traversing the message sequence, the final merged watermark information is output.
7. A template-based, screen-capture-resistant robust image watermarking network system, characterized in that, include: The template fusion unit is used to fuse the carrier image with the structured template output by the template watermark generator to obtain a watermarked image; The screen capture degradation unit is used to input the watermarked image into the screen capture degradation simulation layer for processing to obtain the screen capture degradation image; The cropping processing unit is used to preprocess the screen-captured degraded image to obtain images of each cropping region; The dual-branch decoding unit is used to input the images of each cropped region into the corresponding dual-branch decoder for independent multi-cropping decoding to obtain each decoding result. The voting fusion output unit is used to input the various decoding results into the voting fusion module for processing to obtain the final watermark information.
8. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the template-based localization-based robust image watermarking network method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The device stores a computer program or instructions that, when run on a computer, execute the steps of the template-based anti-screen capture robust image watermarking network method as described in any one of claims 1 to 6.
