Digital image watermark embedding and extraction method and device, storage medium

By embedding the watermark in the low-frequency coefficient area after DCT transformation and combining it with the DC prediction neural network, the insufficient performance of the neural network under JPEG compression attack is solved, and the high robustness and concealment of the watermark are achieved while maintaining the image quality.

CN119963392BActive Publication Date: 2025-09-19GUANGZHOU JINGWEI HUICHENG INFORMATION SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510137789.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2025-09-19
Estimated Expiration
2045-02-07

AI Technical Summary

Technical Problem

Existing neural network embedded digital watermarking technology performs poorly when facing JPEG compression attacks and is difficult to accurately learn and fit the complex mathematical function relationship under JPEG compression.

Method used

The histogram shift technology is used to embed the watermark in the low-frequency coefficient area after DCT transformation. Combined with the DC prediction neural network, the watermark data is embedded through the prediction error. The U-Net architecture and PatchGAN discriminator are used for training to optimize the watermark embedding position to reduce the impact of noise.

Benefits of technology

It improves the robustness of the watermark under JPEG compression and other channel attacks, reduces the impact on image quality, and improves the concealment and reversibility of the watermark.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963392B_ABST
    Figure CN119963392B_ABST
Patent Text Reader

Abstract

This invention discloses a digital image watermark embedding and extraction method, device, and storage medium. The method combines histogram shifting with neural network embedding. After the DCT transform, histogram shifting is performed to minimize noise in the embedded data stream under JPEG compression. A neural network compensation algorithm is then used to minimize the impact of the data stream on the host image. This technical solution addresses the problem of poor performance of existing neural network digital watermarking techniques against JPEG compression attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image information hiding, and in particular relates to a digital image watermark embedding and extraction method and device, and a storage medium. Background Art

[0002] Neural network digital watermarking has been widely used due to its excellent concealment and minimal impact on image quality. This technology achieves low-distortion watermark embedding by learning the characteristics of the host image. However, neural networks have limitations in fitting deterministic mathematical functions, making them relatively weak in learning simple, well-defined patterns. For example, neural networks generally struggle to accurately learn and fit precise mathematical function models.

[0003] During internet image transmission, websites typically use the JPEG compression format to reduce upstream and downstream bandwidth requirements. As a result, images are primarily vulnerable to attacks targeting JPEG compression, but may also be susceptible to other types of attacks, such as Gaussian noise and salt-and-pepper noise. Neural network digital watermarking techniques for JPEG compression still have significant performance deficiencies. This is primarily due to the fact that the discrete cosine transform (DCT) and quantization tables at different quality coefficients involved in JPEG compression represent complex mathematical functions, which are difficult for neural networks to learn and accurately fit. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a digital image watermark embedding and extraction method and device, and a storage medium to solve the problem that the existing neural network embedding digital watermark technology performs poorly when dealing with JPEG compression attacks.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A digital image watermark embedding and extraction method, comprising the following steps:

[0007] Step S1: Information embedding

[0008] Step 11: Host Image Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors ,..., ;

[0009] Step 12: Use DC prediction neural network based on AC vector ,..., Predicted DC vector , the prediction error is calculated by subtracting the predicted DC vector from the actual DC vector : ;

[0010] Step 13: Through histogram shift, the embedded data stream can produce the minimum noise under JPEG compression, and the watermark data stream Embedded into prediction error Generate watermarked prediction error ;

[0011] Step 14: Use the formula Reconstruct the DC vector with watermark ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0012] Step 15: Entropy encode all modified DCT blocks to generate a watermarked image. ;

[0013] Step S2: Extracting secret information and image reconstruction

[0014] Step 21: Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ,..., ;

[0015] Step 22: Use DC prediction neural network based on AC vector ,..., Predicted DC vector ; Calculate the prediction error by subtracting the predicted DC vector from the actual DC vector : ;

[0016] Step 23: From the prediction error Extract watermark , and recover the prediction error ;

[0017] Step 24: Use the formula Reconstruct DC vector ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0018] Step 25: Entropy encode all modified DCT blocks to generate restored images. .

[0019] Preferably, in step 13,

[0020] in, Corresponding to the quantization table in the JPEG algorithm The quantization coefficient of the block position is the best when the quantization coefficient of the quantization table with quality factor QF=50 is selected; is a hyperparameter, Used to control the size of the histogram shift, It is used to control the amount of watermark data embedded and the size of the histogram displacement.

[0021] Preferably, in step 23,

[0022]

[0023] Preferably, the DC prediction neural network includes: a predictor, a generator and a discriminator based on PatchGAN; wherein the predictor is based on the U-Net architecture and consists of 5 upsampling modules and 5 downsampling modules; the total loss of the generator is a balanced combination of prediction loss, image loss and adversarial loss.

[0024] The present invention also provides a digital image watermark embedding and extraction device, comprising: an information embedding module and a secret information extraction and image reconstruction module; wherein,

[0025] The information embedding module includes:

[0026] The first processing unit is used to Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors ,..., ;

[0027] The second processing unit is used to predict the DC neural network based on the AC vector ,..., Predicted DC vector , the prediction error is calculated by subtracting the predicted DC vector from the actual DC vector : ;

[0028] The third processing unit is used to make the embedded data stream produce the minimum noise under JPEG compression by histogram displacement, and to convert the watermark data stream into Embedded into prediction error Generate watermarked prediction error ;

[0029] The fourth processing unit is used to Reconstruct the DC vector with watermark ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0030] The fifth processing unit is used to perform entropy coding on all modified DCT blocks to generate an image embedded with a watermark. ;

[0031] The secret information extraction and image reconstruction modules include:

[0032] The sixth processing unit is used to process the secret image Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ,..., ;

[0033] The seventh processing unit is used to use the DC prediction neural network based on the AC vector ,..., Predicted DC vector ; Calculate the prediction error by subtracting the predicted DC vector from the actual DC vector : ;

[0034] The eighth processing unit is used to obtain the prediction error Extract watermark , and recover the prediction error ;

[0035] The ninth processing unit is used to Reconstruct DC vector ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0036] A tenth processing unit, configured to perform entropy coding on all modified DCT blocks to generate a restored image .

[0037] Preferably, in the third processing unit,

[0038] in, Corresponding to the quantization table in the JPEG algorithm The quantization coefficient of the block position is the best when the quantization coefficient of the quantization table with quality factor QF=50 is selected; is a hyperparameter, Used to control the size of the histogram shift, It is used to control the amount of watermark data embedded and the size of the histogram displacement.

[0039] Preferably, in the eighth processing unit,

[0040]

[0041] Preferably, the DC prediction neural network includes: a predictor, a generator and a discriminator based on PatchGAN; wherein the predictor is based on the U-Net architecture and consists of 5 upsampling modules and 5 downsampling modules; the total loss of the generator is a balanced combination of prediction loss, image loss and adversarial loss.

[0042] The present invention also provides a storage medium, on which a computer program is stored, and the computer program executes the digital image watermark embedding and extraction method when running.

[0043] To reduce the learning complexity of neural networks, this paper introduces a histogram shift paradigm to solve a scheme for minimizing the noise impact of JPEG compression on digital watermarks under different conditions. This effectively improves the robustness and reversibility of the watermark while reducing the learning burden of the neural network. Specifically, the watermark is embedded in the low-frequency coefficient (DC) region of the image after discrete cosine transform (DCT), making the embedded watermark more robust. Furthermore, to further ensure the concealment of the digital watermark, this paper employs a neural network compensation mechanism to minimize the impact of the watermark embedding on image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0045] Figure 1 This is a flow chart of a digital image watermark embedding and extraction method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] Example 1:

[0049] like Figure 1 As shown, the embodiment of the present invention provides a digital image watermark embedding and extraction method that combines histogram shifting with neural network embedding. Unlike existing neural network watermarking methods, this method is specifically designed to target JPEG compression attacks. After DCT transformation, histogram shifting is first used to minimize the noise generated by the embedded data stream under JPEG compression. A neural network compensation algorithm is then used to minimize the impact of the data stream on the host image. Specifically, the method includes the following steps:

[0050] Step S1: Information embedding

[0051] Step 11: Host Image Perform entropy decoding to obtain all its discrete cosine transform (DCT) blocks, and convert the Block, that is The coefficients (low-frequency coefficients) blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ,..., ;

[0052] Step 12: Use DC prediction neural network based on AC vector ,..., Predicted DC vector , the prediction error is calculated by subtracting the predicted DC vector from the actual DC vector : ;

[0053] Step 13: Use formula (1) to make the embedded data stream produce the minimum noise under JPEG compression by histogram shift, and convert the watermark data stream into Embedded into prediction error Generate watermarked prediction error ; Among them, the choice of histogram shift depends on how to make the watermark produce less noise after JPEG compression;

[0054] Step 14: Use the formula Reconstruct the DC vector with watermark ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0055] Step 15: Entropy encode all modified DCT blocks to generate a watermarked image. .

[0056] Formula (1) is as follows:

[0057] in, Corresponding to the quantization table in the JPEG algorithm The quantization coefficient of the block position is the best when the quantization coefficient of the quantization table with quality factor QF=50 is selected; is a hyperparameter, Used to control the size of the histogram shift, It is used to control the amount of watermark data embedded and the size of the histogram shift. The coefficients carrying watermark bit 0 are adjacent to the coefficients that are not used to embed the watermark. External interference may easily move these coefficients to the wrong side, so they are more susceptible to extraction errors than the coefficients carrying watermark bit 1. However, when restoring the main coefficients, these coefficients do not need to be modified, ensuring that even if errors occur when extracting watermark bit 0, the quality of the restored image will not be affected. In addition, the number of bit 0 in the watermark sequence can be predetermined and denoted as , which helps to extract the watermark bit 0. In the extraction phase, the in The coefficients with the largest distance from the origin are assumed to be originally used to embed the watermark bit 0. It does not need to be transmitted to the receiver because it can be pre-set to half the length of the watermark sequence, considering that the number of bits 0 and 1 in the encrypted message sequence is roughly the same. In addition, the number of bits 0 and 1 can be ensured to be the same by truncating or supplementing the message sequence. Match.

[0058] Furthermore, in step 12, the AC coefficients of the image are used as input to the prediction neural network, whose task is to predict the corresponding DC coefficients. The DC prediction neural network includes: a predictor, a generator, and a discriminator; wherein, the predictor is based on the U-Net architecture and consists of 5 upsampling modules and 5 downsampling modules, and the discriminator is a discriminator based on PatchGAN to provide adversarial supervision. Input image go through The block DCT transform separates the AC coefficients and DC coefficients.

[0059] In order to enhance the robustness of the network under noisy communication channels, data augmentation was performed on the AC coefficients during training, including the addition of Gaussian noise ( ) and JPEG distortion (the quality factor QF varies randomly between 50 and 100). This enhancement strategy enables the predictor to accurately predict the DC coefficient in noisy and disturbed environments.

[0060] The total loss of the generator is a balanced combination of prediction loss, image loss, and adversarial loss, and its formula is: .in is a hyperparameter that adjusts the importance of each loss.

[0061] Predicted losses Defined as the predicted DC coefficient and the true value The L2 distance between: .

[0062] Fighting Losses It aims to improve the generation performance through a competitive learning environment between the generator and the discriminator.

[0063] In addition, the image loss is introduced , to maintain the consistency between the predicted DC coefficient and the corresponding AC coefficient. This loss measures the original image and the DC coefficient predicted by With the original AC coefficient ,..., The L2 distance between the reconstructed images generated by the combination is defined as: This loss helps to restore high-fidelity images by using consistent DC and AC coefficients.

[0064] Step S2: Extracting secret information and image reconstruction

[0065] The recipient will receive a secret image , the image may be interfered by the channel, making it different from the image sent by the sender. Extracting secret information and image reconstruction specifically include:

[0066] Step 21: Perform entropy decoding to obtain all its discrete cosine transform (DCT) blocks, and convert the Block, that is The coefficients (low-frequency coefficients) blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ,..., ;

[0067] Step 22: Use DC prediction neural network based on AC vector ,..., Predicted DC vector ; Calculate the prediction error by subtracting the predicted DC vector from the actual DC vector : ;

[0068] Step 23: Using formula (2), we can get the prediction error Extract watermark , and recover the prediction error ;

[0069] Step 24: Use the formula Reconstruct DC vector ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0070] Step 25: Entropy encode all modified DCT blocks to generate restored images. .

[0071] Formula (2) is as follows:

[0072]

[0073] The embodiment of the present invention optimizes the watermark embedding position under JPEG compression by introducing histogram shift, thereby minimizing the noise generated by the embedded data after compression, and at the same time combines the neural network compensation mechanism to improve the concealment of watermark embedding and image quality.

[0074] In the embodiment of the present invention, the watermark embedding position selects the low-frequency coefficients (DC block) of the DCT domain, which significantly improves the robustness of the watermark under JPEG compression and other channel attacks, while reducing the impact on the high-frequency details of the image.

[0075] The embodiment of the present invention uses a DC prediction neural network based on the U-Net architecture, combined with a PatchGAN discriminator, and uses Gaussian noise and JPEG distortion data enhancement strategies to improve the robustness to compression and noise attacks, ensuring high accuracy of watermark extraction and image restoration.

[0076] The embodiment of the present invention adopts the method of efficiently extracting watermark data from the prediction error and using the prediction neural network to restore the low-frequency coefficients of the image, thereby ensuring the dual protection of the watermark and the original image quality during the image reconstruction process.

[0077] Example 2:

[0078] The embodiment of the present invention also provides a digital image watermark embedding and extraction device, comprising: an information embedding module and a secret information extraction and image reconstruction module; wherein,

[0079] The information embedding module includes:

[0080] The first processing unit is used to Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors ,..., ;

[0081] The second processing unit is used to predict the DC neural network based on the AC vector ,..., Predicted DC vector , the prediction error is calculated by subtracting the predicted DC vector from the actual DC vector : ;

[0082] The third processing unit is used to make the embedded data stream produce the minimum noise under JPEG compression by histogram displacement, and to convert the watermark data stream into Embedded into prediction error Generate watermarked prediction error ;

[0083] The fourth processing unit is used to Reconstruct the DC vector with watermark ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0084] The fifth processing unit is used to perform entropy coding on all modified DCT blocks to generate an image embedded with a watermark. ;

[0085] The secret information extraction and image reconstruction modules include:

[0086] The sixth processing unit is used to process the secret image Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ,..., ;

[0087] The seventh processing unit is used to use the DC prediction neural network based on the AC vector ,..., Predicted DC vector ; Calculate the prediction error by subtracting the predicted DC vector from the actual DC vector : ;

[0088] The eighth processing unit is used to obtain the prediction error Extract watermark , and recover the prediction error ;

[0089] The ninth processing unit is used to Reconstruct DC vector ,Will Each coefficient in is placed back to its original position in the corresponding DCT block;

[0090] A tenth processing unit, configured to perform entropy coding on all modified DCT blocks to generate a restored image .

[0091] As an implementation of an embodiment of the present invention, in the third processing unit,

[0092] in, Corresponding to the quantization table in the JPEG algorithm The quantization coefficient of the block position is the best when the quantization coefficient of the quantization table with quality factor QF=50 is selected; is a hyperparameter, Used to control the size of the histogram shift, It is used to control the amount of watermark data embedded and the size of the histogram displacement.

[0093] As an implementation of the embodiment of the present invention, in the eighth processing unit,

[0094]

[0095] As an implementation method of an embodiment of the present invention, a DC prediction neural network includes: a predictor, a generator, and a discriminator based on PatchGAN; wherein the predictor is based on a U-Net architecture and consists of 5 upsampling modules and 5 downsampling modules; the total loss of the generator is a balanced combination of prediction loss, image loss, and adversarial loss.

[0096] Example 3:

[0097] An embodiment of the present invention further provides a storage medium having a computer program stored thereon. The computer program executes the digital image watermark embedding and extraction method when running.

[0098] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection defined by the claims of the present invention.

Claims

1. A digital image watermark embedding and extraction method, characterized in that: The following steps are involved: Step S1: Information embedding Step 11: Host Image Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors ,..., ; Step 12: Use DC prediction neural network based on AC vector ,..., Predicted DC vector , the prediction error is calculated by subtracting the predicted DC vector from the actual DC vector : ; Step 13: Through histogram shift, the embedded data stream can produce the minimum noise under JPEG compression, and the watermark data stream Embedded into prediction error Generate watermarked prediction error ; Step 14: Use the formula Reconstruct the DC vector with watermark ,Will Each coefficient in is placed back to its original position in the corresponding DCT block; Step 15: Entropy encode all modified DCT blocks to generate a watermarked image. ; Step S2: Extracting secret information and image reconstruction Step 21: Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ; Step 22: Use DC prediction neural network based on AC vector Predicted DC vector ; The prediction error is calculated by subtracting the predicted DC vector from the actual DC vector ; Step 23: From the prediction error Extract watermark , and recover the prediction error ; Step 24: Use the formula Reconstruct DC vector ,Will Each coefficient in is placed back to its original position in the corresponding DCT block; Step 25: Entropy encode all modified DCT blocks to generate restored images. .

2. The digital image watermark embedding and extraction method according to claim 1, characterized in that: The DC prediction neural network includes: a predictor, a generator, and a PatchGAN-based discriminator; the predictor is based on the U-Net architecture and consists of 5 upsampling modules and 5 downsampling modules; the total loss of the generator is a balanced combination of prediction loss, image loss, and adversarial loss.

3. A digital image watermark embedding and extraction device, characterized in that: include: Information embedding module and secret information extraction and image reconstruction module; Among them, The information embedding module includes: The first processing unit is used to Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors ,..., ; The second processing unit is used to predict the DC neural network based on the AC vector ,..., Predicted DC vector , the prediction error is calculated by subtracting the predicted DC vector from the actual DC vector : ; The third processing unit is used to make the embedded data stream produce the minimum noise under JPEG compression by histogram displacement, and to convert the watermark data stream into Embedded into prediction error Generate watermarked prediction error ; The fourth processing unit is used to Reconstruct the DC vector with watermark ,Will Each coefficient in is placed back to its original position in the corresponding DCT block; The fifth processing unit is used to perform entropy coding on all modified DCT blocks to generate an image embedded with a watermark. ; The secret information extraction and image reconstruction modules include: The sixth processing unit is used to process the secret image Perform entropy decoding to obtain all its discrete cosine transform DCT blocks, and convert the blocks Block, that is The coefficient blocks are reorganized to form vector and 63 AC vectors (high frequency vectors) ; The seventh processing unit is used to use the DC prediction neural network based on the AC vector Predicted DC vector ; Calculate the prediction error by subtracting the predicted DC vector from the actual DC vector ; The eighth processing unit is used to obtain the prediction error Extract watermark , and recover the prediction error ; The ninth processing unit is used to Reconstruct DC vector ,Will Each coefficient in is placed back to its original position in the corresponding DCT block; A tenth processing unit, configured to perform entropy coding on all modified DCT blocks to generate a restored image .

4. The digital image watermark embedding and extraction device according to claim 3, characterized in that: The DC prediction neural network includes: a predictor, a generator, and a PatchGAN-based discriminator; the predictor is based on the U-Net architecture and consists of 5 upsampling modules and 5 downsampling modules; the total loss of the generator is a balanced combination of prediction loss, image loss, and adversarial loss.

5. A storage medium, characterized in that The storage medium stores a computer program, which executes the digital image watermark embedding and extraction method according to any one of claims 1 to 2 when running.

Citation Information

Patent Citations

  • Watermark attack method and system based on GAN and digital watermark embedding method

    CN115272039A

  • Image digital watermark embedding and extracting method and device

    CN119090698A