High-capacity and Robust Image Watermarking Algorithm


 With the development of internet, digital media can be manipulated, reproduced, and distributed conveniently over networks. However, illegal copy, transmission and distribution of digital media become an important security issue. In this paper, we propose a high-capacity and robustness method based on discrete wavelet transforms(DWT) and optimal discrete cosine transforms(DCT). We present two approaches, they are: DWT-ODCT(high-capacity and robust image watermarking algorithm based on DWT and optimal DCT), and(P-DWT-ODCT) high-capacity and robust image watermarking algorithm based on DWT and optimal DCT by watermark preprocessing. The watermark image is preprocessed by halftone and quad tree techniques, and the position information about the content is extracted as the actual embedded value. The cover image is transformed by DWT and optimal DCT, which provides high imperceptibility and the least image distortion. Watermark bits are not directly inserted into the frequency coefficient, but embedded by modifying the coefficient according to some rules. With this method, regardless of the approach used, our study are higher capacity and robustness than the existing schemes. The watermark extraction produces high image quality after a variety of attacks.


Introduction
With the rapid development of network technology, the illegal copy, transmission and distribution of multimedia information have become an important security issue. This issue has caused research on image authentication and copyright protection. Digital watermarking is regarded as a solution to prevent illegal copying, which has attracted widespread attention [1]. Generally, watermarking is divided into spatial domain and transform domain. The methods of spatial domain directly embed the watermark into the cover image. The calculation speed is faster and the amount of embedding is higher, but the attack resistance and noise robustness are poor [2][3][4]. Watermarking techniques based on frequency domains with the transformations such as DWT, DCT and discrete Chedyshev transform [5][6][7][8][9][10][11]. These methods usually have good robustness, and against numerous known attacks. However, usually cannot achieve high-capacity watermark embedding.
Quick response code(QR) has the characteristics of large capacity and self-correction. By scanning QR, we can quickly obtain the information it carries. Therefore, using QR as a watermark can not only increase the effective embedding amount, but also enhance various resistances to attack [12].
Reliable digital watermarking technology needs to have some characteristics, such as: imperceptibility, robustness, undetectability, security and bind extraction. When a separate frequency domain transform is used, the performance of watermark information imperceptibility and robustness is poor, and the time complexity is also high. [13] adopted DWT and DCT transformation. During noise attack, the image quality was poor, and the effective amount of watermark embedding was low. [11] makes full use of the advantages of each frequency domain transform and improves the calculation speed of [13]. [7] has a greater breakthrough in computational complexity. The problem of poor imperceptibility of the algorithm is alleviated, and the quality of the reconstructed image is improved. [14] adopted QR and DCT, which committed to improving the effective embedding of watermark, and also improved when resisting compression and filtering attacks. However, the image quality is poor during noise attack. [6] made improvements to [14] by fusing QR code, chaotic system and DWT-DCT. In [6], in order to ensure the security of the watermark, the watermark was scrambled before embedding. Due to the redundancy of multimedia information, Seyyed Hossein Soleymania [15] improved to filter out the background part of the text document, which provides a new idea for improving the effective embedding of watermarks.
This paper presents two algorithms of digital watermarking based on discrete wavelet transforms(DWT) and optimal discrete cosine transforms(DCT). The watermarks are divided into QR and binary logo image . When the background information of the watermark is scarce, the cover image is decomposed into first level DWT, and low frequency band(LL) is transformed by optimal DCT. The watermark is embedded into selected coefficients. The results demonstrate the proposed approach is able to withstand different types of attacks. When there is a lot of redundant information in the watermark, the watermark is preprocessed by halftone and quad tree techniques, and the position information of the content is extracted as the actual embedded value. In this way, the watermark information is one-dimensional and is embedded into selected coefficients. The proposed approach can satisfy high capacity, imperceptibility and robustness requirements of the watermarking system.
The rest of this paper is organized as follows. Section Ⅱ gives an overview of related work on watermarking algorithms. Then, the proposed methods are described in detail in Section Ⅲ.Experimental results and analysis are provided in Section Ⅳ. Finally, the conclusion is drawn and future work is proposed in Section Ⅴ.

Related works
At present, in order to improve the imperceptibility and robustness of the watermarked images, many researchers work on the hybrid watermarking techniques based on frequency and matrix decomposition. In 2011, Lai [9] proposed a novel watermarking scheme based on the human visual system with singular value decomposition ) of the image. The watermark bits were embedded by modifying U3,1 and U4,1 coefficients from the hybrid DCT-SVD. This method reportedly got better performance in terms of robustness under numerous known attacks. However, the embedding capacity was still insufficient, the robustness of watermarked image needs to be enhanced. Hence, in 2018, Ferda Ernawan [8] proposed a new embedding technique by examining certain DCT coefficients in the middle frequency based on a psychovisual threshold. Embedding regions were selected based on the lowest modified entropy value of the image blocks. The watermark bits are embedded by modifying the coefficient according to some rules. This scheme reportedly provides an optimal threshold T( 016 . 0  T ) for Lai's scheme. This method reportedly got better performance than Lai's method in the aspect of robustness under numerous attacks. However the embedding capacity was still insufficient, and the performance on resisting rotational attacks was not satisfactory.
Amit Kumar Singh et al. [11] proposed a watermarking scheme based on DWT-DCT-SVD. This scheme has been extensively tested against numerous known attacks and can satisfy the both imperceptibility and robustness requirements of the watermarking system. The cover image was decomposed into first level DWTs, and Low frequency band (LL) was transformed by DCT and SVD. The watermark image was also transformed by DCT and SVD.
The first level decomposition has some advantages such as the watermark embedding was maximized, and the extracted watermarks were more textured with better visual quality. However, when the watermark was embedded in the LL, the imperceptibility was poor.
Frequency domain transformation limits the effective embedding of watermark . QR codes have the advantages of high-capacity and self-correction, so they have become a hot issue in watermark research [6,14]. In 2014, Kang Qingbo et al. [14] combined the QR code and the DCT transformation, embedding the QR code in the cover image. This scheme greatly improved the effective embedding amount of the watermark .However, it is less effective against resisting noise attacks. In 2018, Xu Jiangfeng et al. [6] made improvements to [14]. The QR code was encrypted by a chaotic system, and the cover image was transformed by DWT-DCT. The robustness of the algorithm was enhanced, but the calculation complexity needed to be further improved.
In [15], the scanned text documents and letters were considered as the input message. They could be converted to a sparse message through halftone and quad tree. By considering the message as a sparse form, the high-capacity steganography could be presented to hide the message with large size. The halftone image was got by scanned document and the sparse message was obtained. The content was separated from the background by improved quad tree scheme. The coordinates of content were reserved, and they would be embedded in three low importance pixels of the cover image. This provides us with a new watermarking technology solution. The watermark was proposed by halftone and quad tree technology, and the coordinates of the content was reserved. The watermark is transformed into one-dimensional information, which improves the security of the algorithm. This method improves the effective embedding amount of watermark, and also ensures the robustness of the algorithm.
In our study, the watermark is proposed by halftone and quad tree technology, and the cover image was transformed by DWT and optimal DCT. The watermark bits were embedded by modifying the coefficient according to some rules. The proposed technique has been tested under different types of attacks. The results have been verified with other schemes in terms of peak signal to noise ratio (PSNR), and Normalized cross-Correlation(NC).

Proposed watermarking algorithm with high-capacity and robustness
In this section, we first introduce the global scheme of our proposed method of high-capacity and robust image watermarking algorithm. We suggest embedding the watermark bits by DWT and optimal DCT. As the lowest modified entropy value indicates the highest redundant image information, the watermark bits are embedded by modifying the selected coefficients according to some rules. In the second part of this section, we present two possible approaches in detail. In the first approach, a twodimensional watermark is embedded by modifying the selected coefficients. In the second approach, a onedimensional watermark processed by halftone and quad tree is embedded by modifying the selected coefficients.

Visual entropy and edge entropy
Visual entropy and edge entropy considering human characteristics provide the most significant part of the cover image to embed a watermark [9]. Thus, the entropy values can be adopted to select the region of embedding blocks. The modified entropy of a N-state is defined by: Where pi denotes the occurrence probability of i-th pixel represents the uncertainty or ignorance of the pixel value.

Psychovisual threshold
Referring to the psychovisual threshold [16], the gaps between the psychovisual threshold and minimum quantization values of JPEG compression can be utilized to embed the watermarks. Considering the gap in the frequency order between 4 and 5, some coefficients are selected for watermark embedding. These gaps can be measured as follows: Where g Q represents the gap between the reconstruction errors, psy Q represents the error with DCT psychovisuaold, and min Q indicates the error with the minimum quantization. The DCT coefficients are selected in the lower frequencies, and they are ordered into a vector of A.

Embedding algorithm
DWT decomposes an image into four non-overlapping muti-resolution sub bands denoted as LL(approximation sub band), LH(horizontal sub-band), HL(vertical sub-band) and HH(diagonal sub-band). In our study, the HH is discovered into sub blocks sized 8 8 , and each block is processed by DCT. The proposed watermark embedding procedure is formulated as follows: Step1. The cover image is first decomposed into four sub bands denoted as LL, LH, HL and HH.
Step2. The HH sub band is divided into non-overlapping sub blocks with 8 8 pixels.
Step3. Modified entropy for each non-overlapping block is computed by Formula (1).
Step5.The selected blocks are transformed by DCT.
Step6.The selected DCT coefficients are used to embed watermark bits.
Step8.Watermark bits are embedded according to the rules as follows: Step9. The watermarked image is got by performing inverse DCT and inverse DWT techniques to all selected blocks subsequently.

Extraction algorithm
The watermark extraction sequence consists of the following steps: Step1: The watermarked image is first decomposed into four sub bands denoted as LL, LH, HL and HH.
Step2. The HH sub band is divided into non-overlapping sub blocks with 8 8 pixels.
Step3. Each watermark bit is recovered according to the

P-DWT-ODCT approach
In the P-DWT-ODCT approach, the main goal is to extract the message from the watermark image. A one-dimensional watermark processed by halftone and quad tree is embedded by modifying the selected coefficients.

3.2.1Watermark preprocessing
There is a lot of redundancy in the watermark image, and the redundancy is not deleted in the previous watermark algorithm. In our study, the information is extracted from the watermark by halftone and quad tree technology. The extracted information is one-dimensional watermark, and is embedded into the selected coefficients by some rules.
The watermark image is converted to a binary image by half-tone method. It means that each 8-bit pixel is shown by 1 bit. Thus far, there are many methods for calculating the half-tone image, which are divided into two groups: errordiffusion [17][18][19] and dither [20][21]. The halftone image processed by the error diffusion method has different pixel distribution and irregularity, rich tones and good visual effects. In our study, the method of error-diffusion is used to calculate the halftone image. The part containing the content is represented by 0, and the background is represented by 1. we separate the content from the background and consider the content as secret data. The proposed watermark preprocessing procedure is formulated as follows.
Step1. The watermark images of any dimension are processed into N N  images; Step2. Each watermark image is converted to a halftone image by error-diffusion; Step3. The halftone image is considered a rectangle. When the minimum width and height of the rectangle are larger than 1 1 , the rectangle should be segmented into sub rectangles. This means that the rectangle is divided into four sub-rectangles, and this process is performed repeatedly on all sub rectangles until there is no other sub rectangle with division conditions; Step4. Because there are the sub rectangles without information, we only keep the content and coordinates of sub rectangles that contain information. Normally, the number of these sub rectangles can be high and 4 numbers are retained as coordinates for each sub rectangle increasing the final amount of information; Step5. All sub rectangles that contain information are merged by scanning neighboring rectangles horizontally and vertically. Therefore, the number of merged rectangles can be small and 4 numbers can be retained as coordinates for each merged rectangle, reducing the size mentioned in step 4.
We test the watermark of this paper in Fig. 1, where (a) is the QR watermark image; (b) is the sub rectangle image; (c) is the content of the sub rectangle image and (d) is the rectangle merging image. In Fig. 2, a binary logo image with 32 32 pixels is used as a watermark, where (a) is the watermark image; (b) is the sub rectangle image; (c) is the content of the sub rectangle image and (d) is the rectangle merging image.

Embedding and extraction algorithm
The watermark image is preprocessed into one-dimensional secret information is embedded by modifying the selected coefficient pairs. Use the same extraction algorithm to extract the secret information. The secret message is the

Results and discussions
In this section, we present the results we obtained by applying our method with the DWT-ODCT approach and the P-DWT-ODCT approach. Section A gives a full example for the two approaches and shows the obtained results on 100 images from the BOWS-2 database [22]. Then, in section B, we perform a statistical analysis in order to test the visual security of our methods. Finally, in section C, we compare our two approaches with related methods and discuss its efficiency.
For watermarking technology, we have to measure different performances which are robustness, imperceptibility, security, and blind extraction. We are interested to discover the best trade-off between all these parameters. A larger peak signal to noise ratio (PSNR) indicates that the watermarked image more closely resembles the original image meaning that the watermark is more imperceptible (the more closely the watermark image resembles the original image meaning the more imperceptible it is). The PSNR is defined as: where the mean square error (MSE) is defined as: where the notations M and N represent the width and height of an image, pi,j is the pixel value of coordinate (i,j) in an cover image, and pi,j' is the pixel value of coordinate (i,j) in the watermarked image. The robustness of the algorithm determined in term of correlation factor. The similarity and differences between original watermark and extracted watermark is measured by the normalized correlation (NC). NC is defined as: where M and N denote the row and column sizes of an watermark. W(i,j) is the pixel of the original watermark and W * (i,j) is the pixel of the extracted watermark.

A detail example for the two proposed approaches
We first applied our two approaches on the same original image of 512 512 pixels, from the BOWS-2 database, illustrated in Fig.5. A binary logo image and QR code generated online with 32 32 pixels are used as watermark, illustrated in Fig.3. In order to compare the watermark effects of different scales, a 64×64 binary watermark in Fig.  4 is adopted.For 016 . 0  T , Table 1 shows the results obtained with the DWT-ODCT approach and P-DWT-ODCT approach.In the first approach,when the watermark size is 32×32, the PSNR value is above 60dB and the NC value is 0.9972. As the size of the watermark increases, the performance of the image decreases. In the second approach, the QR code and binary watermark of 32×32 are preprocessed, and the value of the PSNR and NC are 52.5989dB,0.9965 and 68.7818dB,1 respectively. After preprocessing the coordinates of QR code more than the binary watermark. As the size of the watermark increases, the coordinates of binary watermark not change, so the value of the PSNR and NC are still 68.7818dB,1.When the QR code is scattered, there is a lot of coordinate information,the coordinates information is more than before , so the PSNR value and NC value of the DWT-ODCT approach are higher.Through the P-DWT-ODCT approach, a watermark is processed into one-dimensional information, which increases the security of the algorithm.We can see the PSNR of our study are much higher than 50 dB, which indicates a very good image quality.
Commonly, according to the characteristics of the watermark, the capacity of embedding and invisibility, a suitable watermarking algorithm is adopted. In the DWT-ODCT approach, the two-dimensional watermark is embedded into the selected coefficients. This approach is universal, but the security is not as good as the P-DWT-ODCT approach. In the P-DWT-ODCT approach, the watermark is preprocessed, and the embedded data are the coordinates of the content. The data is one-dimensional, so the security is improved. From the above description, it can be seen that in the process of preprocessing, when the content is relatively scattered, the security is higher, but the embedded content will become larger and the invisibility will be worse. It is more advantageous to adopt the DWT-ODCT approach. When the combined coordinates are small, the P-DWT-ODCT approach is more suitable.
The proposed method is test under different types of attacks such as cropping, Gaussian noise, pepper and salt noise, JPEG compression, median filter, and Gaussian low pass.

1)
Cropping. When cropping off 12.5%, the positions of cropping are listed in Table 2.In the DWT-ODCT approach, when the marked image is damaged by cropping the average value of PSNR and NC are 23.10dB and 0.92, respectively.The algorithm can still maintain a good extraction accuracy and ensure the integrity of the watermark.In the P-DWT-ODCT approach, when the marked image is damaged the average value of PSNR and NC are 26.3065dB and 0.9877, respectively.

2)
Noise. Common noise attacks include salt and pepper noise and Gaussian noise. For Binary watermark, when the attack intensity of salt and pepper noise increases, our algorithm has a strong anti-attack ability, as presented in the Table 3. In different Gaussian noise attacks, our study has a higher extraction accuracy, and better imperceptibility and robustness.  Table 4. We can see that when the quality factor is not less than 30, the effect of resisting compression attach is well, and the extraction accuracy is high.  Table 5. We can see that the extraction accuracy of watermark is relatively high.

Statistical analysis of our proposed method
We perform a statistical analysis of our two approaches, in order to verity that they can achieve a high visual security level and have good image quality. As we can see in Table  1, for the same size watermark, the PSNR values are very high with our DWT-ODCT approach. QR code has the characteristics of large capacity and self-correction. By scanning QR code, we can quickly obtain the information it carries. Therefore, using QR as a watermark can not only increase the effective embedding amount, but also enhance various resistances to attack. Because the watermark bits are embedded by modifying the selected coefficients pairs, good imperceptibility and robustness are got. The watermark is preprocessed in the P-DWT-ODCT approach, and one-dimensional information is embedded by modifying the selected coefficients pairs. From the security point of view (a security perspective), the approach of P-DWT-ODCT is better than DWT-ODCT.
In conclusion, in addition to being watermark preprocessing, our method, whatever the adopted approach, allows us to have a very good trade-off between the imperceptibility and robustness.

Comparisons with related methods and discussion
We made several comparisons, in terms of imperceptibility and robustness, between our two proposed approaches and seven state-of the art methods [8,9,23,24,25,26,27]. To do this, we used the well-known images of Lena, Airplane, Man and Peppers. First of all, in Table 6, we can see that our approaches allow us to have a better imperceptibility and robustness. With the P-DWT-ODCT approach, the watermark is transformed into one-dimensional information, hence with higher security. Our method has better imperceptibility than the other five methods. It can be seen from Table 7 that our method has better robustness than the other four methods.

Conclusions
In this work, we proposed an efficient method of watermark based on DWT and optical DCT, with a very high imperceptibility and robustness, which outperforms the state-of-the-art methods. From our knowledge this is one of the first methods which proposes to preprocess the watermark. Due to the fact that QR code has the characteristics of large capacity and self-correction and the preprocessed watermark is one-dimensional, we are then able to have a very high capacity, security and robust watermark algorithm. In the DWT-ODCT approach, the QR code and Binary watermark image are embedded by modifying the selected coefficient pairs. Note that no matter what kind of watermark, as long as the size is the same, the image effect will be the same. In the P-DWT-ODCT approach, the watermark is processed into one-dimensional information, we can see that this approach provides a good security level. Especially, when the watermark has fewer shapes and consists of horizontal and vertical lines, the embedded message becomes very small. In future work, we are interested in preprocessing all binary watermarks.

A list of abbreviations
Discrete Wavelet Transforms DWT Discrete Cosine Transforms DCT