Reversible information hiding method based on translation embedding of multiple pairs of histograms
By dividing the image into a black and white checkerboard pattern and calculating the block complexity, an adaptive prediction error method is designed to generate histogram translation embedding information. This solves the problem that the embedding performance of existing technologies is affected by the image texture complexity, and achieves reversible information hiding with high embedding capacity and high visual quality.
Patent Information
- Application Number
- CN202511355265.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-01-16
AI Technical Summary
In existing reversible information hiding methods, the embedding performance is easily affected by the complexity of image texture. How to improve the visual quality of the image with high embedding capacity is an urgent technical problem to be solved.
The image is divided into black and white checkerboard patterns. The block complexity is calculated, and two methods for calculating prediction error are designed. The prediction error is adaptively selected to generate a histogram, and secret information is embedded by shifting the histogram. Information embedding and extraction are performed in layers.
While maintaining high embedding capacity, it significantly improves the visual quality of embedded images, reduces invalid pixel modifications, and enhances the visual effect of images.
Smart Images

Figure CN121353047A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of information hiding and digital watermarking, specifically to a reversible information hiding method based on multiple pairs of histogram translation embedding. Background Technology
[0002] Reversible Data Hiding (RDH) is a type of information hiding technology and a crucial technique for transmitting and hiding information based on plaintext carriers. It can be applied to most multimedia information, commonly including digital images, audio, text, and video. Digital images, due to their significant visual and spatial redundancy, have attracted widespread attention from researchers both domestically and internationally. The development of image-based reversible data hiding technology is of great importance in various fields, including military, medical, judicial, cloud storage, and remote sensing.
[0003] Histogram Shifting (HS) embeds information by generating a grayscale histogram from the carrier image and shifting pixel values between peak and zero points. Leveraging pixel spatial correlation, a sharper histogram is generated by calculating the difference between adjacent pixels, and this histogram shifting technique is used to embed secret information. Combining HS with PEE, an RDH algorithm based on Prediction Error Histogram (PEH) is proposed. This algorithm calculates the prediction error between the original and predicted pixel values using a prediction algorithm, constructs a prediction error histogram using all prediction errors, and finally uses histogram shifting to modify the error values to embed the secret information. Furthermore, image segmentation is used, and the images are sorted according to the number of invalid shifted pixels in each block, with priority given to blocks with fewer invalid shifted pixels for information embedding, further improving embedding efficiency. Alternatively, by dividing the image into 2×2 pixel blocks and constructing a histogram based on the difference between three adjacent pixels, information can be embedded through translation. This method can reduce image distortion to some extent, but it relies heavily on the correlation between pixels and cannot hide more information in images with high texture complexity. A reversible information hiding algorithm based on Neighbor Mean Difference (NMD) calculates the difference between the average of two adjacent values and one of those values, minimizing the difference using NMD. Because NMD reduces the impact of pixel fluctuations, the generated difference histogram is steeper, thereby increasing the embedding capacity of the carrier image.
[0004] One of the fundamental goals of reversible image watermarking algorithm research is to achieve the maximum effective information embedding with minimal distortion. However, in existing reversible information hiding methods, the embedding performance is easily affected by the image texture complexity. Different image texture complexities have a significant impact on the embedding capacity and embedding performance. How to improve the visual quality of the watermarked image while ensuring the embedding capacity is an urgent technical problem to be solved. Summary of the Invention
[0005] Purpose of the invention: To address the problems existing in the prior art, this invention provides a reversible information hiding method based on adaptive embedding of multiple histograms. The image is divided into black and white checkerboard patterns and the block complexity is calculated. By designing two methods for calculating prediction error, the method for calculating prediction error is adaptively selected according to the complexity to generate a histogram. Then, the secret information is embedded by shifting the histogram, thereby increasing the embedding capacity of the carrier image and improving the visual quality of the secret image.
[0006] Technical Solution: This invention provides a reversible information hiding method based on multiple histogram translation embedding, including a watermark embedding method, specifically:
[0007] Step 1: Scan the given 8-bit grayscale image l and divide it into a gray-white checkerboard structure to obtain a gray layer and a white layer;
[0008] Step 2: Mark all pixels in the grayscale image with a value of 0 or 255 as L. LM (i) = 1, otherwise mark as L LM (i)=0, L LM (i) = 1 No operation is performed, all L are... LM The pixels (i) = 0 are compressed into a bitstream L. CLM ;
[0009] Step 3: First, calculate the local complexity F(x) of the gray layer and obtain the local complexity value of each pixel. Sort the pixels in ascending order of complexity value from low to high. Set two thresholds T1 and T2, and satisfy T1 < T2. If F(x) ≤ T1, it is considered a smooth block. If T1 < F(x) ≤ T2, it is considered a sub-smooth block. If T2 < F(x), it is considered a coarse block.
[0010] Step 4: Let the total amount of watermark information data be EC, the first half of the watermark be b1, and the second half of the watermark be b2. Calculate the prediction error for the smoothed blocks in the gray layer to generate a histogram, and then perform histogram shifting to embed the watermark information. Calculate the prediction error for the smoothed blocks to generate a histogram, and then perform histogram shifting to embed the watermark information until b1 is completely embedded in the gray layer, thus obtaining the gray layer dense image l'.
[0011] Step 5: Repeat the previous operation for the pixels of the white layer until the remaining b2 pixels are embedded;
[0012] Step 6: Embed the compressed auxiliary information, i.e., the compressed bitrate string, into the first row of the image using the LSB algorithm to obtain the final encrypted image l.
[0013] Furthermore, it also includes watermark extraction methods, specifically:
[0014] S1: First, scan the carrier image containing watermark information, divide it into a gray-white checkerboard structure, and obtain a gray layer and a white layer;
[0015] S2: The LSB algorithm is used to extract auxiliary information from the first row of the carrier image. First, the local complexity of each pixel is calculated by the local complexity of the white layer and sorted in ascending order. According to the set thresholds T1 and T2, it is divided into smooth blocks, sub-smooth blocks and coarse blocks.
[0016] S3: For the smooth blocks and sub-smooth blocks in the white layer, the pixel prediction error method is used to generate prediction error values, histogram translation is performed to extract watermark information b2, and the original pixel values of the white layer are restored to obtain the watermark image l'.
[0017] S4: Extract the watermark information b1 from the gray layer using the same method as in S3 until all information has been extracted, thus completing the restoration of the original image.
[0018] Furthermore, the local complexity F(x) is calculated as follows:
[0019] For target pixel I i,j The formula for local complexity is:
[0020]
[0021] in: Defined as the difference between adjacent pixels. The sum of the differences and The calculation formula is shown in equation (2):
[0022]
[0023] Among them, I i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 For target pixel I i,j The top, bottom, left, and right four adjacent pixels.
[0024] Furthermore, a histogram is generated for the prediction error of the smooth block, as follows:
[0025] For the target pixel I of the smooth block i,j The prediction method used is shown in equation (3):
[0026]
[0027] Prediction error value e i,j for:
[0028] e i,j =I i,j -p i,j (4)
[0029] Where p(i,j) is the target pixel I i,j The predicted value, I i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 Let ω1, ω2, ω3, and ω4 be the four adjacent pixels above, below, left, and right of the target pixel. ω1, ω2, ω3, and ω4 are the weight values of the four corresponding adjacent pixels. The weight values range from (0,1], and ω1+ω2+ω3+ω4=1.
[0030] Furthermore, the calculation method for the weight values of the four corresponding adjacent pixels is as follows:
[0031] First, calculate the arithmetic mean of the four pixels above, below, to the left, and to the right of the target pixel. And round down;
[0032] Next, calculate the I of the four adjacent pixels of the target pixel respectively. i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 to average The distance;
[0033] Then, the weights are calculated according to equation (5):
[0034]
[0035] Where d1 to d4 are the distances from four adjacent pixels to the average value;
[0036] Finally, normalizing ω1', ω2', ω3', ω4' yields ω1, ω2, ω3, ω4.
[0037] Furthermore, for the sub-smooth block, the prediction error is calculated as follows:
[0038] For target pixel I i,j The absolute value of the difference between each pair of pixels in the surrounding cross-shaped region is called the local homogeneity, and is defined as m. i (i∈[1,6]), as shown in equation (6):
[0039]
[0040] Among them, I i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 For target pixel I i,j The four adjacent pixels, top, bottom, left, and right.
[0041] Define M = min{m1,m2,m3,m4,m5,m6}, and let p(i,j) be the predicted pixel value of the target pixel. i,j The calculation method is shown in equation (7):
[0042]
[0043] Prediction error value e i,j for:
[0044] e i,j =I i,j -p i,j (8)
[0045] After obtaining the predicted pixel value, the prediction error value is calculated according to equation (8).
[0046] Furthermore, the steps for generating histograms using prediction error values and shifting to embed watermark information are the same for both smooth blocks and sub-smooth blocks, specifically:
[0047] Based on the prediction error values of all target pixels in the smooth block and the sub-smooth block, a prediction error histogram (PEH) is generated. The PEH is then scanned from left to right to find two peak points, FZ. B1 FZ B2 This makes FZ B1 <FZ B2 ;
[0048] Then in PEH, from FZ respectively B1 Left side and FZ B2 Find the two pixel values on the right whose first occurrence count is 0, and denote them as LZ. B1 With LZ B2 ;
[0049] Next, the prediction error is modified using equation (9) to embed the watermark information into the target pixel:
[0050]
[0051] Where e is the prediction error value, e' is the modified prediction error value, and b is a randomly generated 1-bit watermark information with b∈{0,1}. Then, the target pixel value of the carrier image is modified according to equation (10) to complete the watermark information embedding:
[0052] I'=p+e' (10)
[0053] Where p represents the predicted pixel value, i.e., p(i,j) or p i,j .
[0054] Furthermore, for the smooth and sub-smooth blocks in the gray and white layers, the method of generating prediction error values using pixel prediction error and extracting watermark information by histogram shifting are the same, specifically:
[0055] First, based on the generated prediction error value, the secret information is extracted and the prediction error value is recovered using equation (11):
[0056]
[0057] Among them, FZ w1 FZ w2 LZ w1 LZ w2 These are the two peak points and two zero points in the prediction error histogram, and they satisfy FZ. w1 <FZ w2 LZ w1 <LZ> w2 Next, the original pixel values of the carrier image are recovered using equation (12), where I is the recovered carrier pixel value and p is the predicted pixel value, i.e., p(i,j) or p i,j , where e is the recovered prediction error value:
[0058] I = p + e (12).
[0059] Beneficial effects:
[0060] 1. This invention proposes a reversible information hiding method based on adaptive embedding of multiple histograms. The image is divided into black and white checkerboard patterns, and the block complexity is calculated. Two methods for calculating prediction errors are designed, and the method for calculating prediction errors is adaptively selected based on the complexity to generate a histogram. The secret information is then embedded using histogram translation. Experimental results show that this method achieves high embedding capacity while also improving the visual quality of the hidden image to a certain extent.
[0061] 2. This invention divides the image into two layers, gray and white, and designs two methods for calculating pixel prediction error. Based on the varying local complexity of pixel blocks, the image layer is divided into smooth blocks, sub-smooth blocks, and coarse blocks. When using the diamond prediction strategy to calculate the prediction error value of target pixels, the same calculation method is usually applied to all target pixels, which can cause significant errors when the block complexity is high, thus affecting data embedding. This invention uses two methods to calculate the prediction error, one applicable to smooth areas and the other to sub-smooth areas, thereby increasing pixel prediction accuracy. Then, the generated prediction error histogram is used to embed watermark information through translation, with a total of four embedding operations in two rounds, improving the embedding capacity.
[0062] 3. This invention uses the neighboring pixels around the target pixel of the image to calculate the complexity, and then sorts them in ascending order. The watermark information is preferentially embedded into low-complexity pixels. This method can reduce the amount of modification of invalid pixels to a certain extent, thereby improving the visual quality of the watermarked image. Attached Figure Description
[0063] Figure 1 This is a flowchart of the watermark embedding process of the present invention;
[0064] Figure 2 This is a flowchart of the watermark extraction process of the present invention;
[0065] Figure 3 This is a test image for the present invention;
[0066] Figure 4 This is the image segmentation model of the present invention;
[0067] Figure 5 This is a schematic diagram of the diamond prediction strategy of the present invention;
[0068] Figure 6 This is a schematic diagram of the smooth region image pixel prediction of the present invention;
[0069] Figure 7 This is a comparison chart of the PSNR value curves of the four methods of the present invention in four test images;
[0070] Figure 8 This is a comparison of the maximum embedding capacity of different algorithms in this invention. Detailed Implementation
[0071] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0072] This invention discloses a reversible information hiding method based on multiple histogram translation embedding, including a watermark embedding method and a watermark extraction method, specifically including the following processes:
[0073] The watermark embedding process is as follows:
[0074] Step 1: Scan the given 8-bit grayscale image l to divide the original image into a gray-white checkerboard structure.
[0075] Step 2: To prevent pixel overflow or underflow during the embedding process, all pixels in the host image with a value of 0 or 255 are marked as L. LM (i) = 1, otherwise mark as L LM (i) = 0. L LM (i) = 1 No operation is performed, all L are... LM (i) Compress into a bitstream L CLM .
[0076] Step 3: First, calculate the local complexity F(x) of the gray layer and obtain the local complexity value of each pixel. Then, sort the pixels in ascending order of complexity value from low to high. Set two thresholds T1 and T2, where T1 < T2. If F(x) ≤ T1, it is considered a smooth block; if T1 < F(x) ≤ T2, it is considered a slightly smooth block; and if T2 < F(x), it is considered a coarse block.
[0077] Step 4: Let the total amount of watermark information data be EC, the first half of the watermark be b1, and the second half be b2. Embed EC / 2 in both the gray and white layers. Calculate the prediction error for the smoothed blocks in the gray layer to generate a histogram, and then perform histogram shifting to embed the watermark information. Repeat the above operation to embed information in the smoothed blocks until b1 is completely embedded in the gray layer, resulting in the gray layer watermark image l'.
[0078] Step 5: Repeat the previous operation for the pixels in the white layer until the remaining b2 is embedded. The compressed auxiliary information is then embedded into the first row of the image using the LSB algorithm, resulting in the final encrypted image l.
[0079] The watermark extraction process is as follows:
[0080] Step 1: In the watermark extraction stage, the carrier image containing watermark information is first scanned, the gray-white checkerboard structure is divided, and gray and white layers are obtained.
[0081] Step 2: Use the LSB algorithm to extract auxiliary information from the first row of the image. First, extract the white layer watermark information b2, then extract the gray layer watermark information b1. First, calculate the local complexity of each pixel using the local complexity calculation function for the white layer, and sort them in ascending order. Based on the set thresholds T1 and T2, divide them into smooth blocks, sub-smooth blocks, and coarse blocks.
[0082] Step 3: For the smooth blocks and sub-smooth blocks in the white layer, the pixel prediction error method is used to generate prediction error values. Histogram translation is performed to extract watermark information b2, and the original pixel values of the white layer are restored to obtain the watermark image l'.
[0083] Step 4: Extract the watermark information b1 from the gray layer in the same order as in Step 3. Continue until all information has been extracted, at which point the original image restoration is complete.
[0084] To achieve the reversibility of the embedding algorithm, this invention selects a pixel diamond prediction strategy when generating a histogram of prediction errors. For example... Figure 4 As shown, the original image is first divided into gray and white layers according to a checkerboard pattern. During the information embedding process, one layer is used for embedding information, and the other layer is used for pixel prediction. This layered prediction strategy not only ensures the accurate extraction of secret information but also makes full use of the neighboring pixel information of the pixel to be predicted to improve prediction accuracy. During embedding, the gray and white layers each embed half of the total length watermark information (EC / 2). Since the gray and white layers use the same method in pixel prediction and information embedding extraction, the following section uses the gray layer as an example to introduce the specific prediction method in detail.
[0085] Pixel prediction error mechanism:
[0086] When calculating the prediction error value of target pixels using the diamond prediction strategy, the same calculation method is usually applied to all target pixels. This can cause significant errors when the block complexity is high, thus affecting data embedding. This invention uses two methods to calculate the prediction error, one applicable to smooth blocks and the other to sub-smooth blocks, thereby increasing pixel prediction accuracy. A diagram of the diamond prediction strategy is shown below. Figure 5 As shown.
[0087] 1) Smooth block pixel prediction error method
[0088] For the target pixel I in the smooth region i,j The prediction method used here is shown in equation (1):
[0089]
[0090] Where p(i,j) is the target pixel I i,j The predicted value, I i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 Let ω1, ω2, ω3, and ω4 be the four adjacent pixels above, below, left, and right of the target pixel. ω1, ω2, ω3, and ω4 are the weight values of the four corresponding adjacent pixels. The weight values range from (0, 1], and ω1 + ω2 + ω3 + ω4 = 1.
[0091] The weight values are calculated as follows:
[0092] First, calculate the arithmetic mean of the four pixels above, below, left, and right of the target pixel, and round down, as shown in equation (2):
[0093]
[0094] Next, calculate the I values of the four adjacent pixels of the target pixel respectively. i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 arrive The distance is shown in equation (3):
[0095]
[0096] Then, the weights are calculated according to equation (4):
[0097]
[0098] Finally, after normalizing ω1', ω2', ω3', ω4' according to equation (5), we get ω1, ω2, ω3, ω4.
[0099]
[0100] Prediction error value e i,j From equation (6), to facilitate understanding of the calculation process of the prediction error value, Figure 6 Showing target pixel I i,j The predicted value p(i,j) and the prediction error value e i,j The calculation process.
[0101] e i,j =I i,j -p i,j (6)2) Method for calculating prediction error using smooth blocks
[0102] For sub-smooth blocks, the correlation around a pixel is not as strong as in smooth regions. To improve the accuracy of pixel prediction error, a new method for calculating prediction error is proposed. For target pixel I... i,j The absolute value of the difference between each pair of pixels in the surrounding cross-shaped region is called the local homogeneity, and is defined as m. i (i∈[1,6]), as shown in equation (7):
[0103]
[0104] To reduce errors caused by pixels with large fluctuations, only pixel values with high homogeneity are selected for target pixel prediction. M is defined as min{m1,m2,m3,m4,m5,m6}, and the predicted pixel value of the target pixel is p(i,j), calculated as shown in equation (8):
[0105]
[0106] After obtaining the predicted pixel value, the prediction error value is calculated according to equation (6). In the above method for calculating the prediction error in the sub-smooth region, local homogeneity is used as the standard for judging the prediction error formula, which can improve the accuracy of the prediction error value to a certain extent and is more conducive to the embedding of pixel values.
[0107] 3) Histogram translation mechanism
[0108] 3.1) Histogram embedding operation
[0109] The steps for generating histograms from prediction error values and shifting embedded information are the same for smooth blocks and sub-smooth blocks. Here, we take the smooth region as an example. After obtaining the prediction error values for all target pixels of the smooth block, a prediction error histogram (PEH) is generated. The PEH is scanned from left to right to find two peak points (FZ). B1 FZ B2 This makes FZ B1 <FZ B2 Then in PEH, from FZ respectively B1 Left side and FZ B2 Find the two pixel values on the right whose first occurrence count is 0, and denote them as LZ. B1 With LZ B2 Then, the prediction error is modified using equation (9) to embed the watermark information into the target pixel.
[0110]
[0111] Where: e is the prediction error value, e' is the modified prediction error value, and b is a randomly generated 1-bit watermark information and b∈{0,1}. Then, the target pixel value of the carrier image is modified according to equation (10) to complete the watermark information embedding.
[0112] I'=p+e' (10)3.2) Histogram extraction operation
[0113] Based on the priority of the image layers, image restoration and extraction are performed in the reverse order of embedding. For the smooth and sub-smooth regions of the gray and white layers of the image, the histogram extraction mechanism is the same. Here, we take the smooth region as an example. First, after generating the prediction error value according to Section 1.2, we use Equation (11) to extract the secret information and restore the prediction error value:
[0114]
[0115] Among them, FZ w1 FZ w2 LZ w1 LZ w2 These are the two peak points and two zero points in the prediction error histogram, and they satisfy FZ. w1 <FZ w2 LZ w1 <LZ> w2 Then, the original pixel values of the carrier image are recovered using Equation (12), where I is the recovered carrier pixel value, p is the predicted pixel value, and e is the recovered prediction error value.
[0116] I = p + e (12)
[0117] The above method can be used to extract watermark information for other layers of the image. After the information in the gray and white layers has been completely extracted, the image can be restored without loss.
[0118] 4) Complexity calculation
[0119] In the process of embedding secret information based on the prediction error histogram, increasing the amount of invalid pixel modifications not only fails to improve the embedding capacity of the image, but also leads to a decrease in the visual quality of the encrypted image. Therefore, by using the neighboring pixels around the target pixel to calculate the complexity, and then sorting them in ascending order, the watermark information is preferentially embedded into pixels with low complexity. This method can reduce the amount of invalid pixel modifications to a certain extent, thereby improving the visual quality of the encrypted image. Based on this, the present invention uses the following method to calculate the local complexity of the target pixel. For the target pixel I, its pixel distribution map is shown in Section 1.2. Figure 3 As shown, the local complexity formula is given by equation (13):
[0120]
[0121] in: Defined as the difference between adjacent pixels. The sum of the differences and The calculation formula is shown in equation (14):
[0122]
[0123] This reversible image watermarking method can completely recover the original carrier image after extracting the watermark, thus achieving algorithm reversibility. The specific experimental process is as follows:
[0124] 1. PSNR Comparison
[0125] Peak signal-to-noise ratio (PSNR) is a widely used objective evaluation metric in digital image processing. It is mainly used to test the degree of difference between the watermarked image and the original image, and can objectively reflect the quality of the experimental results. The higher the PSNR value, the higher the visual quality of the watermarked image compared to the original image. Figure 7 This paper compares the PSNR values of four test images using Algorithm 1 (YJJia, ZXYin, XPZhang, et al. Reversible data hiding based on reducing invalid shifting of pixels in histogram shifting[J]. SignalProcessing, 2019, 163: 238-246), Algorithm 2 (L.Chu, H.Wu, Y.Zeng, et al. Improved weighted average-based rhombus predictor in reversible data hiding using prediction error expansion[C], 2021 IEEE 6th International Conference on Computer and Communication Systems (ICCCS). IEEE, 2021: 6-11), Algorithm 3 (HZWu. Efficient Reversible Data Hiding Simultaneously Exploiting AdjacentPixels[J]. IEEE Access, 2020, 8: 119501-119510) and the method presented herein under different embedding levels.
[0126] Figure 7This chart shows a comparison of image quality obtained by different algorithms under different embedding capacities in four test images. The horizontal axis represents the embedding capacity, and the vertical axis represents the PSNR value of the encrypted image. As can be seen from the chart, under different embedding capacities, the PSNR value of the present invention is higher than that of the other comparison algorithms in all four test images, indicating that the encrypted image quality generated by the present invention is superior to the comparison algorithms. Taking Baboon images with high texture complexity and Plane images with low texture complexity as examples, when the embedding capacity of the Baboon image is 5000 bits, the PSNR value of the present invention is 60.61 dB, while the PSNR values of the other three algorithms are 59.42, 58.95, and 58.30 dB, respectively. When the embedding capacity of the Baboon image is 10000 bits, the PSNR value of the present invention's algorithm is 56.71 dB, while the PSNR values of the other three algorithms are 55.52, 55.08, and 54.28 dB, respectively. When the plane image embedding size is 10,000 bits, the PSNR value of the algorithm of this invention is 64.01 dB, while the PSNR values of the other three algorithms are 63.13, 62.10, and 62.71 dB, respectively. When the plane image embedding size is 20,000 bits, the PSNR value of the algorithm of this invention is 60.32 dB, while the PSNR values of the other three algorithms are 59.56, 58.99, and 58.46 dB, respectively. To further illustrate the quality of the encrypted image after embedding watermark information, Tables 1 and 2 show the PSNR values of the algorithm of this invention and the other three algorithms when embedding 10,000 bits and 20,000 bits in different test images.
[0127] Table 1. PSNR values of the algorithm when embedding 10000 bits.
[0128]
[0129] Table 2 shows the PSNR values of the algorithm when embedding 20,000 bits.
[0130]
[0131] As shown in Table 1, when the embedded amount of the watermarked image is 10,000 bits, the average PSNR of the watermarked image obtained by the algorithm of this invention is 59.31, which is 1.78%, 2.74%, and 2.51% higher than the other three algorithms, respectively. When the embedded amount of the watermarked image is 20,000 bits, it is 1.47%, 2.40%, and 4.18% higher than the other three algorithms, respectively. Therefore, the algorithm of this invention provides better visual quality for the watermarked image after embedding the watermark compared to Algorithm 1, Algorithm 2, and Algorithm 3.
[0132] 2. Embedded Capacity Comparison
[0133] The reversible information hiding method based on multiple histogram translation proposed in this invention utilizes different methods to calculate prediction errors, enabling the invention to maintain a large embedding capacity while ensuring a certain visual quality. Figure 8 The algorithm of this invention is compared with the highest embedding capacity of Algorithm 1, Algorithm 2, and Algorithm 3.
[0134] from Figure 8 It can be seen that the algorithm of this invention has a higher embedding capacity, with the maximum embedding capacity being greater than that of the other four algorithms. Algorithm 1 designs a new fluctuation value calculation method, prioritizing the embedding of watermark information into regions with smaller fluctuation values, thereby reducing the number of invalid change pixels. The algorithm of this invention has a similar embedding capacity to Algorithm 1, but still has certain advantages. Taking the Baboon image with relatively complex texture and the Plane image with relatively smooth texture as examples, for the Baboon image, the maximum embedding capacity of the other three algorithms are 25060 bits, 24696 bits, and 23712 bits, respectively, while the maximum embedding capacity of the algorithm of this invention is 26897 bits. Compared with these three algorithms, the algorithm of this invention improves by 7.33%, 8.91%, and 13.43%, respectively. For the Plane image, the other three algorithms are 96688 bits, 94304 bits, and 92764 bits, respectively, while the maximum embedding capacity of the algorithm of this invention is 98655 bits, which are improvements of 2.03%, 4.61%, and 6.35%, respectively.
[0135] The simulation results show that the reversible information hiding method proposed in this invention outperforms the other three algorithms in both visual quality and embedding capacity of the encrypted image. Algorithm 1 uses the four neighboring pixels surrounding the target pixel to calculate its local complexity and fluctuation value; Algorithm 2 uses the sum of the differences between the four neighboring pixels to calculate the local complexity of the target pixel; and Algorithm 3 designs a new prediction strategy to further utilize smooth pixels for information embedding. While these methods are effective and improve prediction accuracy to some extent, they do not fully consider the spatial correlation between all neighboring pixels and do not significantly reduce the amount of invalid pixel translation, resulting in no substantial reduction in the distortion of the encrypted image. The new prediction error calculation method proposed in this invention partitions the image using a threshold and employs different prediction error calculation methods for different regions. This fully utilizes the strong correlation between pixels surrounding the target pixel, thereby improving the visual quality of the encrypted image. Furthermore, the two-layer, four-round watermark embedding method also contributes to improving the embedding capacity of the encrypted image.
[0136] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent transformations or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A reversible information hiding method based on multi-pair histogram translation embedding, characterized in that, The application relates to a watermark embedding method and a watermark extraction method. Step 1: scanning a given 8-bit gray image l and dividing the image into a gray-white chessboard structure to obtain a gray layer and a white layer; Step 2: Mark all the points in the gray scale image whose pixel value is either 0 or 255 as L LM (i) = 1, otherwise mark as L LM (i) = 0, L LM (i) = 1 do nothing, compress all L LM (i) = 0 into a bit stream string L CLM ; Step 3: firstly calculating the local complexity F(x) of the gray layer and obtaining the local complexity value of each pixel, performing ascending order sorting according to the complexity value from low to high, setting two threshold values T1 and T2, and satisfying T1 < T2, if F(x) <= T1, regarding the pixel as a smooth block, if T1 < F(x) <= T2, regarding the pixel as a sub-smooth block, and if T2 < F(x), regarding the pixel as a rough block; Step 4: setting the total amount of watermark information data as EC, the first-half watermark as b1 and the second-half watermark as b2, calculating the prediction error histogram of the smooth block of the gray layer, performing histogram translation to embed the watermark information, calculating the prediction error histogram of the sub-smooth block, performing histogram translation to embed the watermark information, and embedding b1 in the gray layer to obtain a gray layer image l'; Step 5: repeating the previous operation on the pixels of the white layer until b2 is embedded; Step 6: embedding the compressed auxiliary information, i.e. the compressed bit rate string, into the first row of the image by using the LSB algorithm to obtain a final carrier image l".
2. The reversible data hiding method based on multi-pair histogram translation embedding according to claim 1, characterized in that, The application further relates to a watermark extraction method. S1: firstly scanning the carrier image containing watermark information, dividing the image into a gray-white chessboard structure to obtain a gray layer and a white layer; S2: extracting the auxiliary information in the first row of the carrier image by using the LSB algorithm, firstly calculating the local complexity of the white layer to obtain the local complexity of each pixel, performing ascending order sorting, and dividing the pixels into smooth blocks, sub-smooth blocks and rough blocks according to the set threshold values T1 and T2; S3: for the smooth blocks and the sub-smooth blocks in the white layer, generating prediction error values by using the pixel prediction error method, performing histogram translation to extract the watermark information b2, and restoring the original pixel values of the white layer to obtain a carrier image l'; S4: extracting the watermark information b1 of the gray layer by using the same method as that in S3 until all the information is extracted, thereby completing the restoration of the original image.
3. The reversible data hiding method based on multi-pair histogram translation embedding according to claim 1 or 2, characterized in that, The local complexity F(x) is calculated as follows: For the target pixel I i,j The local complexity formula is: wherein: is defined as the adjacent pixel difference value, is the difference sum, and the calculation formula is shown in equation (2): wherein I i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 is the target pixel I i,j the four adjacent pixels above, below, left and right.
4. The reversible data hiding method based on multi-pair histogram translation embedding according to claim 1 or 2, characterized in that, The prediction error histogram of the smooth block is calculated as follows: For the target pixel I of the smooth block i,j The prediction method adopted is shown in equation (3): Prediction error value e i,j is: e i,j = I i,j -p i,j (4) wherein p(i,j) is a prediction value of the target pixel I i,j , i-1,j , i+1,j , i,j-1 , i,j+1 are four adjacent pixels of the target pixel, and ω1, ω2, ω3, ω4 are weight values of the four corresponding adjacent pixels, the weight values being in a range of (0, 1], and ω1+ω2+ω3+ω4=1.
5. The reversible data hiding method based on multi-pair histogram translation embedding according to claim 4, characterized in that, The weight values of the four corresponding adjacent pixels are calculated as follows: First, the arithmetic mean value of the target pixel and the four pixels above, below, left and right of the target pixel is calculated and rounded down; Next, the distance of the target pixel to the average value of the four neighboring pixels I i-1,j , i+1,j , i,j-1 , i,j+1 is calculated. ; Then, the weight is calculated according to formula (5): Wherein, d1-d4 are the distances of the four adjacent pixels to the average value. Finally, the omega1', omega2', omega3', omega4' are normalized to obtain omega1, omega2, omega3, omega4.
6. The reversible data hiding method based on multi-pair histogram translation embedding according to claim 1 or 2, characterized in that, For the sub-smooth block, the prediction error method is as follows: For the target pixel I i,j The absolute value of the difference between the surrounding cross-domain pixels is called local homogeneity, defined as m i (i∈[1,6]) as shown in equation (6): wherein I i-1,j ,I i+1,j ,I i,j-1 ,I i,j+1 is the target pixel I i,j the four adjacent pixels above, below, left and right of I Define M = min{m1, m2, m3, m4, m5, m6}, the predicted pixel value of the target pixel is p(i, j), represented by p i,j The calculation method is shown in equation (7): Prediction error value e i,j is: e i,j = I i,j -p i,j (8) After the prediction pixel value is obtained, the prediction error value is calculated according to formula (8).
7. The reversible data hiding method based on multi-pair histogram translation embedding of claim 1, wherein, The steps of generating the histogram by using the prediction error value and performing histogram translation to embed the watermark information of the smooth block and the sub-smooth block are the same, and are specifically as follows: According to the prediction error values of all target pixels of the smooth block and the sub-smooth block, a prediction error histogram PEH is generated, and two peak points FZ are found by scanning the PEH from left to right B1 ,FZ B2 , such that FZ B1 <FZ B2 ; Then in PEH, find two first pixel values with occurrence 0, respectively denoted as LZ B1 Left side with FZ B2 Right side find two first pixel values with occurrence 0, respectively denoted as LZ B1 And LZ B2 ; Then, the watermark information is embedded into the target pixel by modifying the prediction error value according to formula (9): Wherein, e is the prediction error value, e' is the modified prediction error value, b is a randomly generated 1-bit watermark information and b belongs to {0, 1}, then the target pixel value of the carrier image is modified according to formula (10) to complete the embedding of the watermark information: I' = p + e' (10) where p represents the predicted pixel value, i.e. p(i,j) or p(i+1,j) or p(i,j+1) or p(i+1,j+1) i,j .
8. The reversible data hiding method based on multi-pair histogram translation embedding according to claim 2, characterized in that, For the smooth blocks and the sub-smooth blocks of the gray and white layers, the pixel prediction error method is used to generate the prediction error value, and the histogram translation is used to extract the watermark information, which is the same, and the specific is: First, according to the generation of the prediction error value, the secret information is extracted by using formula (11), and the prediction error value is recovered: where FZ w1 ,FZ w2 ,LZ w1 ,LZ w2 are two peak points and two zero points in the prediction error histogram, and FZ w1 <FZ w2 ,LZ w1 <LZ w2 ; then the original pixel value of the carrier image is recovered using equation (12), where I is the recovered carrier pixel value, p is the predicted pixel value, i.e. p(i,j) or p i,j , and e is the recovered prediction error value: I=p+e (12).