Fast and Automatic Watermark Resynchronization based on Zernike Moments Xiangui Kang a, Chunhui Liu a, Wenjun Zeng b, Jiwu Huang a, Congbai Liu a a Dept. of ECE., Sun Yat-Sen Univ. (Zhongshan Univ.), Guangzhou 510275, China. b Dept. of CS, University of Missouri-Columbia, MO65211, USA. ABSTRACT In some applications such as real-time video applications, watermark detection needs to be performed in real time. To address image watermark robustness against geometric transformations such as the combination of rotation, scaling, translation and/or cropping (RST), many prior works choose exhaustive search method or template matching method to find the RST distortion parameters, then reverse the distortion to resynchronize the watermark. These methods typically impose huge computation burden because the search space is typically a multiple dimensional space. Some other prior works choose to embed watermarks in an RST invariant domain to meet the real time requirement. But it might be difficult to construct such an RST invariant domain. Zernike moments are useful tools in pattern recognition and image watermarking due to their orthogonality and rotation invariance property. In this paper, we propose a fast watermark resynchronization method based on Zernike moments, which requires only search over scaling factor to combat RST geometric distortion, thus significantly reducing the computation load. We apply the proposed method to circularly symmetric watermarking. According to Plancherel's Theorem and the rotation invariance property of Zernike moments, the rotation estimation only requires performing DFT on Zernike moments correlation value once. Thus for RST attack, we can estimate both rotation angle and scaling factor by searching for the scaling factor to find the overall maximum DFT magnitude mentioned above. With the estimated rotation angle and scaling factor parameters, the watermark can be resynchronized. In watermark detection, the normalized correlation between the watermark and the DFT magnitude of the test image is used. Our experimental results demonstrate the advantage of our proposed method. The watermarking scheme is robust to global RST distortion as well as JPEG compression. In particular, the watermark is robust to print-rescanning and randomization-bending local distortion in Stirmark 3.1. Keywords: Watermarking, Resynchronization, Robustness, Geometric distortion, Zernike moments 1. Introduction In some applications such as real-time video applications, watermark detection needs to be performed in real time. There are two general approaches to address image watermark robustness against geometric transformations such as the combination of scaling, rotation and translation (RST). One is to do exhaustive search [1] or template matching [2, 3] to find the RST distortion parameters, and then reverse the distortion to resynchronize the watermark. This approach, isskxg@mail.sysu.edu.cn, zengw@missouri.edu, isshjw@ mail.sysu.edu.cn Security, Steganography, and Watermarking of Multimedia Contents IX, edited by Edward J. Delp III, Ping Wah Wong, Proc. of SPIE-IS&T Electronic Imaging, SPIE Vol. 6505, 65050E, 2007 SPIE-IS&T 0277-786X/07/$18 SPIE-IS&T/ Vol. 6505 65050E-1
however, introduces huge computation load because the search space is multiple dimensional, e.g., including scaling parameter γ, rotation parameter θ, translation parameter x, y. Another general approach is to embed watermark in an RST invariant domain [4]. This approach has the advantage that watermark detection can be done in real time. But it might be difficulty to construct such an RST invariant domain. Zernike moments are useful tools in pattern recognition and image watermarking due to their orthogonality and rotation invariance property [5-9]. In [5], a watermarking scheme is proposed that achieves invariance to rotation, but is not robust to RST distortion in general. In [6], watermark rotation invariance is achieved by taking into account the magnitude of the Zernike moments. Image normalization method is used for scale and translation invariance, that is, the origin of a test image is moved to its centroid, and is scaled to a standard size before watermark detection. This in general is not sufficiently robust as, for example, image cropping may cause a deviated centroid with respect to the normalized original image, and thus cause a scale distortion with respect to the normalized original image when they are scaled to the same standard size. As a result, the watermark can not be robust to RST distortion. In this paper, we propose a new watermark resynchronization method using Zernike moments, which requires only search over scaling factor to address RST transformations, thus the computation load can be dramatically reduced. We apply the proposed method to circularly symmetric watermarking [1]. The circularly symmetric watermark is embedded in the Discrete Fourier Transform (DFT) domain, which achieves translation invariance. According to Plancherel's Theorem and the rotation invariance property of Zernike moments, the rotation estimation only requires performing DFT on Zernike moments correlation value once. Thus for RST attack, we can estimate both rotation angle and scaling factor by simply searching for the scaling factor. With the estimated rotation angle and scaling factor parameters, the watermark can be resynchronized. For watermark detection, the normalized correlation between the watermark and the DFT magnitude of the test image is used. We demonstrate the advantage of our proposed method through simulations. The proposed watermarking scheme is robust to global RST distortion as well as JPEG compression. In particular, the watermark is robust to print-rescanning and randomization-bending local distortion in Stirmark 3.1 [10]. In the next section, Zernike moments is introduced. We present our watermarking scheme in Section 3. Simulation results are shown in Section 4. We provide some discussions and concluding remarks in Section 5. 2. Zernike Moments The Zernike basis [6, 8] is a set of complex polynomials which form a complete and orthogonal set on the unit disk. The form of these polynomials is defined as: jm V ( x, y) = V ( ρθ, ) = R ( ρ) e θ (1) where 2 2 ρ = x + y, θ = arctan( y/ x), n is a non-negative integer; m is an integer subject to the constraint that n- m is even, and m n, the radial Zernike polynomial R ( ρ ) is defined as follows: R ( n m )/2 s n 2 s n+ 1 ( 1) ( n s)! ρ ( ρ) = (2) π n+ m n m s= 0 s!( s)!( s)! 2 2 SPIE-IS&T/ Vol. 6505 65050E-2
These polynomials are orthogonal and normal basis, satisfy: * [ V( x, y)] Vpq ( x, y) dxdy = δ x y npδmq 2 + 2 1 With 1 { a = δ b ab 0 otherwise =. The Zernike moment of order n with repetition m for an analog image function f(x, y) is defined as: 2 x + y 2 1 * A f( x, yv ) ( x, y) dxdy where * denotes complex conjugate. For digital image, the integrals should be substituted with summations: = (3) * 2 2 f ( x, y) V ( x, y) dxdy, + A = x y 1 (4) x y 3. Proposed Scheme We describe our proposed watermarking scheme in details in this section. A: Watermark Embedding Let f(x, y) be an N N grayscale image, its Discrete Fourier Transformation (DFT) can be given as follows: N 1 N 1 j2π ( xk1/ N+ yk2/ N) e 1 2 2 x= 0 y= 0 = (5) Fk (, k) f( xy, ), k1, k [1, N ] Let M(k 1,k 2 ) = F(k 1,k 2 ) be the magnitude of F(k 1,k 2 ). Similar to [1], we design a circularly symmetric watermark that will be embedded in the DFT domain. We choose a binary antipodal pseudorandom sequence as the watermark 80 120 180 240 300 380 Fig. 1. The watermark Fig. 2. The value of c Z obtained by performing FFT on F(m). SPIE-IS&T/ Vol. 6505 65050E-3
sequence, which is composed of 1s and -1s. The watermark possesses a ring disk (R 1 R R 2 ) (Fig.1). 2 2 W( k1, k2) =± 1, if R1 k1 + k2 R2, otherwise W( k1, k 2) = 0. The ring disk is separated into (R 2 - R 1 )/3 homocentric sub-rings uniformly, and each sub-ring is divided into 120 sectors evenly. In each sector, the value of watermark is the same (1 or -1) as shown in Fig.1. We use keys to generate different watermarks. The watermark is embedded in the middle frequency band, thus it is expected to be robust and invisible. The embedding formula can be expressed as follows: M '( k, k ) = M( k, k )(1 + aw( k, k )) (6) 1 2 1 2 1 2 where M (k 1, k 2 ) is the modified magnitude of DFT, W(k 1,k 2 ) is the watermark, and a is the embedding strength. In order to ensure that the IDFT of the modified magnitude is real, the watermark must preserve the following symmetry property: W( k, k ) = W( N + 1 k, N + 1 k ), k, k [1, R ] (7) 1 2 1 2 1 2 2 B. Watermark detection Let M be the DFT magnitude of the test image. The correlation c: R2 R2 c = M '( k, k ) W( k, k ) (8) k1= 1k2= 1 1 2 1 2 can be used to detect the watermark. Assuming that W and M are independent and identically distributed random variables, W has zero mean value. The mean value µ c of c is given by µ = Kaµ if the test image is watermarked c M with W; otherwise µ c =0. The variance σ c of c is given by σ = K[ µ + σ (1 + a )] if the test image is watermarked 2 2 2 2 C M M with W; otherwise σ = K[ µ + σ ] [1]. Here 2 2 2 C M M K = π ( R R ), M 2 2 2 1 µ is the mean value of M(k 1,k 2 ), σ is the M variance of M(k 1,k 2 ). In practice, we use normalized correlation value c = c / µ, and we can use µ M instead of µ M [1]. We generate 500 different watermarks by a random number generator with different keys, which have been selected to have near zero mean value, then embed them in the Lena image respectively. We then calculate the normalized correlator output c n between the watermark and the DFT magnitude of the watermarked Lena image. The distribution of c n is shown in Fig. 4 in red. The normalized correlator output c n between the watermark and the DFT magnitude of the unwatermarked Lena is shown in Fig. 4 in green. Fig. 5 is the distribution of c n for the Baboon image. We choose a threshold T=0.17 empirically. If c n 0.17, it is concluded that the watermark W(k 1,k 2 ) is present in the test image; otherwise the test image might have undergone geometric distortion, so the watermark should be resynchronized before performing watermark detection. If c n <0.17 after watermark resynchronization, we conclude that the watermark is not present in the test image. n c SPIE-IS&T/ Vol. 6505 65050E-4
C. Fast watermark resynchronization based on Zernike moments The image may potentially undergo a combination attack of rotation, scaling, translation and cropping (RST distortion). DFT has the shift invariance property, so image translation has no impact on the watermark. Rotation in the spatial domain by an angle causes rotation in the DFT domain by the same angle. Scaling in the spatial domain causes inverse scaling in the frequency domain, as illustrated below 1 1 2 DFT[ f ( sx, sy)] = F( k, k ) (9) 2 s s s In order to resynchronize the watermark, the rotation and scaling distortion in the DFT domain should be reversed. An exhaustive two dimensional search for rotation and scaling parameters by searching for the maximum correlation value c may be performed [1]. But it introduces a heavy computation load. According to orthogonality of Zernike basis and Plancherel's Theorem [11], we have: M ' W * A ( A ) = '(, ) (, ) M k k W k k 1 2 1 2 (10) n m k1 k2 where A M ' denotes the Zernike moment of M (k 1,k 2 ), and A denotes the Zernike moment of W(k 1,k 2 ), * denotes W complex conjugate. In other words, the correlation between M (k 1,k 2 ) and W(k 1,k 2 ) is equal to the correlation between their Zernike moments. So the search for the maximum correlation value c corresponds to the search for the maximum correlation between their Zernike moments. We take a look at a test image M t (k 1,k 2 ) which has undergone a rotation by α degree. According to the property of Zernike moments [6], the Zernike moments of M t (k 1,k 2 ) is: t jmα A Ae = (11) Equation (11) shows that each Zernike moment acquires a phase shift due to rotation. Now we search for the maximum Zernike moments correlation through rotating M t (k 1,k 2 ) by an angle of φ. The Zernike moments correlation c Z between the rotated M t (k 1,k 2 ) and W(k 1,k 2 ) may be calculated as c = = Z Fm ( ) t t M jmϕ W * M W * jmϕ = ( ) = ( ) n m n m M W * ( A ( A ) ) e m n m e A e A A A e t jmϕ M W * Where Fm ( ) = A ( A ) and φ [0, 360º]. Obviously, c Z is a one-dimensional DFT of F(m). According to n t Equation (10-12), searching for the maximum correlation value c through rotating the test image by different angles may be substituted by performing FFT on F(m), then find its maximum value. In Fig. 2, the x-axis denotes the rotation degree, and the Y-axis denotes c Z. We calculate the F(m) of M t (k 1,k 2 ), perform FFT on F(m), and obtain the value of c Z. In Fig. 2, there are two maximum c Z values due to the symmetric property of DFT. We can conclude that the test image has undergone a 10º (or 190º) rotation according to the maximum value of c Z. According to Eq. (10), the maximum value of jmϕ (12) SPIE-IS&T/ Vol. 6505 65050E-5
c Z corresponds to the maximum correlation c. Thus we propose a new method that uses Fast Fourier Transform (FFT) to locate the rotation parameter based on the maximum Zernike moment correlation. If the image undergoes rotation combined with cropping and scaling attack, We only need to perform a numerical search over the scaling factor [1], while the rotation parameter can be determined simultaneously by performing FFT on F(m). We perform search for the maximum c Z between the watermark and a ring of DFT magnitude M t (k 1,k 2 ) of the test image whose size is bounded by γr 1 (inner radius) and γr 2 (outer radius) for every γ (0<γ<1). The flowchart for resynchronization is illustrated in Fig. 3. test image FFT2 M t (k 1,k 2 ) Frequency resample in different step Zernike Moment correlation Reverse rotation and scale Roation and scale parameter find maximum c Z FFT F(m) Fig. 3. The flowchart of watermark resynchronization 02 04 08 08 12 Fig. 4. Distribution of the normalized correlator output for unwatermarked Lena (left) and watermarked Lena (right) with 500 different watermarks. 70 80 80 0 40 0 30 0 20 ID L -0.2 0 0.2 0.4 0.8 0.8 I 1.2 Fig. 5. Distribution of the normalized correlator output for unwatermarked Baboon (left) and watermarked Baboon (right) with 500 different watermarks. SPIE-IS&T/ Vol. 6505 65050E-6
(a) Fig.6. (a) Original Lena of size 512 512 (b) (b) Watermarked Lena (PSNR: 38.8dB) -F "i:: L: '9..- - (a) Fig.7. (a) Original Baboon (512 512) (b) Watermarked Baboon (PSNR: 34.7dB). (b) 4. Simulation Results We applied the proposed scheme on many images. We report some representative results here. In our work, we choose α=0.3, R 1 =52, R 2 =128, and the watermark is a 1560 bits pseudorandom sequence generated by a random number generator with a key. We use Zernike Moments lower than 41 order in this paper. Fig. 6 shows the original Lena image and the watermarked Lena image. The Peak Signal-to-Noise Ratio (PSNR) of the watermarked Lena image is 38.8dB. Fig.7 shows the original Baboon image and watermarked Baboon image. The PSNR of the watermarked Baboon image is 34.7dB. The watermark is robust to JPEG compression, anisotropic cropping and scaling etc. In particular, the scheme is robust to RST geometric distortion, print-rescanning, randomization-bending (RB) in Stirmark 3.1 etc. SPIE-IS&T/ Vol. 6505 65050E-7
.,_-c- 7', < (a) (b) (c) ioj 0.2 00 00-0.06 0 0.06 0.1 0.16 0.2 0.26 0.1 0 46 Fig. 8. (a) JPEG-50 and RST distorted Lena image. (b) JPEG-50 and RST distorted Baboon image. (c) The distribution of the correlation output for the unwatermarked RST distorted Lena image and watermarked RST distorted Lena images with 500 watermarks; (d) The distribution of the correlation output for the unwatermarked RST distorted Baboon image and watermarked RST distorted Baboon images with 500 watermarks. (d) (a) Normalized correlator output value c n =0.59 (b) c n =0.47 Fig. 9. Printing and rescanning watermarked image SPIE-IS&T/ Vol. 6505 65050E-8
Fig. 8 (a) and (b) show the test images that have undergone a combination of JPEG compression with quality factor of 50 (JPEG-50) and RST distortion. The watermark resynchronization is performed first, then the normalized correlation value c n is calculated. The test results are shown in Fig. 8 (c) and (d) respectively. For 500 different watermarks which are generated using different keys, the watermarks can all be detected. The empirical false positive rate and false negative rate for this combination attack is 0 for 2000 times tests shown in Fig. 8 (c) and (d). Fig. 9 shows the print and rescanning watermarked Lena images. Note that the image in Fig. 9 (b) is with slight rotation and scaling. The normalized correlation value c n is 0.59 and 0.47 for these two images respectively. It is noted that the watermark is also robust to randomization and bending distortion (Fig. 10) in Stirmark 3.1 [11]. Fig. 11 is the distribution of the correlation output for 1000 unwatermarked RB distorted images and 1000 watermarked RB distorted images. The empirical false positive rate for RB is 0, while empirical false negative for RB is 0.017. Fig. 10 Stirmark_random_bend distorted Lena image 90-80 70 0 80 0 00 40 0 30 20 ID -02 -DI 0.1 0.1 0.3 00 Fig. 11. The distribution of the correlation output for 1000 unwatermarked RB distorted images and 1000 watermarked RB distorted images. 5. Discussion and conclusions We only need to compute Zernike basis V once in our proposed scheme. Zernike Moments may be computed via an efficient method as proposed in [9]. Once R 2 is fixed, V may be stored in a lookup table to further save computation. In our proposed scheme, we use 3º sector, and the watermark can be detected after a rotation of ± 1º. Using the exhaustive search method used in [1] to detect the watermark, one needs 180 times 2D-Matrix rotation interpolation. SPIE-IS&T/ Vol. 6505 65050E-9
While using our proposed method, one needs only one-time rotation interpolation. Thus computation time of the proposed scheme is about 1/180 of the exhaustive search method [1]. We take a look at a 512 512 watermarked image is rotated by an angle, cropped to 452 452 (a cropping of more than 22%), then scaled back to 512 512 (Fig. 8a). The number of changing the scaling factor search depends on the cropped image portion. If the search step is 6, the total number of searches is (512-452)/6+1=11. So the watermark resynchronization calculation is very fast. The main contribution of this paper is that we propose a fast automatic watermark resynchronization method based on Zernike moments. With the proposed scheme, the watermark can be detected automatically within very reasonable time even if the watermarked images undergo the global RST distortion or printing-rescanning or local RB distortion. Reference [1] Vassilios Solachidis and Ioannis Pitas, Circularly Symmetric Watermark Embedding in 2-D DFT Domain, IEEE Transaction on Image Processing, vol. 10, No. 11, November 2001. [2] S. Pereia and T. Pun, Robust template matching for affine resistant image watermarks, IEEE Trans. Image Processing, vol. 9, pp.1123 1129, 2000. [3] X. Kang, J. Huang, and Y. Q. Shi, Y. Lin: A DWT-DFT composite watermarking scheme robust to both affine transform and JPEG compression. IEEE Trans. on Circuits and Systems for Video Technology, vol. 13, no. 8, pp. 776-786, Aug. 2003. [4] J. J. K. O Ruanaidh and T. Pun, Rotation, scale, and translation invariant spread spectrum digital image watermarking, Signal Processing, vol. 66, pp. 303 317, 1998. [5] M. Farzam and S. Shahram Shirani, A robust multimedia watermarking technique using Zernike transform, in Proc. IEEE Int. Workshop Multimedia Signal Processing, 2001, pp. 529 534. [6] H. S. Kim and Heung-Kyu Lee, Invariant Image Watermark Using Zernike Moments, IEEE Transaction on Circuits and Systems for Video Technology, vol. 13, No. 8, August 2003. [7] C. H. Teh and R. T. Chin, On image analysis by the methods of moments, IEEE Trans. Pattern Anal. Machine Intell., vol. 10, pp. 496 513, Apr. 1988. [8] A. Khotanzad and Y. H. Hong, Invariant image recognition by Zernike moments, IEEE Trans. Pattern Anal. Machine Intell., vol. 12, pp. 489 497, May 1990. [9] Gholam Reza Amayeh, Ali Erol, George Bebis, and Mircea Nocolescu, Accurate and efficient computation of high order Zernike moments, International Symposium on Visual Computing, LNCS, vol. 3804, Lake Tahoe, NV, December 2005. [10] F. A. P. Petitcolas, R. J. Anderson, and M. G. Kuhn, Attacks on copyright marking systems, in Proc. 2nd Int.Workshop Information Hiding,, pp. 218 238, 1998. [11] Bracewell, R. "Rayleigh's Theorem." The Fourier Transform and Its Applications. New York: McGraw-Hill, pp. 112-113, 1965. Acknowledgments Authors appreciate the support by NSFC (60403045, 90604008, 60633030), 973 Program (2006CB303104), NSF of Guangdong (04205407, 04009742), NSF of Guangzhou (2006Z3-D3041). SPIE-IS&T/ Vol. 6505 65050E-10