Hadamard transform screen-resistant watermarking method based on deep learning
By using the Hadamard transform method based on deep learning, combined with convolutional neural networks and residual blocks, a watermark embedding and extraction model is constructed, which solves the problem that digital watermarking algorithms are difficult to resist screen capture attacks, and realizes the effective extraction of watermark information and copyright protection during screen capture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU DIANZI UNIV
- Filing Date
- 2022-09-30
- Publication Date
- 2026-04-21
AI Technical Summary
Existing digital watermarking algorithms are unable to effectively resist screen capture attacks, especially complex attacks during analog-to-digital and digital-to-analog conversion, making copyright protection difficult to achieve.
We employ a deep learning-based Hadamard transform method, combined with convolutional neural networks and residual blocks, to construct a watermark embedding and extraction model. We enhance the robustness of the algorithm by simulating a screen capture attack module and perform end-to-end training within the Hadamard domain.
The robustness of the watermarking algorithm against screen capture has been improved, enabling effective extraction of watermark information and copyright protection during screen capture, thus enhancing the security and robustness of the algorithm.
Smart Images

Figure CN115526758B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of watermarking technology, specifically relating to a deep learning-based Hadamard transform anti-screenshot watermarking method. This method can efficiently extract watermark information from photos taken by voyeurs, thereby protecting the copyright of digital media. Background Technology
[0002] As a new medium for carrying knowledge and disseminating information, electronic screens have become an indispensable part of people's daily lives. Electronic screens have greatly changed people's reading habits, with contemporary people choosing screen reading more often than paper reading.
[0003] Meanwhile, with the widespread use of smartphones, taking photos has become simple and easy. In the field of information security, stealing sensitive internal information through methods such as screen capture and video recording has gradually become a major channel for the leakage of important information.
[0004] Screen capture (i.e., recording of a screen) has become a hot topic for evidence collection regarding leaks. To address this issue, many departments and companies need to deploy screen capture tracing systems to collect evidence of leaks, creating a deterrent effect and preventing future incidents. Specifically, this involves proactive prevention and post-incident verification. By pre-installing tracing information on controlled terminals and issuing warnings to clients, the system's deployment creates a significant deterrent effect, effectively reducing the incentive for leakers to do so. On the other hand, once confidential information is leaked, the tracing system can identify the source and responsible party, making it impossible for the leaker to deny responsibility and effectively holding related parties accountable. This ensures the protection of the copyright information of the organization to which the confidential information belongs and safeguards information security. Currently, the application of deep learning technology in watermarking algorithms is rapidly increasing because it can effectively solve the process of watermark embedding and extraction. Existing digital watermarking technologies can effectively solve problems such as multimedia data copyright protection, but designing a digital watermarking algorithm that can resist screen capture attacks remains a challenge. Traditional digital watermarking algorithms can effectively resist common attack types, such as image processing and geometric transformations. However, screen capture attacks are complex processes. When capturing an image displayed on a screen, both the image and the watermark undergo a series of analog-to-digital and digital-to-analog conversions, which can result in a powerful combination of attacks. Currently, there is limited research on digital watermarking algorithms that resist screen capture attacks. Therefore, improving the robustness of digital watermarking algorithms against screen capture attacks is a pressing technical problem that needs to be solved.
[0005] Due to the rapid development of machine learning tools and deep networks in various fields of computer vision and image processing, the application of convolutional neural networks in watermarking has recently emerged. Summary of the Invention
[0006] The purpose of this invention is to address the problem that existing digital watermarking algorithms are vulnerable to screen capture attacks, and to propose a deep learning-based Hadamard transform-based anti-screen capture watermarking method. This invention combines a convolutional neural network (CNN) and residual blocks to achieve an end-to-end process of watermark embedding and extraction within the Hadamard domain. Furthermore, this invention incorporates a module simulating screen capture attacks between the watermark embedding and extraction layers to ensure robust watermark embedding and the ability to extract watermark information from leaked photos, thus achieving copyright protection.
[0007] The specific technical solution adopted in this invention is as follows:
[0008] A deep learning-based Hadamard transform anti-screen capture watermarking method includes:
[0009] S1. Construct a watermark model framework consisting of a watermark embedding module, an attack simulation module, and a watermark extraction module;
[0010] The watermark embedding module consists of a first Hadamard transform layer, a first convolutional module, and a Hadamard inverse transform layer cascaded together. Its inputs are the watermark to be embedded and the original image to be embedded. The original image of a single channel is pre-divided into a series of first image blocks of the same size. Each first image block is input into the first Hadamard transform layer and transformed from the spatial domain to the frequency domain through Hadamard transform. The two-dimensional transformation results of each first image block are stitched together along the channel dimension to obtain a first transform feature map. The watermark to be embedded is then embedded into the first transform feature map to obtain a second transform feature map. The second transform feature map is input into the first convolutional module for convolution operation to obtain a third transform feature map with the same number of channels as the first transform feature map. The third transform feature map is input into the Hadamard inverse transform layer channel by channel and transformed from the frequency domain back to the spatial domain through Hadamard inverse transform. The two-dimensional transformation results of each channel are re-stitched together according to the segmentation order to obtain an intermediate image of the same size as the original image. The intermediate image is superimposed on the original image and output as a single-channel watermarked image.
[0011] The attack simulation module incorporates various attack operations, including screen capture attacks. Its input is the watermarked image, and each attack operation can attack the watermarked image and generate a single-channel attacked watermarked image. The moiré attack in the screen capture attack is implemented by the moiré attack network, which is trained by the U-Net network. Its input is the watermarked image, and its output is the watermarked image with noise added by the moiré attack.
[0012] The watermark extraction module consists of a second Hadamard transform layer and a second convolution module cascaded together. Its input is a single-channel watermarked image after an attack. The watermarked image after an attack is pre-divided into a series of second image blocks of the same size. Each second image block is input into the second Hadamard transform layer and transformed from the spatial domain to the frequency domain through Hadamard transform. The two-dimensional transformation results of each second image block are stitched together along the channel dimension to obtain a fourth transform feature map. The fourth transform feature map is then input into the second convolution module for convolution operation to obtain the watermark extraction result.
[0013] S2. Using training data, the watermark model framework is iteratively trained by minimizing the total loss function. The watermark extraction module selects different attack operations in different training rounds to attack the watermarked image output by the watermark embedding module. Each training round selects one attack operation, and all training rounds cover all attack operations. The total loss function is a weighted sum of the biased inverses of the normalized cross-correlation loss and the structural similarity index loss.
[0014] S3. After the watermark model framework is trained, the watermark embedding module is used to embed the watermark and output the watermarked image. For images that need to be watermarked, they are directly input into the watermark extraction module for watermark extraction.
[0015] Preferably, the expression for the total loss function is as follows:
[0016]
[0017] Where: L w L represents the normalized cross-correlation coefficient between the original embedded watermark and the watermark extraction result. I C3 represents the structural similarity index between the original image and the watermarked image, and C4 is two weak variables used to stabilize the denominator.
[0018] Preferably, α and β are both decimals greater than 0 and less than 1, and satisfy α + β = 1.
[0019] Preferably, the values of C1, C2, C3, and C4 are each 10. -4 9×10 -4 10 -2 and 3×10 -2 .
[0020] Preferably, the watermark to be embedded is embedded into the first transformation feature map by splicing the watermark to be embedded and the first transformation feature map along the channel dimension.
[0021] Preferably, the first convolutional module and the second convolutional module each contain 5 convolutional layers.
[0022] Preferably, the screen capture attack includes various attack operations such as perspective transformation, light distortion, JPEG distortion, and moiré mode.
[0023] Preferably, the attack simulation module also includes non-screen capture attacks, specifically including various attack operations on the image such as blurring, cropping, Gaussian noise, mosaic noise, scaling, rotation, sharpening, watermarking, display distortion, brightness and contrast.
[0024] Preferably, during the training process of the moiré attack network, a series of watermarked image samples x i and the corresponding watermarked image y after being subjected to a moiré attack to increase noise. i As input samples, by minimizing the loss function L m The U-Net network is trained; where the loss function L m The form is:
[0025]
[0026] In the formula: m is the total number of samples used for training, f(x) i ) represents the input watermarked image sample x for the U-Net network. i The output is the prediction result.
[0027] Preferably, in step S3, the image for which watermark extraction is required is a confidential photo that has been leaked by screen capture, where the watermarked image generated by the watermark embedding module contains watermarks.
[0028] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0029] This invention proposes a deep, end-to-end robust anti-screen capture watermarking method that can learn new watermarking algorithms in the Hadamard transform space. The algorithm framework consists of two fully convolutional neural networks with residual blocks, handling embedding and extraction operations in real time. End-to-end training is performed on the entire deep network for blind secure watermarking. The proposed anti-screen capture watermarking method treats simulated screen capture attacks as a differentiable network layer to facilitate end-to-end training. Furthermore, by diffusing the watermark data to a wider area of the image through the transform domain, the security and robustness of the algorithm are enhanced. Comparison with recent research results shows that the proposed algorithm framework has advantages in terms of concealment, robustness, and speed. Attached Figure Description
[0030] Figure 1 This is the overall flowchart of the watermark model framework.
[0031] Figure 2The image PSNR is obtained by the embedding algorithm in the watermark embedding module.
[0032] Figure 3 The image shows the differences in the watermark before and after embedding it into the original input image. The first row is the original image, the second row is the image with the watermark, and the third row is the difference image before and after watermark embedding.
[0033] Figure 4 These are the Hadamard partial transform coefficients.
[0034] Figure 5 This is a demonstration of a screen capture attack.
[0035] Figure 6 A schematic diagram of the U-Net network structure trained on the Moiré dataset.
[0036] Figure 7 The graph shows the test results of the Moiré network. The first row is the pure input graph, and the second row is the output graph with Moiré mode added. Detailed Implementation
[0037] The present invention will be further described and illustrated below with reference to the accompanying drawings and specific embodiments.
[0038] The development of multimedia technology is closely related to the needs of leakage sources. The development of multimedia technologies such as audio, images, and video has brought new challenges to leakage source localization methods. Therefore, digital watermarking algorithms, as an important means of achieving leakage, have received widespread attention. For different multimedia technologies, existing technologies have proposed audio watermarking schemes, image watermarking schemes, and video watermarking schemes. However, with the development of digital technology, the multimedia information transmission process has undergone tremendous changes, posing new requirements for leakage sources. For traditional methods of information theft, such as scanning and sending business documents or copying electronic files, traditional robust image watermarking schemes can be used to track leakage sources; these schemes are used for image processing attacks. However, with the widespread use of smartphones, photography has become the simplest and most effective way to transmit information, bringing new challenges to leakage tracking. Anyone with access to a file can leak information by taking a picture without leaving any record. Furthermore, the camera shooting process is not easily monitored or prevented from the outside world; therefore, designing a watermarking scheme resistant to screen capture attacks is crucial to solving this problem. Screen capture image watermarking schemes can provide strong guarantees for leakage tracking. This invention can embed relevant watermark information into the original image. When these documents are photographed without consent, the corresponding information can be extracted from the photo to locate the leaked equipment or employee information. Based on the information location, the scope of the investigation can be narrowed to facilitate the accountability process.
[0039] The following is a detailed description of the specific implementation of the Hadamard transform anti-screen capture watermarking method based on deep learning proposed in this invention.
[0040] S1. Construct a watermark model framework consisting of a watermark embedding module, an attack simulation module, and a watermark extraction module.
[0041] The watermarking model framework used in this invention consists of three parts: a watermark embedding module, an attack simulation module, and a watermark extraction module. The watermark embedding module uses embedding components to embed the watermark into the Hadamard coefficients of the image, modifying the image to obtain its Hadamard coefficient features. The attack simulation module simulates a series of screen capture attacks and distortions generated in traditional attacks, such as perspective transformation, ray distortion, JPEG distortion, and moiré patterns. Specifically, this invention designs a moiré attack network in the attack simulation module to simulate the moiré phenomenon, the most common screen capture attack, to improve the watermark image's ability to recover distortions in real-world screen capture scenarios. The watermark extraction module extracts the watermark from the captured photo. The overall flowchart of the above framework is shown below. Figure 1 As shown below, the specific data processing procedures in the three modules will be described in detail.
[0042] The aforementioned watermark embedding module is used to embed the watermark into the original image, minimizing the perceptual difference between the original image and the watermark image, and improving the imperceptibility and security of the watermark image. For example... Figure 1 As shown, the watermark embedding module consists of a first Hadamard Transform layer, a first convolutional module, and an inverse Hadamard Transform layer cascaded together. The input to the watermark embedding module is the watermark to be embedded, W. o And the original image I that needs to be watermarked o The original image of a single channel I o The first image is pre-divided into a series of identical size blocks I p Each first image block I p The input to the first Hadamard transform layer transforms the image from the spatial domain to the frequency domain using the Hadamard transform. Each first image block I p The two-dimensional transformation result I' p The first transform feature map H is obtained by concatenating along the channel dimension. o Then embed the watermark W o Embedded first transform feature map H oThe second transformed feature map H1 is obtained from the first transformation feature map. The second transformed feature map H1 is then input into the first convolution module for convolution operation, thereby obtaining the result that is similar to the first transformed feature map H1. o The third transform feature map H2, with the same number of channels, is input channel by channel into the Hadamard inverse transform layer. Through the Hadamard inverse transform, it is transformed from the frequency domain back to the spatial domain, resulting in a two-dimensional transform H' for each channel. 2i Reassemble the images according to the original segmentation order to obtain an intermediate image I' of the same size as the original image. Then, overlay the intermediate image I' with the original image to output a single-channel watermarked image I. o .
[0043] It should be noted that after performing the Hadamard inverse transform on each channel of the third transform feature map H2, each channel will yield a two-dimensional transform result H'. 2i And these two-dimensional transformation results H' 2i When stitching together the intermediate image, it is necessary to base the results on the original image I. o Divided into first image block I p The corresponding sequences are stitched together to restore the image.
[0044] In this invention, the method for embedding the watermark to be embedded into the first transformation feature map is as follows: the watermark to be embedded and the first transformation feature map are concatenated along the channel dimension. And because the watermark image W... o It needs to be stitched into the first transform feature map. Therefore, in order to ensure that its size meets the stitching requirements, the original image I... o The first image block I formed by segmentation p Size needs to match watermark image W o Consistent. If the original image I o The dimensions are X×Y, and the watermark image is W. o If the dimensions are H×G, then the original image I with dimensions X×Y... o The image needs to be divided into a series of first image blocks I of size H×G. p In this invention, considering the actual characteristics of the image and the requirements for watermark embedding, the image is set to have the same length and width dimensions, i.e., X = Y = M, and the watermark image W... o The length and width are also the same, that is, H×G=N. The specific values of M and N can be adjusted according to the actual situation, but M should be divisible by N. For example, M=512 and N=32.
[0045] like Figure 1 As shown, the attack simulation module is located between the watermark embedding module and the watermark extraction module. Its function is to simulate attack operations during the training process of the watermark embedding module and the watermark extraction module, and then target the watermarked image I. oNoise is introduced. The attack simulation module described above incorporates various attack operations, including screen capture attacks, and its input is a watermarked image I. o Each attack operation can target watermarked images I. o The attack is performed, generating a single-channel watermarked image of the compromised image. Since moiré attacks are the most common type of attack, the moiré attack in the screen capture attack is implemented using a moiré attack network trained on a U-Net network, with the watermarked image I as input. o The output is a watermarked image after noise has been added using a moiré attack.
[0046] The specific network structure of the U-Net network is existing technology, as is its training method. In this invention, during the training process of the moiré attack network, a series of watermarked image samples x... i and the corresponding watermarked image y after being subjected to a moiré attack to increase noise. i As input samples, by minimizing the loss function L m The U-Net network is trained. The loss function L is used. m The form is:
[0047]
[0048] In the formula: m is the total number of samples used for training, f(x) i ) represents the input watermarked image sample x for the U-Net network. i The output is the prediction result.
[0049] It should be noted that the specific form of the screen capture attack can be adjusted according to the actual situation. This invention can include various attack operations such as perspective transformation, light distortion, JPEG distortion, and moiré mode. In addition, to enhance robustness, the attack simulation module should also include non-screen capture attacks in addition to screen capture attacks, specifically including various attack operations such as blurring, cropping, Gaussian noise, mosaic noise, scaling, rotation, sharpening, watermarking, display distortion, brightness and contrast adjustments. Except for the moiré attack, the other attack operations can be implemented by directly calling image processing functions or operations.
[0050] like Figure 1As shown, the watermark extraction module consists of a second Hadamard transform layer and a second convolution module cascaded together. Its input is a single-channel watermarked image after the attack. The attacked watermarked image is pre-divided into a series of second image blocks of the same size. Each second image block is input into the second Hadamard transform layer and transformed from the spatial domain to the frequency domain using the Hadamard transform. The two-dimensional transformation results of each second image block are concatenated along the channel dimension to obtain a fourth transform feature map H3. The fourth transform feature map H3 is then input into the second convolution module for convolution to obtain the watermark extraction result w. e .
[0051] It should be noted that the first and second convolution modules of the present invention each contain 5 convolutional layers. Of course, the specific number of convolutional layers and the parameters of the convolutional kernels of each layer can be optimized according to actual conditions.
[0052] S2. After the above construction is completed Figure 1 After the watermark model framework shown can be obtained, the training data can be used to iteratively train the watermark model framework by minimizing the total loss function. In order to ensure that the trained watermark extraction model can resist different attacks, the watermark extraction module selects different attack operations in different training rounds to attack the watermarked image output by the watermark embedding module. However, each training round selects one attack operation, and all training rounds cover all attack operations.
[0053] The specific total loss function used for iterative training of the watermarking model framework in this invention can be optimized according to actual conditions. In this invention, the total loss function can be obtained by weighting the normalized cross-correlation loss and the structural similarity index loss with biased inverses. The specific expression of the total loss function is as follows:
[0054]
[0055] Where: L w The normalized cross-correlation loss is expressed as follows:
[0056]
[0057] L I The structural similarity index loss is calculated as follows:
[0058]
[0059] In the formula: w o (h,g) is the pixel value at coordinate (h,g) in the original embedded watermark of size H×G, w e (h,g) is the pixel value at coordinate (h,g) in the watermark extraction result; I o(x, y) is the original image I of size X × Y. o The pixel value at coordinate (x, y), I w (x, y) is the watermarked image I w The pixel value at the mid-coordinate position (x, y). and They are all I o The average value of (x,y) and all I w The average value of (x,y), and They are all I o The variance of (x,y) and all I w The variance of (x,y) is given by C1, C2, C3 and C4, which are four weak variable hyperparameters, and α and β are two weight hyperparameters.
[0060] In this invention, α and β can be set to decimals greater than 0 and less than 1, satisfying α + β = 1, preferably α = β = 0.5. Furthermore, the values of C1, C2, C3, and C4 can each be chosen to be 10. -4 9×10 -4 10 -2 and 3×10 -2 .
[0061] S3. After the above watermark model framework is trained, the watermark embedding module can be used to embed the watermark and output the watermarked image. For images that need to be watermarked, they can be directly input into the watermark extraction module for watermark extraction.
[0062] However, it should be noted that in S3 above, it is no longer necessary to... Figure 1 The attack simulation module in S3 is designed so that, in real-world applications, the attack noise is introduced by the actual process of capturing confidential information on a screen. Therefore, the image input to the watermark extraction module for watermark extraction in S3 is a watermarked image generated by the watermark embedding module, representing a confidential photo leaked through screen capture. Even when these confidential photos are leaked, relevant information can still be extracted from them to locate the leaked device or employee information.
[0063] The methods shown in S1 to S3 above will be applied to a specific example to demonstrate the technical effects they can achieve.
[0064] Example
[0065] The specific method process in this embodiment is as shown in S1 to S3 above, and will not be repeated in full. The following mainly shows its specific implementation details and technical effects.
[0066] First, a watermarking model framework is constructed. The watermarking model framework used in this embodiment consists of three parts: a watermark embedding module, an attack simulation module, and a watermark extraction module. The specific data processing procedures in the three modules have been described above and will not be repeated here.
[0067] (1) Watermark Embedding Module
[0068] The watermark embedding module is responsible for embedding the watermark into the image's transform coefficients. This embodiment uses a CNN architecture, taking a 512*512 pixel single-channel grayscale image as input and outputting a single-channel watermarked image. The input watermark is represented as a 32*32 two-dimensional image; therefore, the original image is also divided into 16*16 32*32 image blocks. The Hadamard-transformed image blocks and the watermark image are concatenated along the channel direction to form a (16*16)+1 dimensional tensor, which is then input into the first convolution module for convolution. The convolution result is then subjected to an inverse Hadamard transform channel by channel to reconstruct the watermarked image. In this embodiment, the Hadamard transform layer uses a 1*1 convolution kernel. The first convolution module contains five convolutional layers with kernel sizes of 1*1, 2*2, 2*2, 2*2, and 2*2, respectively. Figure 2 The imperceptibility of the embedding algorithm in this watermark embedding module was demonstrated using PSNR. Figure 2 It can be seen that the imperceptibility of this algorithm is quite ideal, with an average PNSR of 36.62. Figure 3 The changes in the watermark before and after embedding it into the original input image are shown. From a subjective perspective, the watermark is less visible in the image after embedding. Because this embedding algorithm performs watermark embedding in the Hadamard transform domain, Figure 4 The diagram shows some of the Hadamard transform coefficients, and it can be seen that the absolute values of the Hadamard transform coefficients are the same.
[0069] (2) Attack Simulation Module
[0070] Through theoretical analysis of screen capture attacks, the attacks caused during screen capture can be categorized as follows: perspective transformation, optical distortion, brightness variation, JPEG compression, and moiré mode. Visualizations of the results of different attacks are provided, such as... Figure 5 As shown in the figure. Among these, the moiré attack is the most common type of attack. Therefore, this invention constructs a U-Net network for training and testing against moiré attacks, and its network structure diagram is shown in the figure. Figure 6 As shown. The loss function for training the Moiré network is as described above. Figure 7 This is the test result image obtained from the test graph after the U-Net network has been trained. Figure 7It is easy to observe that the original clean image automatically has a moiré pattern added after passing through the U-Net network, realizing the moiré simulation attack generated during screen capture. This trained network is added as a noise layer between the watermark embedding module and the watermark extraction module to increase the robustness of the screen capture algorithm and the diversity of attacks. Furthermore, mixed attacks often occur during screen capture, including both traditional attacks and screen capture attacks. This embodiment simulates all of these attacks in the attack simulation layer, as shown in Table 1. Screen capture attacks include perspective transformation, light distortion, JPEG distortion, and moiré pattern attacks. Non-screen capture attacks specifically include blurring, cropping, Gaussian noise, block noise, scaling, rotation, sharpening, visible watermark, display distortion, and brightness / contrast distortion attacks.
[0071] Table 1 Different attack parameters of the attack simulation layer
[0072]
[0073] (3) Watermark Extraction Module
[0074] This watermark extraction module is used to extract watermarks from watermarked images subjected to screen capture attacks. The watermark is embedded in the Hadamard domain, and the watermarked image is transformed to the Hadamard domain before watermark extraction. The watermarked image is processed through a series of convolutional layers in the Hadamard transform layer and the second convolutional module to extract the watermark. In this embodiment, the Hadamard transform layer is implemented with a 1*1 convolutional kernel, and the first convolutional module contains 5 convolutional layers with kernel sizes of 1*1, 2*2, 2*2, 2*2, and 1*1, respectively.
[0075] This algorithm needs to maximize the quality of the watermarked image and minimize the watermark extraction error rate to balance the algorithm's imperceptibility and robustness. Therefore, this embodiment introduces Peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM) to ensure image imperceptibility, while normalized cross-correlation (NC) and bit error rate (BER) are used to describe the algorithm's robustness. To balance the algorithm's robustness and imperceptibility, a loss function based on the coupling of NC and SSIM is adopted. The specific description is as follows:
[0076] Formula (1) describes the mean square error, I o (x,y) is the original image of size X×Y, I w (x,y) is the watermarked image after embedding the watermark. Formula (2) is the expression for PSNR. Formula (3) is the expression for NC, w o (h,g) is the original embedded watermark image of size H×G, w e (h,g) is the extracted watermark image. Formula (4) is the expression for SSIM. and It is the average value. and They are I o (x,y) and I w The variance of (x,y) is used, and C1 and C2 are two weak variables used to stabilize the denominator. Formula (5) is the total loss function, which consists of two parts: NC and SSIM, where α = β = 0.5, and the values of C1 and C2 are 10 and 10 respectively. -4 9*10 -4, The values of C3 and C4 are 10 respectively. -2 and 3×10 -2 .
[0077]
[0078]
[0079]
[0080]
[0081]
[0082] Using the training dataset, by minimizing the total loss function L tThe watermarking model framework is trained iteratively. In different training rounds, the watermark extraction module selects different attack operations to attack the watermarked image output by the watermark embedding module. Each training round selects one attack operation, and all training rounds cover all attack operations. Training is completed after reaching the maximum number of iterations.
[0083] After the watermarking model framework is trained, it only needs to be tested. During testing, the watermark embedding module is used to embed the watermark, outputting a watermarked image. Then, the watermarking model framework is used to introduce noise into the watermarked image generated by the watermark embedding module through different attack methods. This noise is then directly input into the watermark extraction module for watermark extraction to test its robustness against attacks. In this embodiment, multiple attack types were tested, and the BER (Bitrate Error Rate) metric was used to demonstrate the network layer's ability to extract watermarks; a smaller BER value indicates better extraction performance. The test results are shown in Table 2.
[0084] Table 2 shows the watermark extraction capability.
[0085]
[0086] Therefore, the algorithm framework proposed in this invention has advantages in terms of concealment, robustness, and speed against various screen capture attacks and non-screen capture attacks.
[0087] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. A deep learning-based Hadamard transform anti-screen capture watermarking method, characterized in that, include: S1. Construct a watermark model framework consisting of a watermark embedding module, an attack simulation module, and a watermark extraction module; The watermark embedding module consists of a first Hadamard transform layer, a first convolutional module, and a Hadamard inverse transform layer cascaded together. Its inputs are the watermark to be embedded and the original image to be embedded. The original image of a single channel is pre-divided into a series of first image blocks of the same size. Each first image block is input into the first Hadamard transform layer and transformed from the spatial domain to the frequency domain through Hadamard transform. The two-dimensional transformation results of each first image block are stitched together along the channel dimension to obtain a first transform feature map. The watermark to be embedded is then embedded into the first transform feature map to obtain a second transform feature map. The second transform feature map is input into the first convolutional module for convolution operation to obtain a third transform feature map with the same number of channels as the first transform feature map. The third transform feature map is input into the Hadamard inverse transform layer channel by channel and transformed from the frequency domain back to the spatial domain through Hadamard inverse transform. The two-dimensional transformation results of each channel are re-stitched together according to the segmentation order to obtain an intermediate image of the same size as the original image. The intermediate image is superimposed on the original image and output as a single-channel watermarked image. The attack simulation module incorporates various attack operations, including screen capture attacks. Its input is the watermarked image, and each attack operation can attack the watermarked image and generate a single-channel attacked watermarked image. The moiré attack in the screen capture attack is implemented by the moiré attack network, which is trained by the U-Net network. Its input is the watermarked image, and its output is the watermarked image with noise added by the moiré attack. The watermark extraction module consists of a second Hadamard transform layer and a second convolution module cascaded together. Its input is a single-channel watermarked image after an attack. The watermarked image after an attack is pre-divided into a series of second image blocks of the same size. Each second image block is input into the second Hadamard transform layer and transformed from the spatial domain to the frequency domain through Hadamard transform. The two-dimensional transformation results of each second image block are stitched together along the channel dimension to obtain a fourth transform feature map. The fourth transform feature map is then input into the second convolution module for convolution operation to obtain the watermark extraction result. S2. Using training data, the watermark model framework is iteratively trained by minimizing the total loss function. The watermark extraction module selects different attack operations in different training rounds to attack the watermarked image output by the watermark embedding module. Each training round selects one attack operation, and all training rounds cover all attack operations. The total loss function is a weighted sum of the biased inverses of the normalized cross-correlation loss and the structural similarity index loss. S3. After the watermark model framework is trained, the watermark embedding module is used to embed the watermark and output the watermarked image. For images that need to be watermarked, they are directly input into the watermark extraction module for watermark extraction.
2. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, The expression for the total loss function is as follows: in: This represents the normalized cross-correlation coefficient between the original embedded watermark and the watermark extraction result. The index represents the structural similarity between the original image and the watermarked image, with C3 and C4 being two weak variables used to stabilize the denominator; and All are decimals greater than 0 and less than 1, and satisfy the following conditions: .
3. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 2, characterized in that, The values of C3 and C4 are 10 respectively. -2 and 3×10 -2 .
4. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, The method for embedding the watermark to be embedded into the first transformation feature map is to splice the watermark to be embedded and the first transformation feature map along the channel dimension.
5. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, The first and second convolutional modules each contain 5 convolutional layers.
6. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, The screen capture attack includes various attack operations such as perspective transformation, light distortion, JPEG distortion, and moiré mode.
7. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, The attack simulation module also includes non-screen capture attacks, specifically including various attack operations on the image such as blurring, cropping, Gaussian noise, mosaic noise, scaling, rotation, sharpening, watermarking, display distortion, brightness and contrast.
8. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, During the training process of the moiré attack network, a series of watermarked image samples are used. and the corresponding watermarked image after being subjected to a moiré attack to increase noise. As input samples, by minimizing the loss function The U-Net network is trained; where the loss function is... The form is: In the formula: m is the total number of samples used for training. For the U-Net network, watermarked image samples are input. The output is the prediction result.
9. The deep learning-based Hadamard transform anti-screen capture watermarking method as described in claim 1, characterized in that, In step S3, the image for which watermark extraction is required is a confidential photo that has been leaked through screen capture, and the image displayed on the screen is a watermarked image generated by the watermark embedding module.
Citation Information
Patent Citations
Local multi-watermarking method for color image
CN113689319A
Anti-shooting monitoring video watermarking method combining depth robust watermarking and template synchronization
CN114549270A