CN114529441A - Image frequency domain digital watermarking method, system, device and medium - Google Patents

Image frequency domain digital watermarking method, system, device and medium Download PDF

Info

Publication number
CN114529441A
CN114529441A CN202210061192.1A CN202210061192A CN114529441A CN 114529441 A CN114529441 A CN 114529441A CN 202210061192 A CN202210061192 A CN 202210061192A CN 114529441 A CN114529441 A CN 114529441A
Authority
CN
China
Prior art keywords
watermark
picture
attention
encoder
embedding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210061192.1A
Other languages
Chinese (zh)
Inventor
伍冠中
余翔宇
梅雨婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China University of Technology SCUT
Original Assignee
South China University of Technology SCUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by South China University of Technology SCUT filed Critical South China University of Technology SCUT
Priority to CN202210061192.1A priority Critical patent/CN114529441A/en
Publication of CN114529441A publication Critical patent/CN114529441A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/002Image coding using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking
    • G06T2201/0065Extraction of an embedded watermark; Reliable detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Multimedia (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method, a system, a device and a medium for image frequency domain digital watermarking, wherein the method comprises the following steps: designing an embedding and extracting model of the image frequency domain digital watermark; inputting a carrier picture and a watermark into a watermark embedding and extracting self-encoder to obtain a first picture with the watermark, randomly adding the first picture into noise attack, and inputting the first picture into a decoder of the watermark embedding and extracting self-encoder to obtain a rough extracted watermark; randomly selecting the first picture to cut or not attack to obtain a second picture and a standard confidence map, inputting the second picture into an attention scorer, and outputting an attention confidence map; and (4) multiplying the roughly extracted watermark and the attention confidence map pixel by pixel on a two-dimensional plane for modification to obtain a final watermark. The invention analyzes the picture of the watermark to be extracted through the attention scoring device, reduces the influence of the watermark-free part on the real part with the watermark, obtains better extraction accuracy rate, and can be widely applied to the technical field of information security.

Description

Image frequency domain digital watermarking method, system, device and medium
Technical Field
The invention relates to the technical field of information security, in particular to a method, a system, a device and a medium for image frequency domain digital watermarking.
Background
In the internet era, digital watermarking technology is widely applied in life and commercial activities, has the functions of protecting the copyright of digital media, preventing tampering and the like, and is an important part in the field of information security. Among the many possible carriers in which additional information is embedded, digital images are more common. The widespread dissemination of digital images in various fields, from everyday communications on social networks to medicine, the military and space, has facilitated this process.
Digital watermarking techniques require two main processes, embedding and extraction. Embedding refers to embedding the watermark into the digital media without significantly changing the original perception effect of the content, and the extraction process is to extract the originally embedded content from the digital media in which the information is embedded. One of the key technical difficulties of the digital watermarking technology is how to extract the original watermark as much as possible after the digital media embedded with the watermark is subjected to various digital signal processing processes, namely, the robustness of the digital watermark.
Generally, the watermark embedding positions can be roughly divided into frequency domain embedding and spatial domain embedding, specifically, the object of spatial domain watermark algorithm modification is the pixel values of points on an image, namely, the watermark is embedded into the image on the premise of meeting imperceptibility, and a least significant bit algorithm is typically based on. One advantage of the spatial domain watermarking algorithm is that it is easy to implement, but it has poor robustness. The specific method of the frequency domain digital watermarking technology is to perform mathematical transformation on an image and then embed the watermark in a transform domain, wherein the commonly used mathematical transformation comprises discrete Fourier transformation, discrete wavelet transformation and discrete cosine transformation, and the commonly used mathematical transformation is gradually and widely applied in the field of digital watermarking.
With the development of computer vision, neural networks are greatly varied in a plurality of fields such as target detection, face recognition and the like. Considering that digital watermarking technology of images is also a special branch of digital image processing, a neural network can also be introduced into digital watermarking. At present, researchers gradually combine the digital watermarking technology with the neural network technology and other technologies on the basis of the traditional spatial domain algorithm and the traditional transform domain algorithm, so that the robustness of the algorithm is greatly improved, and the method has unique advantages in some aspects, which has great promotion effect on the development of the digital watermarking technology. Ahmadi et al, the university of isfahan, proposed a method for embedding a watermark in the frequency domain using a convolutional auto-encoder, which received attention from a large number of scholars.
For image digital watermarking, among various digital signal processing means, clipping is an operation that seriously damages the watermark. The cropping of the image means the loss of information, the more cropping, the more information is lost, and how to extract the complete watermark from the remaining small information becomes a difficult problem. If the watermark can still be accurately extracted after the image is cut, a delicate algorithm needs to be designed, the watermark is embedded into each local unit of the image as much as possible, and the watermark is well extracted.
Disclosure of Invention
To solve at least one of the technical problems in the prior art to some extent, an object of the present invention is to provide a method, a system, a device and a medium for frequency domain digital watermarking of an image.
The technical scheme adopted by the invention is as follows:
an image frequency domain digital watermarking method comprises the following steps:
designing an embedding and extracting model of the image frequency domain digital watermark; wherein the embedding and extracting model comprises a watermark embedding extracting from an encoder and an attention scorer;
inputting a carrier picture and a watermark into a watermark embedding and extracting self-encoder to obtain a first picture with the watermark, randomly adding the first picture into a noise attack, and then inputting the first picture into a decoder of the watermark embedding and extracting self-encoder to obtain a rough extracted watermark;
randomly selecting the first picture to cut or not to attack to obtain a second picture and a standard confidence map, inputting the second picture into an attention scorer, and outputting an attention confidence map;
and (3) carrying out pixel-by-pixel multiplication on a two-dimensional plane for correcting the coarsely extracted watermark obtained by embedding the watermark into the self-encoder and the attention confidence map obtained by the attention scorer to obtain the final watermark.
Further, the image frequency domain digital watermarking method further comprises the step of training the watermark embedding extraction self-encoder:
training watermark embedding and extracting from an encoder to perform watermark embedding and extracting in a direction of minimizing an error between a carrier picture and a picture with a watermark and an error between an input watermark and an extracted watermark;
the image frequency domain digital watermarking method further comprises the step of training the attention scorer:
and taking the error between the output of the minimized attention scorer and the standard confidence map as a training direction, and calculating the confidence degree of the input picture with the watermark at each position by the training attention scorer.
Further, the watermark embedding extraction self-encoder and the attention scorer are both composed of a convolutional neural network;
before inputting the picture into said watermark embedding extraction from the encoder and said attention scorer, a step of pre-processing the picture is included:
if the picture is a three-channel color picture, firstly converting the color space of the color picture into a YCbCr space, keeping a CbCr channel unchanged, and only taking a Y channel as a gray scale image for embedding;
if the picture is a single-channel gray-scale picture, color space transformation is not needed; dividing the gray-scale image into non-overlapping image blocks with the size of 8 multiplied by 8, after each image block is subjected to discrete cosine transform independently, all the image blocks are reshaped into 1/8 with the side length being the side length of the carrier image, the number of channels is 64, and each channel represents a coefficient of the discrete cosine transform;
in addition, the watermark input watermark is embedded and extracted from the encoder, and the watermark is preprocessed as follows:
arranging the watermarks into tensors with equal side lengths and 4 channels in total, keeping the number of the channels unchanged, and repeating the steps on a two-dimensional plane until the side lengths are the same as the side lengths of the image reconstruction tensors.
Furthermore, after the preprocessed picture tensor and the watermark tensor are spliced in the watermark embedding and extracting self-encoder, the sizes of the input six layers of convolution kernels are all 1 multiplied by 1, the step lengths are all 1 multiplied by 1, a non-filled convolution layer and a nonlinear activation layer are connected in series to form a neural network for encoding, the output of the encoder is subjected to inverse discrete cosine transform, and the obtained residual image is added with the carrier image to obtain a final grey image with the watermark;
if the picture before preprocessing is a three-channel color picture, the gray-scale image output by the encoder is used as a Y channel, and the Y channel and the CbCr channel reserved during preprocessing are converted back to the RGB color space again; then selecting a preset digital image processing means to add noise attack, decoding through a neural network formed by connecting four layers of convolution kernels with the size of 1 multiplied by 1 and the step length of 1 multiplied by 1 in a series manner to obtain a roughly extracted watermark tensor, averaging repeated information bits to obtain a roughly extracted watermark, and embedding and extracting the watermark from an encoder by taking the error between the roughly extracted watermark and an input watermark and the error between a watermarked picture output by the encoder and the input picture as a training direction.
Further, in the attention scorer, the cropping attack is to randomly generate a rectangle smaller than the picture size, the image content inside the rectangle is not changed, and the part outside the rectangle can be modified into any other value;
the value of the corresponding confidence map at the cut-out position is 0, the value at the reserved position is 1, and if the attack is not carried out, the whole confidence map is 1; then, performing two-dimensional mean pooling on the confidence coefficient graph with the kernel size of 8 multiplied by 8 and the step length of 8 multiplied by 8 to obtain a standard confidence coefficient graph;
after discrete cosine transform is carried out on the processed picture, the processed picture is input into a convolutional neural network formed by connecting four layers of convolutional layers with convolutional kernel size of 3 multiplied by 3 and step length of 1 multiplied by 1 and unit zero filling and a nonlinear activation layer in series, an attention confidence coefficient graph is obtained, the error of the minimum attention confidence coefficient graph and the standard confidence coefficient graph is taken as the direction, and the attention scorer can be trained to learn the confidence coefficient of the input picture with watermarks at each position.
Further, in the process of training the watermark embedding extraction self-encoder, the error of the input watermark and the extracted watermark adopts a mean square error, and the error between pictures also adopts a mean square error, and the training loss function is the sum of the picture error and the watermark error;
in training the attention scorer, the error between the standard confidence map and the attention confidence map adopts the mean square error, and the mean square error is used as a loss function of training.
Further, the modifying the coarsely extracted watermark obtained by embedding the watermark into the encoder and the attention confidence map obtained by the attention scorer by pixel multiplication on a two-dimensional plane to obtain the final watermark includes:
roughly extracting a watermark tensor, wherein the value range of all values is (0, 1), and linearly converting the value range of the watermark tensor to (-1, 1);
performing element-by-element multiplication on a two-dimensional plane by adopting the attention confidence coefficient diagram and the watermark tensor to obtain a final watermark tensor;
and according to the final watermark tensor, averaging the repeated watermark bits and then rounding to obtain the final watermark.
The other technical scheme adopted by the invention is as follows:
an image frequency domain digital watermarking system, comprising:
the model design module is used for designing an embedding and extracting model of the image frequency domain digital watermark; wherein the embedding and extracting model comprises a watermark embedding extracting from an encoder and an attention scorer;
the watermark extraction module is used for embedding and extracting the carrier picture and the watermark into the encoder to obtain a first picture with the watermark, randomly adding the first picture into noise attack, and then inputting the first picture into a decoder of the watermark embedding and extracting encoder to obtain a rough extracted watermark;
the confidence coefficient acquisition module is used for randomly selecting the first picture to cut or not attack to obtain a second picture and a standard confidence coefficient map, inputting the second picture into the attention scorer and outputting the attention confidence coefficient map;
and the watermark correction module is used for performing pixel-by-pixel multiplication on the roughly extracted watermark obtained by embedding the watermark into the encoder and the attention confidence coefficient image obtained by the attention scorer on a two-dimensional plane for correction to obtain the final watermark.
The other technical scheme adopted by the invention is as follows:
an image frequency domain digital watermarking apparatus, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method described above.
The other technical scheme adopted by the invention is as follows:
a computer readable storage medium in which a processor executable program is stored, which when executed by a processor is for performing the method as described above.
The invention has the beneficial effects that: according to the invention, the picture of the watermark to be extracted is analyzed through the attention scoring device, the tampered part is given a lower score, the influence of the watermark-free parts on the real part with the watermark in the final majority voting or averaging process is reduced, and the better extraction accuracy is obtained.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description is made on the drawings of the embodiments of the present invention or the related technical solutions in the prior art, and it should be understood that the drawings in the following description are only for convenience and clarity of describing some embodiments in the technical solutions of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a block diagram of an encoder in which watermark embedding is extracted from the encoder in an embodiment of the present invention;
fig. 2 is a block diagram of a decoder with watermark embedding extracted from the encoder in an embodiment of the invention;
FIG. 3 is a block diagram of an attention scorer in an embodiment of the present invention;
FIG. 4 is a flow chart of pre-processing of pictures in an embodiment of the present invention;
fig. 5 is a schematic flow chart of preprocessing watermark information according to an embodiment of the present invention;
FIG. 6 is a flowchart of an image frequency domain digital watermarking method based on an attention mechanism according to an embodiment of the present invention;
FIG. 7 is a flow chart of attention scorer training in an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. The step numbers in the following embodiments are provided only for convenience of illustration, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
In the description of the present invention, it should be understood that the orientation or positional relationship referred to in the description of the orientation, such as the upper, lower, front, rear, left, right, etc., is based on the orientation or positional relationship shown in the drawings, and is only for convenience of description and simplification of description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
As shown in fig. 6, the present embodiment provides an attention-based image frequency domain digital watermarking method, including the following steps:
s1, designing a self-encoder model and an attention scorer for embedding and extracting watermarks, wherein the specific network structure is set as follows: as shown in fig. 1, the self-encoder model of this embodiment includes an encoder and a decoder, both of which are convolutional neural networks, wherein the encoder has six layers, as shown in fig. 1, the first five layers are 64 × 1 × 1 layers, the step size is 1 × 1, the non-filled convolutional kernel and the ELU activation function are formed in series, and the last layer is 1 layer, 64 × 1 × 1 layer, the step size is 1 × 1 layer, the non-filled convolutional kernel and the ELU activation function are formed in series; the decoder has four layers, as shown in fig. 2, the first three layers are all formed by connecting 64 convolution kernels with length of 1 × 1 and without filling and an ELU activation function in series, and the last layer is formed by connecting 4 convolution kernels with length of 64 × 1 × 1 and with length of 1 × 1 and without filling and a sigmoid activation function in series.
As shown in fig. 3, the attention scorer has four layers, the first three layers are 64 convolution kernels with 64 × 3 × 3, 1 × 1 step size and 1 unit of zero padding, and the ELU activation function are connected in series, and the last layer is 1 convolution kernel with 64 × 3 × 3, 1 × 1 step size and 1 unit of zero padding, and the sigmoid activation function are connected in series.
The ELU activation function is shown by the following equation:
Figure BDA0003478259780000061
where x is the input value of the activation function ELU, ELU (x) is the output value of the activation function, and α is a constant, which is 1 in this embodiment;
the sigmoid activation function is shown as follows:
Figure BDA0003478259780000062
where x is the input value of the activation function sigmoid, (x) is the output value of the activation function.
S2, preprocessing and post-processing the picture and the watermark information before and after entering each network, and the specific operations are as follows:
as shown in fig. 4, the pre-processing of the picture can be divided into three steps of color space conversion, slicing, space and frequency domain conversion, and if the input picture is a black and white single channel picture, the color space conversion is skipped. In this embodiment, a 3 × 128 × 128 color picture is adopted as an input picture. For a color picture, firstly, the color picture is changed from an RGB color space to a YCbCr color space, and the color of the picture is easily changed due to the change of a CbCr channel, so that the CbCr channel is kept unchanged, and only the Y channel is subjected to information embedding. Then, the Y channel is divided into image blocks with a size of 8 × 8, which do not overlap with each other, and each image block is transformed from the spatial domain to the frequency domain, in this embodiment, a DCT (discrete cosine transform) with a size of 8 × 8 is adopted, so as to obtain a picture tensor with a size of 64 × 16 × 16, where 64 is the number of channels, and each channel represents a DCT coefficient. For the encoder in the self-encoder, the output of the network needs to be post-processed. In this embodiment, the encoder outputs a tensor with a size of 64 × 16 × 16, performs IDCT (inverse discrete cosine transform) and then reshapes the tensor to obtain a 1 × 128 × 128Y channel residual image, adds the residual image to the Y channel image when the image is input to the encoder, and then inversely transforms the residual image and the CbCr channel back to the RGB color space.
As shown in fig. 5, the preprocessing of the watermark information is divided into two steps of reshaping and repeating. In this embodiment, the size of the input watermark information is 64 bits, each bit is represented by 0 and 1, the tensor is reshaped into a 4 × 4 × 4 tensor, and then the tensor is repeated on the two-dimensional plane to the same size as the picture tensor, in this embodiment, the width and height dimensions on the two-dimensional plane are repeated 4 times, and finally, the 4 × 16 × 16 watermark tensor is obtained.
S3, training a self-encoder model for watermark embedding and extraction, specifically operating as follows:
as shown in fig. 6, after the carrier picture I to be embedded with the watermark and the watermark information W to be embedded are preprocessed in step S2, the carrier picture I and the watermark information W are put into the encoder of the self-encoder in step S1, and the watermarked picture I 'is obtained, and the reconstruction error between I and I' is calculated according to the following calculation formula:
Figure BDA0003478259780000071
wherein c, h and w respectively represent the number, height and width of image channels, and I' respectively represent a carrier image and an image embedded with a watermark.
Then, in each iteration process, a common digital image processing method is selected for I' to add noise, in the embodiment, one of Gaussian noise (mean value is 0, standard deviation is 0.06), Gaussian blur (radius is 2, standard deviation is 0.1), salt-pepper noise (noise intensity is 0.1) and JPEG compression (quality factor is 50) is randomly selected to obtain a noise-added picture In
Then mix InThe crude watermark tensor W with the same size as the watermark tensor in the step S2 is obtained by a decoder which is input into a self-encoderoWhere the range of values of each element is (0, 1), the tensor size in this embodiment is 4 × 16 × 16. After obtaining the rough extracted watermark tensor, averaging the elements representing the repeated watermark bits in a repeated manner according to step S2 to obtain a rough extracted watermark tensor with a size of 4 × 4 × 4, and performing an inverse operation of reshaping in step S2 to obtain a 64-bit rough extracted watermark W ', and calculating a reconstruction error between W and W', wherein the calculation formula is as follows:
Figure BDA0003478259780000072
wherein W and W' are respectively input watermark and extracted watermark, WiAnd w'iThe ith bit of W and W' respectively, and n is the bit number of the watermark;
and finally, adding the reconstruction error of the picture and the watermark reconstruction error to obtain a Loss function Loss of the self-encoder:
Loss=MSE(I,I′)+aMSE(W,W′)
where α is a constant, 1 in this embodiment, to balance image quality and robustness.
S4, training an attention scoring device, comprising the following specific steps: as shown in fig. 7, after the image is watermarked by using the encoder trained in step S3, in this embodiment, at each iteration, one of three ways is selected randomly to process the watermarked image to obtain IcAnd the three modes are that no operation is carried out, random colors are filled after cutting, and pixels at the corresponding positions of the carrier image are filled after cutting. The clipping operation is to randomly generate a rectangle with a side length 0.2 to 0.8 times that of the original image, in this embodiment, the side length ranges from 24 to 104, the values of the pixels in the rectangle are kept unchanged, and the values outside the rectangle are replaced by others. And simultaneously generating a confidence map with the same size as the picture, wherein the value in the rectangle is 1, and the rest is 0. If no clipping is performed, the confidence maps are all 1.
Then, the confidence map is subjected to two-dimensional mean pooling with a kernel size of 8 × 8 and a step size of 8, to obtain a standard confidence map C having a plane size equal to the amount of the watermark sheets in step S2, which is 16 × 16 in this example. Then adding IcInputting the data into an attention scorer, outputting an attention confidence coefficient graph C ', and calculating a reconstruction error between C and C' to be a loss function, wherein the calculation formula is as follows:
Figure BDA0003478259780000081
where h and w represent the height and width of the confidence map, respectively.
S5, the decoder of step S3 is modified by using the model trained in step S4, as shown in FIG. 6. In step S3, the trained decoder outputs a coarse extraction watermark WoW if the watermarked picture input by the decoder is subject to a clipping attackoOn the two-dimensional plane, the decoded information corresponding to the clipped portion should have no reference value, and the decoding result corresponding to the remaining portion of pixels is correct. For this purpose, W is firstoOf elementsThe value range is linearly converted to (-1,1), and the conversion formula is as follows:
then, the attention confidence maps C' and W obtained in step S4 are usedoCarrying out element-by-element multiplication on a two-dimensional plane to obtain a corrected watermark tensor Wc. At this time, the value of the position corresponding to the clipped part at C' is close to 0, and therefore W is correctedcThe value of the middle corresponding position is also close to 0, and the interference to the subsequent averaging process is reduced. Then, similarly to step S3, for WcAnd after the average value of the elements of the repeated watermark bit is calculated, the average value is rounded upwards, the watermark bit corresponding to the element larger than 0 is 1, and the watermark bit corresponding to the element smaller than 0 is 0.
In summary, compared with the prior art, the embodiment of the invention has the following beneficial effects:
(1) according to the embodiment of the invention, the watermark information is reshaped into four planes and then spliced with the picture tensor, so that four times of information is embedded in each 8X 8 image block of the carrier image compared with the prior image, and the frequency domain of the image is better utilized for embedding.
(2) According to the embodiment of the invention, the watermark information is preprocessed before being input into the watermark self-encoder, namely, the watermark information is repeated more times in a plane space, so that the image with the watermark can extract complete watermark information in a smaller area; meanwhile, due to more repetition on the plane, the method has better error correction capability in voting or averaging after the watermark is roughly extracted, and the robustness of the watermark method is improved.
(3) The embodiment of the invention adds the attention scoring device to analyze the picture to be watermarked, so as to obtain the score of each 8 multiplied by 8 block of the picture, and lower score is given to the tampered part, thereby reducing the influence of the parts without watermark on the real part with watermark in the process of final majority voting or averaging and obtaining better extraction accuracy.
The invention also provides an image frequency domain digital watermarking system, which comprises:
the model design module is used for designing an embedding and extracting model of the image frequency domain digital watermark; wherein the embedding and extracting model comprises a watermark embedding extracting from an encoder and an attention scorer;
the watermark extraction module is used for embedding and extracting the carrier picture and the watermark into the encoder to obtain a first picture with the watermark, randomly adding the first picture into noise attack, and then inputting the first picture into a decoder of the watermark embedding and extracting encoder to obtain a rough extracted watermark;
the confidence coefficient acquisition module is used for randomly selecting the first picture to cut or not attack to obtain a second picture and a standard confidence coefficient map, inputting the second picture into the attention scorer and outputting the attention confidence coefficient map;
and the watermark correction module is used for performing pixel-by-pixel multiplication on the roughly extracted watermark obtained by embedding the watermark into the encoder and the attention confidence coefficient image obtained by the attention scorer on a two-dimensional plane for correction to obtain the final watermark.
The image frequency domain digital watermarking system can execute the image frequency domain digital watermarking method provided by the method embodiment of the invention, can execute any combination implementation steps of the method embodiment, and has corresponding functions and beneficial effects of the method.
The embodiment further provides an image frequency domain digital watermarking device, including:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method as shown in fig. 6.
The image frequency domain digital watermarking device can execute the image frequency domain digital watermarking method provided by the method embodiment of the invention, can execute any combination implementation steps of the method embodiment, and has corresponding functions and beneficial effects of the method.
The embodiment of the application also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and executed by the processor, to cause the computer device to perform the method illustrated in fig. 6.
The embodiment also provides a storage medium, which stores instructions or programs capable of executing the image frequency domain digital watermarking method provided by the embodiment of the method of the invention, and when the instructions or the programs are run, the steps can be implemented in any combination of the embodiment of the method, and the corresponding functions and the beneficial effects of the method are achieved.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the foregoing description of the specification, reference to the description of "one embodiment/example," "another embodiment/example," or "certain embodiments/examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for digital watermarking in image frequency domain is characterized by comprising the following steps:
designing an embedding and extracting model of the image frequency domain digital watermark; wherein the embedding and extracting model comprises a watermark embedding extracting from an encoder and an attention scorer;
inputting a carrier picture and a watermark into a watermark embedding and extracting self-encoder to obtain a first picture with the watermark, randomly adding the first picture into a noise attack, and then inputting the first picture into a decoder of the watermark embedding and extracting self-encoder to obtain a rough extracted watermark;
randomly selecting the first picture to cut or not to attack to obtain a second picture and a standard confidence map, inputting the second picture into an attention scorer, and outputting an attention confidence map;
and (3) carrying out pixel-by-pixel multiplication on a two-dimensional plane for correcting the coarsely extracted watermark obtained by embedding the watermark into the self-encoder and the attention confidence map obtained by the attention scorer to obtain the final watermark.
2. The image frequency-domain digital watermarking method of claim 1, further comprising the step of training the watermark embedding extraction self-encoder to:
training watermark embedding and extracting from an encoder to perform watermark embedding and extracting in a direction of minimizing an error between a carrier picture and a picture with a watermark and an error between an input watermark and an extracted watermark;
the image frequency domain digital watermarking method further comprises the step of training the attention scorer:
and taking the error between the output of the minimized attention scorer and the standard confidence map as a training direction, and calculating the confidence degree of the input picture with the watermark at each position by the training attention scorer.
3. The image frequency domain digital watermarking method according to claim 1, wherein the watermark embedding extraction encoder and the attention scorer are both composed of a convolutional neural network;
before inputting the picture into said watermark embedding extraction from the encoder and said attention scorer, a step of pre-processing the picture is included:
if the picture is a three-channel color picture, firstly converting the color space of the color picture into a YCbCr space, keeping a CbCr channel unchanged, and only taking a Y channel as a gray scale image for embedding;
if the picture is a single-channel grey-scale image, color space transformation is not needed; dividing the gray-scale image into non-overlapping image blocks with the size of 8 multiplied by 8, after each image block is subjected to discrete cosine transform independently, all the image blocks are reshaped into 1/8 with the side length being the side length of the carrier image, the number of channels is 64, and each channel represents a coefficient of the discrete cosine transform;
in addition, the watermark input watermark is embedded and extracted from the encoder, and the watermark is preprocessed as follows:
arranging the watermarks into tensors with equal side lengths and 4 channels in total, keeping the number of the channels unchanged, and repeating the steps on a two-dimensional plane until the side lengths are the same as the side lengths of the image reconstruction tensors.
4. The image frequency domain digital watermarking method according to claim 3, wherein after the preprocessed image tensor and watermark tensor are spliced in the watermark embedding extraction encoder, the input six layers of convolution kernels are all 1 x 1 in size and all 1 x 1 in step length, a neural network formed by the unfilled convolution layer and the nonlinear active layer in series is encoded, the output of the encoder is subjected to inverse discrete cosine transform, and the obtained residual image is added to the carrier image to obtain a final watermarked gray image;
if the picture before preprocessing is a three-channel color picture, the gray-scale image output by the encoder is used as a Y channel, and the Y channel and the CbCr channel reserved during preprocessing are converted back to the RGB color space again; then selecting a preset digital image processing means to add noise attack, decoding through a neural network formed by connecting four layers of convolution kernels with the size of 1 multiplied by 1 and the step length of 1 multiplied by 1 in a series manner to obtain a roughly extracted watermark tensor, averaging repeated information bits to obtain a roughly extracted watermark, and embedding and extracting the watermark from an encoder by taking the error between the roughly extracted watermark and an input watermark and the error between a watermarked picture output by the encoder and the input picture as a training direction.
5. The method for digital watermarking in image frequency domain according to claim 3, wherein in the attention classifier, the cropping attack is to randomly generate a rectangle smaller than the picture size, the image content in the rectangle is not changed, and the part outside the rectangle can be modified into any other value;
the value of the corresponding confidence map at the cut-out position is 0, the value at the reserved position is 1, and if the attack is not carried out, the whole confidence map is 1; then, performing two-dimensional mean pooling on the confidence coefficient graph with the kernel size of 8 multiplied by 8 and the step length of 8 multiplied by 8 to obtain a standard confidence coefficient graph;
after discrete cosine transform is carried out on the processed picture, the processed picture is input into a convolutional neural network formed by connecting four layers of convolutional layers with convolutional kernel size of 3 multiplied by 3 and step length of 1 multiplied by 1 and unit zero filling and a nonlinear activation layer in series, an attention confidence coefficient graph is obtained, the error of the minimum attention confidence coefficient graph and the standard confidence coefficient graph is taken as the direction, and the attention scorer can be trained to learn the confidence coefficient of the input picture with watermarks at each position.
6. The image frequency domain digital watermarking method according to claim 2, wherein in training the watermark embedding extraction self-encoder, errors of the input watermark and the extracted watermark adopt mean square errors, errors between pictures also adopt mean square errors, and a loss function for training is the sum of the picture errors and the watermark errors;
in training the attention scorer, the error between the standard confidence map and the attention confidence map adopts the mean square error, and the mean square error is used as a loss function of training.
7. The method for digital watermarking the image in the frequency domain according to claim 1, wherein the step of modifying the coarsely extracted watermark obtained by embedding the watermark into the encoder and the attention confidence map obtained by the attention scorer by multiplying the coarsely extracted watermark and the attention confidence map pixel by pixel on a two-dimensional plane to obtain the final watermark comprises:
roughly extracting a watermark tensor, wherein the value range of all values is (0, 1), and linearly converting the value range of the watermark tensor to (-1, 1);
performing element-by-element multiplication on a two-dimensional plane by adopting the attention confidence coefficient diagram and the watermark tensor to obtain a final watermark tensor;
and according to the final watermark tensor, averaging the repeated watermark bits and then rounding to obtain the final watermark.
8. An image frequency domain digital watermarking system, comprising:
the model design module is used for designing an embedding and extracting model of the image frequency domain digital watermark; wherein the embedding and extracting model comprises a watermark embedding extracting from an encoder and an attention scorer;
the watermark extraction module is used for embedding and extracting the carrier picture and the watermark into the encoder to obtain a first picture with the watermark, randomly adding the first picture into noise attack, and then inputting the first picture into a decoder of the watermark embedding and extracting encoder to obtain a rough extracted watermark;
the confidence coefficient acquisition module is used for randomly selecting the first picture to cut or not attack to obtain a second picture and a standard confidence coefficient map, inputting the second picture into the attention scorer and outputting the attention confidence coefficient map;
and the watermark correction module is used for performing pixel-by-pixel multiplication on the roughly extracted watermark obtained by embedding and extracting the watermark into the encoder and the attention confidence coefficient image obtained by the attention scorer for correction to obtain the final watermark.
9. An image frequency domain digital watermarking apparatus, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method of any one of claims 1-7.
10. A computer-readable storage medium, in which a program executable by a processor is stored, wherein the program executable by the processor is adapted to perform the method according to any one of claims 1 to 7 when executed by the processor.
CN202210061192.1A 2022-01-19 2022-01-19 Image frequency domain digital watermarking method, system, device and medium Pending CN114529441A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210061192.1A CN114529441A (en) 2022-01-19 2022-01-19 Image frequency domain digital watermarking method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210061192.1A CN114529441A (en) 2022-01-19 2022-01-19 Image frequency domain digital watermarking method, system, device and medium

Publications (1)

Publication Number Publication Date
CN114529441A true CN114529441A (en) 2022-05-24

Family

ID=81620987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210061192.1A Pending CN114529441A (en) 2022-01-19 2022-01-19 Image frequency domain digital watermarking method, system, device and medium

Country Status (1)

Country Link
CN (1) CN114529441A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115293949A (en) * 2022-07-14 2022-11-04 河南和畅利信息科技有限公司 Image encryption method
CN117255232A (en) * 2023-11-14 2023-12-19 南京信息工程大学 DWT domain robust video watermarking method and system based on self-attention mechanism
CN117495649A (en) * 2024-01-02 2024-02-02 支付宝(杭州)信息技术有限公司 Image processing method, device and equipment
WO2024032158A1 (en) * 2022-08-10 2024-02-15 大连大学 Deep image watermarking method based on mixed frequency-domain channel attention

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115293949A (en) * 2022-07-14 2022-11-04 河南和畅利信息科技有限公司 Image encryption method
CN115293949B (en) * 2022-07-14 2024-01-02 中技安全科技有限公司 Image encryption method
WO2024032158A1 (en) * 2022-08-10 2024-02-15 大连大学 Deep image watermarking method based on mixed frequency-domain channel attention
CN117255232A (en) * 2023-11-14 2023-12-19 南京信息工程大学 DWT domain robust video watermarking method and system based on self-attention mechanism
CN117255232B (en) * 2023-11-14 2024-01-26 南京信息工程大学 DWT domain robust video watermarking method and system based on self-attention mechanism
CN117495649A (en) * 2024-01-02 2024-02-02 支付宝(杭州)信息技术有限公司 Image processing method, device and equipment

Similar Documents

Publication Publication Date Title
CN114529441A (en) Image frequency domain digital watermarking method, system, device and medium
Zhang et al. Robust invisible video watermarking with attention
CN112507842A (en) Video character recognition method and device based on key frame extraction
CN113807334B (en) Residual error network-based multi-scale feature fusion crowd density estimation method
Zhang et al. Image robust adaptive steganography adapted to lossy channels in open social networks
EP1908007B1 (en) Image watermarking
CN112911341B (en) Image processing method, decoder network training method, device, equipment and medium
CN109685710A (en) A kind of method and device of the hidden digital watermark embedding of image copyright
Liao et al. GIFMarking: The robust watermarking for animated GIF based deep learning
CN113724136A (en) Video restoration method, device and medium
CN115482142A (en) Dark watermark adding method, extracting method, system, storage medium and terminal
CN116630131A (en) Coding and decoding system and method for invisible screen watermark
Rahim et al. Exploiting de-noising convolutional neural networks DnCNNs for an efficient watermarking scheme: a case for information retrieval
CN118397367A (en) Tampering detection method based on convolution vision Mamba
Khandelwal et al. W-VDSR: Wavelet-based secure image transmission using machine learning VDSR neural network
Agarwal et al. Digital watermarking in the singular vector domain
CN117496338A (en) Method, equipment and system for defending website picture tampering and picture immediate transmission
Hu et al. StegaEdge: learning edge-guidance steganography
CN114255151A (en) High-resolution image robust digital watermarking method based on key point detection and deep learning
Chhikara et al. Information theoretic steganalysis of processed image LSB steganography
Mei et al. A robust blind watermarking scheme based on attention mechanism and neural joint source-channel coding
Cu et al. A robust data hiding scheme using generated content for securing genuine documents
Li et al. Resampling forgery detection in JPEG-compressed images
Orii et al. Data embedding method for printed images using multilayer neural networks with partially fixed weights
Wang et al. Perceptual compressive sensing scheme based on human vision system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination