Reversible watermarking method based on spectrum loss constraint

Through a reversible watermarking method based on spectral loss constraints, a convolutional neural network and a discriminator are used to generate a sensitive loss-free confidential image, which solves the problem of a large impact on image perception after watermark embedding in the existing technology, and achieves the protection of high-quality images. and efficient embedding and extraction of watermarks.

CN119338658APending Publication Date: 2025-01-21NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411371198.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing digital watermarking methods have a great impact on the overall perception of the image after embedding the watermark, especially in medical images, which are not suitable for the protection of high-quality images.

Method used

A reversible watermarking method based on spectral loss constraints is used to generate a lossless dense image through a convolutional neural network encoder and discriminator, and the encoder parameters are updated through the spectral loss function to ensure that the watermark has minimal impact on the image after embedding.

Benefits of technology

It achieves efficient embedding and extraction of watermarks without reducing the visual quality of the image, improves the accuracy of watermark embedding and extraction, and is suitable for scenarios where high-quality images need to be protected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338658A_ABST
    Figure CN119338658A_ABST
Patent Text Reader

Abstract

The invention discloses a reversible watermarking method based on spectrum loss constraint. The method comprises the following steps: generating a secret-carrying image by using an encoder; judging whether the secret-carrying image is a non-inductive loss secret-containing image or not by using a discriminator; inputting the secret-carrying image into a noise layer, inputting an image output by the noise layer into a decoder, and extracting by using the decoder to obtain a carrier decoding image and a watermark decoding image; calculating respective loss according to the carrier image and the carrier decoding image as well as the watermark image and the watermark decoding image, and updating decoder parameters; and repeating the above steps until the encoder and the decoder achieve a stable expected effect, and reserving corresponding parameter settings of the encoder and the decoder for embedding and extracting the watermark. According to the method, the difference between the images is measured by using the spectrum loss, so that the subtle change of the images can be captured more accurately, the watermark embedding and extracting precision is improved, and meanwhile, the copyright protection and the data security of the original images are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to image data processing technology, and in particular to a reversible watermarking method based on spectrum loss constraint. Background Art

[0002] In recent years, with the widespread application of digital images, the security and integrity of image information have become particularly critical. Digital watermarking technology has received widespread attention in the medical community because it can embed information in images and extract information reliably without affecting image quality. With the increasing requirements for image quality and privacy protection, researchers are urgently studying digital watermarking methods that are highly invisible, reversible, and robust.

[0003] In the past few years, deep learning technology has made great progress in the field of computer vision. Convolutional neural networks are used to encode watermarks and embed them into carrier images, and watermarks can be extracted from noisy images. In 2018, Jiren Zhu et al. proposed a convolutional neural network-based watermark model HiDDeN in their paper (Jiren Zhu, Russell Kaplan, Justin Johnson, and Li Fei-Fei. Hidden: Hiding data with deep networks. In Proceedings of the European Conference on Computer Vision, pages 657-672, 2018). The model has excellent inductive bias, including translation equivariance and locality. Although its loss function is well designed, enabling the convolutional neural network to learn good features and achieve success in image quality and robustness, this loss function is designed based on pixel changes and does not take into account the impact of watermark embedding on the frequency domain, resulting in a significant impact on the overall perception of the image after the watermark is embedded, making it unsuitable for embedding watermarks on medical images. Summary of the invention

[0004] Purpose of the invention: In view of the above problems, the purpose of the present invention is to provide a reversible watermarking method based on spectrum loss constraint.

[0005] Technical solution: A reversible watermarking method based on spectrum loss constraint of the present invention comprises the following steps:

[0006] Step 1: Input the original watermark and the carrier image into the convolutional neural network encoder, and use the encoder to generate the encrypted image;

[0007] Step 2: Input the carrier image and the secret image to the discriminator, and use the discriminator to determine whether the secret image is a lossless secret image. If so, proceed to step 3; otherwise, calculate the spectrum loss between the secret image and the carrier image, and update the encoder parameters.

[0008] Step 3, input the encrypted image into the noise layer, input the image output by the noise layer into the decoder, and use the decoder to extract the carrier decoded image and the watermark decoded image;

[0009] Step 4, calculating the respective losses according to the carrier image and the carrier decoded image as well as the original watermark and the watermark decoded image, and updating the decoder parameters;

[0010] Step 5: Repeat steps 1 to 4 until the encoder and decoder achieve stable expected results, and then retain the corresponding encoder and decoder parameter settings for watermark embedding and extraction.

[0011] Further, step 1 includes:

[0012] The watermark image W and the carrier image I are input into the encoder. In the encoder, the convolution block is first used to extract features and generate the watermark mask MASK. Then the watermark mask MASK is added to the carrier image I to generate the encrypted image IW. The mathematical expression is:

[0013] MASK=EnCNN(I,W)

[0014] IW=α*MASK+I

[0015] Among them, EnCNN() represents the convolutional neural network encoder, and α represents the embedding weight.

[0016] Further, step 2 includes:

[0017] The secret image IW and the carrier image I are input into the discriminator, and the discriminator makes a difference between the secret image IW and the carrier image I. If the difference is not greater than the first threshold value K, it is judged that the secret image IW is a lossless secret image; otherwise, the secret image IW is not a lossless secret image, that is, the secret image IW contains a watermark;

[0018] When the encrypted image IW contains a watermark, the spectrum loss between the encrypted image IW and the carrier image I is calculated, and then transmitted back to the encoder according to the stochastic gradient descent method to update the watermark embedding weight of the encoder and the weight of the spectrum loss function;

[0019] The spectrum loss Lossl F The calculation expression is:

[0020]

[0021] Where M and N represent the length and width of the image, respectively, w(u,v) represents the weight of the matrix element w at u and v, and F I (u,v) represents each frequency value of the carrier image mapped to a Euclidean vector in two-dimensional space, F IW (u,v) represents each frequency value of the encrypted image mapped to a Euclidean vector in two-dimensional space.

[0022] Furthermore, the discriminator is composed of an input layer, a binary classifier and an output layer. The binary classifier uses a sigmoid function to determine whether the encrypted image IW contains a watermark.

[0023] Furthermore, the noise layer contains five types of noise, namely Gaussian noise, cropping noise, rotation noise, simulated differentiable JPEG compression noise and scaling noise.

[0024] Furthermore, in step 3, inputting the encrypted image into the noise layer includes:

[0025] The secret image IW is input into the noise layer, and a noise is randomly selected in the noise layer and added to the secret image IW to generate the attacked secret image IW'. The mathematical expression is:

[0026] IW′=Random((Gn,Crop,Rotation,Microj,Resize),IW)

[0027] Where Random() means randomly selecting a noise to be added to the encrypted image IW, Gn means Gaussian noise, Crop means cropping noise, Rotation means rotation noise, Microj means simulating differentiable JPEG compression noise, and Resize means scaling noise.

[0028] Further, step 4 includes:

[0029] Calculate the spectrum loss between the carrier image I and the carrier decoded image I′. The calculation expressions are:

[0030] LossC=(I,I′)

[0031] Calculate the spectrum loss between the watermark image W and the watermark decoded image W′. The calculation expressions are:

[0032] LossW=(W,W′)

[0033] Updates the parameters of linear and nonlinear transformations of input features according to the stochastic gradient descent algorithm.

[0034] Further, the corresponding encoder and decoder parameter settings are retained for watermark embedding and extraction including:

[0035] All parameter settings of the encoder and the decoder are retained as the watermark encoder and the watermark decoder, the watermark is embedded into the carrier image by the watermark encoder to generate an encoded image, and the encoded image is published for use;

[0036] When copyright verification is required, the image to be verified is input into a watermark decoder, and the extracted watermark is output. If the bit error rate between the extracted watermark and the original watermark is less than a second threshold, copyright ownership is proven.

[0037] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:

[0038] 1. Spectrum loss constraint:

[0039] The present invention uses spectrum loss to measure the difference between images, which can more accurately capture the subtle changes of images and improve the accuracy of watermark embedding and extraction;

[0040] 2. Lossless encrypted images:

[0041] In the present invention, the discriminator is used to ensure that the encrypted image has no visual loss, which means that the visual quality of the image will not be significantly reduced after the watermark is embedded, and it can be used to protect high-quality images.

[0042] 3. Reversibility:

[0043] The present invention ensures that the watermark extraction process can restore the original image and the watermark image, and is particularly suitable for scenes where the integrity of the original image needs to be preserved;

[0044] 4. Robustness:

[0045] The present invention can effectively resist a variety of common image attacks, such as Gaussian noise, cropping, rotation, JPEG compression and scaling, by processing the noise layer, thus ensuring the stability and reliability of the watermark;

[0046] 5.Automation parameter update:

[0047] The present invention uses an automated parameter update mechanism to enable the encoder and decoder to be continuously optimized during the iteration process, ensuring that the optimized encoder and decoder achieve the best watermark embedding and extraction effects;

[0048] 6. Wide application:

[0049] The present invention is not only applicable to static images, but can also be extended to watermark embedding and extraction of video frames, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flowchart of a reversible watermarking method based on spectrum loss constraints. DETAILED DESCRIPTION

[0051] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0052] The reversible watermarking method based on spectrum loss constraint described in this embodiment has a flowchart as shown in FIG. Figure 1 As shown, the following steps are included:

[0053] Step 1: Input the original watermark and the carrier image into the convolutional neural network encoder, and use the encoder to generate the encrypted image;

[0054] Step 2: Input the carrier image and the secret image to the discriminator, and use the discriminator to determine whether the secret image is a lossless secret image. If so, proceed to step 3; otherwise, calculate the spectrum loss between the secret image and the carrier image, and update the encoder parameters.

[0055] Step 3, input the encrypted image into the noise layer, input the image output by the noise layer into the decoder, and use the decoder to extract the carrier decoded image and the watermark decoded image;

[0056] Step 4, calculating respective losses according to the carrier image and the carrier decoded image as well as the watermark image and the watermark decoded image, and updating decoder parameters;

[0057] Step 5: Repeat steps 1 to 4 until the encoder and decoder achieve stable expected results, and then retain the corresponding encoder and decoder parameter settings for watermark embedding and extraction.

[0058] Since the human eye pays more attention to the structure and texture of the image when perceiving the image, and the spectrum information is more capable of capturing the characteristics of these structures and textures, in the reversible watermarking method based on spectrum loss constraint described in this embodiment, the loss function is constructed through spectrum loss so as to have a smaller impact on the overall perception of the image, thereby ensuring that the watermark is embedded in the medical image without losing the use value of the medical image, thereby ensuring the copyright protection and data security of the medical image.

[0059] In one example, the implementation process of step 1 includes:

[0060] The original watermark is denoted as W, and the carrier image is denoted as I. The original watermark W and the carrier image I are input into the encoder together. In the encoder, the feature is first extracted through the convolution block to generate the watermark mask MASK. Then the watermark mask MASK is added to the carrier image I to generate the encrypted image IW. The mathematical expression is:

[0061] MASK=EnCNN(I,W)

[0062] IW=α*MASK+I

[0063] Among them, EnCNN() represents the convolutional neural network encoder, and α represents the embedding weight.

[0064] In one example, the implementation process of step 2 includes:

[0065] The secret image IW and the carrier image I are input into the discriminator, and the discriminator makes a difference between the secret image IW and the carrier image I. If the difference is not greater than the first threshold value K, it is judged that the secret image IW is a lossless secret image; otherwise, the secret image IW is not a lossless secret image, that is, the secret image IW contains a watermark;

[0066] When the encrypted image IW contains a watermark, the spectrum loss between the encrypted image IW and the carrier image I is calculated, and then transmitted back to the encoder according to the stochastic gradient descent method to update the watermark embedding weight of the encoder and the weight of the spectrum loss function;

[0067] The spectrum loss Lossl F The calculation expression is:

[0068]

[0069] Where M and N represent the length and width of the image, respectively, w(u,v) represents the weight of the matrix element w at u and v, and F I (u,v) represents each frequency value of the carrier image mapped to a Euclidean vector in two-dimensional space, F IW (u,v) represents each frequency value of the encrypted image mapped to a Euclidean vector in two-dimensional space.

[0070] The discriminator consists of an input layer, a binary classifier, and an output layer. The binary classifier uses the sigmoid function to determine whether the encrypted image IW contains a watermark. In this example, the first threshold can be 0.5. When the sigmoid function output is greater than 0.5, it indicates a watermarked image, otherwise it is a watermark-free image. When there is a watermark, the spectrum loss between the encrypted image IW and the carrier image I is calculated, and the parameters of the encoder are updated using the stochastic gradient descent method until the discriminator cannot perceive that the encrypted image IW contains a watermark, and then enters step 3.

[0071] The noise layer contains five common noises, namely Gaussian noise, cropping noise, rotation noise, simulated differentiable JPEG compression noise and scaling noise.

[0072] Inputting the encrypted image into the noise layer in step 3 includes:

[0073] The secret image IW is input into the noise layer, and a noise is randomly selected in the noise layer and added to the secret image IW to generate the attacked secret image IW′. The mathematical expression is:

[0074] IW′=Random((Gn,Crop,Rotation,Microj,Resize),IW)

[0075] Where Random() means randomly selecting a noise to be added to the encrypted image IW, Gn means Gaussian noise, Crop means cropping noise, Rotation means rotation noise, Microj means simulating differentiable JPEG compression noise, and Resize means scaling noise.

[0076] The generated attacked encrypted image IW′ is input into the decoder, and the decoder is used to extract the carrier decoded image I′ and the watermark decoded image W′. In this example, the structure of the decoder is not particularly limited.

[0077] In one example, the implementation process of step 4 includes:

[0078] Calculate the spectrum loss between the carrier image I and the carrier decoded image I′. The calculation expressions are:

[0079] LossC=(I,I′)

[0080] Calculate the spectrum loss between the watermark image W and the watermark decoded image W′. The calculation expressions are:

[0081] LossW=(W,W′)

[0082] According to the stochastic gradient descent algorithm, update the parameters of the linear and nonlinear transformation of the input features. The spectrum loss function here is the same as the calculation expression of the spectrum loss in step 2 above.

[0083] In step 5, the encoder and decoder achieve stable expected results, which means that the changes of the carrier information and the watermark information before and after encoding and decoding cannot be perceived intuitively. If the expected effect is not achieved, steps 1 to 4 are repeated. When the expected effect is achieved, all parameter settings of the encoder and decoder are retained as the watermark encoder and watermark decoder, and the watermark is embedded into the carrier image through the watermark encoder to generate an encoded image, and the encoded image is published for use.

[0084] When copyright verification is required, the image to be verified is input into a watermark decoder, and the extracted watermark is output. If the bit error rate between the extracted watermark and the original watermark is less than a second threshold, copyright ownership is proven.

Claims

1. A reversible watermarking method based on spectrum loss constraint, characterized in that: The steps include: Step 1: Input the original watermark and the carrier image into the convolutional neural network encoder, and use the encoder to generate the encrypted image; Step 2, input the carrier image and the secret image into the discriminator, and use the discriminator to determine whether the secret image is a lossless secret image. If so, proceed to step 3; Otherwise, the spectrum loss between the encrypted image and the carrier image is calculated, and the encoder parameters are updated; Step 3, input the encrypted image into the noise layer, input the image output by the noise layer into the decoder, and use the decoder to extract the carrier decoded image and the watermark decoded image; Step 4, calculating the respective losses according to the carrier image and the carrier decoded image as well as the original watermark and the watermark decoded image, and updating the decoder parameters; Step 5: Repeat steps 1 to 4 until the encoder and decoder achieve stable expected results, and then retain the corresponding encoder and decoder parameter settings for watermark embedding and extraction.

2. The reversible watermarking method based on spectrum loss constraint according to claim 1, characterized in that: Step 1 includes: The watermark image W and the carrier image I are input into the encoder. In the encoder, the convolution block is first used to extract features and generate the watermark mask MASK. Then the watermark mask MASK is added to the carrier image I to generate the encrypted image IW. The mathematical expression is: MASK=EnCNN(I,W) IW=α*MASK+I Among them, EnCNN() represents the convolutional neural network encoder, and α represents the embedding weight.

3. The reversible watermarking method based on spectrum loss constraint according to claim 2 is characterized in that: Step 2 includes: The secret image IW and the carrier image I are input into the discriminator, and the discriminator makes a difference between the secret image IW and the carrier image I. If the difference is not greater than the first threshold value K, it is judged that the secret image IW is a lossless secret image; otherwise, the secret image IW is not a lossless secret image, that is, the secret image IW contains a watermark; When the encrypted image IW contains a watermark, the spectrum loss between the encrypted image IW and the carrier image I is calculated, and then transmitted back to the encoder according to the stochastic gradient descent method to update the watermark embedding weight of the encoder and the weight of the spectrum loss function; The spectrum loss Lossl F The calculation expression is: Where M and N represent the length and width of the image, respectively, w(u,v) represents the weight of the matrix element w at u and v, and F I (u,v) represents each frequency value of the carrier image mapped to a Euclidean vector in two-dimensional space, F IW (u,v) represents each frequency value of the encrypted image mapped to a Euclidean vector in two-dimensional space.

4. The reversible watermarking method based on spectrum loss constraint according to claim 3 is characterized in that: The discriminator consists of an input layer, a binary classifier and an output layer. The binary classifier uses the sigmoid function to determine whether the encrypted image IW contains a watermark.

5. The reversible watermarking method based on spectrum loss constraint according to claim 1, characterized in that: The noise layer contains five types of noise, namely Gaussian noise, cropping noise, rotation noise, simulated differentiable JPEG compression noise and scaling noise.

6. The reversible watermarking method based on spectrum loss constraint according to claim 5, characterized in that: Inputting the encrypted image into the noise layer in step 3 includes: The secret image IW is input into the noise layer, and a noise is randomly selected in the noise layer and added to the secret image IW to generate the attacked secret image IW'. The mathematical expression is: IW′=Random((Gn,Crop,Rotation,Microj,Resize),IW) Where Random() means randomly selecting a noise to be added to the encrypted image IW, Gn means Gaussian noise, Crop means cropping noise, Rotation means rotation noise, Microj means simulating differentiable JPEG compression noise, and Resize means scaling noise.

7. The reversible watermarking method based on spectrum loss constraint according to claim 1, characterized in that: Step 4 includes: Calculate the spectrum loss between the carrier image I and the carrier decoded image I′. The calculation expressions are: LossC=(I,I′) Calculate the spectrum loss between the watermark image W and the watermark decoded image W′. The calculation expressions are: LossW=(W,W′) Updates the parameters of linear and nonlinear transformations of input features according to the stochastic gradient descent algorithm.

8. The reversible watermarking method based on spectrum loss constraint according to claim 1, characterized in that: The corresponding encoder and decoder parameter settings are retained for watermark embedding and extraction including: All parameter settings of the encoder and the decoder are retained as the watermark encoder and the watermark decoder, the watermark is embedded into the carrier image by the watermark encoder to generate an encoded image, and the encoded image is published for use; When copyright verification is required, the image to be verified is input into a watermark decoder, and the extracted watermark is output. If the bit error rate between the extracted watermark and the original watermark is less than a second threshold, copyright ownership is proven.