A gradient-flow-based blind watermarking embedding method for color images
By using a gradient flow-based blind watermarking embedding method for color images, the problems of insufficient robustness, invisibility, and security of traditional watermarking techniques in color image processing are solved, achieving good visual concealment and strong security under high-capacity conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LUDONG UNIVERSITY
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-02
AI Technical Summary
Traditional watermarking techniques struggle to balance robustness, invisibility, and security when processing color images, especially under conditions of high-volume information embedding and complex attacks.
A gradient-direction-based blind watermarking embedding method for color images is adopted. Through steps such as layered processing, pseudo-random sequence generation, selection of non-overlapping pixel blocks using a pseudo-random sequence generation function, discrete cosine transform, and gradient direction determination, the watermark is embedded and extracted.
It achieves good visual concealment, strong robustness and security of color image watermarking under high-capacity conditions, and can effectively extract watermarks under various attacks.
Smart Images

Figure CN122134535A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information security technology and relates to rapid copyright protection for color digital images with strong robustness and high security. Background Technology
[0002] With the rapid development of multimedia and network technologies, and the widespread dissemination and application of digital information on the Internet, the acquisition and sharing of digital multimedia content has become increasingly convenient. However, piracy, tampering, and other infringements have also emerged, seriously threatening the copyright and information security of digital works. Against this backdrop, digital watermarking technology has emerged. Leveraging the redundancy inherent in digital media and the characteristics of human vision, it embeds identifying information invisibly into the host data, thus providing a key technical means for copyright authentication and anti-tampering of digital content. With the deep application of color images in various fields, their value as information carriers has become increasingly important, and the copyright issues such as illegal copying and tampering have become more prominent. Traditional watermarking technologies often struggle to balance robustness, invisibility, and security when processing color images, especially under conditions of high-capacity information embedding and complex attacks. Therefore, designing a digital watermarking algorithm suitable for color images that maintains good visual concealment under conditions of large capacity, high robustness, and strong security has become an important research direction in this field. Summary of the Invention
[0003] The purpose of this invention is to provide a color image blind watermark embedding method based on gradient flow direction. Its characteristic is that it is achieved through a specific watermark embedding process and a watermark extraction process, the watermark embedding process of which is described as follows: Step 1: Convert an image with a pixel size of Color host image The host image is divided into three layers in the order of red, green, and blue. ,in, They represent the red, green, and blue layers respectively. For color digital host images The number of edge pixels; Step 2: Convert an image with a pixel size of... Color watermark image Dimensionality reduction and layering preprocessing are performed to obtain three single-channel watermark images for the corresponding red, green, and blue channels. Then, using the key as The two-dimensional logic-adjusted sinusoidal mapping scrambling encryption algorithm will scramble each layer of the watermark image. Encryption is performed; furthermore, the watermark image is encrypted at each layer. Each decimal pixel value in the image is represented by 8 bits of binary, resulting in a length of... binary watermark sequence ,in, They represent the red, green, and blue layers respectively. For color watermarked images The number of edges; Step 3: Extract each layer of host image Divided into pixels with Non-overlapping blocks are selected using a pseudo-random sequence generation function. A non-overlapping pixel block is used for watermark embedding, and its position is recorded to the key. ,in, For color watermarked images The number of edge pixels, For color host image The number of edge pixels, These represent the red, green, and blue layers, respectively. Step 4: In the selected One image block is selected sequentially from each of the non-overlapping pixel blocks. ,Will The spatialization of the one-dimensional discrete cosine transform is performed according to formula (1), and a 1×4 block is obtained; (1) in, It is a 1×4 block obtained by spatialization using one-dimensional discrete cosine transform. =1, 2, 3, 4 =1, 2, 3, 4; Step 5: Apply the discrete cosine transform to the 1×4 coefficient block after the fusion domain transformation. The watermark embedding method based on gradient flow direction is used for embedding, and the gradient flow direction is determined according to formula (2); (2) in, Represents the size of pixel blocks ; Step 6: Obtain three sets of flow direction sequences Based on this definition, two key statistics are established: the positive flow count is... Reverse flow count is , where δ(⋅) is the indicator function; Step 7: Embed watermark bits When =1, ensure Embedded watermark bits When =0, ensure If the above conditions are not met, then modify the coefficient block. for Make it satisfy: when embedding watermark bits When =1, When embedding watermark bits When =0, ; Step 8: Obtain the ratio of each pixel value in each column to the sum of the values in that column according to formula (3), and then use the modified fusion domain coefficients. Calculate the sum of the new column; if the sum of a column is 0, then... =0.25, i.e., even distribution; the coefficients after embedding the watermark are reconstructed based on the original proportional relationship of the pixel values within the column, for each column. Add new columns and maintain the original proportions. Assigned to each row, i.e., updated according to formula (4) to obtain the watermarked layered image blocks. ; (3) , (4) in, It is the original block number The ratio of each pixel value in a column to the sum of the values in that column; Step 9: Reconstruct the watermarked image patch Post-processing is performed, including compensation and overflow correction: based on the modification information of the fusion domain coefficients, local compensation is performed on the reconstructed blocks, and the modification amount of the fusion domain coefficients is calculated. and actual changes in airspace blocks Compensation is performed according to formula (5) to obtain the compensated block. Check whether the pixel values in the compensated block exceed the valid range [0, 255]. For overflow pixels, move them down as a whole; for underflow pixels, move them up as a whole. If the pixel sorting relationship after moving is consistent with the original block, then this result is adopted. Otherwise, perform conservative scaling according to formula (6), and finally perform final boundary constraints on all pixel values according to formula (7) to ensure that all values are within the range [0, 255], thus obtaining the final watermarked image block. Complete the watermark embedding for this block; (5) (6) (7) in, This is a compensation factor, with a value range of [0.9, 1.0]. Step 10: Repeat steps 4 through 9 of this process until all watermark information is embedded, thus obtaining a watermarked layered carrier image. Finally, the watermarked layered carrier image is... Reassemble and obtain pixel size Watermarked images ,in, These represent the red, green, and blue layers, respectively. The watermark extraction process is described as follows: Step 1: Set the pixel size to Watermarked images Divided into 3 layers of watermarked images and each layer of watermarked image Further divided into pixels The non-overlapping pixel blocks, where These represent the red, green, and blue layers, respectively. Step 2: Layering the watermarked image In, using key-based Random functions from layered carrier images Selected from A pixel block containing watermark information, among which... For color digital watermarked images The number of edge pixels, where, These represent the red, green, and blue layers, respectively. Step 3: In the selected... One image block is selected sequentially from the blocks containing watermark information. ,Will The spatialization is performed using one-dimensional discrete cosine transform according to formula (1), and a 1×4 block is obtained. ; Step 4: Apply the discrete cosine transform to the 1×4 coefficient block after the fusion domain transformation. Using a gradient-based flow direction method, the gradient flow direction is determined according to formula (2), resulting in three sets of flow direction sequences. ; Step 5: Based on the gradient flow sequence Calculate the gradient flow direction between adjacent coefficients, determine the overall flow direction of the coefficient sequence, and count the positive flow direction. )count and reverse flow ( )count Extract the watermark position according to formula (8) ,in, , indicating the gradient flow direction between adjacent coefficients; (8) Step 6: Repeat steps 3 through 5 of this process to extract the binary watermark bit sequence for each layer. Then, each 8-bit binary information is converted into a set of decimal pixel values to obtain the encrypted layered watermark image. ,in, These represent the red, green, and blue layers, respectively. Step 7: Process the encrypted layered watermark image Execute key-based The inverse two-dimensional logic-adjusted sine map decryption algorithm decrypts the watermark data of each channel and obtains the extracted layered watermark. ,in, They represent the red, green, and blue layers respectively; Step 8: Combine the extracted layered watermarks Forming the final watermark extraction ,in, , representing the red, green and blue layers respectively. Attached Figure Description
[0004] Figure 1 It is a picture of size The original color carrier image. Figure 2 It is a picture of size The original color watermark image. Figure 3 It is Figure 2 The watermark image shown is embedded in the carrier image. Figure 1 The resulting watermarked image has a peak signal-to-noise ratio (PSNR) of 36.2336 dB. Figure 4 From Figure 3 The watermark extracted from it has a normalized cross-correlation coefficient (NC) value of 1. Figure 5 (a) Figure 5 (b) Figure 5 (c) Figure 5 (d) Figure 5 (e) Figure 5 (f) Figure 5 (g) Figure 5 (h) Figure 5 (i) is to Figure 3 The watermarks extracted from the watermarked images shown are subjected to JPEG90, JPEG2000 (4:1), salt and pepper noise (1%), cropping (1:128; 1:128), Gaussian low-pass filtering (5×5), scaling (400%), rotation (15°), translation (10, 10), and affine (0.12, 0.12) attacks, respectively. Their normalized cross-correlation coefficients (NC) are 0.9772, 0.9997, 0.9982, 0.9939, 0.9369, 0.9301, 0.9992, 0.9943, and 0.8979, respectively; and their bit error rates (BER) are 0.0299, 0.0016, 0.0019, 0.0177, 0.0685, 0.0735, 0.0029, 0.0143, and 0.1058, respectively. Detailed Implementation
[0005] The purpose of this invention is to provide a color image blind watermark embedding method based on gradient flow direction. Its characteristic is that it is achieved through a specific watermark embedding process and a watermark extraction process, the watermark embedding process of which is described as follows: Step 1: Convert an image with a pixel size of Color host image The host image is divided into three layers in the order of red, green, and blue. ,in, They represent the red, green, and blue layers respectively. For color digital host images The number of edge pixels; Step 2: Convert an image with a pixel size of... Color watermark image Dimensionality reduction and layering preprocessing are performed to obtain three single-channel watermark images for the corresponding red, green, and blue channels. Then, using the key Ka i and Kb i The two-dimensional logic-adjusted sinusoidal mapping scrambling encryption algorithm will scramble each layer of the watermark image. Encryption is performed; furthermore, the watermark image is encrypted at each layer. Each decimal pixel value in the image is represented by 8 bits of binary, resulting in a binary watermark sequence of length 8192. ,in, They represent the red, green, and blue layers respectively; Step 3: Extract each layer of host image Divided into pixels with Non-overlapping blocks are selected using a pseudo-random sequence generation function. A non-overlapping pixel block is used for watermark embedding, and its position is recorded to the key. ,in, These represent the red, green, and blue layers, respectively. Step 4: In the selected One image block is selected sequentially from each of the non-overlapping pixel blocks. ,Will Spatialization of the one-dimensional discrete cosine transform is performed according to formula (1), resulting in a 1×4 block. One block is selected from the selected blocks for illustration. Let the selected host image block be: According to formula (1), a one-dimensional discrete cosine transform is performed to obtain the fusion domain coefficients. : (1) The calculation yields: , , , At this point, the current coefficient sequence is ; Step 5: Suppose we extract one watermark bit from the watermark sequence. =1, for the 1×4 coefficient block after the one-dimensional discrete cosine transform fusion domain transformation. Perform gradient flow direction determination, and determine the gradient flow direction according to formula (2); (2) in, Represents the size of pixel blocks ,at this time, =1, =-1, =1; Step 6: Based on the gradient flow sequence for =1, =-1, =1, define two key statistics, at this time, the positive flow count is Reverse flow count is ; Step 7: Embed watermark bits When =1, ensure Embedded watermark bits When =0, ensure If the above conditions are not met, then modify the coefficient block. for Make it satisfy: when embedding watermark bits When =1, When embedding watermark bits When =0, Because of the embedded watermark bits When =1, it must satisfy The current conditions are not met; therefore, the fusion domain coefficients are modified according to the original strategy. Let the current channel be the red channel, and the threshold be... Adjusted to Modifying the coefficients from back to front to make the flow direction positive, after continuous modification, the coefficients become: At this point, the flow direction is recalculated as follows: =1, =1, =1 indicates that watermark 1 has been successfully embedded; Step 8: Obtain the ratio of each pixel value in each column to the sum of the values in that column using formula (3). , , , The watermarked layered image blocks are updated according to formula (4). , , , , Similarly, the remaining columns are calculated as follows: ; (3) , (4) in, It is the original block number The ratio of each pixel value in a column to the sum of the values in that column; Step 9: Reconstruct the watermarked image patch Post-processing is performed, including compensation and overflow correction: based on the modification information of the fusion domain coefficients, local compensation is performed on the reconstructed blocks, and the modification amount of the fusion domain coefficients is calculated. and actual changes in airspace blocks In this example ; Calculate the actual changes in the spatial domain Its average value Compensation is performed according to formula (5), taking... =0.95, resulting in the compensated block. : After rounding, it becomes: Check for pixel value overflow, and apply final boundary constraints to all pixel values according to formula (7) to ensure that all values are within the range of [0, 255], thus obtaining the final watermarked image block. This completes the watermark embedding for the block. In this example, all values are within the range [0, 255]. Finally, the final watermarked block is obtained: ; (5) (6) (7) Step 10: Repeat steps 4 through 9 of this process until all watermark information is embedded, thus obtaining a watermarked layered carrier image. Finally, the watermarked layered carrier image is... Reassemble and obtain pixel size Watermarked images ,in, These represent the red, green, and blue layers, respectively. The watermark extraction process is described as follows: Step 1: Set the pixel size to Watermarked images Divided into 3 layers of watermarked images and each layer of watermarked image Further divided into pixels The non-overlapping pixel blocks, where These represent the red, green, and blue layers, respectively. Step 2: Layering the watermarked image In, using key-based Random functions from layered carrier images Selected from A pixel block containing watermark information, among which... For color digital watermarked images The number of edge pixels, where, These represent the red, green, and blue layers, respectively. Step 3: In the selected... Select watermarked image blocks sequentially from blocks containing watermark information. ,Will Perform a one-dimensional discrete cosine transform spatialization operation according to formula (1) to obtain a 1×4 block; assuming here The coefficient matrix of the fusion domain obtained after spatialization by the one-dimensional discrete cosine transform is: , , , ; Step 4: Apply the one-dimensional discrete cosine transform to the 1×4 coefficient block after the fusion domain transformation. Using a gradient-based flow direction method, the fused domain coefficient block is... Based on formula (2), the gradient flow direction is determined, and three sets of flow direction sequences are obtained. ; Step 5: Based on the gradient flow sequence Calculate the gradient flow direction between adjacent coefficients, determine the overall flow direction of the coefficient sequence, and count the positive flow direction. = 1) Counting C_forward and reverse flow ( = -1) Count C_backward, from gradient flow... =1, =1, =1, therefore... =3, =0, and then extract the watermark position according to formula (8). =1, where, , indicating the gradient flow direction between adjacent coefficients; (8) Step 6: Repeat steps 3 through 5 of this process to extract the binary watermark bit sequence for each layer. Then, each 8-bit binary information is converted into a set of decimal pixel values to obtain the encrypted layered watermark image. ,in, These represent the red, green, and blue layers, respectively. Step 7: Process the encrypted layered watermark image Execute key-based The inverse two-dimensional logic-adjusted sine map decryption algorithm decrypts the watermark data of each channel and obtains the extracted layered watermark. ,in, They represent the red, green, and blue layers respectively; Step 8: Combine the extracted layered watermarks Forming the final watermark extraction ,in , representing the red, green and blue layers respectively. Validation of the invention
[0006] To demonstrate the effectiveness of this invention, the following were selected: Figure 1 The size shown is The 24-bit color image was used as the carrier image, and... Figure 2 The size shown is A 24-bit color image was used as a digital watermark for verification. Figure 3 It is Figure 2 The watermark image shown is embedded in the carrier image. Figure 1 The resulting watermarked image has a peak signal-to-noise ratio (PSNR) of 36.2336 dB. Figure 4 From Figure 3 The watermark extracted from it has a normalized cross-correlation coefficient (NC) value of 1. Figure 5 (a) Figure 5 (b) Figure 5 (c) Figure 5 (d) Figure 5 (e) Figure 5 (f) Figure 5 (g) Figure 5 (h) Figure 5 (i) is to Figure 3 The watermarks extracted from the watermarked images shown are subjected to JPEG90, JPEG2000 (4:1), salt and pepper noise (1%), cropping (1:128; 1:128), Gaussian low-pass filtering (5×5), scaling (400%), rotation (15°), translation (10, 10), and affine (0.12, 0.12) attacks, respectively. Their normalized cross-correlation coefficients (NC) are 0.9772, 0.9997, 0.9982, 0.9939, 0.9369, 0.9301, 0.9992, 0.9943, and 0.8979, respectively; and their bit error rates (BER) are 0.0299, 0.0016, 0.0019, 0.0177, 0.0685, 0.0735, 0.0029, 0.0143, and 0.1058, respectively. In summary, the embedded color image digital watermark exhibits good invisibility, meeting the invisibility requirement of watermarking algorithms. Furthermore, the color image digital watermarks extracted from various attacked images demonstrate good identifiability and high NC values, indicating strong robustness of the proposed method. Additionally, the introduction of a two-dimensional logically adjusted sine map encryption system expands the key space to 2... 132 This improves the security of watermarking methods.
Claims
1. The purpose of this invention is to provide a method for embedding blind watermarks in color images based on gradient flow direction, characterized in that... This is achieved through specific watermark embedding and watermark extraction processes. The watermark embedding process is described below: Step 1: Convert an image with a pixel size of Color host image The host image is divided into three layers in the order of red, green, and blue. ,in, They represent the red, green, and blue layers respectively. For color digital host images The number of edge pixels; Step 2: Convert an image with a pixel size of... Color watermark image Dimensionality reduction and layering preprocessing are performed to obtain three single-channel watermark images for the corresponding red, green, and blue channels. Then, using the key as The two-dimensional logic-adjusted sinusoidal mapping scrambling encryption algorithm will scramble each layer of the watermark image. Encryption is performed; furthermore, the watermark image is encrypted at each layer. Each decimal pixel value in the image is represented by 8 bits of binary, resulting in a length of... binary watermark sequence ,in, They represent the red, green, and blue layers respectively. For color watermarked images The number of edges; Step 3: Extract each layer of host image Divided into pixels with Non-overlapping blocks are selected using a pseudo-random sequence generation function. A non-overlapping pixel block is used for watermark embedding, and its position is recorded to the key. ,in, For color watermarked images The number of edge pixels, For color host image The number of edge pixels, These represent the red, green, and blue layers, respectively. Step 4: In the selected One image block is selected sequentially from each of the non-overlapping pixel blocks. ,Will The spatialization of the one-dimensional discrete cosine transform is performed according to formula (1), and a 1×4 block is obtained; (1) in, It is a 1×4 block obtained by spatialization using one-dimensional discrete cosine transform. =1, 2, 3, 4 =1, 2, 3, 4; Step 5: Apply the discrete cosine transform to the 1×4 coefficient block after the fusion domain transformation. The watermark embedding method based on gradient flow direction is used for embedding, and the gradient flow direction is determined according to formula (2); (2) in, Represents the size of pixel blocks ; Step 6: Obtain three sets of flow direction sequences Based on this definition, two key statistics are established: the positive flow count is... Reverse flow count is , where δ(⋅) is the indicator function; Step 7: Embed watermark bits When =1, ensure Embedded watermark bits When =0, ensure If the above conditions are not met, then modify the coefficient block. for Make it satisfy: when embedding watermark bits When =1, When embedding watermark bits When =0, ; Step 8: Obtain the ratio of each pixel value in each column to the sum of the values in that column according to formula (3), and then use the modified fusion domain coefficients. Calculate the sum of the new column; if the sum of a column is 0, then... =0.25, i.e., even distribution; the coefficients after embedding the watermark are reconstructed based on the original proportional relationship of the pixel values within the column, for each column. Add new columns and maintain the original proportions. Assigned to each row, i.e., updated according to formula (4) to obtain the watermarked layered image blocks. ; (3) , (4) in, It is the original block number The ratio of each pixel value in a column to the sum of the values in that column; Step 9: Reconstruct the watermarked image patch Post-processing is performed, including compensation and overflow correction: based on the modification information of the fusion domain coefficients, local compensation is performed on the reconstructed blocks, and the modification amount of the fusion domain coefficients is calculated. and actual changes in airspace blocks Compensation is performed according to formula (5) to obtain the compensated block. Check whether the pixel values in the compensated block exceed the valid range [0, 255]. For overflow pixels, move them down as a whole; for underflow pixels, move them up as a whole. If the pixel sorting relationship after moving is consistent with the original block, then this result is adopted. Otherwise, perform conservative scaling according to formula (6), and finally perform final boundary constraints on all pixel values according to formula (7) to ensure that all values are within the range [0, 255], thus obtaining the final watermarked image block. Complete the watermark embedding for this block; (5) (6) (7) in, This is a compensation factor, with a value range of [0.9, 1.0]. Step 10: Repeat steps 4 through 9 of this process until all watermark information is embedded, thus obtaining a watermarked layered carrier image. Finally, the watermarked layered carrier image is... Reassemble and obtain pixel size Watermarked images ,in, These represent the red, green, and blue layers, respectively. The watermark extraction process is described as follows: Step 1: Set the pixel size to Watermarked images Divided into 3 layers of watermarked images and each layer of watermarked image Further divided into pixels The non-overlapping pixel blocks, where These represent the red, green, and blue layers, respectively. Step 2: Layering the watermarked image In, using key-based Random functions from layered carrier images Selected from A pixel block containing watermark information, among which... For color digital watermarked images The number of edge pixels, where, These represent the red, green, and blue layers, respectively. Step 3: In the selected... One image block is selected sequentially from the blocks containing watermark information. ,Will The spatialization is performed using one-dimensional discrete cosine transform according to formula (1), and a 1×4 block is obtained. ; Step 4: Apply the discrete cosine transform to the 1×4 coefficient block after the fusion domain transformation. Using a gradient-based flow direction method, the gradient flow direction is determined according to formula (2), resulting in three sets of flow direction sequences. ; Step 5: Based on the gradient flow sequence Calculate the gradient flow direction between adjacent coefficients, determine the overall flow direction of the coefficient sequence, and count the positive flow direction. )count and reverse flow ( )count Extract the watermark position according to formula (8) ,in, , indicating the gradient flow direction between adjacent coefficients; (8) Step 6: Repeat steps 3 through 5 of this process to extract the binary watermark bit sequence for each layer. Then, each 8-bit binary information is converted into a set of decimal pixel values to obtain the encrypted layered watermark image. ,in, These represent the red, green, and blue layers, respectively. Step 7: Process the encrypted layered watermark image Execute key-based The inverse two-dimensional logic-adjusted sine map decryption algorithm decrypts the watermark data of each channel and obtains the extracted layered watermark. ,in, They represent the red, green, and blue layers respectively; Step 8: Combine the extracted layered watermarks Forming the final watermark extraction ,in, , representing the red, green and blue layers respectively.