Reversible information hiding method based on asymmetric histogram four-wheel embedding

By dividing the image into four sets and using the pixel correlation in the cross field and the positive and negative diagonal fields to generate two pairs of asymmetric histograms, the problems of limited visual quality and embedding capacity in the existing technology are solved, and the efficient embedding and lossless recovery of the secret image are achieved.

CN120634827APending Publication Date: 2025-09-12HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510738276.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing asymmetric prediction error histogram methods fail to fully exploit the correlation of pixels, which limits the further improvement of the visual quality of encrypted images and has limited embedding capacity.

Method used

A four-round embedding method based on asymmetric histograms is adopted to divide the image into four uncorrelated sets. Two pairs of asymmetric histograms are generated by using the pixel correlation in the cross field and the positive and negative diagonal fields. Through complexity prediction screening and two rounds of prediction error calculation, the probability of pixel compensation restoration is increased and invalid pixel translation is reduced.

Benefits of technology

The embedding capacity and visual quality of the encrypted image are improved, the PSNR value is increased by 1.53 to 4.37dB, and the pixel correlation is fully utilized to generate a sharp concentrated histogram, achieving efficient information hiding and recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120634827A_ABST
    Figure CN120634827A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information hiding and digital watermarking, and discloses a reversible information hiding method based on asymmetric histogram four-wheel embedding, which comprises the following steps of: after scanning an image, dividing the image into four sets, dividing pixel points in odd rows at intervals of A and B sets, dividing pixel points in even rows at intervals of C and D sets, and embedding 1 / 4 watermark information into each set; during embedding, smooth block embedding is selected according to calculated local complexity, surrounding pixels of a target pixel are divided into a cross field part and a positive and negative diagonal field part, error prediction is carried out to generate two pairs of asymmetric histograms, and watermark information is embedded through two rounds of translation until all embedding is completed; the watermark extraction is an inverse process of watermark embedding. Compared with the prior art, the method has the advantages that one target pixel generates two pairs of asymmetric histograms, the probability that the pixels are subjected to compensation reduction reaction is increased, complexity prediction screening is carried out before data embedding, translation of invalid pixels is further reduced, and the quality of a secret-carrying image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information hiding and digital watermarking, and in particular to a method based on asymmetric histogram. Figure 4 Reversible information hiding method based on round embedding. Background Art

[0002] Reversible Data Hiding (RDH) is a type of information hiding technology and an important research area in multimedia security. Using RDH, a sender can embed information into a multimedia file, allowing the receiver to extract the information while also losslessly restoring the original carrier file. With the advancement of information technology, RDH has gained widespread attention in areas such as medical image archiving, military document transmission, and judicial evidence preservation.

[0003] In order to improve the performance of image watermark embedding, He Yufen, Yin Zhaoxia, Tang Jin, et al. Reversible information hiding algorithm based on asymmetric histogram shift [J]. Journal of Network and Information Security, 2019, 5(05): 80-89. Public technology: The original 3 pixels adjacent to the upper left of the target pixel are changed to 4 pixels. When calculating the target pixel prediction error value to generate the histogram, a more sharp and concentrated histogram can be obtained, and more pixels will have a compensation restoration effect during the embedding process. In 2022, He Yufen, Tang Jin, Yin Zhaoxia. Reversible information hiding based on multiple pairs of asymmetric histogram modification [J]. Journal of Applied Sciences, 2022, 40(2): 253-265. Public technology: Combining AHS with the calculation of image complexity, a reversible information hiding technology based on multiple pairs of asymmetric histogram modification is proposed. This method combines the pixel multi-prediction mechanism with the pixel complexity calculation to generate multiple pairs of asymmetric histograms in different complexity ranges, and selects the low complexity range for histogram shift embedding. This method can not only reduce the amount of pixels involved in the modification of the original image, but also produce a pixel compensation and restoration effect, further improving the quality of the encrypted image.

[0004] The traditional asymmetric prediction error histogram algorithm uses the adjacent pixels in the upper left corner to calculate the maximum and minimum prediction errors, generating two histograms with zero values ​​shifted to the left and zero values ​​shifted to the right. By shifting the histogram with zero values ​​shifted to the left and the histogram with zero values ​​shifted to the right, in the two-stage watermark embedding process, some of the pixels are restored to their original pixels after the first change, which is called the pixel compensation restoration effect. Compared with the traditional reversible information embedding algorithm, the asymmetric prediction error histogram method can effectively reduce the distortion of the encrypted image. However, the pixel prediction of this method is obtained by directly calculating the prediction error using the adjacent pixels in the upper left corner, which fails to fully utilize the correlation between adjacent pixels, thereby limiting the further improvement of the visual quality of the encrypted image and also having a negative impact on the embedding capacity to a certain extent. Summary of the Invention

[0005] Purpose of the invention: To solve the problems existing in the prior art, the present invention provides a Figure 4 A reversible information hiding method based on round embedding generates two pairs of asymmetric histograms for one target pixel, which increases the probability of compensation and restoration reaction of the pixel. In addition, complexity prediction screening is performed before data embedding, which further reduces the translation of invalid pixels and improves the quality of the encrypted image.

[0006] Technical solution: The present invention provides a method based on asymmetric histogram Figure 4 A reversible information hiding method based on round embedding, including a watermark embedding method, comprises the following steps:

[0007] Step 1: Scan the given grayscale image I and divide the remaining pixel blocks into four sets: A, B, C, and D, except for the first row. When dividing the sets, the pixels in odd rows are divided into sets A and B, and the pixels in even rows are divided into sets C and D.

[0008] Step 2: Assume that the total amount of watermark information data is EC, and use even distribution embedding for the four sets, embedding EC / 4 watermark information in each set;

[0009] Step 3: First, mark all points in set A where the pixels are 0 or 255 as L. LM (i)=1, otherwise marked as L LM (i)=0, all L LM (i) Compressed into a bit stream L CLM As a location map of set A;

[0010] Step 4: For L in set A LM For the target pixel (i) = 0, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels, and the 3×3 image block formed by the target pixel and the surrounding pixels is divided into a coarse block and a smooth block according to the threshold T;

[0011] Step 5: The 8-area pixels around the target pixel of the smooth block in set A are divided into two parts: the cross area part and the positive and negative diagonal area part. In the first round, the prediction error is calculated by the adjacent pixels in the cross area to generate a pair of asymmetric histograms, which are then translated to embed the watermark information.

[0012] Step 6: Scan the smooth block after the first round of watermark embedding in step 5. If there are pixels with grayscale values ​​of 0 or 255, do not perform the second round of watermark embedding on them, and record their position information in the auxiliary information.

[0013] Step 7: In the second round, for the smooth blocks whose pixel grayscale values ​​are not 0 and 255 after scanning in step 6, a pair of asymmetric histograms are generated by calculating the prediction error of adjacent pixels in the positive and negative diagonal areas, and the watermark information is embedded in the asymmetric histograms by translation until EC / 4 is embedded in the A set;

[0014] Step 8: After the information of set A is embedded, update the image and embed the remaining watermark information of sets B, C, and D in sequence according to the method of steps 3 to 6;

[0015] Step 9: Threshold T, bit stream L CLM The position information in step 6 is embedded as auxiliary information into the least significant bit (LSB) of the first row of pixels in the image to obtain the final encrypted image I'.

[0016] Furthermore, a watermark extraction method is also included, comprising the following steps:

[0017] S1: First, read the LSB of the first row of pixels in the encrypted image I', extract the compressed auxiliary information, and divide all blocks except the first row into four sets. When dividing the sets, the pixels in odd rows are divided into sets A and B, and the pixels in even rows are divided into sets C and D.

[0018] S2: Scan all locations in the D set except the initial L according to the location map in the auxiliary information LM For blocks with (i)=0, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels. The 3×3 image block formed by the target pixel and the surrounding pixels is divided into a coarse block and a smooth block according to the threshold T in the auxiliary information.

[0019] S3: For the smoothing blocks in the D set, first calculate the maximum and minimum prediction errors in the positive and negative diagonal areas of the target pixel, first translate the maximum prediction error histogram to extract data, and then translate the minimum prediction error histogram to extract data;

[0020] S4: adding the pixel points with the pixel grayscale value of 0 or 255 in the first round of embedding recorded in the auxiliary information during embedding, performing the second round of cross-field maximum and minimum prediction error calculation and extracting information;

[0021] S5: When the information of set D is extracted, update the encrypted image and extract the watermark information in sets C, B, and A in the same way until all the information is extracted;

[0022] S5: After all information is extracted, the entire image is restored.

[0023] Furthermore, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels, specifically:

[0024] Set the target pixel p i,j , which forms a 3×3 image block with the surrounding 8 pixels. The pixels around the target pixel are defined as the pixel set F. For the local complexity of the image block N NL It is defined as shown in formula (13):

[0025] F={p i-1,j+m ,p i+3,j+m ,p i+n,j-1 ,p i+n,j+3 |m=-1,0,1,2,3; n=0,1,2} (12)

[0026]

[0027] in: is the average value of pixels in the pixel set F.

[0028] Furthermore, the prediction errors of adjacent pixels in the cross area are calculated to generate a pair of asymmetric histograms, specifically:

[0029] 1) When calculating the prediction error in the cross area of ​​the target pixel, the four pixels in the cross area are numbered clockwise as v1, v2, v3 and v4, and these four pixels are divided into four groups of three. The prediction value of the target pixel is p' i,j , using the diamond prediction strategy to predict:

[0030] p' i,j =ω1·r1+ω2·r2+ω3·r3+ω4·r4 (1)

[0031] Among them, ω1, ω2, ω3, and ω4 are the weight values ​​between each group of cross-domain blocks, and ω1, ω2, ω3, and ω4 satisfy ω1+ω2+ω3+ω4=1. The prediction error is calculated using the weight value distribution;

[0032] 2) Sort the grayscale values ​​of the four groups in ascending order vm σ(1) <v m σ(2) <v m σ(3) , 1≤m≤4, then calculate r1,r2,r3,r4,v m σ(1) ,v m σ(2) ,v m σ(3) Indicates the grayscale values ​​of the first, second, and third pixels in each group after sorting in ascending order from small to large. σ(1), σ(2), and σ(3) represent the subscripts of the pixel grayscale values ​​and have no actual meaning. 1≤m≤4 represents the first to fourth groups:

[0033]

[0034] 3) Use the maximum grayscale value of each pixel in each group minus the minimum grayscale value to obtain the four inter-group distances to determine the texture degree:

[0035]

[0036] 4) After obtaining the inter-group distance, use formula (4) to calculate the sum of the inter-group distance differences e sum , use formula (5) to calculate the weights of each group ω'1, ω'2, ω'3, ω'4, and then normalize them to get ω1, ω2, ω3, ω4, which is required to satisfy ω1+ω2+ω3+ω4=1, as shown below:

[0037]

[0038] 5) After obtaining ω1, ω2, ω3, ω4 and r1, r2, r3, r4, use formula (1) to calculate the predicted value p' of the target pixel i,j , let v max =max{v1,v2,v3,v4}, v min =min{v1,v2,v3,v4}, and use formula (6) to calculate the minimum prediction error value e of the predicted value and the cross area pixel respectively min and the maximum prediction error value e max , as shown below:

[0039]

[0040] Furthermore, the prediction errors of adjacent pixels in the positive and negative diagonal areas are calculated to generate a pair of asymmetric histograms. The four pixels on the positive and negative diagonal areas are numbered clockwise as v5, v6, v7 and v8, and these four pixels are divided into four groups of three. The other operations are the same as the prediction errors of adjacent pixels in the cross area to generate a pair of asymmetric histograms. Figure 1 To.

[0041] Furthermore, the asymmetric histogram is shifted to embed watermark information, as follows:

[0042] Data is embedded in the order of A→B→C→D. After the prediction error is calculated for each target pixel in the set using the cross field pixel, the minimum prediction error value e of the target pixel is obtained. min and the maximum prediction error value e max , let the pixel gray value be x, when embedding for the first time, scan the minimum prediction error value e of the set min , generates a prediction error histogram with a value of 0 to the right, and the embedding formula is shown in formula (7):

[0043]

[0044] Among them, x' is the pixel value after embedding data, b is the randomly generated watermark information and b∈{0,1}, Z ω With P ω are the zero value point and peak point of the histogram respectively; after the first embedding of watermark information, the second embedding operation is performed to scan the maximum prediction error value e max , generate a prediction error histogram with a value to the left of 0, and use formula (8) to perform the embedding operation:

[0045]

[0046] Among them, P ω With Z ω The peak point and zero point of the prediction error histogram to the left of 0;

[0047] When performing pixel translation operations in the positive and negative diagonal areas, the above steps are the same until all data are embedded.

[0048] Furthermore, during extraction, the order of embedding is reversed, and the pixel movement extraction in the positive and negative diagonal areas is performed first, and then the pixel movement extraction in the cross area is performed;

[0049] Data extraction is performed in the order of D→C→B→A sets. The maximum and minimum prediction errors of the positive and negative diagonal areas of the target pixels in each set are obtained. First, the maximum prediction error histogram is shifted to extract data, and then the minimum prediction error histogram is shifted to extract data. The watermark information b is extracted according to formula (9). The pixels are restored according to formulas (10) and (11) for the maximum prediction error histogram to the left of 0 and the minimum prediction error histogram to the right of 0:

[0050]

[0051] The maximum and minimum prediction errors in the cross area are calculated and information is extracted. The same operation is performed until the original target pixel grayscale value x is completely restored.

[0052] Beneficial effects:

[0053] 1. In order to make full use of the correlation between pixels in the image and increase the accuracy of the prediction error, the generated histogram is made sharper and more concentrated. This increases the embedding capacity, so that the encrypted image has good embedding capacity and visual quality. Figure 4 This reversible watermarking method, based on round embedding, first divides the image into four unrelated sets. During prediction, the sets do not affect each other, allowing lossless restoration of the original image. Complexity calculations are performed on the sets, thresholds are set, and operations are performed on low-complexity pixel sets within the sets. Cross-field pixel prediction is then used to generate two asymmetric histograms for the target pixel in the set. Furthermore, two more asymmetric histograms are generated using predictions for positive and negative diagonal pixels. Two pairs of asymmetric histograms can be generated for each target pixel, increasing the probability of pixel compensation and restoration. Furthermore, complexity prediction screening is performed before data embedding, further reducing the translation of invalid pixels and improving the quality of the encrypted image.

[0054] 2. This invention uses eight reference pixels in the cross region of the target pixel and in the positive and negative diagonal regions to calculate the prediction error using a diamond prediction method, generating two pairs of asymmetric histograms. This is then embedded using a histogram shift technique. Experimental results show that compared to the classic asymmetric histogram shift algorithm, PSNR values ​​improve by 1.53 to 4.37 dB. This not only leverages the pixel compensation restoration effect, but also further improves the visual quality of the encrypted image. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is a flow chart of watermark embedding in the present invention;

[0056] Figure 2 This is a flow chart of watermark extraction of the present invention;

[0057] Figure 3 This is a test image for an embodiment of the present invention;

[0058] Figure 4 This is an example diagram of the image block model and target pixel blocks of the present invention;

[0059] Figure 5 Schematic diagram of target pixel partitioning of the present invention;

[0060] Figure 6 This is a schematic diagram of the cross-field grouping mode of the present invention;

[0061] Figure 7 This is a schematic diagram of the positive and negative diagonal area grouping mode of the present invention;

[0062] Figure 8 Schematic diagram of pixels surrounding a 3×3 image block of the present invention;

[0063] Figure 9 The following is a comparison chart of PSNR value curves of four test images using four methods according to embodiments of the present invention. DETAILED DESCRIPTION

[0064] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention.

[0065] The present invention discloses a method based on asymmetric histogram Figure 4 The reversible information hiding method of round embedding includes a watermark embedding method and a watermark extraction method. The watermark embedding method includes the following steps:

[0066] Step 1: Scan the given grayscale image I. Except for the first row, the remaining pixel blocks are divided into four sets: A, B, C and D. When dividing the sets, the pixel points in odd rows are divided into sets A and B at intervals, and the pixel points in even rows are divided into sets C and D at intervals.

[0067] See Figure 4 In order to make full use of the correlation between pixels in the image and increase the accuracy of the prediction error, the generated histogram is made sharper and more concentrated. This increases the embedding capacity, so that the encrypted image has good embedding capacity and visual quality. The present invention divides all the points in the image into 4 non-overlapping sets, denoted as set A, set B, set C and set D. The embedding starts from set A and ends at set D. Each round embeds 1 / 4 of the watermark information. When embedding, the prediction error is calculated for the same point using the cross field and the positive and negative diagonal fields, and a total of two predictions are made to generate 2 pairs of asymmetric prediction error histograms to embed the watermark information, thereby increasing the embedding capacity. A decentralized prediction method is used for each prediction. Through the decentralized prediction method, smaller weights can be assigned to groups in the texture area, which can increase the prediction accuracy to a certain extent.

[0068] like Figure 4 As shown, the central pixel of a certain set is selected as the target pixel, and the surrounding 8 pixels do not belong to the same set as the central pixel. When the target pixel is embedded, the surrounding pixels are not affected, ensuring reversibility. In the first round of prediction, the cross area of ​​the target pixel is used as the reference pixel, and in the second round of prediction, the positive and negative diagonal pixels are used as reference pixels. A pair of asymmetric prediction error histograms can be generated using both rounds of reference pixel prediction. After two rounds of calculation, a total of two prediction error histograms with a value of 0 to the left and two with a value of 0 to the right can be generated. After the pixels are shifted and modified in the first round, the pixels in the second round may still be shifted in the opposite direction and restored to the original pixels. Therefore, this method can make full use of the compensation and restoration effect of the AHS algorithm, so that the encrypted image has good visual quality and embedding capacity.

[0069] Step 2: Assume that the total amount of watermark information data is EC, and use average distribution embedding for the four sets, with EC / 4 watermark information embedded in each set.

[0070] Step 3: First, mark all points in set A where the pixels are 0 or 255 as L. LM (i)=1, otherwise marked as L LM (i)=0, all L LM (i) Compressed into a bit stream L CLM As a location map of set A.

[0071] Step 4: For L in set A LM For a target pixel with (i)=0, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels. The 3×3 image block formed by the target pixel and the surrounding pixels is divided into a coarse block and a smooth block according to the threshold T.

[0072] In the process of embedding watermark information using asymmetric prediction error histogram, the pixels generally used for information embedding are called effective translation pixels, and the pixels that are only used for translation but not for embedding information are called invalid translation pixels. For image reversible information hiding technology, the more invalid translation pixels there are during the embedding process, the lower the visual quality of the encrypted image will be, and the embedding capacity will not be improved. Therefore, the present invention performs complexity calculation around the target pixel, and preferentially selects low-complexity areas for embedding to reduce the translation of invalid pixels. For the target pixel, when the present invention divides the set, for a point in a certain set, the surrounding pixels are unrelated to each other. The local complexity of the target pixel is calculated using the correlation between the surrounding pixels. Define a 3×3 image block, in which a circle of pixels around the central target pixel is defined as the pixel set F, as shown in formula (1), for the local complexity N of the image block NL It is defined as shown in formula (2):

[0073] F={p i-1,j+m ,p i+3,j+m ,p i+n,j-1 ,p i+n,j+3 |m=-1,0,1,2,3; n=0,1,2} (1)

[0074]

[0075] in: is the average value of pixels in pixel set C, and the surrounding pixel set of a 3×3 pixel block is as follows Figure 8 shown.

[0076] During image segmentation, each sub-block is first evaluated for complexity. By calculating the texture complexity of each image block, all sub-blocks are sorted in ascending order of complexity. During data embedding, data is preferentially embedded in smooth regions with low complexity, avoiding embedding in regions with complex textures. This strategy significantly improves the visual quality of encrypted images and effectively increases data embedding capacity by optimizing embedding locations.

[0077] Step 5: The 8-area pixels around the target pixel of the smooth block in set A are divided into two parts, namely the cross area part and the positive and negative diagonal area part. In the first round, the prediction error is calculated by adjacent pixels in the cross area to generate a pair of asymmetric histograms, which are translated to embed watermark information.

[0078] In order to ensure the reversibility of the embedding algorithm, the present invention divides the image into four independent sets. When one set is embedded, the other three sets are used to calculate the prediction error. This method not only makes full use of the correlation between pixels, but also ensures that the watermark information is extracted smoothly. Since the embedding methods of the four sets are basically the same, the specific method of pixel prediction is introduced here using set A as an example. Let a target pixel in set A be p i,j , and its surrounding 8 area pixels are as follows Figure 5 As shown:

[0079] The eight pixels surrounding the target pixel are divided into two parts: the cross-shaped area and the positive and negative diagonal areas. Calculating the prediction error and performing histogram shift embedding is also done in two steps: the first round calculates the prediction error using adjacent pixels in the cross-shaped area to generate a pair of asymmetric histograms for shift embedding the secret information. The second round calculates the prediction error using adjacent pixels in the positive and negative diagonal areas to generate a pair of asymmetric histograms for shift embedding the watermark information. In total, two pairs of asymmetric histograms are generated for shift embedding the watermark information.

[0080] 1. First round of cross-field pixel prediction:

[0081] When calculating the prediction error in the cross region of the target pixel, for the convenience of formula editing, the four pixels in the cross region are numbered clockwise as v1, v2, v3 and v4. And these four pixels are divided into four groups of three. The prediction value of the target pixel is p' i,j , using diamond prediction strategy to predict, the prediction formula is shown in formula (4), the division diagram is shown in Figure 6 As shown:

[0082] p' i,j =ω1·r1+ω2·r2+ω3·r3+ω4·r4 (4)

[0083] Among them, ω1, ω2, ω3, and ω4 are the weight values ​​between each group of cross-region blocks. The weight value distribution is used to calculate the prediction error. Smaller weight values ​​are assigned to the groups in the texture area, which can improve the prediction accuracy of the target pixel to a certain extent. The specific calculation steps are as follows:

[0084] Step 1: Sort the grayscale values ​​of the four groups in ascending order v m σ(1) <v m σ(2) <v m σ(3) (1≤m≤4), and then calculate r1, r2, r3, r4 through formula (5): ω1, ω2, ω3, ω4 need to satisfy ω1+ω2+ω3+ω4=1;

[0085]

[0086] Step 2: In order to determine the texture degree of the four groups of target pixels, the distance between the four groups is obtained by subtracting the minimum grayscale value of the pixels in each group, and the texture degree is determined by this distance, as shown in formula (6):

[0087]

[0088] After obtaining the inter-group distance, use formula (7) to calculate the sum of the inter-group distance differences e sum , use formula (8) to calculate the weights of each group ω'1, ω'2, ω'3, ω'4, and then normalize them to get ω1, ω2, ω3, ω4, which is required to satisfy ω1+ω2+ω3+ω4=1, as shown below:

[0089]

[0090] After obtaining ω1, ω2, ω3, ω4 and r1, r2, r3, r4, use formula (4) to calculate the predicted value p' of the target pixel i,j . Let v max=max{v1,v2,v3,v4}, v min =min{v1,v2,v3,v4}, and use formula (9) to calculate the minimum prediction error value e of the predicted value and the cross area pixel respectively min and the maximum prediction error value e max , as shown below:

[0091]

[0092] 2. Asymmetric histogram shift embedding operation:

[0093] There are similarities in the four sets of image blocks. Here, taking set A as an example, four prediction error values ​​of the target pixels in set A are obtained. Using these four prediction error values, two pairs of asymmetric histograms are generated and two rounds of watermark information embedding are performed continuously for a total of four times.

[0094] After the prediction error calculation is performed for the target pixels in set A using the cross field pixels for the first time, the minimum prediction error value e of the target pixels is obtained. min and the maximum prediction error value e max , let the pixel gray value be x. In the first round of embedding, scan all the minimum prediction error values ​​e in the A set. min , generates a prediction error histogram with a value of 0 to the right, and the embedding formula is shown in formula (10):

[0095]

[0096] Among them, x' is the pixel value after embedding data, b is the randomly generated watermark information and b∈{0,1}, Z ω With P ω are the zero and peak points of the histogram respectively. After the first embedding of watermark information, the second embedding operation is performed to scan the maximum prediction error value e max , generate a prediction error histogram with a value to the left of 0, and use formula (11) to perform the embedding operation:

[0097]

[0098] Among them, P ω With Z ω The peak point and zero point of the prediction error histogram to the left of 0.

[0099] Step 6: Scan the smooth block after the first round of watermark embedding in step 5. If there are pixels with grayscale values ​​of 0 or 255, do not perform the second round of watermark embedding on them, and record their position information in the auxiliary information.

[0100] Step 7: In the second round, for the smooth blocks whose pixel grayscale values ​​are not 0 and 255 after scanning in step 6, a pair of asymmetric histograms are generated by calculating the prediction error of adjacent pixels in the positive and negative diagonal areas, and the watermark information is embedded in them by translation until EC / 4 is embedded in set A.

[0101] 1. Second round of pixel prediction for positive and negative diagonal areas:

[0102] After the first round of cross field operation on the target pixel, the second round of positive and negative diagonal field pixel division is as follows Figure 7 As shown:

[0103] The prediction error calculation of the target pixel in the positive and negative diagonal fields is roughly the same as the cross field step. The difference lies in the grouping mode of the pixel blocks. The calculation steps are consistent with the cross field step, and the minimum prediction error value e of the target pixel can be obtained. min and the maximum prediction error value e max , I won’t go into details here.

[0104] 2. When performing pixel movement operations in the positive and negative diagonal areas, the same as step 5 above is repeated until all data is embedded.

[0105] Step 8: After embedding the information in set A, update the image and embed the remaining watermark information in sets B, C, and D in sequence according to the methods in steps 3 to 6.

[0106] Step 9: Threshold T, bit stream L CLM The position information in step 6 is embedded as auxiliary information into the least significant bit (LSB) of the first row of pixels in the image to obtain the final encrypted image I'.

[0107] The watermark extraction method is the inverse process of the watermark embedding method, which includes the following steps:

[0108] S1: First, read the LSBs of the first row of pixels in the encrypted image I', extract the compressed auxiliary information, and divide all blocks except the first row into four sets. When dividing the sets, the pixels in odd rows are divided into sets A and B, and the pixels in even rows are divided into sets C and D. The division method is the same as that used for embedding.

[0109] S2: Scan all locations in the D set except the initial L according to the location map in the auxiliary information LM For blocks with (i) = 0, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels. The 3×3 image block formed by the target pixel and the surrounding pixels is divided into a coarse block and a smooth block according to the threshold T in the auxiliary information. The calculation method of local complexity is the same as that used during embedding and is not further explained here.

[0110] S3: For the smooth blocks in the D set, first calculate the maximum and minimum prediction errors in the positive and negative diagonal areas of the target pixel, first translate the maximum prediction error histogram to extract data, and then translate the minimum prediction error histogram to extract data.

[0111] During extraction, the order of embedding is reversed. First, the pixel movement extraction of the positive and negative diagonal areas is performed, and then the pixel movement extraction of the cross area is performed. During extraction, the maximum and minimum prediction error histograms of the positive and negative diagonal areas are generated first. Then, the watermark information b is extracted according to formula (12). According to formulas (13) and (14), the maximum prediction error histogram to the left of 0 and the minimum prediction error histogram to the right of 0 are used to restore the pixels:

[0112]

[0113] S4: Add the pixels with grayscale values ​​of 0 or 255 recorded during the first round of embedding in the auxiliary information, perform a second round of cross-domain maximum and minimum prediction error calculations, and extract information. Repeat the same process for the cross-domain until the original target pixel grayscale value x is fully restored.

[0114] S5: When the information of set D is extracted, the encrypted image is updated and the watermark information of sets C, B, and A are extracted in the same way until all the information is extracted. The same method can be used to completely recover the other three sets.

[0115] S5: After all information is extracted, the entire image is restored.

[0116] The following experimental data verifies that the present invention can completely restore the original carrier image after extracting the watermark, realizing the reversibility of the algorithm.

[0117] Experimental comparison 1: PSNR comparison

[0118] The peak signal to noise ratio (PSNR) value can objectively reflect the quality of the experimental results. The higher the PSNR value, the higher the visual quality of the encrypted image compared to the original image. Figure 9The PSNR value comparison of the four test images under different embedding amounts in Algorithm 1 (Lv Zhiheng, Liu Lei, Chen Si, et al. Reversible information hiding scheme based on asymmetric histogram modification [J]. Journal of Network and Information Security, 2018, 4(05): 69-75), Algorithm 2 (He Yufen, Yin Zhaoxia, Tang Jin, et al. Reversible information hiding algorithm based on asymmetric histogram shift [J]. Journal of Network and Information Security, 2019, 5(05): 80-89), Algorithm 3 (He Yufen, Tang Jin, Yin Zhaoxia. Reversible information hiding based on multiple pairs of asymmetric histogram modifications [J]. Journal of Applied Sciences, 2022, 40(2): 253-265) and the method of the present invention is shown as follows:

[0119] from Figure 9 It can be seen that when the same capacity is embedded in different test images, the PSNR value of the algorithm of the present invention is higher than that of the other three algorithms. Algorithm 3 adopts multiple pairs of asymmetric prediction error histogram modification technology. This method adopts pixel complexity calculation strategy and multi-prediction mechanism strategy, generates multiple pairs of asymmetric histograms under different complexity intervals according to the threshold, and selects a smoother histogram to translate and embed information. It can reduce the amount of original pixels involved in the modification and achieve pixel compensation and restoration effect. Compared with the methods of Algorithm 1 and Algorithm 2, the visual quality of the image is improved. The present invention adopts pixel complexity calculation and histogram to improve the image quality. Figure 4 This algorithm combines two pairs of asymmetric histograms generated by calculating prediction error values ​​at smooth locations to perform translation embedding, further improving the image embedding capacity. Taking the highly textured Baboon image and the less textured Plane image as examples, when the Baboon image embedding capacity is 5000 bits, the PSNR value of this algorithm is 59.94dB, 1.84dB higher than Algorithm 3. When the embedding capacity is 15000 bits, the PSNR value of this algorithm is 51.92dB, while the PSNR value of Algorithm 3 is 50.74dB. It can be seen that the performance of the algorithm of this invention is higher than that of Algorithm 3. For Plane images, when the embedding capacity is also 5000 bits, the PSNR value of this algorithm is 67.58dB. While the PSNR value of Algorithm 3 is also higher, it is still 1.31dB lower than that of this method. When embedding 30000 bits, the PSNR value of this algorithm is still 0.75dB higher than that of Algorithm 3. Table 1 shows the PSNR values ​​of this algorithm and the other three algorithms at 10,000-bit embedding for four test images:

[0120] Table 1 PSNR value of the algorithm when embedding 10000 bits

[0121]

[0122] Experimental comparison 2: Pixel compensation restoration effect comparison

[0123] When the present invention uses an asymmetric histogram shift algorithm to embed data, a pixel compensation and restoration effect will occur. Specifically, during the embedding stage, a portion of the pixels that have been modified will be restored to their original pixel values ​​during the secondary modification, thereby reducing the amount of pixel modification during the information embedding process and improving the visual quality of the image after information embedding. The present invention utilizes a four-round embedding method, a total of four sets, and generates two pairs of four asymmetric prediction error histograms for the same set, which can produce two pixel compensation and restoration effects, namely the first pixel compensation and restoration effect and the second pixel compensation and restoration effect. In order to reflect that the present invention can successfully achieve the pixel compensation and restoration effect in the information embedding stage, Tables 2, 3, 4 and 5 respectively record the pixel compensation and restoration effects of four test images at different embedding amounts. Specifically as follows:

[0124] Table 2 Pixel compensation restoration amount when Baboon image is embedded in data

[0125]

[0126] Table 3 Pixel compensation restoration amount when Lake map is embedded in data

[0127]

[0128] Table 4 Pixel compensation restoration amount when the Plane image is embedded in the data

[0129]

[0130] Table 5 Pixel compensation restoration amount when Peppers graph is embedded in data

[0131]

[0132] By embedding data into the four test experimental images, the data of the pixel compensation and restoration table shows that the pixel restoration compensation amount of each set of the image is roughly the same. This is because the sets are adjacent when divided, and there is a strong correlation between the pixels. As the embedding capacity increases, the pixel restoration compensation amount of the image also increases. By calculating the prediction error for a single target pixel to generate two asymmetric histograms, the probability of the pixel restoration compensation effect is increased, which also helps to improve the visual quality of the image. The present invention has a good pixel compensation and restoration effect. On the one hand, the computational complexity gives priority to selecting smooth areas for data embedding. On the other hand, the quadratic prediction error is used to generate two pairs of asymmetric prediction error histograms. The data is embedded by shifting the histogram twice, which further increases the number of pixels where the compensation and restoration effect occurs, and reduces the amount of pixel modification, thereby improving the embedding capacity of the encrypted image and the visual quality of the embedded image.

[0133] The above embodiments are intended only to illustrate the technical concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. They are not intended to limit the scope of protection of the present invention. Any equivalent changes or modifications made in accordance with the spirit of the present invention are intended to be covered by the scope of protection of the present invention.

Claims

1. A reversible information hiding method based on four-round asymmetric histogram embedding, characterized in that: The watermark embedding method includes the following steps: Step 1: Scan the given grayscale image I and divide the remaining pixel blocks into four sets: A, B, C, and D, except for the first row. When dividing the sets, the pixels in odd rows are divided into sets A and B, and the pixels in even rows are divided into sets C and D. Step 2: Assume that the total amount of watermark information data is EC, and use even distribution embedding for the four sets, embedding EC / 4 watermark information in each set; Step 3: First, mark all points in set A where the pixels are 0 or 255 as L. LM (i)=1, otherwise marked as L LM (i)=0, all L LM (i) Compressed into a bit stream L CLM As a location map of set A; Step 4: For L in set A LM For the target pixel (i) = 0, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels, and the 3×3 image block formed by the target pixel and the surrounding pixels is divided into a coarse block and a smooth block according to the threshold T; Step 5: The 8-area pixels around the target pixel of the smooth block in set A are divided into two parts: the cross area part and the positive and negative diagonal area part. In the first round, the prediction error is calculated by the adjacent pixels in the cross area to generate a pair of asymmetric histograms, which are then translated to embed the watermark information. Step 6: Scan the smooth block after the first round of watermark embedding in step 5. If there are pixels with grayscale values ​​of 0 or 255, do not perform the second round of watermark embedding on them, and record their position information in the auxiliary information. Step 7: In the second round, for the smooth blocks whose pixel grayscale values ​​are not 0 and 255 after scanning in step 6, a pair of asymmetric histograms are generated by calculating the prediction error of adjacent pixels in the positive and negative diagonal areas, and the watermark information is embedded in the asymmetric histograms by translation until EC / 4 is embedded in the A set; Step 8: After the information of set A is embedded, update the image and embed the remaining watermark information of sets B, C, and D in sequence according to the method of steps 3 to 6; Step 9: Threshold T, bit stream L CLM The position information in step 6 is embedded as auxiliary information into the least significant bit (LSB) of the first row of pixels in the image to obtain the final encrypted image I'.

2. A reversible information hiding method based on asymmetric histogram four-round embedding according to claim 1, characterized in that: Also included is a watermark extraction method, comprising the following steps: S1: First, read the LSB of the first row of pixels in the encrypted image I', extract the compressed auxiliary information, and divide all blocks except the first row into four sets. When dividing the sets, the pixels in odd rows are divided into sets A and B, and the pixels in even rows are divided into sets C and D. S2: Scan all locations in the D set except the initial L according to the location map in the auxiliary information LM For blocks with (i)=0, the local complexity of the target pixel is calculated using the correlation between the surrounding pixels. The 3×3 image block formed by the target pixel and the surrounding pixels is divided into a coarse block and a smooth block according to the threshold T in the auxiliary information. S3: For the smoothing blocks in the D set, first calculate the maximum and minimum prediction errors in the positive and negative diagonal areas of the target pixel, first translate the maximum prediction error histogram to extract data, and then translate the minimum prediction error histogram to extract data; S4: adding the pixel points with the pixel grayscale value of 0 or 255 in the first round of embedding recorded in the auxiliary information during embedding, performing the second round of cross-field maximum and minimum prediction error calculation and extracting information; S5: When the information of set D is extracted, the encrypted image is updated and the watermark information of sets C, B, and A are extracted in the same way until all the information is extracted; S5: After all information is extracted, the entire image is restored.

3. A reversible information hiding method based on asymmetric histogram four-round embedding according to claim 1 or 2, characterized in that: The local complexity of the target pixel is calculated by using the correlation between the surrounding pixels, specifically: Set the target pixel p i,j , which forms a 3×3 image block with the surrounding 8 pixels. The pixels around the target pixel are defined as the pixel set F. For the local complexity of the image block N NL It is defined as shown in formula (13): F={p i-1,j+m ,p i+3,j+m ,p i+n,j-1 ,p i+n,j+3 |m=-1,0,1,2,3;n=0,1,2}(12) in: is the average value of pixels in the pixel set F.

4. A reversible information hiding method based on asymmetric histogram four-round embedding according to claim 1 or 2, characterized in that: The prediction error of adjacent pixels in the cross area is calculated to generate a pair of asymmetric histograms, specifically: 1) When calculating the prediction error in the cross area of ​​the target pixel, the four pixels in the cross area are numbered clockwise as v1, v2, v3 and v4, and these four pixels are divided into four groups of three. The prediction value of the target pixel is p' i,j , using the diamond prediction strategy to predict: p' i,j =ω1·r1+ω2·r2+ω3·r3+ω4·r4(1) Among them, ω1, ω2, ω3, and ω4 are the weight values ​​between each group of cross-domain blocks, and ω1, ω2, ω3, and ω4 satisfy ω1+ω2+ω3+ω4=1. The prediction error is calculated using the weight value distribution; 2) Sort the grayscale values ​​of the four groups in ascending order v m σ(1) <v m σ(2) <v m σ(3) , 1≤m≤4, then calculate r1,r2,r3,r4,v m σ(1) ,v m σ(2) ,v m σ(3) Indicates the grayscale values ​​of the first, second, and third pixels in each group after sorting in ascending order from small to large. σ(1), σ(2), and σ(3) represent the subscripts of the pixel grayscale values ​​and have no actual meaning. 1≤m≤4 represents the first to fourth groups: 3) Use the maximum grayscale value of each pixel in each group minus the minimum grayscale value to obtain the four inter-group distances to determine the texture degree: 4) After obtaining the inter-group distance, use formula (4) to calculate the sum of the inter-group distance differences e sum , use formula (5) to calculate the weights of each group ω'1, ω'2, ω'3, ω'4, and then normalize them to get ω1, ω2, ω3, ω4, which is required to satisfy ω1+ω2+ω3+ω4=1, as shown below: 5) After obtaining ω1, ω2, ω3, ω4 and r1, r2, r3, r4, use formula (1) to calculate the predicted value p' of the target pixel i,j , let v max =max{v1,v2,v3,v4}, v min =min{v1,v2,v3,v4}, and use formula (6) to calculate the minimum prediction error value e of the predicted value and the cross area pixel respectively min and the maximum prediction error value e max , as shown below:

5. The reversible information hiding method based on asymmetric histogram four-round embedding according to claim 4 is characterized in that: The prediction errors of adjacent pixels in the positive and negative diagonal areas are calculated to generate a pair of asymmetric histograms. The four pixels on the positive and negative diagonal areas are numbered clockwise as v5, v6, v7, and v8. These four pixels are divided into four groups of three. The other operations are consistent with the calculation of the prediction errors of adjacent pixels in the cross area to generate a pair of asymmetric histograms.

6. The reversible information hiding method based on asymmetric histogram four-round embedding according to claim 1 is characterized in that: The asymmetric histogram is shifted to embed watermark information, as follows: After calculating the prediction error for each target pixel in the set using the cross area pixel, the minimum prediction error value e of the target pixel is obtained. min and the maximum prediction error value e max , let the pixel gray value be x, when embedding for the first time, scan the minimum prediction error value e of the set min , generates a prediction error histogram with a value of 0 to the right, and the embedding formula is shown in formula (7): Among them, x' is the pixel value after embedding data, b is the randomly generated watermark information and b∈{0,1}, Z ω With P ω are the zero value point and peak point of the histogram respectively; after the first embedding of watermark information, the second embedding operation is performed to scan the maximum prediction error value e max , generate a prediction error histogram with a value to the left of 0, and use formula (8) to perform the embedding operation: Among them, P ω With Z ω The peak point and zero point of the prediction error histogram to the left of 0; When performing pixel translation operations in the positive and negative diagonal areas, the above steps are the same until all data are embedded.

7. The reversible information hiding method based on asymmetric histogram four-round embedding according to claim 2 is characterized in that: When extracting, the order is opposite to the embedding order, first performing pixel movement extraction in the positive and negative diagonal areas, and then performing pixel movement extraction in the cross area; The maximum and minimum prediction errors of the positive and negative diagonal areas of each target pixel in the set are first extracted by shifting the maximum prediction error histogram, and then the minimum prediction error histogram is shifted to extract data. The watermark information b is extracted according to formula (9). The pixels are restored by the maximum prediction error histogram to the left of 0 and the minimum prediction error histogram to the right of 0 according to formula (10) and formula (11): The maximum and minimum prediction errors in the cross area are calculated and information is extracted. The same operation is performed until the original target pixel grayscale value x is completely restored.