A Watermarking Algorithm Based on DCT and JPEG Quantization Table

In this paper, we propose a scheme of watermark embedding and extracting based on DCT transform and JPEG quantization table. Firstly, the image is divided into non-overlapping 8 × 8 blocks, and each block is transformed by DCT. Then, a pair of points with the same quantization value is selected by the JPEG quantization table in order to embed one watermark bit, and the adjustment coefficients are adaptively selected by using the visual masking property of HVS. The experimental results presented in this paper showed that our proposed algorithm is robust to JPEG compression under different quality factors.


Introduction
With the rapid development of science and technology, information transmission has become more and more convenient, but the protection of information in the transmission process has also become the primary issue. Digital watermarking technology is an effective way to solve this problem, and it is able to protect information security, achieve security traceability and copyright protection [1][2][3][4]. Some identification information (digital watermarking) is directly or indirectly embedded into the digital carrier, and does not only affect the value of the original carrier, but is also uneasy to be detected or modified. And it can be easily recognized and identified by the manufacturer. According to the hidden information we extracted, we can achieve the purpose of confirming the content creators and buyers, sending secret information and judging whether the carrier has been tampered with.
With the increasing of the image quality and size, the burden of the transmission is increased when the watermarked image needs to be transmitted to the receiver. In order to reduce the load of the channel and increase the speed of information transmission, image compression becomes an essential part of image transmission. In the existing compression technology, JPEG compression is widely used in the field of image and video processing because of its good compression performance and good reconstruction quality. Therefore, if the image is compressed by JPEG, whether the embedded watermark information can be effectively extracted becomes a problem that should be considered in the watermarking algorithm [5][6][7].
In order to improve the quality of the extracted watermark from the watermarked image after JPEG compression, this paper proposes a watermarking scheme based on JPEG quantization table. Considering the security of the watermark, the watermark image is firstly scrambled with K times Arnold transform [8,9]. Moreover, in order to improve the robustness of the algorithm, the image is divided into non-overlapping 8 × 8 blocks, and each block is transformed by DCT [10][11][12]. And then, we select the intermediate frequency coefficients of each block to embed one watermark bit using the adjustment coefficients which are calculated by the visual masking property of HVS [13,14]. The experimental results show that, comparing with the watermarking algorithm which does not use the JPEG quantization table [15], the algorithm we proposed in this paper has better quality of the extracted watermark under different quality factors of JPEG compression, and the quality of the watermarked image is also not weaker than the other algorithms'.
The rest of this paper is as follows: Section 2 introduces the related technologies used in this paper. Section 3 introduces the watermark embedding and extracting algorithm. Section 4 is the experimental result, and the last Section 5 concludes the full paper.

Related technologies
In this paper, the watermark image is firstly scrambled by K times Arnold transform, and the K is used as the key to the receiver of the image, so that the watermark cannot be restored to the original image even if the watermark is extracted. Then, the image is divided into nonoverlapping 8 × 8 blocks, and each block is transformed by DCT. After that we select the appropriate watermark embedding position and using the JPEG quantization table. After the watermark bit is embedded, the adjustment coefficients calculated by the HVS's visual masking property are used to adjust the embedding points to ensure the robustness and transparency of the image.

Arnold transform
Arnold transform which is also called Cat transform, is a kind of transformation which is proposed by Arnold in ergodic theory. Cat mapping can substitute each pixel position in the image to achieved the encryption, and is widely used in digital image scrambling. And Arnold transform is periodic, when the iteration is integer times of the cycle, the image can be restored to the original image. Therefore, if we use an iterative time K as a key, the image can only be restored with the key value. So that it greatly improves the security of image.
For an N × N digital image, the two-dimensional Arnold transform is defined by: where, ‫,ݔ‬ ‫ݕ‬ ∈ {0,1,2, ⋯ , ܰ − 1} is the pixel position before the transform ‫ݔ(‬ ᇱ , ‫ݕ‬ ᇱ ) is the position after the transform and mod is for modular arithmetic.

Discrete cosine transform
Discrete Cosine Transform (DCT) is the best orthogonal transformation obtained in the minimum mean square error conditions. It utilizes the character of the Fourier transform, use image edge fold to transform the image into even function form. And then transform the image by the two-dimensional Fourier. After transformation the image contains only cosine terms, so called the process discrete cosine transform.
The two-dimensional DCT transform is defined by: The corresponding inverse 2D DCT transform is given by:

JPEG quantization table
JPEG quantization table is used in the quantization process of JPEG compression, which is divided into luminance quantization table (Table 1) and color  quantization table (Table 2). Because the grey image is processed in this paper, only the luminance quantization table is considered. The algorithm proposed in this paper considers the JPEG luminance quantization table in the watermark embedding process. For each 8 × 8 block after DCT transform, we select a pair of coefficients which has the same value in the quantization table as the watermark embedded bits, so that the embedded watermark has good robustness to JPEG compression.

Visual masking property of HVS
In the process of watermark embedding, it is important to select the watermark adjustment coefficient. The greater the value is, the higher robustness of the watermark has, but the transparency of the watermark image will be relatively poor, and vice versa.
Usually in the digital watermarking technology, the following characteristics of the human visual system are used Firstly, the human visual sensitivity to the different brightness regions is different, usually on the middle grey was the most sensitive. In the wide range of medium scale, Weber Ratio is a constant 0.02, and decreases to the low and the high grey area. We suppose the maximum contrast sensitivity is ߚ, the current block is ‫,ݔ(ܤ‬ ‫,)ݕ‬ and the luminance average is ‫,ݔ(݁ݒܣ‬ ‫,)ݕ‬ so that the masking factor of the different brightness to noise ‫,ݔ(ݓ‬ ‫)ݕ‬ is defined by: where, I 1 and I 2 are the pre-set thresholds, which are 80 and 160 in this paper.
Secondly, the human eye is more sensitive to the smooth area than the texture region. Experimental results show that the smooth region entropy is smaller, while the DOI: 10.1051/ , 01033 (2017) texture region has larger entropy. Therefore, the entropy of each block is used to represent the texture masking factor. We suppose ‫,ݔ(ݕݎݐ݊ܧ‬ ‫)ݕ‬ is the entropy of the block ‫,ݔ(ܤ‬ ‫)ݕ‬ , and normalized it into [ܽ, ܾ], so that the texture masking factor ‫,ݔ(݁‬ ‫)ݕ‬ can be calculated by: where, ܽ and ܾ are the pre-set thresholds, which can affect the robustness and transparency, usually ܽ, ܾ ∈ [1,8].
Integrated the analysis from (4) and (5), each block's noise masking factor (the adjustment coefficient used in this paper) of the image can be expressed by: 3 Embedding and extracting

Watermark embedding
The embedding process is depicted as follows: Step 1. Watermark information pre-treatment: Use ‫ܭ‬ as the key, and the watermark image is scrambled by ‫ܭ‬ times Arnold transform.
Step 4. DCT: Use DCT to transform each block.
Step 5. Watermark embedding: Select a pair of coeffic-ients ‫ݔ(1ܥ‬ ଵ , ‫ݕ‬ ଵ ) and ‫ݔ(2ܥ‬ ଶ , ‫ݕ‬ ଶ ) which has the same value in the quantization table, and use the following algorithm to embed one watermark bit.
Step 6. IDCT: Use IDCT to transform each embedded block to get the watermarked image.

Watermark extracting
The extracting process is depicted as follow: Step 1. Image segmentation: Divide the watermarked image into non-overlapping 8 × 8 blocks.
Step 2. DCT: Use DCT to transform each block.
Step 3. Watermark extracting: According to the coeffi-cients we used in the embedding process ‫ݔ(1ܥ‬ ଵ , ‫ݕ‬ ଵ ) and ‫ݔ(2ܥ‬ ଶ , ‫ݕ‬ ଶ ) , use the following algorithm to extract one watermark bit.

Experimental results
In this Section, we use the 512 × 512 grey-scale images of Lena as the carrier image ‫,ܫ‬ and the 64 × 64 binary image of "Watermark Information" in Chinese as the watermark ܹ. And c and d are 10 and 20 respectively.
The peak signal to noise ratio (PSNR) and the normalized correlation (NC) are computed in order to evaluate the performance of watermarking scheme. The PSNR is used to estimate the visual perception between the watermarked image and the original image. And the NC is used to estimate the quality of the watermark extracted from the image under JPEG compression with the original watermark. PSNR and NC are defined equation (7) and (9). The original image and the watermarked image are shown in Fig. 1 and Fig. 2 respectively, and Fig. 3 and Fig. 4 show the original watermark and the watermark extracted from the watermarked image respectively. Their PSNR and NC are provided in Table 3.    From the image and the data above, the proposed algorithm can guarantee the transparency of the watermarked image and extract the watermark with good quality.
Experimental evaluation of the robustness of the proposed algorithm compared with Xiong et al. [15], Gu et al. [16], Zhao et al. [17], AR et al. [18] under different quality factor of JPEG compression, are shown in Table 4. In the table below, before the '/' is the value of PSNR, and after '/' is that of NC. The variable ‫݁ݒܣ‬ stands for average of PSNR and NC respectively.