Watermark information extraction method and electronic equipment
By recovering the deformed image and extracting watermark information through geometric correction network model, the problem of insufficient robustness of watermark anti-geometric attacks in the prior art is solved, and the resynchronous detection of watermarks and stronger anti-attack capabilities are realized.
Patent Information
- Application Number
- CN202411589695.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-28
AI Technical Summary
The image watermark method based on multiplication embedding requires manual adjustment when selecting the watermark embedding parameters, making it difficult to realize the resynchronous detection of the watermark, resulting in the weak robustness of the watermark against global geometric attacks.
The geometric correction network model is used to estimate the geometric transformation parameters of the deformed image, and the watermarked image is restored through inverse geometric transformation, and finally the watermark information is extracted from the corrected image.
Resynchronous detection of watermarks is realized, improving the robustness of watermarks against geometric attacks and combination attacks, and improving the detection performance of watermarks through hidden Markov models and visual saliency models.
Smart Images

Figure CN119540022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image watermarking, and in particular to a watermark information extraction method and electronic equipment. Background Art
[0002] The image watermarking method based on multiplicative embedding utilizes the Watson entropy mask visual model and selects the image sub-block with larger entropy value in the image as the watermark embedding area. A simple and efficient image watermark embedding method is proposed, which has good robust performance in resisting attacks such as additive Gaussian noise, median filtering, and JPEG compression.
[0003] However, the image watermarking method based on multiplicative embedding selects the watermark embedding parameters according to human experience, and the parameters need to be constantly adjusted, which makes it difficult to achieve watermark resynchronization detection, resulting in weak robustness of the watermark against global geometric attacks. For watermarked images that have been geometrically attacked, it is difficult to extract the watermark information normally. Summary of the invention
[0004] In view of this, an object of the embodiments of the present invention is to provide a watermark information extraction method and an electronic device to at least partially improve the above-mentioned problem.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for extracting watermark information, the method comprising:
[0007] Embedding the first watermark information into the original image to obtain the first watermark image;
[0008] Obtaining a deformed image of the first watermark image after being geometrically attacked;
[0009] Inputting the original image and the deformed image into a geometric correction network model to obtain a corrected second watermark image;
[0010] The second watermark image is input into a watermark extraction model to obtain extracted second watermark information.
[0011] Optionally, the geometric correction network model includes a feature extraction network module and a matching network module, and the step of inputting the original image and the deformed image into the geometric correction network to obtain a corrected second watermark image includes:
[0012] Dividing the original image and the deformed image into a plurality of original image sub-blocks and deformed image sub-blocks respectively;
[0013] Inputting each of the original image sub-blocks and each of the deformed image sub-blocks into a feature extraction network module respectively to obtain an original feature map and a deformed feature map respectively;
[0014] The original feature map and the deformed feature map are fused through channel cascading to obtain a fused feature map;
[0015] Inputting the fused feature map into the matching network module to obtain geometric transformation parameters;
[0016] According to the geometric transformation parameters, the deformed image is subjected to geometric inverse transformation to obtain a corrected second watermark image.
[0017] Optionally, the feature extraction network module includes N first network layers, the network layers include convolutional layers, batch normalization and linear correction units, and the network layers are connected by reshape; the matching network module includes M second network layers and a fully connected layer, and the second network layers are cascaded in sequence.
[0018] Optionally, inputting the second watermark image into a watermark extraction model to obtain extracted second watermark information includes:
[0019] Perform statistical tests based on the likelihood ratio to obtain the hypothesis test formula;
[0020] Using a hidden Markov model to perform statistical modeling on the image coefficient distribution of the second watermark image to obtain a watermark distribution function;
[0021] According to the watermark distribution function and the maximum likelihood function, the second watermark information of the second watermark image is extracted by maximum likelihood decoding.
[0022] Optionally, the hypothesis testing formula is:
[0023]
[0024] Among them, H1 is the alternative hypothesis and H0 is the null hypothesis;
[0025] The watermark distribution function is:
[0026]
[0027] Among them, x ij Indicates that the i-th node on the j-th decomposition layer has a hidden state S ij ,in, x ij It follows a multivariate Gaussian distribution, For x ij The mean of For x ij The covariance of
[0028] The maximum likelihood function is:
[0029]
[0030] in, The probability distribution function of the coefficient representing the embedded watermark information "1"; The probability distribution function of the coefficient representing the embedded watermark information "-1".
[0031] Optionally, embedding the original image into the first watermark information to obtain the first watermark image includes:
[0032] Dividing the original image into a plurality of image sub-blocks of equal size and non-overlapping;
[0033] Calculating the energy value of each of the image sub-blocks, and sorting them in descending order according to the energy values, selecting a preset number of the image sub-blocks as target image sub-blocks, and the other image sub-blocks as non-target image sub-blocks; the target image sub-block represents the watermark embedding area;
[0034] Performing contourlet transform on each of the target image sub-blocks to calculate a low-frequency sub-band coefficient vector and a high-frequency sub-band average energy in each of the target image sub-blocks;
[0035] Calculating embedding parameters of each target image sub-block according to the high-frequency sub-band average energy and based on a visual saliency model;
[0036] According to the low-frequency sub-band coefficient vector and the embedding parameters, watermarking is embedded in each of the target image sub-blocks to obtain a watermarked image sub-block embedded with a watermark;
[0037] Each of the watermark image sub-blocks is combined with each of the non-target image sub-blocks to obtain a first watermark image.
[0038] Optionally, performing contourlet transform on each of the target image sub-blocks to calculate a low-frequency sub-band coefficient vector and a high-frequency sub-band average energy in each of the target image sub-blocks includes:
[0039] Performing one-layer contourlet decomposition on each of the target image sub-blocks to obtain one low-frequency sub-band image and four high-frequency sub-band images;
[0040] Convert each of the low-frequency sub-band images into a one-dimensional vector to obtain a low-frequency sub-band coefficient vector;
[0041] For each of the target image sub-blocks, calculating the energy average of the corresponding high-frequency sub-band images;
[0042] The high frequency sub-band average energy is calculated based on the energy average values.
[0043] Optionally, the calculation formula for the energy average value is:
[0044]
[0045]
[0046] Among them, E j Represents the coefficient energy of the j-th high-frequency sub-band image, is the high-frequency sub-band image, and represents the contour wave coefficient of the high-frequency sub-band image at position.
[0047] Optionally, the calculation formula of the embedding parameter is:
[0048]
[0049] where a is set to 1.023, c is set to 0.02, and ξ is set to 3.5×10 -5 , E HF is the average energy of the high frequency sub-band, D is the saliency distance of each target image sub-block, D max represents the maximum saliency distance in each of the target image sub-blocks.
[0050] In a second aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements any of the above-described methods when executing the program.
[0051] The embodiment of the present invention provides a watermark information extraction method and electronic device, which use a geometric correction network model to estimate the geometric transformation parameters of a deformed image, such as rotation angle, scaling, and translation parameters, and then restore the watermarked image according to the estimated geometric transformation parameters. Finally, the watermark information is extracted from the watermarked image after geometric correction, thereby realizing the resynchronization detection of the watermark and improving the robustness of the watermark against geometric attacks and combined attacks. The non-Gaussian property of the statistical distribution of the image contour wave coefficients is utilized, and the hidden Markov model is used to perform statistical modeling on the image contour wave coefficients, and combined with the maximum likelihood estimation method, the watermark detection performance is further improved. The visual saliency model is combined, the parameters are embedded adaptively, and the area with larger energy of the image contour wave coefficients is used as the watermark embedding space, thereby improving the ability to resist synchronization attacks.
[0052] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention;
[0055] Figure 2 A schematic diagram of a flow chart of a watermark information extraction method provided by an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of the process of step S210 provided in an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of the process of step S230 provided in an embodiment of the present invention;
[0058] Figure 5 A schematic diagram of a structural block diagram of a feature extraction network module provided by an embodiment of the present invention;
[0059] Figure 6 A schematic diagram of a structural block of a matching network module provided by an embodiment of the present invention;
[0060] Figure 7 A schematic diagram of the process of step S240 provided in an embodiment of the present invention;
[0061] Figure 8 A data flow diagram of a watermark information extraction method provided by an embodiment of the present invention;
[0062] Fig. 9 A performance comparison diagram of the method provided by the embodiment of the present invention and the existing multiplicative watermarking method;
[0063] Fig.10 Another performance comparison result diagram of the method provided in an embodiment of the present invention and an existing multiplicative watermarking method is shown.
[0064] Icon: 100 - electronic device; 101 - memory; 102 - communication interface; 103 - processor; 104 - bus. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0066] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0068] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0069] As described in the background technology, the image watermarking method based on multiplicative embedding utilizes the Watson entropy mask visual model, selects image sub-blocks with larger entropy values in the image as watermark embedding areas, and proposes a simple and efficient image watermarking embedding method, which has good robust performance in resisting attacks such as additive Gaussian noise, median filtering, and JPEG compression.
[0070] The multiplicative embedding image watermarking method divides the original image into several non-overlapping sub-blocks, and the size of the image sub-block is generally set to 16×16. Then, with the help of the Watson entropy mask visual model, this method calculates the information entropy of each image sub-block, and sorts all the image sub-blocks in descending order according to the entropy value, and selects the first K image sub-blocks with larger entropy values as the watermark embedding area. On this basis, wavelet transform is performed on the K image sub-blocks with larger entropy values to obtain the low-frequency wavelet coefficient vector of the image, which is recorded as x=[x1,x2,…,x K ] T , and then perform multiplicative embedding on the low-frequency wavelet coefficients of the image according to the following formula:
[0071] y i =x i ×(1+α), w=1
[0072] y i =x i ×(1-α), w=-1
[0073] Among them, α represents the embedding parameter of the multiplicative watermark, and its value ranges from 0.05 to 0.30, and y i represents the low-frequency wavelet coefficients of the image after embedding the watermark, x i Represents the low-frequency wavelet coefficient of the original image. When w=1 means the watermark information is "1", according to y i =x i ×(1+α) is used to embed the watermark information. w=-1 means that when the watermark information is “-1”, the watermark information is embedded according to y i =x i ×(1-α) is used to embed the watermark information. Then, the image sub-block embedded with the watermark is reconstructed by inverse wavelet transform to obtain an image sub-block embedded with the watermark.
[0074] Repeat the above watermark embedding process for each image sub-block to obtain K watermarked image sub-blocks, and set y = [y1, y2, …, y K ] T Denote as the low-frequency wavelet coefficient vector after the entire watermark is embedded. Finally, the K watermarked image sub-blocks are combined with the image sub-blocks without watermark information, and then the entire watermarked image is obtained.
[0075] However, the image watermarking method based on multiplicative embedding selects the watermark embedding parameters according to human experience, and the parameters need to be constantly adjusted, which makes it difficult to achieve watermark resynchronization detection, resulting in weak robustness of the watermark against global geometric attacks. For watermarked images that have been geometrically attacked, it is difficult to extract the watermark information normally.
[0076] Based on the above situation, an embodiment of the present invention provides a watermark information extraction method and an electronic device, which uses a geometric correction network model to estimate the geometric transformation parameters of the deformed image, such as rotation angle, scaling, and translation parameters, and then restores the watermarked image according to the estimated geometric transformation parameters. Finally, the watermark information is extracted from the watermarked image after geometric correction, thereby realizing watermark resynchronization detection and improving the robustness of the watermark against geometric attacks and combined attacks.
[0077] To implement the process steps and functions of each example of the present invention, please refer to Figure 1 , Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 100 includes a memory 101 and a processor 103, and the memory 101 and the processor 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses 104 or signal lines. The memory 101 can be used to store software programs and modules, and the processor 103 executes the software programs and modules stored in the memory 101 to perform various functional applications and data processing.
[0078] The electronic device 100 may be, but is not limited to, a personal computer (PC), a server, a distributed computer, etc. It is understandable that the electronic device 100 is not limited to a physical server, but may also be a virtual machine on a physical server, a virtual machine built on a cloud platform, etc., which can provide the same functions as the server or virtual machine. The operating system of the electronic device 100 may be, but is not limited to, a Windows system, a Linux system, etc.
[0079] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0080] The communication connection between the electronic device 100 and an external device is achieved through at least one communication interface 102 (which can be wired or wireless).
[0081] The processor 103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the embodiment of the present invention can be completed by the hardware integrated logic circuit in the processor 103 or the instructions in the form of software. The processor 103 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0082] Understandably, Figure 1 The structure shown is for illustration only. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0083] The following is an exemplary description of the watermark information extraction method provided by the present invention. Specifically, Figure 2 A schematic diagram of a watermark information extraction method provided by an embodiment of the present invention, see Figure 2 , the execution subject of this method can be the above Figure 1 The electronic device 100 shown in FIG. 1 includes: Figure 2 The following steps are described:
[0084] S210: Embed the original image with the first watermark information to obtain a first watermark image.
[0085] S220: Obtain a deformed image of the first watermark image after being geometrically attacked.
[0086] S230: Input the original image and the deformed image into a geometric correction network model to obtain a corrected second watermark image.
[0087] S240: Input the second watermark image into the watermark extraction model to obtain extracted second watermark information.
[0088] Adding a watermark to an image can be a clear mark of the image copyright, indicating the copyright owner of the image and preventing others from using it without authorization. By adding a watermark to an image, the risk of the image being illegally copied or distributed can be reduced. The presence of a watermark makes it easier to detect the theft of an image.
[0089] However, in some cases, some users will perform geometric attacks on images, such as rotation, scaling, shearing, etc., to destroy the digital watermark in the image, thereby weakening or eliminating the effectiveness of the watermark and making the copyright protection mechanism unable to work properly. This attack is designed to make the watermark undetectable or unextractable, thereby illegally using or distributing copyrighted images.
[0090] After obtaining the deformed image, the original image and the deformed image are input into the geometric correction network model, and the deformed image is corrected to obtain a corrected second watermark image. Subsequently, the watermark is extracted from the second watermark image using the watermark extraction model, and the second watermark information can be obtained, which can then be compared with the first watermark information to determine whether the extraction is correct.
[0091] This method uses a geometric correction network model to perform geometric correction on the deformed image after geometric attack, extracts watermark information from the corrected second watermark image, realizes watermark resynchronization detection, and improves the robustness of the watermark against geometric attacks and combined attacks.
[0092] In one possible implementation, in order to improve the ability of the watermark image to resist synchronization attacks, a visual saliency model can be used to embed the watermark, see Figure 3 , step S210 may include the following steps:
[0093] S211: Divide the original image into a plurality of image sub-blocks of equal size and non-overlapping.
[0094] In this embodiment, the original image size may be set to 512×512, and the image sub-block size may be set to 32×32.
[0095] S212: Calculate the energy value of each image sub-block, sort it in descending order according to the energy value, select a preset number of image sub-blocks as target image sub-blocks, and other image sub-blocks as non-target image sub-blocks. The target image sub-block represents the watermark embedding area.
[0096] Optionally, the energy calculation formula for each image sub-block may be:
[0097]
[0098] Wherein, L×L represents the image size of each image sub-block, B represents each image sub-block, m, n represent the row and column of the image sub-block respectively, B(m, n) represents the image pixel at position m, n, and E represents the energy of the image sub-block.
[0099] Optionally, in this embodiment, the value of L may be 32, and N may be 64, that is, the first 64 image sub-blocks with larger energies are selected as target image sub-blocks, that is, watermark embedding areas.
[0100] S213: Perform contourlet transform on each target image sub-block to calculate the low-frequency sub-band coefficient vector and the high-frequency sub-band average energy in each target image sub-block.
[0101] Optionally, one-layer contourlet decomposition may be performed on each target image sub-block, and step S213 may include the following steps:
[0102] S2131: Perform one-layer contourlet decomposition on each target image sub-block to obtain one low-frequency sub-band image and four high-frequency sub-band images.
[0103] S2132: Convert each low-frequency sub-band image into a one-dimensional vector to obtain a low-frequency sub-band coefficient vector.
[0104] In this embodiment, the size of each image sub-block is 32×32, so the size of the low-frequency sub-band coefficient vector of the image sub-block after one layer of contourlet decomposition is 16×16, which is converted into a one-dimensional vector with a size of 256. The low-frequency sub-band coefficient vector can be recorded as x=[x1, x2, …, x k ] T , the k value is 256.
[0105] S2133: For each target image sub-block, calculate the energy average of each corresponding high-frequency sub-band image.
[0106] Optionally, the calculation formula for the energy average value may be:
[0107]
[0108]
[0109] Among them, E j represents the coefficient energy of the jth high-frequency subband image, is the high frequency subband image, Indicates that the high-frequency subband image is at position The contour wave coefficient at .
[0110] Calculate the average value of the sum of the energies of the four high-frequency sub-band images of the i-th target image sub-block In this embodiment, the size of each high-frequency sub-band image is 16×16, E j The value of can be expressed as
[0111] For each target image sub-block, the energy average value of each high frequency sub-band image of each target image sub-block can be calculated by the above formula.
[0112] S2134: Calculate the average energy of the high frequency sub-band according to the average values of each energy.
[0113] The high-frequency sub-band average energy can be calculated by taking the energy average of each high-frequency sub-band image of each target image sub-block calculated in step S2133 .
[0114] S214: Calculate the embedding parameters of each target image sub-block according to the average energy of the high-frequency sub-band and based on the visual saliency model.
[0115] The embedding parameters can be calculated using the following formula:
[0116]
[0117] where a is set to 1.023, c is set to 0.02, and ξ is set to 3.5×10 -5 , E HF is the average energy of the high-frequency sub-band, D is the saliency distance of the target image sub-block, and D max Represents the maximum saliency distance in each target image sub-block.
[0118] S215: embedding a watermark into each target image sub-block according to the low-frequency sub-band coefficient vector and each embedding parameter to obtain a watermarked image sub-block embedded with a watermark.
[0119] Watermark embedding can be expressed as:
[0120] y i =λ×x i ,w i =1
[0121] y i =(1 / λ)×x i ,w i =-1
[0122] Among them, y i is the low-frequency subband coefficient vector after embedding the watermark, x i represents the low-frequency subband coefficient vector, w i represents the watermark information, and λ is the embedding parameter.
[0123] By performing an inverse contourlet transform on the low-frequency subband coefficient vector after watermarking, the watermarked image sub-block embedded with the watermark can be obtained.
[0124] S216: Combine each watermark image sub-block with each non-target image sub-block to obtain a first watermark image.
[0125] The watermarked image sub-blocks with each watermark embedded are combined with the image sub-blocks without watermark embedded information to form the entire watermark embedded image.
[0126] In a possible implementation, the geometric correction network model in step S230 may include a feature extraction network module and a matching network module. Step S230 may include: Figure 4 The following steps are shown:
[0127] S231: Divide the original image and the deformed image into a plurality of original image sub-blocks and deformed image sub-blocks respectively.
[0128] S232: Input each original image sub-block and each deformed image sub-block into a feature extraction network module respectively to obtain an original feature map and a deformed feature map respectively.
[0129] For example, the size of each original image sub-block and each deformed image sub-block is 32×32, and the feature map obtained after extracting features through the feature extraction network module is a 256-dimensional feature.
[0130] S233: Fusing the original feature map and the deformed feature map through channel cascading to obtain a fused feature map.
[0131] The original feature map and the deformed feature map are both 256-dimensional, and they can be combined by channel cascading to obtain a fused feature map. The channels of different feature maps are stacked together to increase the dimension of the feature.
[0132] S234: Input the fused feature map into the matching network module to obtain geometric transformation parameters.
[0133] S235: Performing an inverse geometric transformation on the deformed image according to the geometric transformation parameters to obtain a corrected second watermark image.
[0134] Optionally, the feature extraction network module may include N first network layers, the first network layers include convolutional layers, batch normalization and linear correction units, and the first network layers are connected by reshape; the matching network module may include M second network layers and a fully connected layer, and the second network layers are cascaded in sequence. Figure 5 , Figure 6 , Figure 5 A schematic diagram of a structural block diagram of a feature extraction network module provided by an embodiment of the present invention, Figure 6A schematic diagram of the structural block of a matching network module provided in an embodiment of the present invention, the feature extraction network module may include 3 first network layers, each layer includes a convolution layer Conv, a batch normalization BatchNorm and a linear correction unit Relu, and the layers are connected by reshape, the function of reshape is to convert 1×1×256 into 16×16×1, and the convolution kernels of each layer are 32×32, 16×16, and 16×16. The matching network module may include 4 second network layers, each layer includes a convolution layer Conv, a batch normalization BatchNorm and a linear correction unit Relu, and the layers are cascaded in sequence, and the convolution kernels of each layer are 5×5, 3×3, 1×1, and 1×1. Wherein d represents the number of convolution kernels, s represents the step size, and K represents the convolution kernel size.
[0135] Optionally, the geometry correction network model can be trained using the following cost function:
[0136]
[0137] in, are the geometric parameters estimated by the network, is the original geometric parameter (Ground-truth), N is the number of grid points. The training data includes the original image and the deformed image as well as the original geometric transformation parameters.
[0138] In a possible implementation, in order to further improve the watermark detection performance, refer to Figure 7 , step S240 may include the following steps:
[0139] S241: Perform statistical test based on likelihood ratio to obtain hypothesis test formula.
[0140] S242: Use a hidden Markov model to perform statistical modeling on the image coefficient distribution of the second watermark image to obtain a watermark distribution function.
[0141] S243: extracting the second watermark information of the second watermark image by using a maximum likelihood decoding method according to the watermark distribution function and the maximum likelihood function.
[0142] The hidden Markov model is used to statistically model the corrected watermarked image, and the distribution function of the corrected watermarked image is assumed to be f(y|w).
[0143] First, the watermark extraction is regarded as a signal estimation problem. According to the likelihood ratio (LR), a statistical test is performed, and the hypothesis test formula can be obtained as follows:
[0144]
[0145] Among them, H1 is the alternative hypothesis and H0 is the null hypothesis.
[0146] Then, the vector hidden Markov model is used to statistically model the distribution of the image coefficients embedded with the watermark. The watermark distribution function of the image coefficients is:
[0147]
[0148] Among them, x ij Indicates that the i-th node on the j-th decomposition layer has a hidden state S ij ,in, x ij It follows a multivariate Gaussian distribution, For x ij The mean of For x ij The covariance of .
[0149] Finally, the maximum likelihood method is used to extract the watermark information. Extract watermark information, the maximum likelihood function is:
[0150]
[0151] in, represents the probability distribution function of the coefficient of embedding watermark information "1"; f yi|w=-1 (y i )=λf X (λy i ) represents the probability distribution function of the coefficients of the embedded watermark information “-1”. X (y i / λ) and f X (λy i ) Average watermark distribution function calculation.
[0152] Refer to the following Figure 8 , the data flow of the watermark information extraction method is explained. First, the watermark information is added to the original image, and a geometric attack is performed on the watermark image to obtain a deformed image. The original image and the deformed image are respectively input into the feature extraction network module to obtain an original feature map and a deformed feature map. The original feature map and the deformed feature map are input into the matching network module to obtain geometric transformation parameters. The deformed image is corrected according to the geometric transformation parameters to obtain a corrected watermark image, and the watermark information is extracted from it to obtain the extracted watermark information.
[0153] Reference Fig. 9 , Fig.10 The embodiment of the present invention compares the performance with the existing multiplicative watermarking method, and uses the bit error rate (BER) as an evaluation index of the watermark robust performance. Fig. 9, Fig.10 The performance comparison results of the method of the embodiment of the present invention and the existing multiplicative watermarking method are given, wherein Fig. 9 It is a combined attack of noise and rotation on the Barbara image, with a rotation angle of 10° and a noise variance range of [1,5,10,15,20,25,30]; Fig.10 It is a combined attack of noise and scale scaling on the Mandrill image, with a scale scaling factor of 0.75 and a noise variance range of [1,5,10,15,20,25,30]. Fig. 9 and Fig.10 It can be seen that the method of the embodiment of the present invention has strong robustness in resisting noise attacks and rotation attacks, and the effectiveness of the method of the present invention is further verified by this embodiment.
[0154] In summary, the watermark information extraction method and electronic device provided by the embodiments of the present invention use a geometric correction network model to estimate the geometric transformation parameters of the deformed image, such as rotation angle, scaling, and translation parameters, and then restore the watermarked image according to the estimated geometric transformation parameters. Finally, the watermark information is extracted from the watermarked image after geometric correction, thereby realizing the resynchronization detection of the watermark and improving the robustness of the watermark against geometric attacks and combined attacks. The non-Gaussian property of the statistical distribution of the image contour wave coefficients is utilized, and the hidden Markov model is used to perform statistical modeling on the image contour wave coefficients, and combined with the maximum likelihood estimation method, the watermark detection performance is further improved. The visual saliency model is combined with the adaptive embedding parameters, and the area with larger energy of the image contour wave coefficients is used as the watermark embedding space to improve the ability to resist synchronization attacks.
[0155] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0156] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0157] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0158] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, 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.
[0159] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A watermark information extraction method, characterized in that: The method comprises: Embedding the first watermark information into the original image to obtain the first watermark image; Obtaining a deformed image of the first watermark image after being geometrically attacked; Inputting the original image and the deformed image into a geometric correction network model to obtain a corrected second watermark image; The second watermark image is input into a watermark extraction model to obtain extracted second watermark information.
2. The method according to claim 1, characterized in that The geometric correction network model includes a feature extraction network module and a matching network module. The original image and the deformed image are input into the geometric correction network to obtain a corrected second watermark image, including: Dividing the original image and the deformed image into a plurality of original image sub-blocks and deformed image sub-blocks respectively; Inputting each of the original image sub-blocks and each of the deformed image sub-blocks into a feature extraction network module respectively to obtain an original feature map and a deformed feature map respectively; The original feature map and the deformed feature map are fused through channel cascading to obtain a fused feature map; Inputting the fused feature map into the matching network module to obtain geometric transformation parameters; According to the geometric transformation parameters, the deformed image is subjected to geometric inverse transformation to obtain a corrected second watermark image.
3. The method according to claim 2, characterized in that The feature extraction network module includes N first network layers, the network layers include convolutional layers, batch normalization and linear correction units, and the network layers are connected by reshape; the matching network module includes M second network layers and a fully connected layer, and the second network layers are cascaded in sequence.
4. The method according to claim 1, characterized in that: The step of inputting the second watermark image into a watermark extraction model to obtain extracted second watermark information comprises: Perform statistical tests based on the likelihood ratio to obtain the hypothesis test formula; Using a hidden Markov model to perform statistical modeling on the image coefficient distribution of the second watermark image to obtain a watermark distribution function; According to the watermark distribution function and the maximum likelihood function, the second watermark information of the second watermark image is extracted by maximum likelihood decoding.
5. The method according to claim 4, characterized in that The hypothesis test formula is: Among them, H1 is the alternative hypothesis and H0 is the null hypothesis; The watermark distribution function is: Among them, x ij Indicates that the i-th node on the j-th decomposition layer has a hidden state S ij ,in, x ij It follows a multivariate Gaussian distribution, For x ij The mean of For x ij The covariance of The maximum likelihood function is: in, The probability distribution function of the coefficient representing the embedded watermark information "1"; The probability distribution function of the coefficient representing the embedded watermark information "-1".
6. The method according to claim 1, characterized in that The step of embedding the first watermark information into the original image to obtain the first watermark image includes: Dividing the original image into a plurality of image sub-blocks of equal size and non-overlapping; Calculating the energy value of each of the image sub-blocks, and sorting them in descending order according to the energy values, selecting a preset number of the image sub-blocks as target image sub-blocks, and the other image sub-blocks as non-target image sub-blocks; the target image sub-block represents the watermark embedding area; Performing contourlet transform on each of the target image sub-blocks to calculate a low-frequency sub-band coefficient vector and a high-frequency sub-band average energy in each of the target image sub-blocks; Calculating embedding parameters of each target image sub-block according to the high-frequency sub-band average energy and based on a visual saliency model; According to the low-frequency sub-band coefficient vector and the embedding parameters, watermarking is embedded in each of the target image sub-blocks to obtain a watermarked image sub-block embedded with a watermark; Each of the watermark image sub-blocks is combined with each of the non-target image sub-blocks to obtain a first watermark image.
7. The method according to claim 6, characterized in that The step of performing contourlet transform on each of the target image sub-blocks to calculate the low-frequency sub-band coefficient vector and the high-frequency sub-band average energy in each of the target image sub-blocks includes: Performing one-layer contourlet decomposition on each of the target image sub-blocks to obtain one low-frequency sub-band image and four high-frequency sub-band images; Convert each of the low-frequency sub-band images into a one-dimensional vector to obtain a low-frequency sub-band coefficient vector; For each of the target image sub-blocks, calculating the energy average of the corresponding high-frequency sub-band images; The high frequency sub-band average energy is calculated based on the energy average values.
8. The method according to claim 7, characterized in that The calculation formula of the energy average value is: Among them, E j represents the coefficient energy of the jth high frequency subband image, is the high frequency sub-band image, Indicates that the high frequency subband image is at position The contour wave coefficient at .
9. The method according to claim 6, characterized in that The calculation formula of the embedding parameter is: where a is set to 1.023, c is set to 0.02, and ξ is set to 3.5×10 -5 , E HF is the average energy of the high frequency sub-band, D is the saliency distance of each target image sub-block, D max represents the maximum saliency distance in each of the target image sub-blocks.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.