Zero-Error Watermarking on JPEG Images by ... - Semantic Scholar

3 downloads 0 Views 168KB Size Report
Abstract—This paper proposes a full fidelity watermarking on. JPEG bitstreams. That is, without a designated decoder/player, the watermarked bitstream can be ...
Zero-Error Watermarking on JPEG Images by Shuffling Huffman Tree Nodes Yongdong Wu

Robert H. Deng

Cryptography and Security Department Institute for Infocomm Research, Singapore Email: [email protected]

School of Infomation Systems Singapore Management University Email: [email protected]

Abstract—This paper proposes a full fidelity watermarking on JPEG bitstreams. That is, without a designated decoder/player, the watermarked bitstream can be decompressed to the original one. To this end, the scheme modifies the JPEG Huffman tables and the bitstream synchronically according to the watermark. Thus it is unnecessary for the JPEG decompressor to recover DCT coefficients because they are not modified at all. In addition, the present scheme is applicable to any JPEG bitstream even if its Huffman tables are optimized.

I. I NTRODUCTION Digital watermarking enables to embed special labels in digital contents. However, most image watermarking methods (e.g., [1]) introduce un-recoverable distortions to the original content. Because some applications such as medical and military images, prohibit the permanent loss of image fidelity during watermarking, it is desirable to embed a watermark in a reversible/recoverable way so that the loss of signal fidelity can be remedied by the use of reversible hiding techniques. For example, although schemes [2]–[4] insert information by modifying the host signal, thus induce an embedding distortion, they enable the removal of such distortions and the exact lossless restoration of the original host signal. Specifically, the schemes compress portions of the LSBs (Least Significant Bit) of image pixels to leave space for watermark, and transmitting these compressed descriptions as a part of the embedded payload. At the detector side, the original image can be recovered with decompression and recovery operations. JPEG is the most popular image format because it offers a convenient trade off between compression rate and the perceptual quality of the encoded image. However, the above LSB embedding on pixel data is not suitable for JPEG images as JPEG quantization process reduces the data significantly. Instead, reversible data hiding on JPEG images use the quantized DCT (QDCT) coefficient (e.g., [5]–[13]), bitstream body (e.g. [14]) and bitstream header to embed messages. Fridrich et al. [5] [6] compressed the LSB plane of quantized coefficients so as to leave space for reversible data embedding. Consequently the payload is rather limited. Zhang et al. [7] adjusted three quantized coefficients so as to embed 2 bits into an 8 × 8 block. Cheng and Yoo [8] selected tuples in quantized DCT coefficient blocks, and embedded messages with difference expansion [15] and last non-zero coefficient embedding [9]. Xuan et al. [10] embedded messages into the histogram of

quantized DCT coefficients. Sakai et al. [11] improved [10] by selecting the suitable embedding blocks for better image quality. Kuo et al. [12] embedded data into the quantized DCT coefficients by moving the EOB (End Of Block) position. Li et al. [13] proposed methods to perform embedding and extracting in a single pass without waiting for the end of the bitstream. One improvement on the method [13] is to encode the watermark in base-3 so as to increase the embedding capacity 50%. All the above QDCT-based schemes require to fully or partially decode the JPEG bitstream in both embedding and extracting processes. This requirement makes practical application of these methods limited. In contrast, the code-mapping scheme [14] does not decode the bitstream in either embedding or extracting process at all. Instead, it maps one Huffman code to another one assume only portion of Huffman codes in JPEG Huffman tables are used in the JPEG bitstream. However, if the assumption holds, optimal Huffman Tables (e.g., using photoshop optimzation tool) have higher hiding capacity and better quality than [14]. Either QDCT-based scheme or bitstream-based scheme will degrade the JPEG image quality unless a dedicated decoder is used to remove the distortion. i.e, reversible watermarking schemes require dedicated decoders so as to render the original images. In contrast, a Zero-Error Watermarking (ZEW) produces a watermarked signal which can be shown with the same quality as the original one without a designated decoder. Wu [16] presented exemplary applications on GIF images by adjusting the palettes and software by re-arranging the software instructions based on integer-sequence conversion algorithm [17]. This paper presents a Zero-Error Watermarking on JPEG bitstream headers. Concretely, it discloses a new integer-vector conversion algorithm, and applies the conversion algorithm to JPEG Huffman Tables even if the JPEG Huffman tables are already optimal in terms of compression rate before the present method is employed. The remainder of this paper is organized as follows. Section II presents a bijective mapping algorithm between an integer and a permutation. Section III introduces the concept of ZEW and its application on JPEG bitstreams. Section IV discusses the scheme performance. Section V draws conclusions.

TABLE II S AMPLE EXTRACTING WITH n = 5

II. C ONVERSION BETWEEN I NTEGER AND P ERMUTATION Given an integer w and a vector S =< 1, 2, . . . , n >, where 0 ≤ w < n!, this section describes a bijective mapping between w and a permutation of S. A vector permutation means to re-order the vector elements. A. Mapping integer to vector permutation As the number of the permutation of S is n! − 1, each w ∈ [0, n!) can be mapped to one vector permutation. To this end, assume there are n empty bins, and each bin is tagged with a unique number j ∈ [1, n]. Then we divide the interval [0, n!) into n sub-intervals, where the ith sub-interval is [(i − 1) · (n − 1)!, i · (n − 1)!), i = 1, 2, · · · , n. If w is in the j th sub-interval, then put n to the j th empty bin. Afterward, repeat the above process by replacing w with w − (j − 1) · (n − 1)!, and replacing n with (n − 1), and so on. As a result, the data in the bins consist of the permutation vector S0 . Specifically, 1: t ← n − 1, and let Bin[i] ← i, i ∈ {1, 2, . . . , n}. 2: if (j − 1) × t! ≤ w < j × t!, then k ← Bin[j], S0 [k] ← t + 1, Bin[j] ← Bin[j + 1], j = 1, · · · , n − t − 1, w ← w − (j − 1) × t! and t ← t − 1 3: Repeat the step 2, until t = 0. Table I is an example to illustrate the generation process of permutation vector, where the new vector S0 = {4, 2, 1, 3, 5} is mapped to integer w = 101.

step t 4 3 2 1 0

w∈ [4 · 4!, 5 · 4!) [0, 1 · 3!) [2 · 2!, 3 · 2!) [0, 1!)

1 4 4 4 4

2 2 2

3 1

4 3 3 3

5 5 5 5 5 5

new w 5 5 1 1 0

2 2 2 2 2 -

The process to map a vector into an integer is reverse to the process in Subsection II-A. Specifically, 1: t = n − 1, and w = 0; 2: if the maximum element in S0 is at the j th nonempty position, w ← w + (j − 1) × t!. Denote the position of S0 as empty. 3: Repeat the step 2, until t = 0. Table II illustrates the reverse process in Table I. From the vector S0 , the integer w is recovered successfully.

4 3 3 3 -

5 5 -

new w 0 4 · 4! = 96 96 + 0 · 3!=96 96 + 2 · 2! = 100 100 + 0 · 1!=100 100 + 1 · 0! = 101

A. Framework of Zero-Error Watermarking ZEW aims to produce a watermarked image which has no distortion to its original image for any decoder. Hence, we call these two images as equivalences. For example, if two image bitstreams can be decoded to the same bitmap image, they are equivalent. If each equivalence of a host signal is numbered, we regard that the number is the message embedded into the image. In other words, when an image is presented, its number is regarded to be the embedded message. Therefore, ZeroError Watermarking is different from previous watermarking schemes [5]–[14] in the embedding and extracting processes. Figure 1 describes the framework of the ZEW scheme which does not modify the host content but transforms the host into its equivalence. Therefore, how to find the equivalence of a signal is critical in ZEW. To this end, the present scheme exploits the Huffman tree which is able to be reconstructed from the original JPEG bitstream. The embedding modifies the leaves of the Huffman tree and outputs an equivalent JPEG bitstream, while the extractor is able to obtain the watermark from the equivalent JPEG bitstream. watermark w

JPEG

Embedding watermark

JPEG

Extracting watermark

watermark w'

Reconstructing Huffman Tree

Fig. 1.

B. Mapping vector permutation to integer

3 1 1 1 1 1 -

III. ZEW ON JPEG I MAGES

TABLE I S AMPLE EMBEDDING WITH w = 101 AND n = 5 step t 4 3 2 1 0

1 4 4 -

Framework for ZEW

B. Reconstructing Huffman tree According to [18], JPEG standard specifies the processes to compress an image into a bitstream 1 . These processes consist of DCT transform, quantization, RLE encoding, entropy encoding, and bitstream forming. The RLE encoding compresses the quantized DCT coefficients into some forms (e.g., symbol runksize and value for AC). The entropy encoding transforms the symbols into Huffman codeword. The JPEG bitstream consists of containers led by markers. The containers have 1 Indeed, JPEG standard specifies the de-compression algorithm. For ease of exposition, we explain it with counterpart compression.

two classes: header and body. The header part introduces some general information such as coder algorithm (either Huffman code or Arithmetic code), while the body data is the real visual content. As Huffman code is the most popular entropy encoding algorithm used in JPEG images, we will discuss Huffman code in this Section. Huffman table is defined in a container shown in Table III. TABLE III DHT sn 1 2 3 4 5

Field size 2 bytes 2 bytes 1 bytes count[16] symbols[]

MARKER FORMAT

Description the marker value (FFC416 ) the total length of the items 2-5 Table identifier and class 1 byte each, count[i] is the number of i-bit codes 1 byte each, sorted by Huffman code P the total size is 16 i=1 count[i]

Fig.2 shows a JPEG bitstream with two DHT markers. In the second DHT marker, the longest code is of 16 bytes, and there are 7716 = 162 16-byte codewords. Each symbol corresponds to a codeword. For example, the last byte (FA16 ) in Fig. 2 corresponds to a 16-byte codeword.

If we mark each edge between a parent node and its child node as 0 or 1, the marks of the whole path from root to a leaf node forms a Huffman codeword. Hence, the codeword uniquely identifies the leaf node whose value is a RLE symbol. In the above Huffman tree construction process, there are two marking options for each edge, and both options have the same code efficiency. As the codeword is inserted into the JPEG bitstream, different codeword will output different bitstream but same code efficiency and image quality. That is to say, if we regard one path between root node and leaf node as one number, we can embed that number into the bitstream with zero error and zero overhead. C. Embedding watermark For any watermarking scheme, it is important to find suitable content element (e.g., pixel or coefficient) to embed the information. In this Subsection, we focus on the leaf nodes in the Huffman tree only. Let all the symbols corresponding to l-bit codewords form a vector Vl =< v1 , v2 , · · · , vn >, where vi < vi+1 , i ∈ [1, n− 1]. Given a watermark w < n!, using the mapping algorithm in Subsection II-A, the embedor maps integer w into vector S0 =< s01 , s02 , · · · , s0n >. Therefore, the symbols of l-level Huffman leaf nodes form a vector V0 =< v10 , v20 , · · · , vn0 > where vi0 = vj , j = s0 [i]. The codeword assignment is simple: for each non-leaf node, just mark its left edge as 0, and its right edge as 1. The codeword for each symbol is the concatenation of edge marks starting from root to leaf. In the bitstream, replace the original codeword with the new codeword for the same symbol. Please pay attention that the JPEG bitstream can not have data FFXX16 where XX 6= 00. If the original bitstream have FF0016 , the new code should remove 00 if FF16 is replaced. Meanwhile, if the new bitstream adds FF16 , 00 must be added to follow it. At a result, the new JPEG image is embedded with the watermark w and is equivalent to the original JPEG image.

Fig. 2. Example Huffman Table led by DHT markers (FFC416 ). The JPEG bitstream has two Huffman tables.

D. Extracting watermark

Assume that the maximum length of codewords in a DHT marker is Lmax . If the codeword is of l-bits, the leaf node corresponding to the symbol is at l-level of Huffman tree. For 1 ≤ l ≤ Lmax , all the l-level nodes {vl , v2 , · · · , vn } should be the leaf nodes with the same depth in the Huffman tree. Thus, the tree can be built as

Given a JPEG bitstream, the extractor can obtain the Huffman tables according to the DHT markers similar to Fig.2. After re-constructing the Huffman tree, the extractor forms a vector Vl =< v1 , v2 , · · · , vn > with all the l-level leaf nodes from the leftmost leaf to the rightmost leaf. Construct a vector S =< s1 , s2 , · · · , sn >, s[i] = j if vi is the (n − j + 1)st largest symbol, for all i. Then, using the mapping algorithm in Subsection II-B, recove integer w with vector S.

1: Let l = Lmax , create an empty binary tree H. 2: Denote R as the set of l-level nodes which are not tagged in the tree H. Create an intermediate node which has two children nodes selected from set R. The intermediate node is of (l − 1)-level. 3: Repeat the step 2, until all the nodes in R have an (l − 1)-level parent node. 4: Let l ← l − 1, and repeat steps 2 and 3 until l = 0.

IV. D ISCUSSION A. Multiple Tables If there are two tables which includes la and lb entries, the present scheme can embed any message w ∈ [0, la !lb !]. To this end, we divide message w into w wa = w mod la !, wb = b c la !

Then, wa is embedded into the first table while wb is embedded into the second table. At the extractor side, after messages wa0 and wb0 are extracted from the tables independently, the complete message is recovered to be w0 = wb0 × la ! + wa0 . B. Quality As the embedding process merely re-orders the symbols of the same codeword-length in the original JPEG Huffman table, it does not introduce any distortion to the image quality. Thus, the watermarked image is the same as the original image. Clearly, any decoder is able to decode the watermarked bitstream to the original one, while a designated decoder can extract the watermark further. C. Embedding capacity If the number of k-byte codewords is Nk , the embedding capacity is log2 Nk bits. For example, the number of 16-byte codewords is 7716 = 162 in the Huffman table shown in Fig.2. Hence, those 16-byte codewords can be used to embed any message of no more than log2 162! ≈ 960 bits. Additionally, there are other resources in the JPEG bitstream which can be used to increase the watermarking capacity too. For example, many JPEG markers such as DQT (Define Quantization Table), COM (Comment) and DRI (Define Restart Interval) can appear anywhere (with conditions) in a JPEG file, the order of components, non-used DHT table items etc. D. Authentication application One application of the present scheme is to authenticate the image. Concretely, given a JPEG image, the image owner will embed the signature of the image as follows. • Denote D1 as all of the header information except the Huffman tables to be modified; • Decode the data into DCT coefficients (or RLE output). Let the decoded coefficients as D2 ; • Calculate h = SHA1(D1 k D2 ) with hash function SHA1(·), x k y is a concatenation of x and y; • Produce a signature w = Sign(h, sk) based on digital signature scheme Sign(·) with the private key sk, e.g., Elliptic Curve Digital Signature Scheme(IEEE P1363); • Regard the signature w as a watermark, and embed it into the Huffman tables based on the present scheme. In order to verify the authenticity of a JPEG image, the verifier will check the DCT coefficients as 0 • Denote D1 as all of the header information except the modified tables; • Decode the data into DCT coefficients (or RLE output). Let the decoded coefficients as D20 ; 0 0 0 • Calculate the hash value of the h = SHA1(D1 k D2 ); 0 • Extract the watermark w from the Huffman tables based on the present scheme. 0 0 • Run the verification algorithm Verify(w , h , pk) based on digital signature scheme Verify(·) with the private key pk which corresponding to sk. If the algorithm returns positive, the JPEG image is authentic, otherwise, it is tampered.

V. C ONCLUSION In most lossless watermarking schemes, an embedor inserts a watermark by manipulating the quantized DCT coefficients, while a designated detector is able to recover the original image. However, the watermarked image itself may have serious distortion if recovery process does not carry on. This paper proposes a zero-error watermarking (ZEW) which creates the equivalence of the original JPEG bitstream by reshuffling the Huffman Table leaf nodes according to the watermark. Because an equivalence has the same appearance as the original one, no recovery procedure is desired at the detector side. However, like almost all lossless watermarking scheme, ZEW is vulnerable to tampering. In other words, ZEW is a fragile watermarking. ACKNOWLEDGEMENT This work was supported by A*STAR SERC Grant No. 102 101 0027 in Singapore. R EFERENCES [1] I. J. Cox, J. Kilian, T. Leighton, and T. Shamoon, “Secure Spread Spectrum Watermarking for Multimedia,” IEEE Trans. on Image Processing, 6(12):1673-1687, 1997. [2] M. Goljan, J. Fridrich, and D. Rui, “Distortion-free Data Embedding,” Information Hiding Workshop, 2001. [3] M. Goljan, and D. Rui, “Invertible Authentication,” SPIE Photonics West, vol. 3971, Security and Watermarking of Multimedia Contents III, pp.197-208, 2001. [4] M. Celik, G. Sharma, A.M. Tekalp, and E. Saber, “Reversible Data Hiding,” International Conference on Image Processing, 2002. [5] J. Fridrich, M. Goljan, and R. Du, “Lossless Data Hiding for All Image Formats,” SPIE, Electronic Imaging 2002, Security and Watermarking of Multimedia Contents IV, vol.4675, pp.572-583, 2002. [6] J. Fridrich, M. Goljan, Q. Chen, and V. Pathak, “Lossless Data Embedding with File Size Preservation,” SPIE Electronic Imaging, Security and Watermarking of Multimedia Contents, 2004. [7] Xinpeng Zhang, Shuozhong Wang, Zhenxing Qian, and Guorui Feng, “Reversible Fragile Watermarking for Locating Tampered Blocks in JPEG Images,” Signal processing, 90(12):3026-3036, 2010. [8] Ziqiang Cheng, and Kee-Young Yoo, “A Reversible JPEG-to-JPEG Data Hiding Technique,” International Conference on Innovative Computing, Information and Control, pp.635-638, 2009. [9] Akira Shiozaki, Motoi Iwata, and Akio Ogihara, “Reversible Watermarking Method for JPEG Images,” IEICE - Transactions on Information and Systems, Volume E91-D Issue 7, pp. 2068-2071, 2008. [10] G. Xuan, Y.Q. Shi, Z. Ni, P. Chai, X. Cui, and X. Tong, “Reversible Data Hiding for JPEG Images Based on Histogram Pairs,” ICIAR, LNCS 4633, pp.715-727, 2007. [11] H. Sakai, M. Kuribayashi, and M. Morii, “Adaptive Reversible Data Hiding for JPEG Images,” ISITA, pp.1-6, 2008. [12] Wen-Chung Kuo, Shao-Hung Kuo, and Lih-Chyau Wuu, “High Embedding Reversible Data Hiding Scheme for JPEG,” International Conference on Intelligent Information Hiding and Multimedia Signal Processing, pp.74-77, 2010. [13] Qiming Li, Yongdong Wu, and Feng Bao, “A Reversible Data Hiding Scheme for JPEG Images,” Pacific Rim conference on Advances in multimedia information processing, Part I, 2010. [14] Bijan G. Mobasseri, Robert J. Berger, II, Michael P. Marcinak, and Yatish J. NaikRaikar, “Data Embedding in JPEG Bitstream by Code Mapping,” IEEE Trans. on Image Processing, 19(4):958-966, 2010. [15] J. Tian, “Reversible Data Embedding Using a Difference Expansion,” IEEE Trans. Circuits Syst. Video Technol., 13(8):890-896, 2003. [16] Yongdong Wu, “Zero-Distortion Authentication Watermarking,” International Conf. on Information Security, LNCS 2851, pp.325-337, 2003. [17] M. Kwan, Gifshuffle, http://www.darkside.com.au/gifshuffle/description. html, 2003. [18] John Miano, “Compressed Image File Formats: JPEG, PNG, GIF, XBM, BMP,” Publisher: Addison-Wesley Professional, 1999.

Suggest Documents