Screen-shooting-attack-resistant digital watermarking method capable of automatically positioning
By adopting the automatic embedding-positioning-extraction architecture of the positioning network and decoding network in the screen shooting scene, combined with the CBAM fusion attention mechanism and multi-stage multi-loss constraint training, the problem of automatic positioning and decoding of watermark images in the screen shooting scene is solved. , achieving efficient and convenient copyright protection and improving the robustness and visual quality of watermark images.
Patent Information
- Application Number
- CN202410866451.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-20
AI Technical Summary
The existing technology cannot realize automatic positioning and decoding of watermark images in screen shooting scenarios, resulting in the need for manual positioning of watermark images after stolen photos, which limits the application and efficiency of deep robust watermarking.
Propose a digital watermarking method that resists screen capture attacks. It adopts the automated embedding-positioning-extraction architecture of the positioning network and the decoding network, and combines the encoding network with the CBAM fusion attention mechanism and the decoding network based on the positioning mask. Through multi-stage and multi-loss Constrained training strategy realizes automatic positioning and decoding of watermark images in screen shooting scenarios.
It realizes the automatic positioning and decoding of watermark images, improves the efficiency and convenience of watermark embedding-positioning-extraction, improves the visual quality and robustness of watermark images, reduces artifacts, and enhances the imperceptibility and concealment of watermarks. sex.
Smart Images

Figure CN118674601A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital watermarking, and in particular to an automatically positioned anti-screen-capture attack digital watermarking method. Background Art
[0002] Digital images are widely disseminated in modern society through cross-media transmission applications such as displays, cameras, and printers, bringing convenience to people's lives and work. However, in the process of copyright protection, such a dissemination method often destroys the copyright watermark, making it difficult to trace the source after stealing. Screen stealing not only infringes on intellectual property rights, but also reduces the value of the work and causes economic losses to the original author. Distortion attacks during screen shooting will damage the extractability of the watermark, making it impossible to accurately restore the embedded copyright information of the watermark image. In order to protect the copyright of digital media works, watermark technology needs to improve its performance and resist distortion across screen shooting to prevent piracy and infringement. This requires the watermark to be robust and anti-interference, and to maintain image quality and watermark extractability during screen shooting. Therefore, resisting screen shooting distortion has become one of the new requirements for image watermarking technology to improve copyright protection.
[0003] In recent years, neural network models have developed rapidly and have gradually been applied in digital image watermarking. Researchers have used a training model that uses an encoder / decoder network plus a noise layer to enable deep watermark images to still extract watermarks under screen distortion. For example, the document "Wengrowski E, Dana K. Light field messaging with deep photographic steganography [C]. Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2019: 1515-1524." builds a large screen watermark image dataset to train a distortion simulation network as a noise layer. This method requires a new screen watermark image dataset for each new model, so it is not universal. The literature "Tancik M, Mildenhall B, Ng R. Stegastamp: Invisible hyperlinks in physical photographs [C]. Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2020: 2117-2126." By simulating various distortions in the shooting process, an end-to-end training method is used to improve the model's robustness to screen distortion, but the generated watermark image has low visual quality and visible artifacts. The literature "Fang H, Jia Z, Ma Z, et al. PIMoG: An effective screen-shooting noise-layer simulation for deep-learning-based watermarking network [C]. Proceedings of the 30th ACM International Conference on Multimedia. 2022: 2267-2275." modeled moire distortion, and further divided screen distortion into three categories: perspective distortion, illumination distortion, and moire distortion, making the watermark more robust.
[0004] However, the methods described in the above literature all have a problem, that is, after shooting, the four corners of the screen shot image need to be manually extracted to locate the area of the watermark image, which greatly limits the promotion and application of deep robust watermarking. The literature "Jia J, Gao Z, Zhu D, et al. Learning invisible markers for hidden codes in offline-to-online photography [C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2022: 2273-2282." proposes a method for selecting a sub-region in an image to partially embed a watermark, using Hrnet to generate a heat map to locate the four corners of the sub-image, and automatically locate the position of the watermark area in the image. However, this method requires manually extracting the target image from the screen shot image before the positioning network can extract the watermark sub-image. Given that there is no method that can automatically encode / decode and locate the screen shot watermark image in the screen shot scenario, this method proposes a digital watermark method that can automatically locate and resist screen shot attacks. Summary of the invention
[0005] This paper proposes an anti-screen-capture attack digital watermark method that can be automatically positioned. The positioning network is used to construct an anti-screen-capture watermark automatic embedding-positioning-extraction architecture, which aims to automatically locate and decode the copyright image in the screen-capture scenario, and solve the problem that the watermark image taken in the voyeuristic scenario still needs to be manually positioned. The method mainly includes the following contents:
[0006] (1) A training strategy for embedding-localization-extraction in screen shot image scenarios is proposed.
[0007] (2) A coding network based on CBAM fusion attention mechanism for feature splicing is proposed.
[0008] (3) A decoding network based on positioning mask is proposed.
[0009] The specific contents are as follows:
[0010] (1) A training strategy for watermark embedding, positioning and extraction in screen capture images is proposed. The overall structure is as follows: Figure 1As shown, it is specifically composed of an encoding network En, a noise simulation layer N, a positioning network Los, a decoding network De and a discrimination network Dis. The input is defined as a tuple (W, C) of the original image and the watermark information, W represents a bit string of code watermark information, and C represents the original image to be embedded with the watermark. The encoding network of the present invention is a Unet network based on the CBAM fusion attention mechanism for feature splicing. The output watermark residual is added to the original image to obtain the watermark image S: S = Clamp (En (W, C) + C). The clamp function can limit the pixel value to between 0-255 to prevent pixel value overflow. The noise simulation layer simulates the image degradation of the screen capture process, which is used to train the robustness of the watermark embedding-positioning-extraction process, such as Figure 2 As shown, it includes Jpeg compression, perspective transformation, background filling, blur noise, brightness, contrast, saturation distortion, as well as illumination distortion and moiré distortion. At the same time, the watermark area mask M: M = N (S) is retained to train the positioning network. The noise simulation layer finally outputs a simulated screen capture image S'. The positioning network of the present invention uses Hrnet to perform a semantic segmentation, divides the pixels of the noisy image into a watermark area and a background area, and outputs a positioning mask M': M' = Loc (S'). The present invention also designs a decoding network based on a positioning mask, which accepts a noisy image S' and a positioning mask M as input, so as to refer to the mask of the watermark area obtained by the positioning network as prior knowledge during the decoding process, thereby resisting the interference of screen capture on decoding. Finally, the decoding network outputs the decoding information W': W' = De (S', M'). Existing anti-screen capture watermarking methods all cause serious artifacts in the watermark image due to the need to have sufficient robustness.
[0011] In order to achieve the complex functional requirements of the model, the present invention uses a multi-stage multi-loss constraint training strategy. In the first stage, the codec is trained, using MSE as the information loss L de As the first stage loss The calculation process is as follows:
[0012] L de =MSE(W,W′) (1)
[0013]
[0014] In the first stage, the noise layer does not enable perspective transformation and background filling, because the positioning network is not trained, and only the encoding / decoding network is trained to have the basic ability to embed / extract watermark information. In the second stage, the strength of perspective distortion is gradually increased, and pictures are selected as background filling. At this time, the positioning loss is added to train the positioning network. w and h are the width and height of the watermark image. The loss in the second stage is The calculation is as follows:
[0015] Lloc=μ1BCE(M,M′)+μ2(1-IOU(M,M′)) (3)
[0016]
[0017] BCE is used to constrain the distance between the binary classification output probability generated by the positioning network for each pixel and the label to which the pixel belongs (background 0 and watermark area 1). IOU is used to calculate the degree of overlap between the positioning mask generated by the positioning network and the watermark area mask. The second step is to train the encoding network, positioning network and decoding network to correctly embed, locate and extract watermarks under the attack of the screen-shot simulated noise layer. Because correct positioning is a prerequisite for correct extraction, the present invention gives a larger weight to the positioning loss during training. However, the watermark image will have a large visual loss at this time, so the third stage needs to gradually restore the visual effect of the watermark image. The visual loss of the present invention is obtained by weighting the MSE loss, SSIM loss and LPIPS loss. l, c, s are the similarity functions of brightness, contrast and structure, respectively, and the formula is as follows:
[0018] L v =μ3MSE(C,S)+μ4(1-SSIM(C,S))+μ5LPIPS(C,S) (5)
[0019]
[0020] MSE loss is the distance between the watermark image and the original image constrained at the pixel level. SSIM loss is the visual loss that constrains the image in three dimensions: brightness, contrast, and structure. LPIPS is to evaluate the perceptual difference between two images through a deep learning model. The visual loss obtained by weighting these three factors has an excellent visual constraint effect. The constrained encoding network gradually generates a visually imperceptible watermark image. In the last stage, the steganalysis network is introduced as a discriminant network to confront the encoding network, further reducing artifacts and improving visual effects. The discriminant network loss is as follows:
[0021] L Dis =BCE(Dis(S),1)+BCE(Dis(C),0) (7)
[0022] L g =BCE(Dis(D),0) (8)
[0023] L Dis It is used to constrain the discriminative network to correctly classify the watermark image and the original image, and to classify the watermark image S as 1 and the original image as 0 as much as possible. gIt is used to constrain the loss of the discriminant network and make the discriminant classify the watermark image S as 0 as much as possible. In the GAN network structure, UCNet, as a discriminant network, distinguishes the watermark image and the original image as much as possible, while the encoding network may deceive the discriminant network to identify the watermark image as the original image. The existing steganalysis network mainly extracts image artifacts to determine whether the image contains steganography, and the existing robust blind watermarking schemes often have more obvious artifacts. Therefore, jointly training the steganalysis network and the encoding network to form a GAN network structure allows the steganalysis network to supervise the encoding network to suppress the generation of artifacts. The loss of the fourth stage as follows:
[0024]
[0025] (2) A coding network based on CBAM fusion attention mechanism for feature splicing is proposed: the network structure is as follows Figure 3 As shown. Traditional deep watermarking methods often use Unet networks as encoding networks, but the resulting watermarked images have poor visual effects. In order to improve the imperceptibility of embedded watermarks, the present invention adds a fusion attention mechanism to the Unet network. Traditional Unet fuses surface features and deep features by splicing in the upsampling stage, while the present invention adds a CBAM layer in the fusion process. CBAM is a lightweight attention module that can perform attention operations in the spatial dimension and channel dimension. For the input features Among them, F1 is the surface feature of the same size, and F2 is the deep feature of the same size. The distribution of F′ and F″ represents the features transformed by the channel attention mechanism and the spatial attention mechanism. First, calculate the channel attention M c ,have Then calculate the spatial attention M s , with post-fusion features The coding network of the present invention first performs a feature extraction process on the input, first performs a convolution on the input, and undergoes four downsampling and convolution processes to obtain deep features. After feature extraction, it enters the upsampling process, uses four CBAM layers to replace the splicing operation after four upsampling to perform feature fusion, and finally obtains the output through one convolution. Compared with splicing, this feature fusion can select the optimal channel feature in the channel dimension and select the optimal area in the spatial dimension for watermark embedding, thereby having better visual quality.
[0026] (3) A decoding network based on positioning mask is proposed. In the existing scheme, when an error occurs in the positioning network, it will cause a larger error in subsequent operations. Such error transmission often causes the decoder to be unable to decode the watermark. In order to solve this problem, the present invention designs a decoding network based on positioning mask. The network receives the screen shot image S′ and the positioning mask M′ as input, and directly decodes the watermark W′ without the need for four-corner extraction and perspective distortion. First, because the decoding network refers to the positioning mask, it grasps the position characteristics of the watermark image area in the screen shot image, so that the watermark can be correctly decoded. At the same time, if the screen shot image is not processed with perspective distortion, the complete original information is retained to avoid decoding failure due to the transmission of positioning errors. The decoding network structure is as follows: Figure 4 As shown in the figure, it is composed of three ConvBNReLU blocks and three SE blocks, and finally passes through the fully connected layer FC and changes its shape to obtain the watermark information. ConvBNReLU consists of convolution, batch normalization, and activation function ReLU. The SE block is a module that uses a channel attention mechanism. It has few parameters and strong versatility. It can explicitly model the interdependence between convolution feature channels and effectively enhance the modeling ability of deep neural networks for features. In short, such a decoding network setting can fully draw on the positioning mask generated by the positioning network but is not affected by the accuracy of the positioning mask.
[0027] Compared with other methods, the present invention has the following significant advantages:
[0028] 1. The present invention realizes automatic positioning and decoding of watermark images through positioning networks and decoding networks, solving the positioning problem of deep robust watermarks in practical applications. The positioning network can accurately identify the watermark area and complete the positioning process without manual intervention, greatly improving the efficiency and convenience of watermark embedding-positioning-extraction. At the same time, the design of the decoding network enables the watermark image to be directly extracted from the screen shot image without the need for complex preprocessing steps, further simplifying the watermark extraction process and improving the convenience and practicality of the operation.
[0029] 2. The present invention adopts an encoding network based on the CBAM fusion attention mechanism and a discriminant network based on the steganalysis network UCNet, which effectively improves the visual quality of the watermark image. By optimizing the feature fusion process, the method can selectively select the watermark area for embedding, reducing the impact of watermark embedding on the visual effect of the image. This improvement in visual quality makes the watermark image difficult to be detected by the naked eye after being added to the original image, maintaining the overall aesthetics of the image. The GAN network training method using UCNet as the discriminant network is adopted, so that the encoding network gradually improves the visual quality of the generated watermark image under the supervision of the discriminant network, further reducing visible artifacts and enhancing the imperceptibility and concealment of the watermark.
[0030] 3. The present invention improves the robustness of the watermark image to screen capture distortion through a multi-stage, multi-loss-constrained training method, combined with joint training of the noise simulation layer, positioning network, decoding network and discrimination network. The introduction of the decoding network based on positioning mask enables the watermark image to be directly decoded in the screen capture scenario, reducing the dependence on positioning accuracy, thereby improving the reliability and stability of the watermark. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is an overall schematic diagram of the present invention's "A digital watermarking method capable of automatically positioning and resisting screen capture attacks".
[0032] Figure 2 This is a schematic diagram of the noise simulation layer structure of the present invention "A digital watermarking method capable of automatically positioning and resisting screen capture attacks".
[0033] Figure 3 This is a schematic diagram of the structure of the encoding network for feature splicing based on the CBAM fusion attention mechanism of the present invention "A digital watermarking method that can be automatically positioned to resist screen capture attacks".
[0034] Figure 4 This is a structural diagram of a decoding network based on a positioning mask in the present invention "a digital watermarking method capable of automatically positioning and resisting screen capture attacks". DETAILED DESCRIPTION
[0035] In order to more clearly show the features and advantages of this patent, a detailed description of an embodiment is provided below. It should be clear that the following detailed description is only used as an example and is intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meaning as those commonly understood by ordinary technicians in the technical field to which this application belongs.
[0036] This embodiment can be implemented according to the following steps, not limited to any programming language. In this example, Python programming language is used as an example to build a model on the PyTorch deep learning framework. The specific steps are as follows:
[0037] Step 1: Dataset preparation. Get 25,000 images from the MIR-Flicker25k dataset, and randomly select 2,500 images from them to form the test set, with a ratio of 9:1 between the training set and the test set. Then select 20 images from the COCO2017 dataset to form the validation set. In order to adapt to the model input, the dataset images are scaled to have the same size of 400×400, and the length of the input watermark information is fixed to 100 bits. In order to eliminate the randomness of the results, each of the 20 images in the validation set is repeatedly shot 10 times during the actual shooting process.
[0038] Step 2: Construct a model framework. According to the present invention, a watermark embedding-positioning-extraction model strategy for resisting screen capture distortion is constructed. The model consists of an encoding network, a noise simulation layer, a positioning network, a decoding network, and a discrimination network. The encoding network uses a Unet network based on the CBAM fusion attention mechanism, the noise simulation layer simulates screen capture distortion, the positioning network uses Hrnet to generate a positioning mask, and the decoding network decodes the watermark information of the screen capture image based on the positioning mask. The discrimination network is a steganalysis network based on UCNet. Among them, the input data items are the 100-bit watermark information to be embedded and the original image of size 400×400, and the output data items are the 100-bit watermark information extracted from the screen capture image.
[0039] Step 3: Multi-stage multi-loss constraint model training. Training is performed on the model framework built in step 2. The specific experimental parameters are as follows: Adam optimizer is used, and the learning rate of the first stage is 10 -5 , the learning rate of the second, third and fourth stages is 0.000015. The batch_size used in training is 4. The training is performed for a total of 250,000 iterations, including 5,000 iterations in the first stage, 15,000 iterations in the second stage, 30,000 iterations in the third stage, and 200,000 iterations in the fourth stage. During training, the weights of each loss function are set to μ1, μ2, μ3, μ4, μ5 = 2, 1, 1, 2, 1, σ1, σ2, σ3, σ4 = 8, 50, 5, 1. In the noise simulation layer, the intensity of each noise is set as follows: the quality interval of Jpeg compression is [70, 100]. The perspective transformation is a 24-bit four-corner coordinate perturbation, followed by a [0, 0.5] size reduction and a random position translation. Background filling sets the background to a random watermark-free image. The blur noise uses a Gaussian noise with an intensity of 0.02. The brightness distortion range is [0.9, 1.3], the contrast distortion range is [0.7, 1.3], and the saturation distortion range is [0.7, 1.3]. Lighting distortion uses linear light sources and point light sources to simulate and generate lighting masks. Moiré distortion uses a moiré simulation algorithm to generate a moiré mask. Finally, the image is multiplied by the lighting mask and then added to the moiré mask.
[0040] Step 4: Test the trained model. Perform a performance test of watermark embedding and extraction on the validation set. First, embed the watermark into the image, calculate the PSNR, SSIM, and LPIPS of the watermarked image and the original image to calculate the visual indicators of the embedded watermarked image. Then, take a screen shot of the watermarked image, perform a watermark extraction test at different distances, angles, and different proportions of the watermarked image area in the screen shot image, and calculate the accuracy of watermark recovery.
[0041] In summary, for the automatic positioning and decoding of watermarks in screen capture scenarios, the present invention proposes an automatic positioning digital watermarking method that can resist screen capture attacks. It can generate watermark images with high visual quality, directly locate and decode watermarks under the influence of screen capture distortion, realize a more intelligent and convenient copyright protection process for images, meet the copyright authentication needs of massive screen capture watermark images, and have great practical application value in real life.
[0042] Those skilled in the art will appreciate that the protection scope of the present invention is not limited to the specific embodiments described. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features. It should be noted that the technical solutions after the changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A digital watermark method capable of automatic positioning and anti-screen capture attack, characterized in that: The positioning network is used to build an automatic embedding-positioning-extraction architecture for anti-screen capture watermarks, which includes: The embedding-localization-extraction training strategy in the screen-capture image scenario, the encoding network based on the CBAM fusion attention mechanism for feature splicing, the decoding network based on the positioning mask, and the GAN network training method using the steganalysis network as the discriminant network; in the watermark encoding process, the watermark information W and the original image C are passed through the encoding network to obtain the watermark image S, and then after passing through the noise simulation layer, the simulated screen-capture image S′ is obtained, where the watermark area M records the position information of the watermark image in the screen-capture image; in the watermark positioning process, the simulated screen-capture image S′ will be input into the positioning network to generate the positioning mask M′; in the decoding process, the positioning mask M' and the simulated screen-capture image S' are input into the decoding network to obtain the decoded watermark information W'; in the training process, the discriminant network based on the steganalysis network UCNet and the encoding network are used to form a GAN network structure, the steganalysis network will distinguish the watermark image from the original image, and the encoding network will generate a realistic watermark image to deceive the discriminant network.
2. The method for automatically locating and resisting screen capture attacks as claimed in claim 1 is characterized in that: The embedding-localization-extraction training strategy in the screenshot image scenario is to train a multi-stage multi-loss function constraint model, specifically including: First stage use As the loss function, only the encoding / decoding network is trained, and only the decoding loss L is considered de , used to train the basic ability to embed / extract watermark information in scenes without perspective distortion and background filling; the second stage uses As the loss function, add the positioning network for training and consider L de With L loc , where L de is to calculate the MSE loss of embedded watermark and decoded watermark, and L loc The BCE loss and IOU loss of the watermark area mask and the positioning mask are calculated; the third stage uses As the loss function, visual loss is added, where the visual loss is composed of MSE loss, SSIM loss and LPIPS loss between the watermarked image and the original image; the fourth stage uses As the loss function, the discriminative network is added for joint training, and the GAN loss L is added to the loss function of the third stage. g .
3. The digital watermark method capable of automatic positioning and anti-screen-capture attack according to claim 1 is characterized in that: The encoding network based on CBAM fusion attention mechanism for feature splicing uses CBAM layer to replace the splicing and fusion of deep features and surface features in the traditional Unet network, specifically including: First, an input convolution layer is used to convolve the input; four downsampling and convolution processes are performed; four upsampling and feature fusion processes are performed, in which the feature fusion process uses the CBAM fusion attention mechanism to fuzzy the input feature map. F1 is the surface feature of the same size, F2 is the deep feature of the same size, and the channel attention M is calculated. c and spatial attention M s , with F′ and F" distribution representing the features after the transformation of the channel attention mechanism and the spatial attention mechanism, then we have Finally, an output convolution layer is used to get the output.
4. The digital watermark method capable of automatic positioning and anti-screen-capture attack according to claim 1 is characterized in that: The decoding network based on the positioning mask receives both the screen shot image and the positioning mask generated by the positioning network, and specifically includes: For the input screen shot image and positioning mask, they pass through three ConvBNReLU blocks and three SE blocks successively, and then enter a fully connected layer FC; ConvBNReLU is composed of convolution, batch normalization, and activation function ReLU; the SE block uses the channel attention mechanism to model the dependency between input features; the FC layer performs a full connection operation on all features and changes the feature shape to obtain the watermark information.
Citation Information
Cited By
Anti-screen-shooting robust watermarking method based on generative adversarial network and multiple tokens
CN120374346A
A robust watermarking method against screen capture based on generative adversarial networks and multi-tokens
CN120374346B
Screen watermark embedding method and device based on deep learning
CN121526866A
