2017 2 nd International Conference on Computer Science and Technology (CST 2017) ISBN: 978-1-60595-461-5 A Reversible Data Hiding Scheme Based on Prediction Difference Ze-rui SUN 1,a*, Guo-en XIA 1,2, Guo-xiang LI 1, Yi-lin JIANG 1 1 Office of Academic Affairs Guangxi University of Finance & Economics, Nanning, China 2 Department of Business Administration Guangxi University of Finance & Economics, Nanning, China a gxufeszr@163.com *Corresponding author Keywords: Data hiding, Reversible, Prediction difference. Abstract. In this paper, we propose a new data hiding scheme based on prediction difference. The difference between prediction value and the real value in the corresponding position of the cover image is calculated, and the secret bits are embedded into the difference. That is changing or staying the original pixel of corresponding position in the original image to embed secret bits. Experimental results indicated that our scheme provides higher PSNR value with the same payload. Introduction Data hiding [1] is a technique which can achieve secret communication through cover multimedia with the secret information, and transfer the covered multimedia to the receiver without detection. Data hiding can be classified to two categories according to the cover image can be restore or not, reversible data hiding and irreversible data hiding. Reversible data hiding, also named as lossless data hiding, is an important way to hide the secret message and protect multimedia productions. The cover image can be completely recovered after embedded messages are completely extracted with the reversible data hiding. Therefore, it has been commonly used to the military, medical, and art productions etc. Recent years, researchers have proposed multiple reversible data hiding algorithms. Almost all of them are based on lossless compression [2, 3, 4], difference expansion (DE) [5, 6, 7], histogram shifting [8, 9, 10, 11], and interpolation images [12, 13]. Ni et al. [8] presented a histogram-shifting based reversible data hiding scheme. For a given image, obtained the histogram of the cover image firstly, and selected the frequent and the least frequent pixel values. That is the peak point and zero point of the histogram. Scan the cover image once in a sequential order. If the pixel value of the peak point is large than the zero point, the left part of the histogram is shift to the left-hand by one unit. If the pixel value of the peak point is small than the zero point, the right part of the histogram is shift to the right-hand by one unit. Then scan the image once again in the same order. After scanning the pixel with the peak point value, embed a bit of secret bit, if the secret bit is 1, then change the pixel value with the histogram shift direction. If the histogram is shift to the left-hand, the pixel is minus 1, and if the histogram is shift to the right-hand, the pixel is plus 1. If the secret bit is 0, the pixel is unchanged. 341
The payload of the histogram-shifting based reversible data hiding scheme is limited for the peak size is small. Many researchers extended Ni s method [9, 10, 11] and obtained the higher payload and the better visual effect. As the natural images have local similarity, the pixel grayscale values in a local area are often highly correlated and spatial redundancy. Therefore, the prediction value of one pixel is close to the real value, that is the difference between the prediction value and the real value is close to zero. The peak of the difference value histogram is expected to be very close to zero, thus, there are lots of candidates for embedding data. By the observations above, we would like to integrate the prediction errors into the histogram-based scheme. The paper is organized as follows. In Section II we discuss how to generate the difference errors. In Section III we describe the proposed hiding and extracting algorithm. Simulation results are demonstrated in Section IV. Finally, we point out the contributions of our algorithm and conclude this paper in Section V. The Generation of the Prediction Errors The ideas of difference error are always used in the coding process of digital image. The data hiding algorithm take the advantage of difference error. The errors between the prediction value and the real value are calculated, and then modified the errors with histogram shifting algorithm. The common errors are generated between two real pixels or between the prediction value and the real value. In order to obtain the higher payload, we would like to get an error value which has high frequency. As the pixels nearby have the closet values, so we can predict a pixel s value by the value of pixels nearby. Figure 1. Five consecutive pixels and values in one direction. As shown in Fig. 1, it denotes 5 consecutive pixels and their values in one direction of the image, and the direction could be the vertical direction, horizontal direction and diagonal directions. The pixels of P2 and P4 are used to calculate the prediction errors which have no background colour. The prediction values of P2 and P4 are generated by the value of P1, P3 and P5. In order to get more same error, the prediction value of P2 is 1 3 choose the mode of y1, y3, ( y + y ), and the prediction value of P4 are choose the 2 3 5 mode of y3, y5, ( y + y). 2 Suppose the cover image is C with the size of W*H. The prediction image of C is C' which has the same size. The pixels are same in C and C' when the row and column coordinates are odd number at the same time, the rest are the prediction pixels. The prediction error matrix is calculated by the Eq.1. D(i,j) = C(i,j) - C'(i,j) (1) D(i,j) = 0, i = 1,3,5, j = 1,3,5 (2) We can get an error matrix D by Eq. 1, which the value is 0 when the row and column coordinates are odd number at the same time. Each error value in D is between -255 and 342
255, and the size of D is same with the cover image C. An error histogram H is obtained by counting the errors in D, the secret bits are hiden in the errors. The Proposed Hiding Algorithm Using the histogram based hiding algorithm [8] to hide secret bits into the error histogram we get above. Find the most K common of errors in the error series, put the secret bits into the errors to achieve embeding. Scanning the image from the top-left, choosing the second and the forth pixel of five consecutive pixels in one direction, and embeding the secret bits into the pixels. The details of hiding procedure is composed of 5 steps as follows. Step1: Calculate the error matrix D and find the K common errors of the matrix, suppose the mean value of K errors is M. Step2: Scan the image from the top-left toward to the three directions with the step length of five, the second and the forth pixel are embeding pixels with the position (i, j). Step3: Check the error matrix D(i, j), if the value of D(i, j) is not in the range of K errors, the D(i, j) is changed by Eq. 3 to make space for embeding. That is shift the histogram H. The new value of error can be calculated by the Eq.3. (, ) K (, ) Dij+ ( +1 ) Dij>M + ( K+1) 2 2 D' ( i, j) = D( i, j) - K D( i, j) <M-K 2 2 If the value of D(i, j) is in the range of K errors, that is the value of D(i, j) is [ M - K 2, M + ( K +1) ], the pixel of D(i, j) is changed to hide the secret by Eq.3. 2 According to value of D(i, j) and M to embed the secret bit s, the new value of error can be calculated by the Eq.4. D( i, j) s= 0 D' ( i, j) = D( i, j) + ( K +1) D( i, j) M && s = 1 2 D( i, j) - K D( i, j) <M && s = 1 2 The value of D(i, j) is unchanged if the secret value is 0. If the secret value is 1, we should compare the value of D(i, j) and the mean value M. If M is not bigger than D(i, j), the pixel of D(i, j) plus ( K +1) to embed 1. If M is bigger than D(i, j), the pixel of 2 D(i, j) minus K to embed 1. 2 Step4: Repeat step3 until all the embeding position of error matrix are embedded with the secret bits. Step5: Add the new error matrix D' to the prediction image C' to get the stego-image Ste. Ste(i,j) = C' (i, j) + D'(i, j) (5) If the value of P1, P3 and P5 is close to 255 or to 0, the value of P2 and P4 in the stego-image could be overflow with the secret bits. In order to avoid the overflow in the stego-image, we do not embed bits in the pixels with the value bigger than 240 or small than 15. The procedure extracting and recovering can be described as follows: (3) (4) 343
Step1: Calculate the prediction C' with same method form the stego-image and get the error matrix D', and get the value of K and M from the sender. Step2: Scan the matrix D' from the top-left, get secret bit s in the embeding position (i, j) with the Eq. 6. If the value of D'(i, j) is between ( M -( K +1), M + K ], we can 2 2 extract 0 from the D'(i, j), if the value of D'(i, j) is between ( M + K 2, M + K +1) or between ( M -K, M -( K +1) ], we can extract 1 from the D'(i, j). The error value of 2 D' (i, j) is changed by Eq. 7. ( ) 0 M- ( K +1) < D' i, j M+ K 2 2 s= 1 M+ K+1 >D' ( i, j) >M+ K 2 1 MK - <D' ( ij, ) M-( K +1) 2 D' ( i, j) s = 0 D( i, j) = D' ( i, j) -( K +1) D' ( i, j) M && s = 1 2 D' ( i, j) + K D' ( i, j) <M && s = 1 2 Similarity, if the secret value is 0, the value of D'(i, j) is unchanged. If the secret value is 1, we should compare the value of D'(i, j) and the mean value M. If M is not bigger than D'(i, j), the pixel of D'(i, j) minus ( K +1) to recover. If M is bigger than 2 D'(i, j), the pixel of D'(i, j) plus K to recover. 2 Step3: Repeat step2 until all the secret bits are extracted. Step4: Add the corrected error matrix D to the prediction image to recover the image C. C(i, j) = C'(i, j) + D(i, j) (8) Experimental Results and Analysis In order to evaluate the advantages and efficiency of the proposed algorithm, we did lots of experiment with Tseng et al. s scheme [10] on the common images. Four common test images sized 512 512 as shown in Fig. 2. The measure standard are the hiding capacity and the PSNR values. The payload and the PSNR values of different images are listed in Table 1 when K = 1, from which we can learn that the PSNR of our algorithm is better than Tseng et al. s scheme with the same payload. We can increase the embed payload by adding the value of K or appling the algorithm many times. The outcome of hiding more than one times is listed in Table 2. (6) (7) 344
Table 1. Comparisons between the proposed method and Tseng et al. s scheme. Image The proposed scheme Tseng et al. s scheme Payload PSNR Payload PSNR (bpp) (db) (bpp) (db) Lena 0.177 48.69 0.176 43.84 Barbara 0.160 47.87 0.132 43.32 F16 0.191 50.07 0.160 44.73 (a) Lena (b) Baboon (c) Barbara (d) F16 Figure 2. Four test images used in the experiments. Table 2. The payload and PSNR when embed 1 and 2 times. Image One time Two times Payload PSNR Payload PSNR (bpp) (db) (bpp) (db) Lena 0.150 49.93 0.297 44.56 Baboon 0.055 49.64 0.104 43.80 Barbara 0.129 49.87 0.254 44.37 F16 0.191 50.07 0.402 45.07 Conclusions In this paper, we proposed a new reversible data hiding method based on prediction error and histogram shift. The error is calculated by the prediction value and the real value of one pixel. As the prediction effect is good, the real value and prediction value is very close, more 0 are obtained and more pixels can be used to hide secret bits. The experimental results indicated that the stego-images generated by our data hiding scheme have a better visual quality, so it can be used in the real application such as the military or medical images. Future work include reversible data hiding with new prediction method or in the encrypted images, and so on. Acknowledgment This research was partially supported by the Guangxi Province Universities and Colleges Excellence Scholar and Innovation Team Funded Scheme; Guangxi University of Science and Technology Research Projects (ky15yb267) and The Young teachers research Fund of Guangxi University of Finance and economics. (2016QNA03); 2014 Guangxi University of Finance & Economics College project (2014B070). 345
References [1] Bender, W., Gruhl, D., Morimoto N., et al. Techniques for data hiding [J]. IBM systems journal, 1996, 35(3.4): 313-336. [2] Fridrich, J., Golja,n M., Du R. Lossless data embedding: new paradigm in digital watermarking [J]. EURASIP Journal on Applied Signal Processing, 2002, 2002(1): 185-196. [3] Fridrich, J., Goljan, M., Du, R. Lossless data embedding for all image formats [C]//Electronic Imaging 2002. International Society for Optics and Photonics, 2002: 572-583. [4] Celik, M. U., Sharma, G, Tekalp A. M., et al. Lossless generalized-lsb data embedding [J]. IEEE transactions on image processing, 2005, 14(2): 253-266. [5] Tian, J. Reversible data embedding using a difference expansion [J]. IEEE transactions on circuits and systems for video technology, 2003, 13(8): 890-896. [6] Tseng, H. W., Chang, C. C. An extended difference expansion algorithm for reversible watermarking [J]. Image and Vision Computing, 2008, 26(8): 1148-1153. [7] Lee, C. C., Wu, H. C., Tsai, C. S., et al. Adaptive lossless steganographic scheme with centralized difference expansion [J]. Pattern Recognition, 2008, 41(6): 2097-2106. [8] Ni, Z., Shi, Y. Q., Ansari, N., et al. Reversible data hiding [J]. IEEE Transactions on circuits and systems for video technology, 2006, 16(3): 354-362. [9] Lee, C. F., Chen, H. L., Tso, H. K. Embedding capacity raising in reversible data hiding based on prediction of difference expansion [J]. Journal of Systems and Software, 2010, 83(10): 1864-1872. [10] Tseng, H. W., Hsieh, C. P. Prediction-based reversible data hiding [J]. Information Sciences, 2009, 179(14): 2460-2469. [11] Dragoi, I. C., Coltuc, D. Local-prediction-based difference expansion reversible watermarking [J]. IEEE Transactions on image processing, 2014, 23(4): 1779-1790. [12] Jung, K. H., Yoo, K. Y. Data hiding method using image interpolation [J]. Computer Standards & Interfaces, 2009, 31(2): 465-470. [13] Lee, C. F., Huang, Y. L. An efficient image interpolation increasing payload in reversible data hiding [J]. Expert systems with applications, 2012, 39(8): 6712-6719. 346