19
Digital Image Watermarking Using Singular Value Decomposition SUBMITTED BY: Nishant Saurabh (82/EC/09) Pawan Bhardwaj (85/EC/09) Rohit Jha (102/EC/09) Sumit Bhardwaj (120/EC/09)

Final Report

Embed Size (px)

DESCRIPTION

report on someshit

Citation preview

Digital Image Watermarking

Using Singular Value

Decomposition

SUBMITTED BY:

Nishant Saurabh (82/EC/09)

Pawan Bhardwaj (85/EC/09)

Rohit Jha (102/EC/09)

Sumit Bhardwaj (120/EC/09)

INTRODUCTION

Digital Image Watermarking is the process of embedding secret information into a digital signal

which may be used to verify its authenticity or the identity of its owners. In this project, we

have taken image as the medium of watermarking.

In this project, Singular Value Decomposition (SVD) and Arnold Transform are combined to be

introduced into the research of wavelet domain Digital Watermarking Algorithm. During

experiment, we embed the watermark image through modifying the singular value of low-

frequency domain of host image with the authentic watermark information. The simulation

experiments show that the algorithm realizes the embedding and extraction of watermark

smoothly. There is no visual difference between watermarked image and original host image

can be found by naked eye that means the invisibility of the algorithm is well. The watermark

still can be extracted after several kinds of algorithm and noise attacks like salt and pepper,

Gaussian, JPEG compression and Cropping that means the robustness of the algorithm is

acceptable. With these algorithms, we have also evaluated the Peak signal to noise ratio (PSNR)

and Normalized Correlation function (NC) of the original watermarked image and the

watermarked image extracted after several noise and geometric attacks. From the

experimental results, it can be proved that this algorithm gives better PSNR and NC value,

which makes the algorithm to imperceptible.

Our project research has a certain value in the digital copyright protection and security printing.

Work Done So Far

1. In this project firstly, we have studied Discrete Wavelet Transform (Haar) and some its

commands that are to be used in MATLAB.

2. We have studied the usage of the Singular Value Decomposition and Arnold Transformation

algorithm to embed the watermark in the host image efficiently.

3. We have implemented two research papers in MATLAB to watermark an image and studied

the results.

WAVELET TRANSFORM

A wavelet is a wave-like oscillation with amplitude that begins at zero, increases, and then decreases back to zero. Wavelets are purposefully crafted to have specific properties that make them useful for image processing.

Wavelet transform is defined as a mathematical technique in which a particular signal is analyzed (or synthesized) in the time domain by using different versions of a dilated (or contracted) and translated (or shifted) basis function called the wavelet prototype or the mother wavelet. Wavelet transforms also decompose a signal into a set of "frequency bands" (referred to as scales) by projecting the signal onto an element of a set of basis functions. The basis functions are called wavelets. Wavelets in a basis are all similar to each other, varying only by dilation and translation. Basic Idea behind Wavelet Transform is to represent the time series as a linear combination of Wavelet basis functions, but keep only the first N coefficients.

There are two types of Wavelet Transforms:

1. Continuous Wavelet Transform (CWT)

2. Discrete Wavelet Transform (DWT)

The Wavelet Transform is similar to the Fourier transform (or much more to the windowed Fourier transform) with a completely different merit function. The main difference is this: Fourier transform decomposes the signal into sines and cosines, i.e. the functions localized in Fourier space; in contrary the Wavelet transform uses functions that are localized in both the real and Fourier space. Generally, the wavelet transform can be expressed by the following equation:

Where the * is the complex conjugate symbol and function ψ is some function.

Problem with the Fourier Transform

Fourier analysis breaks down a signal into constituent sinusoids of different frequencies.

A serious drawback in transforming to the frequency domain, time information is lost. When looking at a Fourier transform of a signal, it is impossible to tell when a particular event took place.

Why Wavelet Transform?

A Fourier transform (FT) will tell us what frequencies are present in our signal. A wavelet transform (WT) will tell us what frequencies are present and where (or at what scale). If we had a signal that was changing in time, then the Fourier Transform wouldn't tell us when (time) this has occurred. Each wavelet measurement (the wavelet transform corresponding to a fixed parameter) tells us something about the temporal extent of the signal, as well as something about the frequency spectrum of the signal.

We basically need Wavelet Transform (WT) to analyze non-stationary signals, i.e., whose frequency response varies in time as Fourier Transform (FT) is not suitable for non-stationary signals.

For practical purposes it is difficult to make the separation, since there are a lot of practical stationary signals, as well as non-stationary ones. Almost all biological signals, for example, are non-stationary. Some of the most famous ones are ECG (electrical activity of the heart, electrocardiograph), EEG (electrical activity of the brain, electroencephalograph), and EMG (electrical activity of the muscles). The Fourier Transform just only gives the information about what frequency components (spectral components) exist in the signal. When the Time

Localization of the spectral components is needed, the Wavelet Transform gives the TIME-FREQUENCY REPRESENTATION of the signal.

MULTIRESOLUTION ANALYSIS

As the Time and Frequency resolution problems are results of a physical phenomenon (the Heisenberg uncertainty principle) and exist regardless of the transform used, it is possible to analyze any signal by using an alternative approach called the Multi-Resolution Analysis (MRA). MRA, as implied by its name, analyzes the signal at different frequencies with different resolutions. Every spectral component is not resolved equally as was the case in the STFT.

MRA is designed to give good time resolution and poor frequency resolution at high frequencies and good frequency resolution and poor time resolution at low frequencies. This approach makes sense especially when the signal at hand has high frequency components for short durations and low frequency components for long durations. Fortunately, the signals that are encountered in practical applications are often of this type. For example, the following shows a signal of this type. It has a relatively low frequency component throughout the entire signal and relatively high frequency components for a short duration somewhere around the middle.

Singular Value Decomposition Singular Value Decomposition is a factorization of a real or complex matrix with many useful

applications in signal processing and statistics. It is a technique for handling matrices (sets of

equations) that do not have an inverse. This includes square matrices whose determinant is

zero and all rectangular matrices.

The SVD of an m-by-n matrix A is given by the formula:

Where:

U is an m×m real or complex unitary matrix

S is an m×n rectangular diagonal matrix with nonnegative real numbers on the diagonal

VT (the conjugate transpose of V) is an n×n real or complex unitary matrix

Use of Singular Value Decomposition in Image Processing

In this project we have applied theory of linear algebra called “singular value decomposition

(SVD)” to digital image processing.

The reason behind using SVs to embed the watermark comes from the fact that changing SVs slightly does not affect the image quality

SVD method can transform matrix A into product U*S*V T, which allows us to refactoring a

digital image in three matrices. The using of singular values of such refactoring allows us to

represent the image with a smaller set of values, which can preserve useful features of the

original image, but use less storage space in the memory.

DWT-SVD IMAGE WATER MARKING

In a DWT- based watermarking scheme, the host image is decomposed into four frequency

bands. Then apply SVD on each band and also compute the SVD of watermark. Modify the

singular values of host image in each sub-band according to those of watermark image, and

lastly apply the inverse DWT and find the watermarked image. Modification in all frequencies

enables watermarking schemes using DWT robust to a wide range of attacks but embedding

data in high frequency is more robust to geometric attack. So far we make more robust SVD-

DWT scheme.

Arnold Transformation To confirm the security and improve the robustness of the proposed watermarking scheme, the

watermark should be pre-processed before embedded into the original image. Due to the

periodicity process of the Arnold transform, the image can be easily recovered. The Arnold

transform is applied to the original image watermark.

Let us consider the size of original image is N*N, (i, j)T and its coordinate of the watermark

image’s pixel.(i’,j’)T and these coordinate are gained after transform.

Arnold transform can be expressed as:

Where i,j ∈ {0,1, . . . .,N-1} and

W= is input.

Proposed Watermarking Algorithm 1

Here, the readable watermark is an n *n grayscale image. Original image is an m*m grayscale

image.

A. Watermark Embedding Scheme

The steps of embedding watermarks can be described as follows.

Step 1: We perform a 3-level wavelet transform using Haar wavelet for host image, and intend

to embed watermark in 3 LL (denotes as A).

Step 2: Perform Arnold transform for watermark image W.

Step 3: We obtain the watermarked image coefficients matrix Aw through the following three

steps:

A = USVT

S +α W = U w S w V wT

A w= U Sw V T

Step 4: Apply reverse wavelet transform for original image, and then changing the double-

precision real number to unsigned 8-bit integer. Thus, obtain the watermarked image in which

watermark are embedded.

B. Watermark Extracting Scheme

We can extract the watermark by the reverse calculation of watermark embedding:

Step 1: Perform a 3-level wavelet transform using Haar wavelet for watermarked image, and

obtain low-frequency wavelet coefficient 3 LL (denotes as A*).

Step 2: Apply SVD to the A*, A* = U * S 1*V *T, and obtain U *, S 1 *, V *.

Step 3: Associating with U w, V W and S 1 *, obtain D* according D* =U WS 1*V WT, in the end we

can obtain the watermark which is embedded according to W* = (D* −S) /α.

Step 4: Changing the double-precision real number to unsigned 8-bit integer for watermark

image, and perform inverse Arnold transform for watermark image.

Code:

close all;

clear all;

%Read the Host image

x=imread('lena.tif');

x=imresize(x,[256 256]);

[h g rh rg]=daub(2);

AA=wt2d(double(x),h,g,3);

A=AA(1:32,1:32);

%Read the Watermark image

w=imread('wmark.tif');

%Algorithm for Embedding Watermark

aw=arnold(w,1); %Arnold Transform

[u s v]=svd(A); %Singualr Value Decomposition

a=0.01;

[uw sw vw]=svd(s+a*aw);

Anew=u*sw*v';

AA(1:32,1:32)=Anew;

xx=iwt2d(AA,rh,rg,3);

pp=uint8(xx);

figure

imshow(pp)

%Algorithm for extracting Watermark

AAn=wt2d(double(xx),h,g,3);

An=AAn(1:32,1:32);

[un sn vn]=svd(An);

Dn=uw*sn*vw';

Wn=(Dn-s)/a;

ww=uint8(Wn);

wim1=iarnold(ww,1);

imshow(wim1)

Output of the Code:

PSNR : 73.188

Proposed Watermarking Algorithm 2

Here, the readable watermark is an n *n grayscale image. Original image is an m*m grayscale

image.

The proposed DWT-SVD watermarking scheme is formulated as given here :

A) Watermark embedding:

1) Use one-level Haar DWT to decompose the cover image A into four subbands (i.e., LL, LH, HL, and HH). 2) Apply SVD to LH and HL subbands, i.e., Ak = UkSkV k

T, k= 1, 2 (1) where k represents one of two subbands. 3) Divide the watermark into two parts: W = W1 +W2, where Wk denotes half of the watermark. 4) Modify the singular values in HL and LH subbands with half of the watermark image and then apply SVD to them, respectively, i.e., Sk + αWk = Uk

W SkW V k

T W (2) where α denotes the scale factor. The scale factor is used to control the strength of the watermark to be inserted. 5) Obtain the two sets of modified DWT coefficients, i.e., A*k = UkSk

WV kT, k= 1, 2. (3)

6) Obtain the watermarked image AW by performing the inverse DWT using two sets of modified DWT coefficients and two sets of non modified DWT coefficients.

B) Watermark extraction:

1) Use one-level Haar DWT to decompose the watermarked (possibly distorted) image A* W into four subbands: LL, LH, HL, and HH. 2) Apply SVD to the LH and HL subbands, i.e., AkW = U*kS*kW V *k

T, k= 1, 2 (4) where k represents one of two subbands. 3) Compute D*k = UkW S*kW V kT

W , k = 1, 2. 4) Extract half of the watermark image from each subband, i.e., W*k = (D*k − Sk)/α, k = 1, 2. (5) 5) Combine the results of Step 4 to obtain the embedded watermark: W* = W*1 +W*2.

Code:

close all; clear all clc; x=imread('lena.tif'); x=imresize(x,[256 256]); figure(1); imshow(x); title('original'); [h g rh rg]=daub(2); AA=wt2d(double(x),h,g,1); A1=AA(129:256,1:128); A2=AA(1:128,129:256); we=imread('wmark.tif'); wee=imresize(we,[128 128]); figure(2); imshow(wee); w=im2double(wee); % Singular Value Decomposition [u1 s1 v1]=svd(A1); [u2 s2 v2]=svd(A2); w1=w; w2=w; w1(65:128,1:128)=zeros(64,128) w2(1:64,1:128)=zeros(64,128); k=0.01; [uw1 sw1 vw1]=svd(s1+k*w1); [uw2 sw2 vw2]=svd(s2+k*w2); Anew1=u1*sw1*v1'; Anew2=u2*sw2*v2'; AA(129:256,1:128)=Anew1; AA(1:128,129:256)=Anew2; figure(3); xx=iwt2d(AA,rh,rg,1); pp=uint8(xx); imshow(pp); title('watermarked'); %Extraction AE = wt2d(AA,h,g,1);

AE1=AE(129:256,1:128); AE2=AE(1:128,129:256); [u11 s11 v11]=svd(AE1); [u22 s22 v22]=svd(AE2); Dn1 = uw1*s11*vw1'; Dn2 = uw2*s22*vw2'; W11= (Dn1 - s1)/k; W22= (Dn2-s2)/k; water(1:128,1:128) = ones(128,128); water(1:64,1:128)=W11(1:64,1:128); water(65:128,1:128)=W22(65:128,1:128); figure(4); imshow(water); title('extracted watermark'); function PSNR=fpsnr(IM,WIM) % PSNR=fpsnr(IM,WIM) double arguements %find PSNR between image and water marked Image in db [m n]=size(IM); slopp=0; for i=1:m for j=1:n slopp=slopp+(IM(i,j)-WIM(i,j))^2; end end PSNR=10*log10((255^2)*m*n/slopp); end

Output of the Code:

PSNR = 115.4321 db

Work Yet To be Completed

1. Until now we have studied Wavelet Transform, Singular Value Decomposition and Arnold

Transformation and used all these concepts to embed a watermark image in a host image and

finally extracted that image using different algorithms given in the research paper.

2. In the future course of study, we have to study the effect and robustness of the watermark

image under the conditions when the host image is subjected to different attacks like Salt and

Pepper noise attack, Gaussian noise attack, Cropping of image, JPEG compression attack ,attack

by Low Pass filtering etc.

3. We have to observe the original and the extracted watermark.

4. Also we have to calculate the Peak Signal to Noise Ratio (PSNR) and Normalized Correlation

(NC) to show the similarity between the original and the extracted watermark.

5. We have to verify from the experimental results that it can be proved that the algorithm

used in our project gives better PSNR and NC value.

CONCLUSION

We have implemented two research papers on watermark embedding algorithms. We have

successfully embedded the watermark in the host image and extracted the watermark from the

watermarked image. The watermarking scheme has been found to be robust and clean. The

Peak Signal to noise ratio between the watermarked image and the host image is of the order

70-100 db .Therefore, the geometric properties of the image has been preserved while the

watermark provides the necessary protection to prevent any violation of the copyright of the

host image.

REFERENCES

1. A Digital Watermarking Algorithm Using singular Value Decomposition in Wavelet Domain by by Weimin Yang and Xiaoning Zhao. 2. Digital Image Watermarking Using Discrete Wavelet Transform and Singular Value Decomposition Chih-Chin Lai, Member, IEEE, and Cheng-Chih Tsai. 3. Algorithm of Image Information Hiding Based on New Anti-Arnold transform and Blending in DCT Domain by YANG Jie 4. An image watermarking method based on the singular value decomposition and the wavelet transform by Ruth Buse Dili.