Image digital watermark embedding method, image digital watermark extracting method and image digital watermark embedding system

Integrating digital watermarking technology through the denoising diffusion implicit model solves the problems of image quality reduction and semantic changes in the existing technology, achieves efficient digital watermark embedding and extraction, and improves anti-detection capabilities.

CN118632012APending Publication Date: 2024-09-10BEIJING UNIV OF POSTS & TELECOMM +3
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202410724349.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing digital watermarking technology directly modifies the carrier image in the image, resulting in reduced image quality and semantic changes, low detection resistance, and insufficient information capacity.

Method used

The denoising diffusion implicit model is used to integrate the binary secret information with Gaussian noise, and the image digital watermark is generated and extracted through the pre-trained encoder and decoder to ensure that the semantics of the carrier image remain unchanged.

Benefits of technology

Under the condition of ensuring that the semantics of the image remain unchanged, efficient digital watermark embedding and extraction is achieved, improving image quality and anti-detection capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632012A
    Figure CN118632012A
Patent Text Reader

Abstract

The invention provides an image digital watermark embedding method, extraction method and system, and the method comprises the steps: enabling an image digital watermark embedding part to code original secret information to generate binary secret information, obtaining a carrier image, and superposing the randomly generated original Gaussian for multiple times to obtain potential noise; the binary secret information and the potential noise are integrated through an encoder to generate secret-containing potential noise, the secret-containing potential noise is input into a denoising diffusion implicit model to obtain estimated Gaussian noise, and a target image containing the digital watermark is generated according to the secret-containing potential noise and the estimated Gaussian noise; the image digital watermark extraction method comprises the following steps: inputting a target image into a denoising diffusion implicit model and outputting estimated Gaussian noise, superposing the estimated Gaussian noise on the target image for multiple times to obtain secret-containing potential noise, inputting the secret-containing potential noise into a decoder, outputting binary secret information, and restoring the binary secret information into original secret information. The image semantics before and after the image digital watermark is embedded are kept consistent, and the quality and the detection resistance of the image are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image digital watermarking, and in particular to an image digital watermark embedding method, an extraction method and a system. Background Art

[0002] Digital watermarking technology is a technology that embeds secret information into multimedia files through a certain algorithm without affecting the original use value of multimedia media. When needed, these secret information can be detected or extracted. Digital watermarking technology is mainly used in copyright protection, data integrity verification and anti-counterfeiting traceability. In terms of copyright protection, by embedding copyright information, piracy can be effectively tracked and combated to protect the legitimate rights and interests of creators; in terms of data integrity verification, it can also be used to verify the integrity of data and detect whether the data has been tampered with or destroyed; in terms of anti-counterfeiting traceability, it can embed specific identification information to achieve authenticity identification and traceability.

[0003] In the existing digital watermarking technology, the original image is usually modified directly. The digital watermark generated in this way has low anti-detection ability, low image quality, low embedded information capacity, and the image before and after the digital watermark is embedded changes at the semantic level. Summary of the invention

[0004] In view of this, the embodiments of the present invention provide an image digital watermark embedding method, extraction method and system to eliminate or improve one or more defects existing in the prior art, and solve the problem in the prior art that image quality is reduced and image semantics are damaged due to directly modifying the carrier image to add a watermark.

[0005] One aspect of the present invention provides a method for embedding a digital watermark in an image, characterized in that the method is performed by an image digital watermark embedding party, and the method comprises the following steps:

[0006] Encode the original secret information into a binary sequence to generate binary secret information;

[0007] Acquire a carrier image, randomly generate original Gaussian noise, and superimpose the original Gaussian noise on the carrier image multiple times according to a set rule to obtain latent noise;

[0008] Integrating the binary secret information and the latent noise through a pre-trained encoder to generate secret latent noise that is similar to the latent noise in data distribution;

[0009] Inputting the secret potential noise into the pre-trained denoising diffusion implicit model to obtain estimated Gaussian noise;

[0010] According to the secret potential noise and the estimated Gaussian noise, the set rule is used to perform reverse processing to generate a target image containing a digital watermark, so that the target image contains the original secret information.

[0011] In some embodiments, the original Gaussian noise is repeatedly superimposed on the carrier image according to a set rule to obtain the latent noise, including:

[0012] A sequence of predefined values ​​in the range (0,1) Indicates the maximum time step; defines the coefficient

[0013] The noise is superimposed on the carrier image x0 in rounds according to the time step, and the expression is:

[0014]

[0015] Among them, x t represents the carrier image with noise superimposed at t time steps, and ∈ represents the original Gaussian noise.

[0016] In some embodiments, the encoder training step includes:

[0017] Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image;

[0018] Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information;

[0019] The encoder is obtained by minimizing the deviation between the sample noise image and the secret noise image, and minimizing the deviation construction loss between the sample binary secret information and the estimated value of the binary secret information, and using the first training sample set to train the initial encoder and the initial decoder.

[0020] In some embodiments, the step of training the denoising diffusion implicit model includes:

[0021] Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images;

[0022] A sequence of predefined values ​​in the range (0,1) Indicates the maximum time step; defines the coefficient Randomly generate raw Gaussian noise ∈;

[0023] Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model;

[0024] During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output the estimated value of the original Gaussian noise ∈ θ (x t ,t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

[0025] In some embodiments, according to the secret potential noise and the estimated Gaussian noise, the set rule is used to perform reverse processing to generate a target image containing a digital watermark, and the calculation formula is:

[0026]

[0027] Among them, x t represents the latent noise, α t represents a definition coefficient, t represents the time step, ∈ θ (x t , t) represents the estimated Gaussian noise.

[0028] On the other hand, the present invention also provides a method for extracting a digital watermark from an image, the method being performed by an image digital watermark extractor, the method comprising the following steps:

[0029] Acquire a target image to be processed, wherein the target image is obtained based on the above-mentioned image digital watermark embedding method;

[0030] Inputting the target image into a pre-trained denoising diffusion implicit model and outputting estimated Gaussian noise;

[0031] According to a set rule, the estimated Gaussian noise is repeatedly superimposed on the target image to obtain a secret latent noise;

[0032] The secret latent noise is input into a pre-trained decoder to output binary secret information, and then restored to the original secret information.

[0033] In some embodiments, the step of training the denoising diffusion implicit model includes:

[0034] Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images;

[0035] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈;

[0036] Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model;

[0037] During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t , t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

[0038] In some embodiments, the decoder training step includes:

[0039] Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image;

[0040] Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information;

[0041] The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss, and using the first training sample set to train the initial encoder and the initial decoder.

[0042] In some embodiments, the decoder training step includes:

[0043] acquiring a plurality of sample carrier images;

[0044] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈;

[0045] The original Gaussian noise is superimposed on each sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as Obtaining a sample potential noise image and constructing a second training sample set;

[0046] The initial encoder and the initial decoder are obtained. During the training process, the initial encoder takes the sample binary secret information and the sample potential noise image as input and outputs a secret noise image; the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; the secret noise image is also input into the denoising diffusion implicit model to output a noise estimation value, and the secret noise image is reversely processed according to a set rule using the noise estimation value to obtain a target image containing a digital watermark; an image discriminator is constructed to classify and identify the target image containing a digital watermark and the sample carrier image;

[0047] The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information, and minimizing the recognition accuracy construction loss of the image discriminator, and using the second training sample set to train the initial encoder and the initial decoder.

[0048] On the other hand, the present invention also provides an image digital watermark embedding device, the device comprising:

[0049] A binary conversion module, used for encoding the original secret information into a binary sequence to generate binary secret information;

[0050] A carrier image acquisition module is used to acquire a carrier image, randomly generate original Gaussian noise, and superimpose the original Gaussian noise on the carrier image multiple times according to a set rule to obtain potential noise;

[0051] A secret latent noise generation module, used for integrating the binary secret information and the latent noise through a pre-trained encoder to generate a secret latent noise that is similar to the latent noise in data distribution;

[0052] An estimated Gaussian noise generation module, used for inputting the secret potential noise into a pre-trained denoising diffusion implicit model to obtain an estimated Gaussian noise;

[0053] The target image generation module is used to generate a target image containing a digital watermark by performing reverse processing based on the secret potential noise and the estimated Gaussian noise using the set rules, so that the target image contains the original secret information.

[0054] In some embodiments, the carrier image acquisition module superimposes the original Gaussian noise on the carrier image multiple times according to a set rule to obtain potential noise, including:

[0055] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient

[0056] The noise is superimposed on the carrier image x0 in rounds according to the time step, and the expression is:

[0057]

[0058] Among them, x t represents the carrier image with noise superimposed at t time steps, and ∈ represents the original Gaussian noise.

[0059] In some embodiments, the apparatus is further provided with a model pre-training module for performing the training steps of the encoder, including:

[0060] Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image;

[0061] Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information;

[0062] The encoder is obtained by minimizing the deviation between the sample noise image and the secret noise image, and minimizing the deviation construction loss between the sample binary secret information and the estimated value of the binary secret information, and using the first training sample set to train the initial encoder and the initial decoder.

[0063] In some embodiments, the model pre-training module is further used to train the denoising diffusion implicit model, including:

[0064] Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images;

[0065] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈;

[0066] Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model;

[0067] During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x tand time step t as input and output the estimated value of the original Gaussian noise ∈ θ (x t , t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

[0068] In some embodiments, the target image generation module generates a target image containing a digital watermark by performing reverse processing based on the secret potential noise and the estimated Gaussian noise using the set rules, and the calculation formula is:

[0069]

[0070] Among them, x t represents the latent noise, α t represents a definition coefficient, t represents the time step, ∈ θ (x t , t) represents the estimated Gaussian noise.

[0071] On the other hand, the present invention also provides an image digital watermark extraction device, the device comprising:

[0072] A target image acquisition module, used to acquire a target image to be processed, wherein the target image is obtained based on an image digital watermark embedding method;

[0073] An estimated Gaussian noise generation module, used for inputting the target image into a pre-trained denoising diffusion implicit model and outputting estimated Gaussian noise;

[0074] A secret latent noise generation module, used for superimposing the estimated Gaussian noise on the target image multiple times according to a set rule to obtain the secret latent noise;

[0075] The original secret information restoration module is used to input the secret potential noise into a pre-trained decoder to output binary secret information and restore it to the original secret information.

[0076] In some embodiments, the device is further provided with a model pre-training module for training the denoising diffusion implicit model, including:

[0077] Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images;

[0078] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈;

[0079] Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model;

[0080] During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t , t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

[0081] In some embodiments, the model pre-training module is further used to perform the training steps of the encoder, including:

[0082] Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image;

[0083] Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information;

[0084] The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss, and using the first training sample set to train the initial encoder and the initial decoder.

[0085] In some embodiments, the model pre-training module is further used to perform the training steps of the encoder, including: obtaining a plurality of sample carrier images;

[0086] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈;

[0087] The original Gaussian noise is superimposed on each sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as Obtaining a sample potential noise image and constructing a second training sample set;

[0088] The initial encoder and the initial decoder are obtained. During the training process, the initial encoder takes the sample binary secret information and the sample potential noise image as input and outputs a secret noise image; the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; the secret noise image is also input into the denoising diffusion implicit model to output a noise estimation value, and the secret noise image is reversely processed according to a set rule using the noise estimation value to obtain a target image containing a digital watermark; an image discriminator is constructed to classify and identify the target image containing a digital watermark and the sample carrier image;

[0089] The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information, and minimizing the recognition accuracy construction loss of the image discriminator, and using the second training sample set to train the initial encoder and the initial decoder.

[0090] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction implements the steps of any of the above-mentioned methods when executed by a processor.

[0091] The beneficial effects of the present invention are at least:

[0092] In the image digital watermark embedding method, extraction method and system of the present invention, the image digital watermark embedding party encodes the original secret information into a binary sequence to generate binary secret information, obtains a carrier image and randomly generates original Gaussian noise, and superimposes the original Gaussian noise on the carrier image multiple times according to a set rule to obtain latent noise, integrates the binary secret information and the latent noise through a pre-trained encoder to generate secret latent noise, inputs the secret latent noise into a pre-trained denoising diffusion implicit model to obtain estimated Gaussian noise, and according to the secret latent noise and the estimated Gaussian noise, According to the set rules, reverse processing is performed to generate a target image containing a digital watermark, thereby completing the embedding of the image digital watermark; the image digital watermark extraction party inputs the target image into a pre-trained denoising diffusion implicit model and outputs an estimated Gaussian noise, and according to the set rules, the estimated Gaussian noise is superimposed on the target image for multiple times to obtain a secret latent noise, and the secret latent noise is input into a pre-trained decoder to output binary secret information, and is restored to the original secret information, thereby completing the extraction of the image digital watermark. The present invention can realize efficient embedding and extraction of watermark information while ensuring that the semantics of the carrier image are not distorted.

[0093] Furthermore, the present invention uses an image discriminator to perform differential identification on the images before and after the image digital watermark is embedded and the secret information before and after the image digital watermark is extracted, accurately identifying the deviation between the target image containing the digital watermark and the carrier image when the image digital watermark is embedded, and the estimated value of the binary secret information and the deviation of the binary secret information when the image digital watermark is extracted, so as to maintain the semantic consistency of the image before and after the image digital watermark is embedded after process optimization, thereby improving the image quality and anti-detection capability.

[0094] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0095] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0097] Figure 1 The figure is a flow chart of a method for embedding a digital watermark in an image according to an embodiment of the present invention.

[0098] Figure 2 The figure is a flow chart of a method for extracting digital watermark from an image according to an embodiment of the present invention.

[0099] Figure 3 The figure is a schematic diagram of the structure of the method for embedding and extracting digital watermarks of an image according to an embodiment of the present invention. DETAILED DESCRIPTION

[0100] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0101] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0102] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0103] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0104] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0105] In the prior art, image digital watermarking technology usually directly modifies the original carrier image, reducing the quality and anti-detection ability of the carrier image; the present invention proposes an image digital watermark embedding method, extraction method and system. When embedding the image digital watermark, a denoising diffusion model is used to input the secret latent noise and output estimated Gaussian noise, and a target image containing a digital watermark is generated; when extracting the image digital watermark, a denoising diffusion implicit noise is used to input the target image and output estimated Gaussian noise. After multiple estimated Gaussian noises are superimposed on the target image, the secret latent noise is obtained, and the binary secret information is extracted by a decoder and restored to the original secret information, which solves the problem of image quality degradation before and after digital watermark embedding in the prior art and improves the image's anti-detection ability.

[0106] Figure 1 The figure is a flow chart of the method for embedding a digital watermark in an image according to an embodiment of the present invention. Specifically, the present application provides a method for embedding a digital watermark in an image, which is executed by an image digital watermark embedding party and includes the following steps S101 to S105:

[0107] Step S101: Encode the original secret information into a binary sequence to generate binary secret information.

[0108] Step S102: Obtain a carrier image, and randomly generate original Gaussian noise, and superimpose the original Gaussian noise on the carrier image multiple times according to a set rule to obtain latent noise.

[0109] Step S103: Integrate the binary secret information and the latent noise through a pre-trained encoder to generate secret latent noise that is similar to the latent noise in data distribution.

[0110] Step S104: inputting the secret latent noise into the pre-trained denoising diffusion implicit model to obtain estimated Gaussian noise.

[0111] Step S105: Based on the secret potential noise and the estimated Gaussian noise, reverse processing is performed using set rules to generate a target image containing a digital watermark, so that the target image contains the original secret information.

[0112] In step S101, when the image digital watermark embedder generates binary secret information from the original secret information, it first needs to encode the secret information into a binary sequence. To encode the information into a binary sequence, it is first necessary to determine the encoding rules, then divide the secret information into small units, convert the small units into corresponding binary sequences according to the encoding rules, and package the binary sequences into a format suitable for transmission. Common binary encoding types include ASCII encoding, UTF-8 encoding and Huffman encoding. Binary sequences are the basis of information representation and data processing. The secret information is converted into a binary format that can be stored or transmitted, and error correction encoding and redundant encoding measures are taken to generate a binary sequence of a set length from the original secret information. When the length does not reach the set length, the insufficient part is filled with 0, thereby generating binary secret information.

[0113] In step S102, the carrier image is the original image embedded with the image digital watermark, which can not only hide the digital watermark information but also maintain the visual quality of the original image. The selection of the carrier image will affect the robustness and concealment of the image digital watermark. The better the robustness and concealment, the better the image digital watermark embedding technology. The factors to be considered in selecting the carrier image include: image type and format, image size and quality, image content and texture, and image use and environment. These factors will affect the quality, embedding capacity and concealment of the image digital watermark. After selecting a suitable carrier image, it is necessary to repeatedly superimpose the randomly generated original Gaussian noise on the carrier image to obtain the final latent noise. In some embodiments, the original Gaussian noise is repeatedly superimposed on the carrier image according to the set rules to obtain the latent noise, including:

[0114] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient

[0115] The noise is superimposed on the carrier image x0 in turn according to the time step, and the expression is:

[0116]

[0117] Among them, x t represents the carrier image with superimposed noise at time step t, and ∈ represents the original Gaussian noise.

[0118] Specifically, adding Gaussian noise to the carrier image includes the following steps S1021 to S1024:

[0119] Step S1021: read the carrier image and determine the parameters of Gaussian noise, which include the mean and standard deviation.

[0120] Step S1022: According to the parameters of Gaussian distribution and Gaussian noise, a noise matrix with the same size as the image is randomly generated, and the value of each pixel is randomly extracted from the Gaussian distribution.

[0121] Step S1023: Add the generated noise matrix to the carrier image by element addition, and the superposition result must be within the pixel value range.

[0122] Step S1024: performing normative adjustment on the image after adding noise.

[0123] Furthermore, Gaussian noise is to add a noise that obeys the Gaussian distribution to the carrier image. The mean of the Gaussian distribution determines the center position of the Gaussian noise. When the mean is 0, the height of the carrier image will not change. The larger the variance and standard deviation, the stronger the noise. The pixel range of the carrier image is usually 0 to 255. The image with added noise has values ​​that exceed the pixels and needs to be standardized. The adjustment methods include cropping, truncation, reflection and modulo operation to adjust the values ​​to be within the pixel range.

[0124] In step S103 and step S104, the secret latent noise is generated by encoding the binary secret information into the latent noise. The binary secret information is converted into changes in pixel values ​​using a pre-trained encoder, and these changes are embedded in the noisy image containing the latent noise. The latent noise before and after the binary secret is embedded and the secret latent noise should be as similar as possible in data distribution to ensure the quality of the carrier image and the integrity of the secret information. The binary secret information and the latent noise are integrated by the encoder, and the encoder needs to be pre-trained. In some embodiments, the training step of the encoder includes steps S1031 to S1033:

[0125] Step S1031: Acquire a first training sample set, where the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image.

[0126] Step S1032: obtaining an initial encoder and an initial decoder, wherein the initial encoder takes sample binary secret information and a sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information.

[0127] Step S1033: The initial encoder and the initial decoder are trained using the first training sample set to obtain an encoder by minimizing the deviation between the sample noise image and the secret noise image, and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss.

[0128] Specifically, the role of the encoder is to integrate the binary secret information and the noisy image containing potential noise to obtain the secret noise image. In the process of training the encoder, it is necessary to measure the difference between the noise image and the secret noise image. After calculating the loss, the gradient descent method is used to update the parameters of the encoder for the next iteration. The gradient descent method is an optimization method that finds the loss function by calculating the derivative of the loss function. The loss function is minimized by iteratively updating the parameters to more accurately predict the results. Commonly used gradient descent algorithms include: batch gradient descent algorithm, stochastic gradient descent algorithm and mini-batch gradient descent algorithm. The optimization methods currently used for gradient update include adaptive moment estimation method (Adam) and root mean square propagation (RMSProp). The encoder is obtained after the initial encoder training is completed.

[0129] Furthermore, the diffusion model is a generative model that gradually adds random noise to the original data, and in the reverse diffusion process, extracts the original data from the noise. The denoising diffusion implicit model used in the present invention is an improvement on the original version of the diffusion model, that is, the denoising diffusion probability model, in the process of generating images. In addition, the denoising diffusion implicit model ensures that the same noise generates the same image, ensuring that the process of generating images from noise is deterministic. At the same time, the denoising diffusion implicit model is reversible, and the noise corresponding to the image can be approximately obtained through ordinary differential equations. In some embodiments, the training steps of the denoising diffusion implicit model include steps S1041 to S1044:

[0130] Step S1041: Acquire an image data training sample set, where the image data training sample set includes a plurality of sample carrier images.

[0131] Step S1042: Predefine a sequence of values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Generate raw Gaussian noise ∈ randomly.

[0132] Step S1043: obtaining an initial denoising diffusion implicit model, where the initial denoising diffusion implicit model is a U-Net model.

[0133] Step S1044: During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t , t), the parameters of the initial denoising diffusion implicit model are updated by minimizing the deviation between the original Gaussian noise estimate and the true value to obtain the denoising diffusion implicit model.

[0134] Specifically, the original noise superposition of the carrier sample is performed step by step, x0, x1…x t , the series β t The invention relates to a denoising diffusion implicit model, which is a neural network with a U-Net structure. U-Net is a convolutional neural network (CNN) architecture, which is widely used in the fields of image segmentation and medical image processing. The U-Net neural network has a multi-stage convolution and deconvolution process, which can effectively extract the features of the input image and perform fine segmentation on it. In addition to the neural network with a U-Net structure, the denoising diffusion implicit model also includes: convolutional neural network (CNN), recursive convolutional neural network (RCNN), fast convolutional neural network (Fast R-CNN, Faster R-CNN), generative adversarial network (GAN) and variational autoencoder (VAE). The appropriate network structure is selected according to the complexity of the task, the amount of data and the calculation requirements.

[0135] Furthermore, the denoising diffusion implicit model calculates the original Gaussian noise ∈ and the estimated value of the original Gaussian noise ∈ during training. θ (x t , t) and then construct the loss function L = ||∈-∈ θ (x t , t)|| 2 , the gradient descent method is used to update the neural network parameters θ, and the neural network parameters are updated to Where η is the learning rate, and the update stops when the loss is small enough or the number of iterations is reached. Both the image digital watermark embedding process and the image digital watermark extraction process require the conversion between image and noise through the pre-trained denoising diffusion implicit model.

[0136] In step S105, the reverse processing is a process of generating a target image based on the secret latent noise and the estimated Gaussian noise. The target image is a carrier image containing a digital watermark, and carries binary secret information compiled from the original secret information. In some embodiments, the reverse processing is performed based on the secret latent noise and the estimated Gaussian noise using a set rule to generate a target image containing a digital watermark. The calculation formula is:

[0137]

[0138] Among them, x t represents the latent noise, α t represents a definition coefficient, t represents the time step, ∈ θ(x t , t) represents the estimated Gaussian noise.

[0139] Specifically, the calculation formula gradually generates the image x t-1 , x t-2 , …x1, x0, until the final target image x0 is output. In the calculation process, estimated Gaussian noise is used to calculate and the possible losses in the embedding process are taken into account in advance. The receiving image will change during the image embedding process, so that a more accurate and closer to the actual target image result can be obtained based on the estimated Gaussian noise; further, the denoising diffusion implicit noise can use its own characteristics to accelerate sampling, that is, sampling is performed according to a subsequence of the original sampling sequence to reduce the sampling steps and accelerate the generation process of the target image. The denoising diffusion implicit model constructs the forward process as a non-Markov process, and the reverse process is the inverse process of the non-Markov process, thereby accelerating the generation of high-quality samples in a non-Markov process manner.

[0140] Figure 2 The figure is a flow chart of the method for extracting digital watermarks from an image according to an embodiment of the present invention. On the other hand, the present invention also provides a method for extracting digital watermarks from an image, which is executed by an image digital watermark extractor, and includes the following steps S201 to S204:

[0141] Step S201: Acquire a target image to be processed, where the target image is obtained based on the above-mentioned image digital watermark embedding method.

[0142] Step S202: Input the target image into the pre-trained denoising diffusion implicit model and output estimated Gaussian noise.

[0143] Step S203: Estimate Gaussian noise by superimposing it on the target image multiple times according to the set rules to obtain the latent noise.

[0144] Step S204: inputting the secret latent noise into the pre-trained decoder to output binary secret information, and restore it to the original secret information.

[0145] In step S201, step S202 and step S203, when the image digital watermark extractor needs to extract the secret information in the image digital watermark, it is necessary to use the denoising diffusion implicit noise model to calculate the estimated Gaussian noise of the target image containing the digital watermark. The process of generating the secret latent noise is to estimate the Gaussian noise of the target image by multiple superposition according to the same setting rules as in the image digital watermark embedding method.

[0146] In step S204, the decoder decodes the secret potential noise into binary secret information, and the binary secret information is converted from a binary format that can be stored or transmitted into the original secret information. The original secret information can be directly read, used and stored by the image digital watermark extractor without the need for transcoding and reading with the help of computers and other devices. In some embodiments, the training of the decoder includes the following steps S2041-S2043:

[0147] Step S2041: obtaining a first training sample set, the first training sample set comprising a plurality of sample data, each sample data comprising a sample binary secret information and a sample noise image.

[0148] Step S2042: obtaining an initial encoder and an initial decoder, wherein the initial encoder takes sample binary secret information and a sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information.

[0149] Step S2043: The initial encoder and the initial decoder are trained using the first training sample set to obtain a decoder by minimizing the deviation between the secret noise image and the sample noise image and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss.

[0150] In some embodiments, the training of the decoder includes the following steps S1-S5:

[0151] Step S1: Acquire multiple sample carrier images.

[0152] Step S2: Predefine a sequence of values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Generate raw Gaussian noise ∈ randomly.

[0153] Step S3: Superimpose the original Gaussian noise on each sample carrier image according to the time step, and define the noise added to the sample carrier image at time step t as A sample potential noise image is obtained, and a second training sample set is constructed.

[0154] Step S4: obtaining an initial encoder and an initial decoder. During the training process, the initial encoder takes the sample binary secret information and the sample potential noise image as input and outputs the secret noise image; the initial decoder takes the secret noise image as input and outputs the estimated value of the binary secret information; the secret noise image is also input into the denoising diffusion implicit model to output the noise estimation value, and the secret noise image is reversely processed according to the set rules using the noise estimation value to obtain the target image containing the digital watermark; an image discriminator is constructed to classify and identify the target image containing the digital watermark and the sample carrier image.

[0155] Step S5: By minimizing the deviation between the secret noise image and the sample noise image, minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information, and minimizing the image discriminator recognition accuracy construction loss, the initial encoder and the initial decoder are trained using the second training sample set to obtain a decoder.

[0156] Specifically, the present invention adopts the idea of ​​training a generative adversarial network. The generative adversarial network is a deep learning architecture, which is composed of two neural networks, a generator and a discriminator. After the generator generates false data according to random noise, the discriminator needs to judge whether the input data is true data or false data. During the training process, adversarial training is used to optimize parameters to generate more real data until the discriminator cannot recognize false data. The present invention establishes an image discriminator, alternately trains a decoder, an encoder and an image discriminator, performs a difference comparison between a carrier image and a target image containing a digital watermark, and performs a difference comparison between the binary secret information embedded in the image and the extracted binary secret information. The smaller the difference, the smaller the loss in the process of embedding the image digital watermark and extracting the secret information in the image digital watermark, thereby ensuring the integrity and authenticity of the image and the secret information. The function of the decoder is to decode the binary secret information in the potential noise containing secrets, and restore the decoded binary secret information to the original secret information. The restored original secret information is compared with the original secret information when the image digital watermark is embedded. When the difference is smaller, the loss in the embedding and extraction process is smaller, the transmission of the secret information is safer, and the extracted secret information is more complete.

[0157] On the other hand, the present invention also provides an image digital watermark embedding device, the image digital watermark embedding device comprising:

[0158] The binary conversion module is used to encode the original secret information into a binary sequence to generate binary secret information.

[0159] The carrier image acquisition module is used to acquire the carrier image and randomly generate original Gaussian noise, and superimpose the original Gaussian noise on the carrier image multiple times according to the set rules to obtain the potential noise.

[0160] The secret latent noise generation module is used to integrate the binary secret information and the latent noise through a pre-trained encoder to generate a secret latent noise that is similar to the latent noise in data distribution.

[0161] The estimated Gaussian noise generation module is used to input the secret potential noise into the pre-trained denoising diffusion implicit model to obtain the estimated Gaussian noise.

[0162] The target image generation module is used to generate a target image containing a digital watermark by performing reverse processing based on the secret potential noise and the estimated Gaussian noise using set rules, so that the target image contains the original secret information.

[0163] In some embodiments, the carrier image acquisition module superimposes the original Gaussian noise on the carrier image multiple times according to a set rule to obtain potential noise, including:

[0164] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient

[0165] The noise is superimposed on the carrier image x0 in turn according to the time step, and the expression is:

[0166]

[0167] Among them, x t represents the carrier image with superimposed noise at time step t, and ∈ represents the original Gaussian noise.

[0168] In some embodiments, the image digital watermark embedding device is further provided with a model pre-training module, which is used to perform the encoder training steps, including:

[0169] A first training sample set is obtained, where the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image.

[0170] An initial encoder and an initial decoder are obtained. The initial encoder takes sample binary secret information and a sample noise image as input and outputs a secret noise image; the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information.

[0171] The encoder is obtained by minimizing the deviation between the sample noise image and the secret noise image and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss, and using the first training sample set to train the initial encoder and the initial decoder.

[0172] In some embodiments, the model pre-training module is further used to train a denoising diffusion implicit model, including:

[0173] An image data training sample set is obtained, where the image data training sample set includes a plurality of sample carrier images.

[0174] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Generate raw Gaussian noise ∈ randomly.

[0175] Get the initial denoising diffusion implicit model, which is a U-Net model.

[0176] During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t , t), the parameters of the initial denoising diffusion implicit model are updated by minimizing the deviation between the original Gaussian noise estimate and the true value to obtain the denoising diffusion implicit model.

[0177] In some embodiments, the target image generation module generates a target image containing a digital watermark by performing reverse processing based on the secret potential noise and the estimated Gaussian noise using the set rules. The calculation formula is:

[0178]

[0179] Among them, x t represents the latent noise, α t represents a definition coefficient, t represents the time step, ∈ θ (x t , t) represents the estimated Gaussian noise.

[0180] On the other hand, the present invention also provides an image digital watermark extraction device, the image digital watermark extraction device comprising:

[0181] The target image acquisition module is used to acquire the target image to be processed. The target image is obtained based on the image digital watermark embedding method.

[0182] The estimated Gaussian noise generation module is used to input the target image into the pre-trained denoising diffusion implicit model and output the estimated Gaussian noise.

[0183] The secret latent noise generation module is used to estimate the Gaussian noise of the target image by multiple superposition according to the set rules to obtain the secret latent noise.

[0184] The original secret information restoration module is used to input the secret potential noise into the pre-trained decoder to output binary secret information and restore it to the original secret information.

[0185] In some embodiments, the image digital watermark extraction device is further provided with a model pre-training module for training a denoising diffusion implicit model, including:

[0186] An image data training sample set is obtained, where the image data training sample set includes a plurality of sample carrier images.

[0187] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Generate raw Gaussian noise ∈ randomly.

[0188] Get the initial denoising diffusion implicit model, which is a U-Net model.

[0189] During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t , t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

[0190] In some embodiments, the model pre-training module is further used to perform the training steps of the encoder, including:

[0191] A first training sample set is obtained, where the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image.

[0192] An initial encoder and an initial decoder are obtained. The initial encoder takes sample binary secret information and a sample noise image as input and outputs a secret noise image; the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information.

[0193] The initial encoder and the initial decoder are trained using the first training sample set to obtain a decoder by minimizing the deviation between the secret noise image and the sample noise image and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss.

[0194] In some embodiments, the model pre-training module is also used to perform the training steps of the encoder, including: obtaining multiple sample carrier images.

[0195] A sequence of predefined values ​​in the range (0, 1) T represents the maximum time step; define the coefficient Generate raw Gaussian noise ∈ randomly.

[0196] The original Gaussian noise is superimposed on each sample carrier image according to the time step, and the noise added to the sample carrier image at time step t is defined as A sample potential noise image is obtained, and a second training sample set is constructed.

[0197] An initial encoder and an initial decoder are obtained. During the training process, the initial encoder takes the sample binary secret information and the sample potential noise image as input and outputs the secret noise image; the initial decoder takes the secret noise image as input and outputs the estimated value of the binary secret information; the secret noise image is also input into the denoising diffusion implicit model to output the noise estimation value, and the secret noise image is reversely processed according to the set rules using the noise estimation value to obtain the target image containing the digital watermark; an image discriminator is constructed to classify and identify the target image containing the digital watermark and the sample carrier image.

[0198] By minimizing the deviation between the secret noise image and the sample noise image, minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information, and minimizing the image discriminator recognition accuracy construction loss, the initial encoder and the initial decoder are trained using the second training sample set to obtain a decoder.

[0199] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, wherein the computer program / instruction implements the steps of any of the above-mentioned methods when executed by a processor.

[0200] The present invention is described below in conjunction with a specific embodiment:

[0201] Figure 3 The structure diagram of the method for embedding and extracting digital watermarks of an image according to an embodiment of the present invention is shown in FIG. First, a denoising diffusion implicit model (DDIM) needs to be trained to generate images from Gaussian noise. The content of the training set should be semantically similar to the carrier image, for example, both are faces, but the carrier image does not need to appear in the training set. The sampling process of the model generates images from noise, and the desampling process restores the image to the corresponding noise.

[0202] The encoder and decoder are trained. The encoder and decoder are two artificial neural networks, which are used to embed secret information into noise and extract secret information from noise containing secret information respectively. At the same time, an image discriminator is introduced to guide the encoder and decoder to correctly embed secret information and make the target image containing the digital watermark as similar as possible to the original carrier image.

[0203] During training, a batch of carrier images are randomly selected, and then restored to latent noise through the DDIM reverse sampling process. Then, the latent noise and secret information are input into the encoder to generate secret latent noise, and then the target image with digital watermark is generated from the noise through the DDIM model. The loss function of the codec consists of two parts, namely, the term related to the extraction accuracy and the term related to the image quality; when calculating the term related to the extraction accuracy, the target image with digital watermark needs to be restored to secret latent noise through the DDIM model again. Because there are errors in the reverse sampling process, the decoder needs to adapt to the errors, and then the secret information is extracted through the decoder. The original secret information and the extracted secret information are compared, and then the terms of the loss function related to the information extraction accuracy can be calculated; when calculating the term related to the image quality, it is given by the image discriminator. When the image discriminator identifies the target image with digital watermark as not containing watermark, the loss in the process from the original carrier image to the target image with digital watermark is small. The image discriminator, encoder and decoder are trained using the adversarial generative network method, that is, the codec and image discriminator are trained alternately. The goal of the image discriminator is to distinguish whether the given image contains watermark as much as possible.

[0204] After the training is completed, the method can be applied. The embedding and extraction of the digital watermark need to hold the same DDIM model. The former also needs an encoder, and the latter also needs a decoder. The embedding party inputs the secret information and the carrier image with superimposed noise into the encoder to obtain the noise containing the secret information, and then generates an image containing the digital watermark through DDIM; the extraction party superimposes noise on the target image containing the digital watermark through the DDIM model to obtain the secret noise, and then the decoder extracts the binary secret information and restores it to the original secret information.

[0205] 1. The training method of the denoising diffusion implicit model includes:

[0206] 1.1. The preparation work includes preparing the data set, determining the structure of the model and determining the noise sequence.

[0207] a. Prepare a sufficient number of image datasets, whose content depends on the content and semantics of the carrier image. If the carrier image is a face, a sufficient number of face images should be prepared.

[0208] b.DDIM model∈ θ (x t , t) can be a U-Net structure neural network, and its performance can be enhanced using the attention mechanism, where x t represents the image at time step t, and θ is the neural network parameter.

[0209] c. Predefined sequence where β tis the variance of the noise added at time step t in the process of gradually adding noise to the images in the training set, T is the maximum time step, and satisfies 0<β1<β2<…<β T <1; at the same time, for time step t, define the coefficient

[0210] 1.2. Select an original image x0 from the dataset, randomly generate a Gaussian noise ∈, and randomly select a time step t. Then calculate the image after adding noise at time step t, Then x t and t are input into the model to obtain an estimate of the noise ∈ θ (x t , t). Calculate the loss L = ||∈-∈ θ (x t , t)|| 2 , which is the square of the Euclidean distance between the real noise and the estimated noise. The neural network parameters θ are updated using gradient descent to be Where η is the learning rate. Repeat the above steps until the loss is small enough or the set number of iterations is reached to obtain the neural network model ∈ θ (x t , t).

[0211] 1.3. For Gaussian noise x T , gradually generate image x T-1 , x T-2 , ..., x0, the final x0 is the output image, which will be composed of the noise x T With the help of model ∈ θ (x t ,t) The process of generating an image is defined as f θ (x T ), the expression is:

[0212]

[0213] The characteristics of DDIM are used to accelerate the sampling process, that is, instead of generating images in the order of {T, T-1, ..., 0}, a subsequence of {T, T-1, ..., 0} is used for sampling to reduce the sampling steps and accelerate image generation. For example, for T = 1000, the subsequence {1000, 990, 980, ..., 0} can be used for sampling, and only t-1 and t in the formula need to be replaced with adjacent time steps in the subsequence.

[0214] 1.4. For image x0, gradually restore it to potential noise x0, x1, ..., x T , the last x T That is the restored potential noise, expressed as:

[0215]

[0216] The above process is defined as Its meaning is that the image x0 is obtained by using the model ∈ θ (x t ,t) Potential noise of restoration. It should be noted that due to the calculation accuracy and integer / floating point conversion, the above restoration process has errors and is not a true inverse operation.

[0217] 2. The training methods of encoder, decoder and image discriminator include:

[0218] 2.1. Define the capacity of a single image as C, define the encoder as E(m, z), the decoder as D(z′), and the image discriminator as I(p), and determine their structures respectively, where m represents binary secret information, z represents potential noise restored from the carrier image, z′ represents the secret potential noise, and p represents the image; the image discriminator is a binary classifier used to determine whether the input image is embedded with an image digital watermark; the encoder, decoder and discriminator can adopt any neural network structure suitable for image processing, which may be composed of several fully connected layers, convolutional layers and residual connections.

[0219] 2.2. Use the method of training adversarial generation network to alternately train the encoder-decoder and image discriminator.

[0220] When training the codec, first generate a random binary sequence of length C, or a binary sequence with a length less than C but filled with 0s, which is defined as the secret information m. In addition, the original carrier image p is randomly selected and restored to the potential noise z using the DDIM model. After that, the binary secret information C and the potential noise z are input into the encoder to obtain the secret potential noise z′=E(m,z), and then the secret potential noise is input into the image generation process fθ, the noise restoration process fθ, and the image generation process fθ. and decoder to extract the secret information Define the loss function as L′=L A +L B , where L A and L B They represent information extraction error and image quality error respectively. The former is used to measure the similarity between the extracted secret information m′ and m, and the latter is used to measure the target image p′=f containing the digital watermark. θ The similarity between (z′) and the original carrier image p is calculated. After calculating the loss, the parameters of the encoder and decoder are updated synchronously using the gradient descent method. The following are two examples of loss functions:

[0221] L A =-(m log(m′)+(1-m)log(1-m′));

[0222] L B =log(I(p′));

[0223] L A That is, the binary cross entropy of the extracted binary secret information and the original binary secret information; L B That is, the target image with digital watermark output by the encoder is submitted to the image discriminator for recognition. The encoder hopes that the image discriminator cannot correctly recognize it and judges the watermarked p′ as an image without watermark.

[0224] When training the image discriminator, each training batch of the discriminator contains the same number of original carrier images and images with image digital watermarks. The original carrier images and images with image digital watermarks in the training batch do not need to correspond to each other, that is, images with image digital watermarks are not necessarily generated from the original carrier images in the same batch; Like the basic adversarial generative network, the image discriminator is a binary classifier, using the binary cross entropy loss function L I , the expression is:

[0225] L I =-(y log(y′)+(1-y)log(1-y′));

[0226] Where y′ and y are the predicted result and the true result respectively, 1 represents that the input is an image with an image digital watermark, and 0 represents that the input is not an image with an image digital watermark.

[0227] 3. Image digital watermark embedding and extraction methods include:

[0228] 3.1. Both the embedding and extraction of image digital watermarks need to have the same model and parameters ∈ θ (x t ,t), the embedding party must also have an encoder E(m,z), and the extraction party needs to have a decoder D(z′). These neural network models must be shared and transmitted in a secure and reliable manner.

[0229] 3.2. The embedder of the image digital watermark encodes the secret information into a binary sequence, and can take error correction coding or redundant coding measures to form a binary sequence m of length C. The subsequences less than C are padded with 0; for each binary sequence m and carrier image p, the embedder uses the DDIM model and encoder to generate an image p′ containing the image digital watermark; the carrier image p is restored to the potential noise by the DDIM model Then the latent noise and secret information are input into the encoder to obtain the secret latent noise Generate an image with digital watermark from latent noise using DDIM model The expression is:

[0230]

[0231] 3.3. For the image p′ containing the image digital watermark, the receiver uses the decoder and DDIM model to extract the secret information m′; the image p′ containing the image digital watermark is restored to the secret latent noise by the DDIM model Input the latent noise into the decoder to extract the binary secret information The expression is:

[0232]

[0233] The extracted binary secret information m′ may contain errors, and the use of redundant coding or error correction codes helps prevent errors.

[0234] In summary, the present invention provides an image digital watermark embedding method, an extraction method and a system. The image digital watermark embedding method encodes the original secret information into a binary sequence to generate binary secret information, obtains a carrier image and randomly generates original Gaussian noise, and obtains latent noise after superimposing the original Gaussian noise on the carrier image multiple times according to a set rule; integrates the binary secret information and the latent noise through a pre-trained encoder to generate a secret latent noise that is similar to the latent noise in data distribution; inputs the secret latent noise into a pre-trained denoising diffusion implicit model to obtain an estimated Gaussian noise. sound; according to the secret latent noise and the estimated Gaussian noise, reverse processing is performed using the set rules to generate a target image containing a digital watermark; the image digital watermark extraction method inputs the target image into a pre-trained denoising diffusion implicit model and outputs an estimated Gaussian noise, and the estimated Gaussian noise is superimposed on the target image multiple times according to the set rules to obtain the secret latent noise, and the secret latent noise is input into a pre-trained decoder to output binary secret information, and then restored to the original secret information. The present invention can realize efficient embedding and extraction of watermark information under the condition of ensuring that the semantics of the carrier image are not distorted.

[0235] Furthermore, the present invention constructs an image discriminator to perform differential identification on the images before and after the image digital watermark is embedded and the secret information before and after the image digital watermark is extracted, accurately identifying the deviation between the target image containing the digital watermark and the carrier image when the image digital watermark is embedded, and the estimated value of the binary secret information and the deviation of the binary secret information when the image digital watermark is extracted, so as to maintain the consistency of the image semantics before and after the image digital watermark is embedded, and improve the image quality and anti-detection capability.

[0236] An embodiment of the present invention further provides a computer device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or in other ways.

[0237] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0238] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the key shielding method of the vehicle-mounted display device in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory.

[0239] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0240] The one or more modules are stored in the memory, and when executed by the processor, the method described in this embodiment is performed.

[0241] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0242] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0243] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0244] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.

[0245] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for embedding digital watermark in an image, characterized in that: The method is performed by an image digital watermark embedding party, and the method comprises the following steps: Encode the original secret information into a binary sequence to generate binary secret information; Acquire a carrier image, randomly generate original Gaussian noise, and superimpose the original Gaussian noise on the carrier image multiple times according to a set rule to obtain latent noise; Integrating the binary secret information and the latent noise through a pre-trained encoder to generate secret latent noise that is similar to the latent noise in data distribution; Inputting the secret potential noise into the pre-trained denoising diffusion implicit model to obtain estimated Gaussian noise; According to the secret potential noise and the estimated Gaussian noise, the set rule is used to perform reverse processing to generate a target image containing a digital watermark, so that the target image contains the original secret information.

2. The method for embedding digital watermark in an image according to claim 1, characterized in that: The original Gaussian noise is repeatedly superimposed on the carrier image according to a set rule to obtain potential noise, including: A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient The noise is superimposed on the carrier image x0 in rounds according to the time step, and the expression is: Among them, x t represents the carrier image with noise superimposed at t time steps, and ∈ represents the original Gaussian noise.

3. The method for embedding digital watermark in an image according to claim 2, characterized in that: The encoder training steps include: Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image; Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; The encoder is obtained by minimizing the deviation between the sample noise image and the secret noise image, and minimizing the deviation construction loss between the sample binary secret information and the estimated value of the binary secret information, and using the first training sample set to train the initial encoder and the initial decoder.

4. The method for embedding digital watermark in an image according to claim 3, characterized in that: The training steps of the denoising diffusion implicit model include: Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images; A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈; Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model; During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output the estimated value of the original Gaussian noise ∈ θ (x t ,t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

5. The method for embedding digital watermark in an image according to claim 4, characterized in that: According to the secret potential noise and the estimated Gaussian noise, the target image containing the digital watermark is generated by reverse processing using the set rules, and the calculation formula is: Among them, x t represents the latent noise, α t represents a definition coefficient, t represents the time step, ∈ θ (x t ,t) represents the estimated Gaussian noise.

6. A method for extracting digital watermark from an image, characterized in that: The method is performed by an image digital watermark extraction party, and the method comprises the following steps: Acquire a target image to be processed, wherein the target image is obtained based on the image digital watermark embedding method according to any one of claims 1 to 5; Inputting the target image into a pre-trained denoising diffusion implicit model and outputting estimated Gaussian noise; According to a set rule, the estimated Gaussian noise is repeatedly superimposed on the target image to obtain a secret latent noise; The secret latent noise is input into a pre-trained decoder to output binary secret information, and then restored to the original secret information.

7. The method for extracting digital watermark from an image according to claim 6, characterized in that: The training steps of the denoising diffusion implicit model include: Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images; A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈; Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model; During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t ,t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

8. The method for extracting digital watermark from an image according to claim 7, characterized in that: The training steps of the decoder include: Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image; Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss, and using the first training sample set to train the initial encoder and the initial decoder.

9. The method for extracting digital watermark from an image according to claim 8, characterized in that: The training steps of the decoder include: acquiring a plurality of sample carrier images; A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈; The original Gaussian noise is superimposed on each sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as Obtaining a sample potential noise image and constructing a second training sample set; The initial encoder and the initial decoder are obtained. During the training process, the initial encoder takes the sample binary secret information and the sample potential noise image as input and outputs a secret noise image; the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; the secret noise image is also input into the denoising diffusion implicit model to output a noise estimation value, and the secret noise image is reversely processed according to a set rule using the noise estimation value to obtain a target image containing a digital watermark; an image discriminator is constructed to classify and identify the target image containing a digital watermark and the sample carrier image; The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information, and minimizing the recognition accuracy construction loss of the image discriminator, and using the second training sample set to train the initial encoder and the initial decoder.

10. An image digital watermark embedding device, characterized in that: The device comprises: A binary conversion module, used for encoding the original secret information into a binary sequence to generate binary secret information; A carrier image acquisition module is used to acquire a carrier image, randomly generate original Gaussian noise, and superimpose the original Gaussian noise on the carrier image multiple times according to a set rule to obtain potential noise; A secret latent noise generation module, used for integrating the binary secret information and the latent noise through a pre-trained encoder to generate a secret latent noise that is similar to the latent noise in data distribution; An estimated Gaussian noise generation module, used for inputting the secret potential noise into a pre-trained denoising diffusion implicit model to obtain an estimated Gaussian noise; The target image generation module is used to generate a target image containing a digital watermark by performing reverse processing based on the secret potential noise and the estimated Gaussian noise using the set rules, so that the target image contains the original secret information.

11. The image digital watermark embedding device according to claim 10, characterized in that: The carrier image acquisition module superimposes the original Gaussian noise on the carrier image multiple times according to a set rule to obtain potential noise, including: A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient The noise is superimposed on the carrier image x0 in rounds according to the time step, and the expression is: Among them, x t represents the carrier image with noise superimposed at t time steps, and ∈ represents the original Gaussian noise.

12. The image digital watermark embedding device according to claim 11, characterized in that: The device is also provided with a model pre-training module for executing the training steps of the encoder, including: Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image; Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; The encoder is obtained by minimizing the deviation between the sample noise image and the secret noise image, and minimizing the deviation construction loss between the sample binary secret information and the estimated value of the binary secret information, and using the first training sample set to train the initial encoder and the initial decoder.

13. The image digital watermark embedding device according to claim 12, characterized in that: The model pre-training module is also used to train the denoising diffusion implicit model, including: Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images; A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈; Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model; During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output the estimated value of the original Gaussian noise ∈ θ (x t ,t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

14. The image digital watermark embedding device according to claim 13, characterized in that: The target image generation module generates a target image containing a digital watermark by performing reverse processing based on the secret potential noise and the estimated Gaussian noise using the set rules. The calculation formula is: Among them, x t represents the latent noise, α t represents a definition coefficient, t represents the time step, ∈ θ (x t ,t) represents the estimated Gaussian noise.

15. An image digital watermark extraction device, characterized in that: The device comprises: A target image acquisition module, used to acquire a target image to be processed, wherein the target image is obtained based on an image digital watermark embedding method; An estimated Gaussian noise generation module, used for inputting the target image into a pre-trained denoising diffusion implicit model and outputting estimated Gaussian noise; A secret latent noise generation module, used for superimposing the estimated Gaussian noise on the target image multiple times according to a set rule to obtain the secret latent noise; The original secret information restoration module is used to input the secret potential noise into a pre-trained decoder to output binary secret information and restore it to the original secret information.

16. The image digital watermark embedding device according to claim 15, characterized in that: The device is also provided with a model pre-training module for training the denoising diffusion implicit model, including: Acquire an image data training sample set, wherein the image data training sample set includes a plurality of sample carrier images; A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈; Acquire an initial denoising diffusion implicit model, wherein the initial denoising diffusion implicit model is a U-Net model; During the training process, the original Gaussian noise is superimposed on the sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as The initial denoising diffusion implicit model is based on the noise x t and time step t as input and output an estimate of the original Gaussian noise ∈ θ (x t ,t), the denoised diffusion implicit model is obtained by updating the parameters of the initial denoised diffusion implicit model by minimizing the deviation between the original Gaussian noise estimate and the true value.

17. The image digital watermark embedding device according to claim 16, characterized in that: The model pre-training module is also used to perform the training steps of the encoder, including: Acquire a first training sample set, wherein the first training sample set includes a plurality of sample data, each of which includes a sample binary secret information and a sample noise image; Obtain an initial encoder and an initial decoder, wherein the initial encoder takes the sample binary secret information and the sample noise image as input and outputs a secret noise image; and the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, and minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information to construct a loss, and using the first training sample set to train the initial encoder and the initial decoder.

18. The image digital watermark embedding device according to claim 17, characterized in that: The model pre-training module is also used to perform the training steps of the encoder, including: obtaining a plurality of sample carrier images; A sequence of predefined values ​​in the range (0,1) T represents the maximum time step; define the coefficient Randomly generate raw Gaussian noise ∈; The original Gaussian noise is superimposed on each sample carrier image according to the time step, and the noise added to the sample carrier image at the time step t is defined as Obtaining a sample potential noise image and constructing a second training sample set; The initial encoder and the initial decoder are obtained. During the training process, the initial encoder takes the sample binary secret information and the sample potential noise image as input and outputs a secret noise image; the initial decoder takes the secret noise image as input and outputs an estimated value of the binary secret information; the secret noise image is also input into the denoising diffusion implicit model to output a noise estimation value, and the secret noise image is reversely processed according to a set rule using the noise estimation value to obtain a target image containing a digital watermark; an image discriminator is constructed to classify and identify the target image containing a digital watermark and the sample carrier image; The decoder is obtained by minimizing the deviation between the secret noise image and the sample noise image, minimizing the deviation between the sample binary secret information and the estimated value of the binary secret information, and minimizing the recognition accuracy construction loss of the image discriminator, and using the second training sample set to train the initial encoder and the initial decoder.

19. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 18 are implemented.

Citation Information

Cited By

  • Key generation method and device based on diffusion model, electronic equipment and medium

    CN119182525A

  • Robust image watermarking method, system and terminal based on conditional diffusion model

    CN119205478A

  • Picture noise reduction method and system based on denoising automatic encoder

    CN119477741A

  • Microscopic electron microscope image processing method and system based on multi-scale zooming

    CN119648526A

  • Generative invisible watermark method based on stable diffusion model

    CN119693214A