Performance Optimization of Discrete Wavelets Transform Based Image Watermarking Using Genetic Algorithms

: The excellent spatial localization, frequency spread and multi-resolution characteristics of the Discrete Wavelets Transform (DWT), which were similar to the theoretical models of the human visual system, facilitated the development of many imperceptible and robust DWT-based watermarking algorithms. There had been extremely few proposed algorithms on optimized DWT-based image watermarking that can simultaneously provide perceptual transparency and robustness since these two watermarking requirements are conflicting, in this study we treat the DWT-based image watermarking problem as an optimization problem and solve it using genetic algorithms. We demonstrate through the experimental results we obtained that optimal DWT-based image watermarking can be achieved only if watermarking has been applied at specific wavelet sub-bands and by using specific watermark-amplification values.


INTRODUCTION
The widespread of the Internet and the continuous advancements in computer technology have facilitated the unauthorized manipulation and reproduction of original digital multimedia products. The audio-visual industry has been the main victim of such illegal reproduction and consequently, the design and development of effective digital multimedia copyright protection methods have become necessary more than ever. Encryption and authentication have always been the traditional methods of providing multimedia security [4] , however, they fell short in providing the required copyright protection. Instead, digital watermarking technology has been recently advocated as the best solution to the multimedia copyright protection problem [3,8,10] . Its expected that digital watermarking will have a wide-span of practical applications in digital cameras, digital libraries, medical imaging, image databases, surveillance imaging and video-on-demand systems, among many others [1] .
The watermark itself is usually a random number sequence, a copyright message, an ownership identifier, or a control signal carrying ownership information. In order for a digital watermark to be effective, it should be robust to common image manipulations like compression, filtering, rotation, scaling cropping, collusion attacks, among many other digital signal processing operations. The watermark should also be imperceptible, which means that the addition of the watermark should not degrade the perceptual quality of the host image. In general, it is not difficult to achieve imperceptibility. Indeed, its robustness that is usually the kernel that decides the success of watermarking algorithms.
Current digital image watermarking techniques can be grouped into two major classes: Spatial-domain watermarking techniques and watermarking frequencydomain techniques [3] . Spatial-domain techniques embed a watermarks in a host image by directly modifying its pixels [2] . These techniques are easy to implement and reacquire few computational resources, however, they are sensitive to alternations and are not robust against common digital signal processing operations such compression. On the other hand, transform-domain watermarking techniques modify the coefficients of the transformed image according to a predetermined embedding scheme. The scheme disperses the watermark in the spatial domain of the image, hence making it very difficult to remove the embedded watermark. Compared to spatial domain techniques, frequency-domain watermarking techniques proved to be more effective with respect to achieving the imperceptibility and robustness requirements of digital watermarking algorithms [3] . Commonly used frequency-domain transforms include the DWT: Discrete Wavelet Transform [11] , the DCT: Discrete Cosine Transform [13] and the DFT: Discrete Fourier Transform.
DWT has been used in digital watermarking more frequently than other transforms. This is due to its excellent spatial localization, frequency spread and multi-resolution characteristics, which are similar to the theoretical models of the human visual system [16] . By virtue of these properties, an efficient relationship between the transform and coefficients and visual masking properties of the human visual system has been constructed [18] . Effective utilization of this relationship facilitated the development of many imperceptible and robust DWT-based watermarking algorithms. Although there has been an active research on the application of the Discrete Wavelets Transform (DWT) in image watermarking systems by virtue of its attractive features mentioned above, as mentioned above, there has been also extremely little literature on optimized DWT-based image watermarking that can simultaneously provide perceptual transparency and robustness. Since these two requirements are conflicting, we applied Genetic Algorithms (GA) in order to reach the optimal performance.

MATERIALS AND METHODS
DWT-based watermarking research: Wavelets are special functions which, in a form analogous to sins and cosines in Fourier analysis, are used as basal functions for representing signals. For 2-D images, applying DWT corresponds to processing the image by 2-D filters in each dimension. The filters divide the input image into four non-overlapping multi-resolution subbands LL 1 , LH 1 , HL 1 and HH 1 . The LL 1 sub-band represents the coarse-scale DWT coefficients while the LH 1 , HL 1 and HH 1 sub-bands represent the fine-scale DWT coefficients. To obtain the next coarser scale of wavelet coefficients, the LL 1 sub-band is further processed until some final scale N is reached. When N is reached, we will have 3N+1 sub-bands consisting of the multi-resolution sub-bands LL N and LH x , HL x and HH x where x ranges from 1 until N. Fig. 1 shows the wavelet decomposition when the scale N equals to 3.
Due to its excellent spatial-frequency localization properties, the DWT is very suitable to identify areas in the host image where a watermark can be embedded effectively. In particular, this property allows the exploitation of the masking effect of the human visual system such that if a DWT coefficient is modified, only the region corresponding to that coefficient will be modified. In general, most of the image energy is concentrated at the lower frequency sub-bands LL x and therefore embedding watermarks in these sub-bands may degrade the image significantly. Embedding in the low frequency sub-bands, however, could increase robustness significantly. On the other hand, the high frequency sub-bands HH x include the edges and textures of the image, for which the human eye is not generally sensitive to changes in such sub-bands. This allows the watermark to be embedded without being perceived by the human eye. The compromise adopted by many DWT-based watermarking algorithm, is to embed the watermark in the middle frequency subbands LH x and HL x where acceptable performance of imperceptibility and robustness could be, at least theoretically, achieved. Active research based on the above reasoning has been done [6,12,14,17] . However, there has been also extremely little literature on optimized DWT-based image watermarking that can simultaneously provide perceptual transparency and robustness [7,9,15] .
Proposed algorithm: Our proposed DWT-based watermarking algorithm. The algorithm consists of two procedures, watermark embedding and watermark extraction procedures.
Watermark embedding procedure: The watermark embedding procedure is shown in Fig. 2 and described in details in the following steps: Step 1: Apply DWT to the original host image repeatedly up to the third level. This operation produces 64 non-overlapping multi-resolution sub-bands.
Step 2: Select one sub-band for embedding the watermark.
Step 3: Re-formulate the grey-scale watermark image into a vector of zeros and ones. Step 4: Generate a uniformly distributed, highly uncorrelated, zero-mean, two-dimensional pseudorandom sequence (PN) using a secret seed value. The PN sequence is used to embed the zero watermark bit in the host image.
Embed the pseudorandom sequence (PN) in the selected DWT sub-band with a gain factor . Number of elements in the selected sub-band and the pseudorandom sequence (PN) must be equal for embedding to take place. If we donate X as coefficients matrix of the selected sub-band, then embedding is done according to Eq. 1 and 2 shown: If the watermark bit is 0 then: Otherwise, if the watermark bit is 1 then: Step 5: Apply the inverse DWT (IDWT) on the DWT transformed image, including the modified sub-band, to produce the watermarked host image. The watermark image into m strings each of n bits length.
Watermark extraction procedure: The watermark extraction procedure is sown in Fig. 3 and described in details in the following steps. Since the proposed DWTbased algorithm is a blind watermarking algorithm, the original host image is not required in the watermark extraction procedure.
Step 1: Apply DWT to the watermarked image repeatedly up to the third level. This operation produces 64 non-overlapping multi-resolution sub-bands.
Step 2: Select the sub-band into which the watermark was embedded.
Step 3: Regenerate the Pseudorandom Sequence (PN sequence) using the same seed used in the watermark embedding procedure described above. Step 4: Calculate the correlation between the watermarked sub-band and the generated pseudorandom sequence (PN sequence). This step is repeated m times, where m is number of bit elements in the watermark vecto.
Step 5: Compare each correlation value with the mean correlation value. If the calculated value is greater than the mean, then the extracted watermark bit will be taken as a 0, otherwise its taken as a 1. A mean correlation value of 0.75 is used.
Step 6: Reconstruct the watermark image using the extracted watermark bits and compute the similarity between the original and extracted watermarks.

Optimization problem formulation:
Genetic Algorithms (GAs) are adaptive heuristic search algorithms that were developed based on the evolutionary ideas of natural selection and genetics. They have been widely used in real-world applications to find optimal parameters which were difficult to find using traditional optimization methods. Applying GAs to watermarking has been based on the fact that effective watermarking has two conflicting requirements, perceptual transparency and robustness. These two requirements are related to each other and therefore the watermarking algorithm described above must be optimized. We define the optimization search space and the relevant GA operators.
Search space: In The appropriate DWT sub-band and the value of the watermark amplification factor are the two key elements that, if chosen properly, will result in optimal imperceptible and robust watermarking. It's the role of the GA to find such elements, where the GA's search space is all possible combinations of the DWT sub-bands and watermark amplification factor. The two elements are described. DWT Sub-band. The discrete wavelet transform decomposes the host image into four sub-bands of different resolutions. Decomposition can be done at different DWT levels, 1st, 2nd 3rd, 4th and higher, however, in this study we decided to decompose up to the 3rd DWT level and apply genetic algorithms to find the optimal sub-band from a total number of 64 subbands produced as follows. The 1st level produces 4 sub-bands, the 2nd level takes each sub-band of the 1st level and decomposes it further into four sub-bands. This results in 16 sub-bands. Similarly, the 3rd DWTlevel decomposes each 2nd level sub-band into 4 subbands, giving a total of 64 sub-bands, as shown in Fig. 4. The genetic algorithm procedure will attempt to find the specific sub-band that will provide simultaneous perceptual transparency and robustness.
Watermark amplification factor . The value of watermark amplification factor, , should be used in a way to provide balanced imperceptibility and robustness. Since these requirements are conflicting, then the value of should be an optimization parameter to be determined using genetic algorithms. The value of can be varied depending as different sub-bands may require different values of .

GA operators:
The GA is an iterative procedure that achieves optimization in a give search space using three operators and a fitness function. It starts with some randomly selected population made of individuals, each corresponding to a solution to the problem. The fitness function is used to evaluate the quality of each solution so that individuals with high quality will survive and form a population for the next generation. GA recombines a new generation to the find the best optimal solution using three operators: Reproduction, crossover and mutation. The GA procedure is repeated until a predefined number of iterations is reached. The fitness function and the three genetic operators are described as follows.
The fitness function: Two common performance evaluation metrics are combined to form the fitness function, the Peak Signal to Noise Ratio (PSNR) and the correlation factor . The fitness function is formed by combining the two metrics as shown is Eq. 3. The correlation value has been multiplied by 100 since its normal values fall in the range 0 ~ 1, whereas PSNR values may reach the value of 100. The correlation factor measures the similarity between the original watermark and the watermark extracted from the attacked watermarked image (robustness). The correlation factor is computed using Eq. 5 shown: Where: N = The number of pixels in watermark w and wˆ = The original and extracted watermarks respectively The correlation factor may take values between 0 (random relationship) to 1 (perfect linear relationship).
Reproduction: Individuals with low fitness values are discarded through this genetic operator. The discarded individuals will be replaced by new offspring after executing the crossover and mutation genetic operators.
Crossover: This operator is responsible for producing better offspring by inheriting high-quality genes from their parents [5] . In this study we used a crossover rate of 0.6.

Mutation:
Refers to the occasional random alteration of the value in some positions of some chromosomes [5] . The mutation is usually selected with a probability between 0 and 1, so that only a small portion of the genes in the chromosomes will be selected to be muted. We selected the mutation rate to be 0.05.

Ga-based optimization procedure:
The GA-Training operates on the optimization problem formulated in the above. Two optimization parameters were described, the DWT sub-band and the optimal watermarking amplification factor . The standard GA-based optimization procedure is shown in Fig. 5.
Step 1: Initialize the GA-training parameters: • Select a value for between 0 and 1 • Define initial population size, crossover rate, mutation rate, number of iterations Step 2: Generate the first generation of GA individuals based on the parameters specified by performing the watermark embedding procedure. A different watermarked image is generated for each individual.
Step 3: Evaluate the perceptual transparency of each watermarked image by computing the corresponding PSNR value, using Eq. 4.
Step 4: Apply a common attack on the watermarked image. Common attacks include Gaussian noise, image compression and image cropping. The three attacks are a few, however, they are good representatives of the more general attacks.
Step 5: Perform the watermark extraction procedure on each attacked watermark image.
Step 6: Evaluate robustness by computing the correlation between the original and extracted watermarks, according to Eq. 5.  Step 7: Evaluate the fitness function for the PSNR and values using Eq. 3.
Step 8: Select the individuals with the best fitness values.
Step 9: Generate new population by performing the crossover and mutation functions on the selected individuals.
Step 11: According the obtained results, select the optimal level of decomposition, the optimal sub-band and optimal value of .

RESULTS AND DISCUSSION
We evaluated the performance of the optimized DWT-based algorithm using a 512×512 Lena as the original host image and a 256×256 grey-scale image of the expression Copyright as the watermark image. The two images are shown in Fig. 6 and 7 respectively.
We executed the GA-based training procedure described in the previous function using 14 individuals (chromosomes), crossover rate of 0.6, a mutation rate of 0.05 and a pre-set maximum iteration number of 1000. The GA procedure was repeated for three attacks that have been commonly used to benchmark watermarking algorithms, JPEG compression and Gaussian noise addition, which are classified as watermark removal and degrading attacks and image rotation, which is classified as a geometrical attack. The results are described in the following paragraphs. The watermarked image was compressed with different quality factors. As shown in Fig. 8, the result of the GA optimization for a JPEG quality factor of 50% indicates that the fitness function was maximum (141.3629) for the D1H2A3 sub-band, with a watermark amplification value of 0.1739. This result was obtained at the 185th iteration of the GA optimization process. The watermarked image and extracted watermark for the optimal D1H2A3 sub-band are shown in Fig. 9.
Gaussian Noise: A Gaussian noise was added to the watermarked image. As shown in Fig. 10, the result of the GA optimization indicates that the fitness function was maximum (137.1884) for the V1A2H3 sub-band, with a watermark amplification value of 0.1162. This result was obtained at the 147th iteration of the GA optimization process. The watermarked image and extracted watermark for the optimal V1A2H3 sub-band are shown in Fig. 11. Image rotation: The watermarked image was rotated with different angles. As shown in Fig. 12, the result of the GA optimization process indicates that the fitness function was maximum (157.95) for the V1H2H3 subband, with a watermark amplification value of 0.2257. This result was obtained at the 350th iteration of the GA optimization process. The watermarked image and extracted watermark for the optimal D1H2A3 sub-band are shown in Fig. 13.

CONCLUSION
Digital image watermarking algorithms based on the discrete wavelet transform (DWT) have been widely recognized to be more prevalent than the others. This is due to the wavelets excellent spatial localization, frequency spread and multi-resolution characteristics, which are similar to the theoretical models of the human visual system. However, improvement in their performance can still be obtained by viewing the DWT-based image watermarking problem as an optimization problem. In this study we applied genetic algorithms to locate the optimal DWT sub-band and the corresponding watermark amplification factor that will lead to maximum imperceptible and robustness. Ongoing and future research is concentrating on enlarging the GA-based the search space by adding the wavelet type as a vital optimization parameter.