A method, device and equipment for processing image watermark information
Image blocks are selected for watermark embedding through image complexity scoring and deep learning algorithms, which solves the problem of image distortion in the existing technology and achieves high-quality watermark embedding and anti-screen photography effects in different sizes and scenarios.
Patent Information
- Application Number
- CN202410401121.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-04-03
AI Technical Summary
Existing anti-screen robust watermarking technology causes image distortion when processing images containing large smooth areas, and cannot adapt to different sizes and complex scenes, limiting its applicability.
Select image blocks with higher complexity through image complexity scoring, use deep learning algorithms for watermark embedding, improve the quality of generated watermark images, and use multiple loss functions during the training process to enhance anti-screen capture robustness and imperceptibility sex.
It realizes embedding watermark information in high-definition images of any size, improving the quality and robustness of watermark images against screen shots, while adapting to the needs of different scenarios.
Smart Images

Figure CN118279119B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image information processing, and in particular to a method, device and equipment for processing image watermark information. Background Art
[0002] In recent years, with the widespread use of digital media, digital watermarking technology has gradually become a research hotspot in the field of information security. This technology aims to embed information into the corresponding digital content so that the information can still be extracted after the digital content has undergone various transmissions, compressions, and distortions, in order to achieve copyright protection, leak tracing, and other purposes.
[0003] With the popularity of portable devices such as smart phones, the way of transmitting information by taking photos with mobile phones poses a great challenge to the robustness of traditional watermarks, and robust watermarking technology that is resistant to screen shooting becomes increasingly important.
[0004] Although the existing robust watermarking technology against screen capture can maintain a high decoding accuracy and is very robust against screen capture, the smooth areas of the picture have textures caused by adding watermarks, which causes picture distortion and seriously affects the normal use of the picture. Considering that important pictures in some important occasions often include maps, design drawings, ID photos and other pictures that also have large smooth areas, the usability of this method in such scenarios is very low and still needs to be improved. In addition, pictures in real-world scenes are often of different sizes and cannot be compressed or cropped at will. This method is only applicable to fixed-size pictures and cannot handle more complex scenes. Summary of the invention
[0005] The technology to be solved by the present invention is to provide a method, device and equipment for processing image watermark information, select image blocks with higher complexity based on image complexity score and deep learning algorithm for watermark embedding, so as to improve the quality of the generated watermark image.
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a method for processing image watermark information, comprising:
[0007] Obtaining the original carrier image to be processed and the watermark information to be embedded;
[0008] Determine a plurality of first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented;
[0009] Determining a plurality of watermark information sub-segments corresponding to a plurality of the first target image blocks;
[0010] Inputting the plurality of first target image blocks and the corresponding plurality of watermark information sub-segments into the coding layer of the trained watermark network model for processing, and obtaining a plurality of second target image blocks after adding watermark information sub-segments; the watermark network model is obtained by training a preset deep neural network model based on the training image blocks with preset complexity scores and the training watermark information;
[0011] A target carrier image embedded with watermark information is obtained according to the plurality of second target image blocks and the plurality of image blocks segmented from the original carrier image.
[0012] Optionally, determining a plurality of first target image blocks after the original carrier image is segmented according to a complexity score corresponding to each image block after the original carrier image is segmented includes:
[0013] Segmenting the original carrier image to obtain a plurality of image blocks;
[0014] Obtain a complexity score corresponding to each image block in the multiple image blocks, and select M first target image blocks in descending order of the complexity score corresponding to each image block in the multiple image blocks, where M is a positive integer.
[0015] Optionally, obtaining a complexity score corresponding to each image block in the plurality of image blocks includes:
[0016] The multiple image blocks are input into a preset image complexity prediction network model for processing to obtain a complexity score corresponding to each image block; the preset image complexity prediction network model is obtained by training the training image blocks and the complexity score loss function based on a preset convolutional neural network model.
[0017] Optionally, the training process of the watermark network model includes:
[0018] Acquire a training data set; the training data set includes a plurality of first training image blocks constituting a complete training carrier image and having a preset complexity score and training watermark information, wherein the plurality of first training image blocks have the same size;
[0019] Inputting the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model; the training output result includes a plurality of second training image blocks embedded with the training watermark information, third training image blocks after adding noise corresponding to the second training image blocks embedded with the training watermark information, and decoded training watermark information sub-segments corresponding to the third training image blocks after adding noise;
[0020] The model parameters of the preset deep neural network model are iteratively updated using a back propagation algorithm and a preset loss function to obtain the trained watermark network model.
[0021] Optionally, inputting the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training to obtain a training output result of the preset deep neural network model includes:
[0022] Inputting the plurality of first training image blocks and the training watermark information into the encoding layer of the preset deep neural network model for convolution and pooling processing to obtain a plurality of second training image blocks;
[0023] Inputting the plurality of the second training image blocks into the noise simulation layer of the preset deep neural network model for screen capture simulation processing to obtain the third training image block;
[0024] Input the plurality of third training image blocks into the decoding layer of the preset deep neural network model for conversion and convolution processing to obtain the decoded training watermark information sub-segments.
[0025] Optionally, the preset loss function includes:
[0026] A first loss function, wherein the first loss function is used to calculate a residual between the first training image block and the second training image block to minimize a modification of an image block in a coding layer of the preset deep neural network model;
[0027] A second loss function, wherein the second loss function is a cross entropy between the decoded watermark information and the initially input training watermark information, so as to minimize a decoding error generated by a decoding layer of the preset deep neural network model;
[0028] A third loss function is the product of the Laplacian matrix of the first training image block and the pixel value of the second training image block, so as to minimize the quality loss of the image block after the watermark information is embedded.
[0029] Optionally, the method for processing image watermark information further includes:
[0030] The watermark network model is used to sequentially convert and decode the plurality of second target image blocks, thereby obtaining decoded watermark information sub-segments corresponding one-to-one to the second target image blocks.
[0031] An embodiment of the present invention further provides a device for processing image watermark information, comprising:
[0032] An acquisition module, used to acquire the original carrier image to be processed and the watermark information to be embedded;
[0033] A processing module is used to determine multiple first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented; determine multiple watermark information sub-segments corresponding to the multiple first target image blocks; input the multiple first target image blocks and the corresponding multiple watermark information sub-segments into the encoding layer of the trained watermark network model for processing, and obtain multiple second target image blocks after adding watermark information sub-segments; the watermark network model is obtained by training a preset deep neural network model based on training image blocks with preset complexity scores and training watermark information; according to the multiple second target image blocks and the multiple image blocks after the original carrier image is segmented, a target carrier image with embedded watermark information is obtained.
[0034] An embodiment of the present invention further provides a computing device, comprising: a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed.
[0035] An embodiment of the present invention further provides a computer-readable storage medium, comprising instructions, and when the instructions are executed on a computer, the computer executes the method as described above.
[0036] The above solution of the present invention includes at least the following beneficial effects:
[0037] According to the complexity score corresponding to each image block after the original carrier image is segmented, multiple first target image blocks after the original carrier image is segmented are determined; multiple watermark information sub-segments corresponding to the multiple first target image blocks are determined; the multiple first target image blocks and the corresponding multiple watermark information sub-segments are input into the encoding layer of the trained watermark network model for processing to obtain multiple second target image blocks after adding watermark information sub-segments; according to the multiple second target image blocks and the multiple image blocks after the original carrier image is segmented, the target carrier image after the watermark information is embedded is obtained; based on the image complexity score, the image blocks with higher complexity in the image are screened for embedding watermark information, and the size of the watermark strength is adaptively selected according to the image complexity, so that the watermark information can be embedded in the high-definition image of any size, and the quality of the generated watermark image is improved at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a flowchart of a method for processing image watermark information according to an embodiment of the present invention;
[0039] Figure 2 It is a schematic diagram of a watermark network model training process provided by an optional embodiment of the present invention;
[0040] Figure 3is a schematic diagram of the result of processing a Lenna image based on a first loss function provided by an optional embodiment of the present invention;
[0041] Figure 4 It is a module block diagram of a device for processing image watermark information according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0043] like Figure 1 As shown, an embodiment of the present invention provides a method for processing image watermark information, comprising:
[0044] Step 11, obtaining the original carrier image to be processed and the watermark information to be embedded;
[0045] Step 12, determining a plurality of first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented;
[0046] Step 13, determining a plurality of watermark information sub-segments corresponding to a plurality of the first target image blocks;
[0047] Step 14, inputting the plurality of the first target image blocks and the corresponding plurality of the watermark information sub-segments into the coding layer of the trained watermark network model for processing, and obtaining a plurality of second target image blocks embedded with the watermark information sub-segments; the watermark network model is obtained by training a preset deep neural network model based on the training image blocks with preset complexity scores and the training watermark information;
[0048] Step 15, obtaining a target carrier image embedded with watermark information according to the plurality of second target image blocks and the plurality of image blocks segmented from the original carrier image.
[0049] In this embodiment, based on the complexity score corresponding to each image block in the multiple image blocks of the original carrier image after segmentation, multiple first target image blocks are screened out as target objects for embedding watermark information, and the embedding position of the watermark information in the entire original carrier image is determined, so that the embedding of the watermark information has adaptive selection; the complexity score represents the complexity of the image block, and the first target image block is an image block with a higher complexity score among the multiple image blocks. Embedding watermark information based on the image block with high complexity can reduce the impact of the watermark information embedding caused by the small amount of information and monotonous color of the low-complexity image, thereby improving the quality of the generated watermark image; here, the size of the original carrier image is not limited, and the watermark information can be embedded in a high-definition image of any size based on the complexity score of the image block;
[0050] The watermark information may be a segment of Chinese or English. After determining a plurality of first target image blocks, the watermark information is segmented based on the number of the first target image blocks to obtain the same number of watermark information sub-segments as the target image blocks, so as to ensure that the watermark information can be embedded in each first image block;
[0051] Further, the corresponding watermark information sub-segment and the first target image block are input into the trained watermark network model to perform watermark information sub-segment embedding processing, and then the second target image block after the watermark information sub-segment is embedded can be output;
[0052] Furthermore, the corresponding positions of the selected first target image blocks in the original carrier image are replaced by the plurality of second target image blocks respectively, and finally a complete target carrier image embedded with watermark information is obtained;
[0053] The watermark network model is obtained by training a preset deep neural network model based on training image blocks with preset complexity scores and training watermark information; during the training process, training is simultaneously conducted based on a combination of multiple loss functions, so that the watermark information has high anti-screen capture robustness while also having high imperceptibility, so that the watermark network model can better embed the watermark in the edge area of the image, thereby further improving the quality of the generated watermark image.
[0054] In an optional embodiment of the present invention, the above step 12 may include:
[0055] Step 121, segmenting the original carrier image to obtain a plurality of image blocks;
[0056] Step 122, obtaining a complexity score corresponding to each of the multiple image blocks, and selecting M first target image blocks in descending order of the complexity score corresponding to each of the multiple image blocks, where M is a positive integer.
[0057] In this embodiment, the original carrier image can be divided into K non-overlapping image blocks of the same size; here, only the original carrier image is segmented (no other processing that changes the quality of the original carrier image, such as compression, etc., is performed) to ensure that the authenticity of the original carrier image can be retained in the segmented image blocks, and the quality of the subsequently generated target carrier image (watermark image) is guaranteed; after the original carrier image is divided into K non-overlapping image blocks of the same size, the complexity scores corresponding to each of the multiple image blocks can be arranged in order from large to small, starting from the image block corresponding to the maximum complexity score, and M image blocks are selected in sequence as the first target image; here, K and M are both positive integers, and their specific values can be set according to actual needs.
[0058] In an optional embodiment of the present invention, the above step 122 may include:
[0059] Step 1221, input the multiple image blocks into a preset image complexity prediction network model for processing to obtain a complexity score corresponding to each image block; the preset image complexity prediction network model is obtained by training the training image blocks and the complexity score loss function based on a preset convolutional neural network model.
[0060] In this embodiment, a complexity score prediction process is performed on each image block in the preset complexity prediction network model, and a complexity score corresponding to each image block is output; the preset image complexity prediction model is a dual-branch convolutional neural network including a detail branch network and a global branch network, and the dual branches are respectively connected by convolution layers of a ResNet deep residual network, and the final results of the convolution layers of the two ResNets are spliced according to channels, and a global complexity score prediction head is connected to output the final complexity score; the complexity score is a value of 0 to 1, which provides a basis for determining the first target image block, thereby ensuring the quality of the subsequently generated target carrier image;
[0061] The preset image complexity prediction network model predicts the complexity score of each input image block, and the specific process is as follows:
[0062] Step 12211, input each image block into the detail branch network and the global branch network respectively; extract low-level detail features of the image block through the detail branch network to capture local detail information of each image block; extract high-level semantic features of the image block through the global branch network to capture global semantic information of each image block
[0063] Step 12212, optimizing and fusing the first feature image blocks corresponding to the extracted low-level detail features in sequence to obtain a first fused feature image block; specifically: flattening the first feature image block according to the spatial dimension of the first preset length and width, and then inputting it into the fully connected layer with shared weights, adaptively predicting the first weight for each channel according to the spatial feature distribution, and using the first weight to weight the first feature image block through an element-level multiplication operation, further using bilinear upsampling to adjust it to the spatial size of the first preset length and width, and then performing feature splicing based on the channel dimension to obtain the first fused feature image block;
[0064] Step 12213, optimizing and fusing the second feature image block corresponding to the extracted high-level semantic feature to obtain a second fused feature image block: Specifically: flattening the second feature image block according to the spatial dimension of the second preset length and width, and then inputting it into the fully connected layer with shared weights, adaptively predicting the second weight for each channel according to the spatial feature distribution, and using the second weight to weight the second feature image block through an element-level multiplication operation, further using bilinear upsampling to adjust it to the spatial size of the first preset length and width, and then performing feature splicing based on the channel dimension to obtain the second fused feature image block;
[0065] Step 12214, input the first fused feature image block into the global complexity score prediction head, average pool the first fused feature image block into a vector through a global average pooling operation, map the vector using a preset number of neurons, and normalize the mapped vector through a preset activation function to obtain a global complexity score of the current first fused feature image block; perform the above operation on each image block to obtain a complexity score of each image block;
[0066] The specific training process of the preset image complexity prediction network obtained by training the training image blocks and the complexity score loss function based on the preset convolutional neural network model is the same as the above prediction process. During the specific training, the parameters of the entire network model are optimized through the gradient back propagation algorithm and the mean square error loss function.
[0067] In an optional embodiment of the present invention, the above step 13 may include:
[0068] Step 131, according to the number of the first target image blocks, the watermark information is segmented to obtain the same number of watermark information sub-segments as the target image blocks, so as to ensure that the watermark information can be embedded in each first target image block; preferably, before segmentation, the watermark information can be converted into binary sequence information to facilitate the subsequent encoding processing of each watermark information sub-segment, thereby ensuring the quality of the target carrier image containing the watermark information.
[0069] In an optional embodiment of the present invention, the training process of the watermark network model may include:
[0070] Step 21, obtaining a training data set; the training data set includes a plurality of first training image blocks constituting a complete training carrier image and having a preset complexity score and training watermark information, and the plurality of first training image blocks have the same size;
[0071] Step 22, inputting the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model; the training output result includes: a plurality of second training image blocks embedded with the training watermark information, third training image blocks after adding noise corresponding to the second training image blocks embedded with the training watermark information, and decoded training watermark information sub-segments corresponding to the third training image blocks after adding noise;
[0072] Step 23, using a back propagation algorithm and a preset loss function to iteratively update the model parameters of the preset deep neural network model to obtain the trained watermark network model.
[0073] In this embodiment, the preset complexity score of the first training image block can be set according to actual needs, and the training watermark information can be a paragraph of Chinese or English; here, the training watermark information can be a paragraph of Chinese or English randomly generated according to the needs of training during the training process;
[0074] The training of the preset deep neural network model is performed end-to-end, and during the training process, the model parameters are adjusted through the back propagation algorithm and the preset loss function until the model converges or reaches the preset number of iterative training times.
[0075] like Figure 2 As shown, in an optional embodiment of the present invention, the above step 22 may include:
[0076] Step 221, inputting the plurality of first training image blocks and the training watermark information into the encoding layer of the preset deep neural network model for convolution and pooling processing to obtain a plurality of second training image blocks;
[0077] Step 222, inputting the plurality of the second training image blocks into the noise simulation layer of the preset deep neural network model for screen capture simulation processing to obtain the third training image block;
[0078] Step 223: input the plurality of third training image blocks into the decoding layer of the preset deep neural network model for conversion and convolution processing to obtain the decoded training watermark information sub-segments.
[0079] In this embodiment, the preset deep neural network model may include: a coding layer, a noise simulation layer, and a decoding layer;
[0080] The coding layer mainly includes a fully connected network, a residual block and a plurality of convolutional layers; the training watermark information is segmented and encoded in the coding layer and embedded into the first training image block to obtain a second training image block containing the training watermark information; specifically:
[0081] After the plurality of first training image blocks and the training watermark information are input into the coding layer, the training watermark information is firstly segmented and coded, which includes: binary conversion of the training watermark information, segmentation of the binary-converted training watermark information into sub-segments, and BCH coding of each segment of the segmented training watermark information; when the training watermark information is segmented, the number of segments is consistent with the number of the first training image blocks;
[0082] Further, each training watermark information sub-segment is transformed and mapped into a training watermark image block of the same size as the first training image block through the fully connected network in the coding layer; and a training watermark image block obtained after mapping is superimposed in each first training image block, and the image block after superimposing the training watermark image block is subjected to feature extraction through multiple convolutional layers, and then connected through residual blocks to obtain a watermark residual image block corresponding to each first training image block and embedded with the training watermark information sub-segment; further, the watermark residual image block is multiplied by a preset complexity score of the initial first training image block corresponding to it, and then superimposed on the first training image block to obtain a final third training image block;
[0083] The noise simulation layer is used to simulate various attacks on the second training image block during the process of simulating screen shooting. The attacks in the process of simulating screen shooting by the noise simulation layer may include perspective transformation distortion, color distortion, noise simulation, defocus blur and other attacks, wherein the noise simulation attack can be implemented by a noise model, such as Gaussian noise, salt and pepper noise, etc.; the noise model adds random disturbances to the second training image block to simulate the noise effect in the real scene, so that the trained encoding layer and decoding layer can resist the screen shooting attack in the real world, ensure the robustness and security of the entire processing process, and finally output the third training image block after adding noise;
[0084] The decoding layer splits and decodes the training watermark information sub-segments added to the third training image block; the decoding layer is generally composed of a spatial transformation network layer, a plurality of convolutional layers and a fully connected layer; in the decoding layer, the spatial transformation parameters of the third training image block are extracted through the spatial transformation network to restore the distorted part of the third training image block when the screen is taken, so as to ensure that the decoding process can better adapt to the characteristics of the noise and the training watermark information sub-segments; further, the third training image block is convoluted through the convolutional layer and the fully connected layer to output the decoded watermark information sub-segments corresponding to each third training image block;
[0085] In the training process of the above model, different levels of the model can be trained and converged by different preset loss functions respectively; in an optional embodiment of the present invention, the preset loss function may include:
[0086] A first loss function, wherein the first loss function is used to calculate a residual between the first training image block and the second training image block to minimize a modification of an image block in a coding layer of the preset deep neural network model;
[0087] A second loss function, wherein the second loss function is a cross entropy between the decoded watermark information and the initially input training watermark information, so as to minimize a decoding error generated by a decoding layer of the preset deep neural network model;
[0088] A third loss function, wherein the third loss function is the product of the Laplacian matrix of the first training image block and the pixel value of the second training image block, so as to minimize the quality loss of the image block after the watermark information is embedded;
[0089] In this embodiment, the first loss function may be an image residual loss function, the second loss function may be a decoding loss function, and the third loss function may be a graph Laplacian loss function;
[0090] Preferably, the image residual loss function L1 can be expressed as:
[0091] L1=(I encoded -I original ) 2 ;
[0092] Among them, I encoded represents the second training image block, I original represents the first training image block;
[0093] The decoding loss function L2 can be expressed as:
[0094]
[0095] Where N represents the number of training watermark information sub-segments of the initial segmentation, P t represents the error between the t-th decoded training watermark information sub-segment and the t-th training watermark information sub-segment after initial segmentation; y c is a sign function (its value is 0 or 1), t=1, 2, 3, ..., N is an integer;
[0096] The graph Laplace loss function L3 can be expressed as:
[0097] L3=∑ blocks u B T L A u B ;
[0098] Wherein, blocks represents the number of corresponding first training image block blocks and the number of corresponding second training image block blocks obtained after segmenting the first training image block and the second training image block respectively when solving the graph Laplace loss; here, the number of the first training image block blocks is the same as the number of the third training image block blocks, u B represents a one-dimensional vector obtained by compressing the pixel values of one of the second training image blocks after the second training image block is segmented; L A represents the Laplacian matrix corresponding to one of the first training image blocks after the first training image block is divided; T represents transpose;
[0099] In specific applications, in order to facilitate calculation, the above graph Laplace loss function can be converted. The specific process is as follows:
[0100] Step 31, image representation conversion of the first training image block: first, the first training image block is cut into a preset size and quantity to obtain a plurality of first training image block blocks, for example, cut into small blocks of 16*16 with a step size of 8; the first training image block blocks are represented as a graph structure, wherein the pixel points in the first training image block blocks are used as nodes of the graph structure, and the connection relationship between any two adjacent pixel points is used as an edge of the graph structure;
[0101] Step 32, determining the weight of each edge in the graph structure corresponding to each of the first training image blocks:
[0102] Step 321, determine the distance between two pixels constituting each line in the graph structure (the distance can be represented by Euclidean distance or Manhattan distance); specifically, it can be represented by the following formula:
[0103]
[0104] Among them, δ i,jRepresents the distance between pixel i and pixel j in the graph structure, x i represents the pixel value of pixel i, x j represents the pixel value of pixel j, l i represents the position of pixel i in the first training image block, l j represents the position of pixel j in the first training image block, σ x , σ y Respectively represent the set parameters;
[0105] Step 322, according to the distance between any two pixels, determine the weight value of the edge formed by the two pixels; specifically, it can be expressed by the following formula:
[0106] w Ai,j =exp(-δ i,j );
[0107] Among them, w Ai,j Represents the weight of the edge in the graph structure composed of pixel i and pixel j;
[0108] Step 33, based on step 31-step 32, transform the Laplacian matrix of the above graph:
[0109]
[0110] Among them, u Bi Represents a one-dimensional vector u B In the first training image block, i The specific pixel value at the corresponding position; u Bj Represents a one-dimensional vector u B In the first training image block, j The specific pixel value at the position corresponding to the position;
[0111] like Figure 3 As shown, in order to more intuitively illustrate the impact of the preset graph Laplace loss function, Figure 3 The adjacency matrix corresponding to a part of Lena's picture calculated according to the above formula is shown; Figure 3 The continuous white line segments in the rightmost image block represent edges with high weights (the weight here represents the distance between two nodes in the graph structure, which is used to measure whether the two nodes are close enough and have low pixel value differences), which is the smooth area in Lena's image; Figure 3 The black breakpoints in the rightmost image block represent the edge area in the Lena image. Through this figure and the above loss function, the interference of the watermark on the smooth area of the image can be reduced, and the quality of the generated watermark image can be improved.
[0112] Through the back-propagation algorithm and the preset graph Laplace loss function, the gradient of the loss function to the model parameters is calculated to update the model parameters, thereby constraining the smoothness of the first training image block after the embedded training watermark information segment output by the coding layer during the model training process on the graph structure, helping the model to learn a more continuous and smooth representation, thereby improving the generalization ability and robustness of the model.
[0113] In an optional embodiment of the present invention, the above step 14 may include:
[0114] Step 141, in the coding layer of the watermark network model, the watermark information sub-segment after binary processing is encoded by BCH (finite field linear block code), and a certain number of check bits are added to each watermark information sub-segment after binary processing, so as to facilitate detection and correction after embedding the watermark information sub-segment, thereby ensuring the accuracy of watermark information embedding and generation, and thus improving the quality of the target carrier image containing the watermark information;
[0115] Further, each watermark information sub-segment after BCH encoding is converted and mapped into a watermark image block of the same size as the first target image block through the fully connected network in the encoding layer of the watermark network model; further, a watermark image block is superimposed on each first target image block, and processed through the convolution layer and the residual block in the encoding layer of the watermark network model to obtain a plurality of second target image blocks after embedding the watermark information sub-segments; here, the specific embedding process of the watermark information sub-segment after BCH encoding is the same as the training process of the encoding layer in the above-mentioned model training process, and will not be repeated here;
[0116] Furthermore, the corresponding positions of the plurality of first target image blocks selected from the original carrier image are replaced by the plurality of second target image blocks respectively, so as to finally obtain a complete target carrier image embedded with watermark information.
[0117] In an optional embodiment of the present invention, based on steps 11 to 15, the following may also be included:
[0118] Step 16: convert and decode the plurality of second target image blocks obtained in sequence through the watermark network model to obtain decoded watermark information sub-segments corresponding one-to-one to the second target image blocks.
[0119] In this embodiment, it should be known that, in actual application, after obtaining the second target image block after embedding the watermark information through steps 11 to 15, the second target image block after embedding the watermark information can be obtained by photographing or taking a screenshot. While obtaining the second target image block after embedding the watermark information by photographing or taking a screenshot, the photographing or taking a screenshot has caused a screen capture attack on the second target image block. At this time, the second target image block after embedding the watermark information obtained by photographing or taking a screenshot can be directly spatially transformed and convolved through the decoding layer in the watermark network model (the specific process is the same as the training process of the decoding layer of the above-mentioned model), and finally the decoded watermark information sub-segment is output; further, the decoded watermark information sub-segment can be detected and matched with the watermark information sub-segment obtained after cutting the original embedded watermark information through BCH coding.
[0120] By using the method for processing image watermark information provided in the embodiment of the present invention, when embedding image watermark information, the embedding position of the watermark information in the image can be determined based on the complexity score corresponding to each image block after segmentation of the original carrier image to be processed, that is, the first target image block with higher complexity is determined, which can improve the quality and effect of the subsequent generation of the target carrier image containing the watermark information, and can also embed the watermark information in a high-definition image of any size; the process of embedding the watermark information is completed in a watermark network model obtained by training a preset deep neural network model based on training image blocks with preset complexity scores and training watermark information; in the training process of the model, multiple loss functions such as the graph Laplacian loss function are used for training at the same time, so that the watermark information has high robustness against screen capture and high imperceptibility, and the coding layer in the trained watermark network model can better embed the watermark in the edge area of the image, so that the watermark information has high robustness against screen capture and high imperceptibility, further improving the quality of the generated watermark image (target carrier image).
[0121] like Figure 4 As shown, the embodiment of the present invention further provides an image watermark information processing device 40, comprising:
[0122] An acquisition module 41 is used to acquire the original carrier image to be processed and the watermark information to be embedded;
[0123] The processing module 42 is used to determine a plurality of first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented; determine a plurality of watermark information sub-segments corresponding to the plurality of first target image blocks; input the plurality of first target image blocks and the corresponding plurality of watermark information sub-segments into the encoding layer of the trained watermark network model for processing to obtain a plurality of second target image blocks after adding watermark information sub-segments; the watermark network model is obtained by training a preset deep neural network model based on training image blocks with preset complexity scores and training watermark information; and obtain a target carrier image after embedding watermark information according to the plurality of second target image blocks and the plurality of image blocks after the original carrier image is segmented.
[0124] Optionally, the processing module 42 is used to determine a plurality of first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented, including:
[0125] Segmenting the original carrier image to obtain a plurality of image blocks;
[0126] A complexity score corresponding to each image block in the multiple image blocks is obtained, and M first target image blocks are selected in descending order of the complexity score corresponding to each image block in the multiple image blocks, where M is a positive integer.
[0127] Optionally, the processing module 42 is used to obtain a complexity score corresponding to each image block in the plurality of image blocks, including:
[0128] The multiple image blocks are input into a preset image complexity prediction network model for processing to obtain a complexity score corresponding to each image block; the preset image complexity prediction network model is obtained by training the training image blocks and the complexity score loss function based on a preset convolutional neural network model.
[0129] Optionally, the process of the processing module 42 for training the watermark network model includes:
[0130] Acquire a training data set; the training data set includes a plurality of first training image blocks constituting a complete training carrier image and having a preset complexity score and training watermark information, wherein the plurality of first training image blocks have the same size;
[0131] Inputting the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model; the training output result includes a plurality of second training image blocks embedded with the training watermark information, third training image blocks after adding noise corresponding to the second training image blocks embedded with the training watermark information, and decoded training watermark information sub-segments corresponding to the third training image blocks after adding noise;
[0132] The model parameters of the preset deep neural network model are iteratively updated using a back propagation algorithm and a preset loss function to obtain the trained watermark network model.
[0133] Optionally, the processing module 42 inputs the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training, and obtains the training output result of the preset deep neural network model, including:
[0134] Inputting the plurality of first training image blocks and the training watermark information into the encoding layer of the preset deep neural network model for convolution and pooling processing to obtain a plurality of second training image blocks;
[0135] Inputting the plurality of the second training image blocks into the noise simulation layer of the preset deep neural network model for screen capture simulation processing to obtain the third training image block;
[0136] Input the plurality of third training image blocks into the decoding layer of the preset deep neural network model for conversion and convolution processing to obtain the decoded training watermark information sub-segments.
[0137] Optionally, the preset loss function includes:
[0138] A first loss function, wherein the first loss function is used to calculate a residual between the first training image block and the second training image block to minimize a modification of an image block in a coding layer of the preset deep neural network model;
[0139] A second loss function, wherein the second loss function is a cross entropy between the decoded watermark information and the initially input training watermark information, so as to minimize a decoding error generated by a decoding layer of the preset deep neural network model;
[0140] A third loss function is the product of the Laplacian matrix of the first training image block and the pixel value of the second training image block, so as to minimize the quality loss of the image block after the watermark information is embedded.
[0141] Optionally, the processing module 42 is further used for:
[0142] The watermark network model is used to sequentially convert and decode the plurality of second target image blocks, thereby obtaining decoded watermark information sub-segments corresponding one-to-one to the second target image blocks.
[0143] It should be noted that the device is a device corresponding to the method for processing image watermark information, and all implementations in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.
[0144] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0145] The embodiment of the present invention further provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0146] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0147] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0148] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0151] If the functions are implemented in the form of software functional units and sold or used as independent products, they 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 storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0152] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.
[0153] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.
[0154] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing image watermark information, It is characterized in that include: Obtaining the original carrier image to be processed and the watermark information to be embedded; Determine a plurality of first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented; Determining a plurality of watermark information sub-segments corresponding to the plurality of first target image blocks, specifically comprising dividing the watermark information based on the number of the first target image blocks to obtain the same number of watermark information sub-segments as the target image blocks; Inputting the plurality of first target image blocks and the corresponding plurality of watermark information sub-segments into the coding layer of the trained watermark network model for processing, and obtaining a plurality of second target image blocks after adding watermark information sub-segments; the watermark network model is obtained by training a preset deep neural network model based on the training image blocks with preset complexity scores and the training watermark information; Obtaining a target carrier image after embedding watermark information according to the plurality of second target image blocks and the plurality of image blocks segmented from the original carrier image; The training process of the watermark network model includes: Acquire a training data set; the training data set includes a plurality of first training image blocks constituting a complete training carrier image and having a preset complexity score and training watermark information, wherein the plurality of first training image blocks have the same size; Inputting the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model; the training output result includes a plurality of second training image blocks embedded with the training watermark information, third training image blocks after adding noise corresponding to the second training image blocks embedded with the training watermark information, and decoded training watermark information sub-segments corresponding to the third training image blocks after adding noise; Iteratively update the model parameters of the preset deep neural network model using a back propagation algorithm and a preset loss function to obtain the trained watermark network model; Inputting the plurality of first training image blocks into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model, comprises: Inputting the plurality of first training image blocks and the training watermark information into the encoding layer of the preset deep neural network model for convolution and pooling processing to obtain a plurality of second training image blocks; Inputting the plurality of the second training image blocks into the noise simulation layer of the preset deep neural network model for screen capture simulation processing to obtain the third training image block; Input the plurality of third training image blocks into the decoding layer of the preset deep neural network model for conversion and convolution processing to obtain the decoded training watermark information sub-segments.
2. The method for processing image watermark information according to claim 1, It is characterized in that Determining a plurality of first target image blocks after the original carrier image is segmented according to the complexity score corresponding to each image block after the original carrier image is segmented includes: Segmenting the original carrier image to obtain a plurality of image blocks; Obtain a complexity score corresponding to each image block in the multiple image blocks, and select M first target image blocks in descending order of the complexity score corresponding to each image block in the multiple image blocks, where M is a positive integer.
3. The method for processing image watermark information according to claim 2, It is characterized in that Obtaining a complexity score corresponding to each image block in the plurality of image blocks includes: The multiple image blocks are input into a preset image complexity prediction network model for processing to obtain a complexity score corresponding to each image block; the preset image complexity prediction network model is obtained by training the training image blocks and the complexity score loss function based on a preset convolutional neural network model.
4. The method for processing image watermark information according to claim 1, It is characterized in that The preset loss function includes: A first loss function, wherein the first loss function is used to calculate a residual between the first training image block and the second training image block to minimize a modification of an image block in a coding layer of the preset deep neural network model; A second loss function, wherein the second loss function is a cross entropy between the decoded watermark information and the initially input training watermark information, so as to minimize a decoding error generated by a decoding layer of the preset deep neural network model; A third loss function is the product of the Laplacian matrix of the first training image block and the pixel value of the second training image block, so as to minimize the quality loss of the image block after the watermark information is embedded.
5. The method for processing image watermark information according to claim 1, It is characterized in that Also includes: The watermark network model is used to sequentially convert and decode the plurality of second target image blocks, thereby obtaining decoded watermark information sub-segments corresponding one-to-one to the second target image blocks.
6. A device for processing image watermark information, It is characterized in that include: An acquisition module, used to acquire the original carrier image to be processed and the watermark information to be embedded; A processing module, configured to determine a plurality of first target image blocks after the original carrier image is segmented according to a complexity score corresponding to each image block after the original carrier image is segmented; Determine a plurality of watermark information sub-segments corresponding to the plurality of first target image blocks, specifically comprising: dividing the watermark information based on the number of first target image blocks to obtain the same number of watermark information sub-segments as the target image blocks; inputting the plurality of first target image blocks and the corresponding plurality of watermark information sub-segments into the coding layer of a trained watermark network model for processing to obtain a plurality of second target image blocks after adding watermark information sub-segments; the watermark network model is obtained by training a preset deep neural network model based on training image blocks with preset complexity scores and training watermark information; and obtaining a target carrier image after embedding watermark information according to the plurality of second target image blocks and the plurality of image blocks segmented from the original carrier image; The training process of the watermark network model includes: Acquire a training data set; the training data set includes a plurality of first training image blocks constituting a complete training carrier image and having a preset complexity score and training watermark information, wherein the plurality of first training image blocks have the same size; Inputting the plurality of first training image blocks and the training watermark information into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model; the training output result includes a plurality of second training image blocks embedded with the training watermark information, third training image blocks after adding noise corresponding to the second training image blocks embedded with the training watermark information, and decoded training watermark information sub-segments corresponding to the third training image blocks after adding noise; Iteratively update the model parameters of the preset deep neural network model using a back propagation algorithm and a preset loss function to obtain the trained watermark network model; Inputting the plurality of first training image blocks into the preset deep neural network model for training, and obtaining the training output result of the preset deep neural network model, comprises: Inputting the plurality of first training image blocks and the training watermark information into the encoding layer of the preset deep neural network model for convolution and pooling processing to obtain a plurality of second training image blocks; Inputting the plurality of the second training image blocks into the noise simulation layer of the preset deep neural network model for screen capture simulation processing to obtain the third training image block; Input the plurality of third training image blocks into the decoding layer of the preset deep neural network model for conversion and convolution processing to obtain the decoded training watermark information sub-segments.
7. A computing device, It is characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 5 is performed.
8. A computer-readable storage medium, It is characterized in that The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 5.
