Reversible data hiding based on histogram modification of difference images by s-type and Hilbert curve scanning

Reversible data hiding technology has currently attracted great attention recently. Using reversible data hiding methods, original cover images can be recovered losslessly from the cover image embedded information. In this paper, spatial reversible data hiding schemes based on histogram modification of difference images are discussed, in which the pixel gray values of difference image are altered slightly to perform the embedding and extraction. Specifically, we design two reversible data hiding schemes based on S-type scanning and Hilbert curve scanning, and compare them with the reversible data hiding scheme by difference between adjacent columns of the cover image. Embedding capacity and PSNR are calculated to figure out how block size, difference manner and embedding level influence the effect of hiding.


INTRODUCTION
With the rapid development of computer network technology and multimedia processing technology, image, video and other digital products are largely distributed, communicated and shared online, which brings great convenience for people's life. However, information disclosure, content tampering, infringement problems become increasingly serious consequently. In order to solve these problems, encryption technology, information hiding technology provides two effective approaches for protecting confidential information, works copyright certification, information authenticity identification, etc. In image processing research field, data hiding is refered to a process to embed the secret data into a cover image. According to the relationship between embedded data and cover image, data hiding is roughly divided into two categories. One kind is called steganography which embedded data has nothing to do with the cover image; another kind is called watermarking technology whose embedded data has a close relationship with cover image. In the digital watermarking technology, the embedded data can provide information for cover image authentication, author signature, etc. Embedded information will affect the cover image quality more or less, but after the watermark extraction, one hopes to be able to fully reconstruct the original cover image, i.e., realizing reversible data hiding. Reversible data hiding has been widely used in sensitive areas, such as medical, military and judicial field [1][2][3][4].
Reversible data hiding has become a hot spot in the field of digital watermarking research. Many scholars put forward many kinds of reversible data hiding algorithms recently [5][6][7][8][9][10][11]. Reversible watermarking algorithms based on compressing secret data are designed to increase the embedding capacity [5,6]. Reversible watermarking algorithms based on difference expansion perform the reversible watermark data embedding by extending the difference of adjacent pixels [7]. Reversible data embedding based on histogram translation embeds watermark data in the vacancy of grayscale using statistical characteristic of the image histogram [8,9]. In recent years, combining histogram modification and reversible data hiding algorithms has become one of the important methods in the field of reversible data hiding technology research [10,11]. In 2004, Lee et al. used difference histogram modification to embed secret information data, resulting in higher image quality as well as large capacity [10]. In 2008, Lin et al. proposed a multi-level reversible watermarking algorithm based on difference histogram modification and further improve the embedded information capacity [11]. Because the peak value frequency of the difference image among the columns of the original cover image is greatly improved compared with the cover image, Lee et al. designed a multi-level reversible data embedding algorithm, in which block and embedding level are introduced to improve the embedding capacity and reduce distortion. How to generate the difference image, improve the peak value frequency of difference image, the difference method adopted is a worth considering issue. This paper considers the design of two different difference schemes, s-shaped scanning difference and Hilbert curve scanning difference. As the s-type curve and Hilbert curve can traverse the whole cover image, one can determine the calculation rules of the corresponding difference of adjacent pixels according to the pixel scanned successively. S-scanning and Hilbert curve scanning are used respectively to design reversible hiding algorithms based on difference image histogram modification. The simulation results are compared with those using the column difference method. The influence of block size, differential method and embedding level to embedded capacity and peak signal to noise ratio are analyzed as well.

MULTI-LEVEL SCHEME BASED ON HISTOGRAM MODIFICATION OF DIFFERENCE IMAGE USING CURVE SCANNING
It is common sense that the adjacent pixels's gray values are relatively close for a natural image. There is a large probability that adjacent pixels in a natural image have similar gray values. It follows from this property that the difference between two adjacent pixels in a natural image is expected to be near zero. If the difference is set to be one value in the difference image, then in the obtained difference image, the grayscale value with the maximum number of pixel values tends to be around 0. Furthermore, we can observe that the peak value frequence of the difference image becomes larger that that of that of the original cover image. How to choose adjacent pixels difference methods, however, there is little discussion in the literature. One can choose simple difference operation of adjacent columns or rows [11] , or one can determine the calculation rules of the corresponding difference of adjacent pixels with the help of a specific curve tranversing the whole image. In this paper, we adopt S-scanning and Hilbert curve sanning to calculate the difference image and then design the histogram modification based reversible data hiding scheme. Experimental results are then compared with those of column difference method. As for reversible data hiding scheme based on column difference, please refer to [11] for details.

S-type Scanning Based Reversible Hiding Scheme
Difference method based on S-type scanning converts the two-dimensional image data into one-dimensional data by Stype curve. The hiding phase and the extracting-recovery phase of the proposed scheme are explained in details in the sequel. We assume that the proposed cover image is sized MN  and let The hiding stage based on S-type scaning is described as follows. Step (1)

Fig. 1. S-type scanning.
Step 2. Generate the histogram of the difference image bs D and record its peak value bs P for each block. Step Step 4. The pixels in the modified difference image bs D having grayscale values the same as peak value bs P can be modified to hide embedded message bit Step 5. The original scanned cover image bs H  and its hidden difference image bs D are used to reconstruct the cover image hidden embedded message by performing the following transformation. For the first two pixels, the inverse operation is represented as: For the remaining pixels, the inverse operation is expressed as: The generated vector bs S with length AB  is then reconstructed to be one two-diemnsional matrix block with size AB  . All the blocks are accumulated to be the resulted cover image SH with secret embedded message.
We can extract the embedded message and reconstruct the original cover image losslessly. The process is the reverse of the above-mentioned embedding phase. The detailed extraction and reversing process are stated as follows.
Step 1. The marked cover image SH is divided into samll blocks b SH , each of size AB  . The two-dimensional matrix block b SH is scanned according to S-type scanning and converted to one vector bs S with length AB  , and then get the difference image bs SD with length 1 AB  by neighboring pixels gray value subtraction by (2). D e c e m b e r 01, 2015 Step 2. Extract the embedded message Step 3. Remove the embedded message from the difference image bs SD for block b using the following formula: Step Step 5. The inverse difference transformation is applied to get the original scanned cover image bs RH by performing the following formulae. Similarly, for the first two pixels, the inverse operation is represented as: The above process is one round of embedding and extraction process. The algorithm can be implemented several rounds and it is referred to one multi-level algorithm. The marked cover image can be regarded as a new cover image where other secret data can be embedded. As a result, more secret message can be hidden to improve the embedding capacity. For the sake of convenience, we will denote the embedded level as n if the algorithm is performed n rounds.

Hilbert Curve Scanning Based Reversible Hiding Scheme
Thanks to the good filling nature, space-filling curves have been widely applied in many fields, especially in digital image processing, such as image clustering, image encryption, image encoding, image storing, image retrieving, and pattern recognition [12]. The Hilbert curve, one famous space-filling curve presented by Hilbert to traverse points on a twodimensional square grid, preserves point neighborhoods as much as possible [13]. This paper will use the Hilbert curve to scan square image pixels, and realize the difference histogram modification based reversible data hiding. Based on the Hilbert curve generation algorithm [14], the Hilbert curves with first, second and fourth order are dipicted in Figure 2. The curve starts from buttom left, then scans the pixels in its unique way and ends at bottom right.
Compared with the difference between ajacent columns and S-type scanning based difference, difference method based on Hilbert curve scanning is more complex to describe the image information. The process is a little more complicated than that of S-type scanning based method as well. The image data information is first read according to the Hilbert curve and rearranged to be one-dimensional vector data orderly. Difference operation is then performed for the adjacent pixels to get the difference image. The histogram translation and difference image's modification are next carried out and the inverse operation is finally implemented to reconstruct the marked image. Furthermore, we note that the classical Hilbert D e c e m b e r 01, 2015 curve can traverse the square lattice, and therefore hiding algorithm based on Hilbert curve scanning is only suitable to square images.

Comparison of Embedding Capacity Expansion
The peak value frequency of the difference image is worthy of attention which is related to the cover image embedding capacity. Different difference methods will generate different peak value frequencies for the same processed cover image. and record the corresponding pixel peak value and its frequency for each image. For example, the histograms of the three differnce images for Lena.bmp using column difference, S-type scanning difference and Hilbert curve scanning difference, are shown in Figure 4. The peak value frequency for the four test images and their difference images are demonstrated in Table 1. One can draw the following conclusions from Table 1. 1) No matter what kind of difference method is adopted, the peak value frequency of the difference image is larger than that of the original cover image. Therefore ajacent pixels difference operation is helpful for improving image embedding capacity.
2) The S-type scanning based difference is the most effective method to improve the embedding capacity among the three difference methods. 3) When the peak value frequency of the original cover image is large, the column difference method seems better. 4) Hilbert curve scanning based difference method can usually improve the embedding capacity compared with the column difference method.

Block Size
In the three reversible data hiding algorithms, the cover image is seperated into small blocks and embedded secret message in the blocks, so as to improve the quality of image after embedded information. To the best of our knowledge, there is less detailed discussion on how the block size affects the marked cover image quality in the literature. To this end, we analyze the specific influence of block size on the embedding result. The original cover image is separated into small pieces with size AB  . Considering the main purpose of histogram modification of the difference image, we should allow more adjacent pixels with similar gray values to be in the same block to create more positions embedded secret message. Note that if the block size is too small, then too many adjacent pixels with similar intensity will be separately divided, and hence it is hard to maintain high embedding capacity. If the block size is too large, the marked image has to afford the visual distortion. Therefore, we only discuss the cases , (2,32] AB . In addition, considering the Lena image' size is 256  256, the block size is limited in the those cases shown in Table 2. Assuming that the embedding level is at round 1, we apply the algorithm based on column difference to get the results. From Table 2, we have the following observations: 1) Under normal circumstances, as the block size varies large, the PSNR value of the marked image declines, as well as embedding capacity. 44  is the best block size to get the best embedding effect. 2) Under the condition of equal block area, a square block can well guarantee the marked image quality.
Moreover, similar results like above can be obtained when applying methods of S-type scanning and Hilbert curve scanning based difference.

Embedding Level
Furthermore, we turn to discuss the influence of embedding level. Given the block size 44  , the results of the image quality and embedding capacity with respect to embedding level by different difference methods are demonstrated in Figures 5-6. It follows from the experimental results that the quality of image degrades as the embedded level increases. The three algorithms have almost the same degree of decline because the image quality is caused by embedded information. The more secret message is embedded, the worse is the image quality. However, the image embedding capacity rate increases as the embedding level increases. The embedding capacities for both S-type scanning and Hilbert curve scanning algorithms are consistent, while that for clolumn difference algorithm is different in some ways. Within the same embedding level, the embedding capacities obtained by S-type scanning and Hilbert curve scanning algorithms are a little larger than that generated by the algorithm based on column difference. The conclusion regarding PSNR is just the reverse. D e c e m b e r 01, 2015

Difference Method
From the analysis above, we can see that when the embedding level is more than 5, the PSNR values for the marked cover image will be lower than 35 usually, and hence the marked cover image will have large distortion. Here we only delve into cases of embedding levels ranging from 1 to 5. The results are shown in Table 3 and Table 4. We can draw the following conclusions: 1) Algorithm based on column difference under high embedding level can still maintain a good image quality, while S-type scanning and Hilbert curve scanning algorithm can't achieve it. 2) Considering the same D e c e m b e r 01, 2015 image quality and block size, S-type scanning algorithm can obtain larger embedding capacity if embedded with the level 1 to avoid attack, otherwise, column difference algorithm with high embedding level is adopted to embed more secret data.

CONCLUSION
In this paper, two multi-level reversible data hiding algorithms based on S-type scanning and Hilbert curve scanning and difference image histogram modification are proposed. Specifically, we provide concrete steps of the algorithms, and then present the implemented results and make comparision with algorithm based on column difference in detial. Difference image generated by adjacent pixels difference operation can effectively improve the original cover image's embedding capacity. The column difference based algorithm is simple but effective. The S-type scanning difference based algorithm is the most effective in improving the embedding capacity among these three algorithms. In practical applications, the blocking and multi-level embedding can effectively guarantee the embedding capacity as well as the image quality to avoid excessive distortion. Nevertheless, along with the increase of embedding levels, the PSNR value of the marked cover image will be gradually reduced. Therefore, the embedding level should not be too large to ensure the quality of the marked cover image.