Dummy Report Digital - Image - Watermarking
Dummy Report Digital - Image - Watermarking
Dummy Report Digital - Image - Watermarking
Prepared by:
Maleka Hanhan
Submitted To:
Our heart pulsates with the thrill for tendering gratitude to those persons who helped us in
completion of the project.
The most pleasant point of presenting a thesis is the opportunity to thank those who have
contributed to it. Unfortunately, the list of expressions of thank no matter how extensive is always
incomplete and inadequate. Indeed this page of acknowledgment shall never be able to touch the
horizon of generosity of those who tendered their help to us.
First and foremost, we would like to express our gratitude and indebtedness to Dr.Allam Mousa,
for his kindness in allowing us for introducing the present topic and for his inspiring guidance,
constructive criticism and valuable suggestion throughout this project work. We are sincerely
thankful to him for his able guidance and pain taking effort in improving our understanding of
this project. We are also grateful to everyone taught us in the Department of Electrical
Engineering.
An assemblage of this nature could never have been attempted without reference to and
inspiration from the works of others whose details are mentioned in reference section. we
acknowledge our indebtedness to all of them.
Last but not least, our sincere thanks to all our friends and our family who have patiently
extended all sorts of help for accomplishing this undertaking.
Acronym Description
List of Symbols
Symbol Description
In digital watermarking, a watermark is embedded into a cover image in such a way that the
resulting watermarked signal is robust to certain distortion caused by either standard data
processing in a friendly environment or malicious attacks in an unfriendly environment. This
project presents a digital image watermarking based on two dimensional discrete wavelet
transform (DWT2), two dimensional discrete cosines transform (DCT2) and two dimensional fast
Fourier transform (FFT2). Signal to noise ratio (SNR) and similarity ratio (SR) are computed to
measure image quality for each transform.
Introduction
This chapter gives full insight of digital watermarking, its history, requirements, application and
possible attacks. The first subheading tells how, with information revolution, the need to have
some technique to prevent piracy and illegal copying of data arises. This need give rise to a new
technique, known as Digital Watermarking. While proposing any algorithm some parameters are
needed to keep in mind on which the proposed algorithm must be consistent. These parameters
are discussed in following section. Following sections are dedicated to watermarking application
and attacks. A lot of work is going on for making watermarking techniques immune towards
attack to retain the originality of watermark and assuring successful extraction of watermark with
low error probabilities so to sort out disputes, if any, over copyrights or ownership.
Figure 1: Image showing an INR 100 note having watermark at its left side which is
considerably visible when note hold under light
Thus, watermarking is defined as, “the process of possibly irreversibly embedding information
into a digital signal. The signal may be audio, pictures or video”.
History of watermarking
Although the art of papermaking was invented in China over one thousand years earlier, paper
watermarks did not appear until about 1282, in Italy. The marks were made by adding thin wire
patterns to the paper molds. The paper would be slightly thinner where the wire was and hence
more transparent. The meaning and purpose of the earliest watermarks are uncertain. They may
have been used for practical functions such as identifying the molds on which sheets of papers
were made, or as trademarks to identify the paper maker. On the other hand, they may have
represented mystical signs, or might simply have served
asdecoration. By the eighteenth century, watermarks on paper made in Europe andAmerica had
become more clearly utilitarian. They were used as trademarks,
To record the date the paper was manufactured, and to indicate the sizes of original sheets. It
was alsoabout this time that watermarks began to be used as anticounterfeiting measures on mone
yand other documents. The term watermark seems to have been coined near the end of
the eighteenth century and may have been derived from the German term was sermarke (though it
could also be that the German word is derived from the English). The term is actually a
misnomer, in that water is not especially important in the creation of the mark. It was probably
given because the marks resemble the effects of water on paper. About the time the term
watermark was coined, counterfeiters began developing methods of forging watermarks used to
protect paper money. Counterfeiting prompted advances in watermarking technology. William
Congreve, an Englishman, invented a technique for making color watermarks by inserting dyed
material into the middle of the paper during papermaking. The resulting marks must
have been extremely difficult to forge, because the Bank of England itself declined to use them on
the grounds that they were too difficult to make. A more practical technology was invented by
anotherEnglishman,WilliamHenrySmith.Thisreplacedthe fine wire patterns used to make earlier
marks with a sort of shallow relief sculpture, pressed into the paper mold. The resulting variation
on the surface of the mold produced beautiful watermarks with varying shades of gray. This is the
basic technique used today for the face of President Jackson on the $20 bill. Four hundred years
later, in 1954, Emil Hembrooke of the Muzak Corporation filed a patent for “watermarking”
musical Works. An identification code was inserted in music by intermittently applying a narrow
notch filter centered at 1 kHz. The absence of energy at this frequency indicated that the notch
Transparency: The most fundamental requirement for any Watermarking method shall be
such that it is transparent to the end user. The watermarked content should be consumable
at the intended user device without giving annoyance to the user. Watermark only shows
up at the watermark-detector device.
Security: Watermark information shall only be accessible to the authorized parties. Only
authorized parties shall be able to alter the Watermark content. Encryption can be used to
prevent unauthorized access of the watermarked data
Effect on bandwidth: Watermarking should be done in such a way that it doesn’t increase
the bandwidth required for transmission. If Watermarking becomes a burden for the
available bandwidth, the method will be rejected.
Visible watermarks
Visible watermarks are an extension of the concept of logos. Such watermarks are applicable to
images only. These logos are inlaid into the image but they are transparent. Such watermarks
cannot be removed by cropping the center part of the image. Further, such watermarks are
protected against such as statistical analysis.
The drawbacks of visible watermarks are degrading the quality of image and detection by visual
means only. Thus, it is not possible to detect them by dedicated programs or devices. Such
watermarks have applications in maps, graphics and software user interface.
Invisible watermark
invisible watermark is hidden in the content. It can be detected by an authorized agency only.
Such watermarks are used for content and /or author authentication and for detecting
unauthorized copier.
Robust Watermark
Fragile Watermark
Fragile watermarks are those watermarks which can be easily destroyed by any attempt to
tamper with them. Fragile watermarks are destroyed by data manipulation. In the following
figure an example of fragile watermarking the first one represent the original image, the
second is the modified image and the third the detected modification.
Besides watermark robustness, watermark can also categorized into visible and invisible types,
visible watermarks are perceptible to a viewer. On the other hand, invisible watermarks are
imperceptible and don’t change the visual of the images. In our project, we are interested in
invisible watermarks because they have a wider range of applications compared to visible
watermarks[4].
The watermark does not incur visible (or audible) artifacts to the ordinary users.
The watermark is independent of the data format.
The information carried by the watermark is robust to content manipulations,
compression, and so on.
The watermark can be detected without the un watermarked original content.
The watermark can be identified by some kind of “keys” that are used to identify large
number of individual contents uniquely.
• Removal attacks
• Geometrical attacks
• Cryptographic attacks
• Protocol attacks
Removal attacks
Removal (simple) attacks attempt to separate and remove the watermark. If somebody tries to
remove the watermark from the data, this is called a removal attack. The means employed most
frequently are filter models taken from statistical signal theory. Denoising the marked image
through median or high-pass filtering as well as nonlinear truncation or spatial watermark
prediction are methods considered very likely to succeed. The goal is to add distortion to the host
image in order to render the watermark undetectable or unreadable [4]. The attack is successful if
the watermark cannot be detected anymore, but the image is still intelligible and can be used for a
particular determined purpose. Many such attack operations have been proposed:
Compression: this is generally an unintentional attack, which appears very often in multimedia
applications. Practically all images currently being distributed via Internet have been compressed.
the watermark is required to resist different levels of compression, it is usually advisable to
perform the watermark embedding in the same domain where the compression takes place. For
instance, the Discrete Cosine Transform (DCT) domain image watermarking is more robust to
Joint Photograph Expert Group (JPEG) compression than the spatial-domain watermarking. Also,
the Discrete Wavelet Domain (DWT) domain watermarking is robust to JPEG 2000 compression.
Denoising explores the idea that a watermark is an additive noise (which can be modeled
statistically) relative to the original image. These attacks include: local median, midpoint,
trimmed mean filtering, Wiener filtering, as well as hard and soft thresholding.
Filtering attacks are linear filtering: high-pass, low pass, Gaussian and sharpening filtering, etc.
Low-pass filtering, for instance doesn’t introduce considerable degradation in watermarked
images, but can dramatically affect the performance since spread-spectrum-like watermarks have
non negligible high-frequency spectral contents. To design a watermark robust to a known group
of filters that might be applied to the watermarked image, the watermark message should be
designed in such a way to have most of its energy in the frequencies which filters change the
least.
Statistical averaging: the aim of these attacks is retrieving the host image and/or watermark by
statistical analysis of multiple marked data sets. An attacker may try to estimate the watermark
and then to “unwatermark” the object by subtracting the estimation. This is dangerous if the
watermark doesn’t depend substantially on data. This is a good reason for using perceptual masks
to create a watermark. In this group of attacks belong the averaging and collusion attacks.
Averaging attack consists of averaging many instances of a given data set each time marked with
a different watermark. In this way an estimate of the host data is computed and each of the
watermarks is weakened. Collusion attack consists of averaging different host data containing the
same watermark. The resulting signal may serve as a good estimate of the watermark, which can
be used to remove it from the watermarked data.
Geometrical attacks
These attacks are not aimed at removing the watermark, but try to either destroy it or disable its
detection. They attempt to break the correlation detection between the extracted and the original
watermark sequence, where the image is subjected to translation, rotation, scaling and/or
cropping. This can be accomplished by “shuffing” the pixels. The values of corresponding pixels
in the attacked and the original image are the same. However, their location has changed. These
attacks can be subdivided into attacks applying general affine transformations and attacks based
on projective transformation. Cropping is a very common attack since in many cases the attacker
is interested in a small portion of the watermarked object, such as parts of a certain picture or
frames of video sequence. With this in mind, in order to survive, the watermark needs to be
spread over the dimensions where this attack takes place.
Mosaic attack. This point is emphasized by a “presentation” attack, which is of quite general
applicability and which possesses the initially remarkable property that a marked image can be
unmarked and yet still rendered pixel for pixel in exactly the same way as the marked image by a
standard browser. The attack was motivated by a fielded automatic system for copyright piracy
detection, consisting of a watermarking scheme plus a web crawler that downloads pictures from
the net and checks whether they contain a watermark. It consists of chopping an image up into a
number of smaller sub images, which are embedded in a suitable sequence in a web page.
Common web browsers render juxtaposed sub images stuck together, so they appear identical to
the original image, which is shown in Fig. 3. This attack appears to be quite general; all marking
schemes require the marked image to have some minimal size (one cannot hide a meaningful
Cryptographic attacks
Cryptographic attacks aim at cracking the security methods in watermarking schemes and thus
finding a way to remove the embedded watermark information or to embed misleading
watermarks. One such technique is brute-force search for the embedded secret information.
Practically, application of these attacks is restricted due to their high computational complexity.
They cover, for example, direct attacks to find the secret key or attacks called collusion attacks.
Cryptographic attacks are very similar to the attacks used in cryptography. There are the brute
force attacks, which aim at finding secret information through an exhaustive search. Since many
watermarking schemes use a secret key, it is very important to use keys with a secure length.
Another attack in this category is so-called Oracle attack which can be used to create a non-
watermarked image when a watermark detector device is available.
Protocol attacks
Protocol attacks neither aim at destroying the embedded information nor at disabling the
detection of the embedded information (deactivation of the watermark). Rather, they take
advantage of semantic deficits of the watermark’s implementation. The protocol attacks aim at
attracting the concept of the watermarking application. The first protocol attack was proposed by
Craveret al. They introduced the framework of invertible watermark and showed that for
copyright protection applications watermarks need to be non-invertible. The idea of inversion
consists of the fact that an attacker who has a copy of the stego-data can claim that the data
contains also the attacker’s watermark by subtracting his own watermark. This can create a
situation of ambiguity with respect to the real ownership of the data. The requirement of non-
invertability on the watermarking technology implies that it should not be possible to extract a
watermark from non-watermarked image. As a solution to this problem, the authors proposed to
make watermarks signal-dependent by using a one-way function. Consequently, a watermark
must not be invertible or to be copied. A copy attack, for example, would aim at copying a
watermark from one image into another without knowledge of the secret key. It also belongs to
the group of the protocol attacks. In this case, the goal is not to destroy the watermark or impair
its detection, but to estimate a watermark from watermarked data and copy it to some other data,
called target data [7].
In our work we use removal attacks to compare between the different techniques, we compress
the watermarking image using JPEG compression; also we add Gaussian noise and salt and
peppers noise to the watermarking image and then we filtering it using median filter.
In order to evaluate the quality of watermarked image, the following signal-to-noise ratio (SNR)
equation is used:
M N
∑ ∑ I 2 (i, j)
i=1 j=1
SNR= M N
2
∑ ∑ [ I ( i, j ) −I w (i , j)]
i=1 j=1
OR,
M N
∑ ∑ I 2 (i , j)
i=1 j=1
SNR dB =10∗log 10 M N
The number of mismatched data between the embedded watermark and the extracted watermark
is used to represent the similarity of watermarks. The similarity factor of extracted watermark and
original watermark is computed by the following:
M N
√∑ ∑
M N N N
W (i , j) ∗∑ ∑ W ' (i , j)2
2
Where W and W ' represent the original watermark image and the extracted watermark
image, respectively, M and N represent the image size. The magnitude range of SF is [0, 1]. SF is
near or equals to 1, the extracted watermark is more effective extraction. In general, it is
considered acceptable that SF is 0.75 or above.
In two-dimensional separable dyadic DWT, each level of decomposition produces four bands of
data, one corresponding to the low pass band (LL), and three other corresponding to horizontal
(HL), vertical (LH), and diagonal (HH) high pass bands. The decomposed image shows a coarse
approximation image in the lowest resolution low pass band, and three detail images in higher
bands. The low pass band can further be decomposed to obtain another level of decomposition.
This process is continued until the desired number of levels determined by the application is
reached [2].
Process:
1. using two-dimensional separable dyadic DWT, obtain the first level decomposition of the cover
image I.
Extracting watermarking
Process:
1. using two-dimensional separable dyadic DWT, obtain the first level decomposition of the
¿
watermarked (and possibly attacked) cover image I w .
Simulation results
Since the magnitudes of DWT coefficients are larger in the lowest band at each level of
decomposition, it is possible to use a larger scaling factor for watermark embedding. For the
other 3 bands, the DWT coefficients are smaller, allowing a smaller scaling factor to be used.
The resulting watermarked image does not have any degradation leading to a loss in its
commercial value. In the below experiments, we measured the visual quality of watermarked and
attacked images using the Signal To-Noise Ratio (SNR), SNR measures are estimates of the
quality of the reconstructed image compared with an original image. The fundamental idea is to
compute the value which reflects the quality of the reconstructed image. Reconstructed image
with higher metric are judged as having better quality.
The visual quality of extracted visual watermarks is measured by the Similarity Factor (SF). The
DWT was performed using Matlab with the wavelet filter. The chosen attacks were JPEG
compression (with 3 quality factors), also we measured a compression ratio (CR) it defined by
compression Ratio=image bytes/compressed bytes.
The following data calculated from run matlab code for DWT watermarking for different value of
quality factor and alpha (gain).
The watermarked image in LL, LH, HL and HH bands are presented respectively in Figure 6 for
different value of scaling factors and different quality factors, and the number below each image
denotes the SNR value.
Figure 7 contains the watermarks extracted from the four bands for each value of alpha and QF.
The numbers below the images are the SF values. According to Figure 7 we can note that
watermark embedding in the LL band is most resistant to JPEG compression than other bands.
The attacked images are presented in Figure 8 together with the tools and parameters used for the
attacks. The number next to the label below each image denotes the SNR value. Figure 9 contains
SNR=19.9011 SNR= 21.2960 SNR= 21.5097 SNR= 20.2804 SNR= 21.7980 SNR= 21.7985
JPEG 60 , alpha=0.09 JPEG 80 , alpha=0.09 JPEG 100 , alpha=0.09
Salt& peppers noise(0.02): Salt& peppers noise(0.5): 4.2115 median filter: 19.3196
16.1830
Salt& peppers noise(0.02): Salt& peppers noise(0.5): 0.5215 median filter: 0.9123
0.9623
Chapter 3
As DCT is having good energy compaction property, many DCT based Digital image
watermarking algorithms are developed. Common problem with DCT watermarking is block
based scaling of watermark image changes scaling factors block by block and results in visual
discontinuity [9]. In this chapter, we propose a visible watermarking technique that modifies the
DCT coefficients of the host image using eqn. (1). We call an embedding factor we try different
values for it to achieve visible watermarking we find α =10 a good value and we also use α =0.09
for invisible watermarking. We have also proposed a modification to make the watermark more
robust.
INSERTION OF WATERMARK
Figure 5 gives the schematic representation of the insertion process. The steps for watermark
insertion are discussed below:
The original image I (to be watermarked) and the watermark image W are reading. (Both
the images may be not of equal size).
The watermark image resize if necessary to make it size the same of host image.
The DCT coefficients for host image and watermark image are found out.
The value of embedding factor defined to be suitable for visible watermarking.
Simulation result
Figure 11 shows the 512x512 gray scale cover image Lena and 512x512 watermark copyright.
After running code and achieve desired result five types of attacks applied to the watermarked
image. The attacked images are presented in Figure 12 together with the tools and parameters
used for the attacks. The number next to the label below each image denotes the SNR value.
Figure 13 contains the watermarks extracted from the watermarked for each of the attacks. The
numbers next to the images are the SF values. According to Figure 12 and Figure 13, it is possible
to note the resistance of watermarked image for each attack using either subjective human
evaluation or objective SF.
JPEG 75: 0.9998 Salt& peppers noise(0.02): 0.5511 Salt& peppers noise(0.02):
With alpha=10 0.1190
With alpha=0.09
Chapter 4
The Fourier Transform is used in a wide range of applications, such as image analysis, image
filtering, image reconstruction, image compression and image watermarking.
INSERTION OF WATERMARK
Figure 14 gives the schematic representation of the insertion process. The steps for watermark
insertion are discussed below:
The original image I (to be watermarked) and the watermark image W are reading. (Both
the images may be not of equal size).
The watermark image resize if necessary to make it size the same of host image.
The FFT coefficients for host image and watermark image are found out.
The value of embedding factor defined to be suitable for visible watermarking.
The FFT coefficient of the host image and watermark image is modified using the
following equation. The IFFT of modified coefficients give the watermarked image.
Extracted of watermark
To extract the watermark applying the following equation:
Simulation result
Figure 15 shows the 512x512 gray scale cover image Lena and 512x512 watermark copyright.
In the Figure above we have extracted watermarks after different type of attacks applying on the
watermarking image, we can note that this method robust against JPEG compression.
From the table above we can note that the two methods have approximately, the same result. The
value of SNR in the table indicates that FFT robust to blurring attack more than DCT but for
other attacks are the same. For retrieval watermark image we can also compare between the two
techniques. In Table 2 we compare between them for different types of attacks using SF as visual
quality.
DCT / FFT
Watermark image
Watermarking Image
Retrieval
Extracted Watermark
In chapter one we have general definition of digital image watermarking, our own work in
watermarking start on chapter two using DWT first we decompose the host image into four bands
LL, LH, HL and HH and we embedding the watermark in each band and with different values of
QF and embedding factor we note that at QF=100 and alpha=0.09 we can retrieval the watermark
image with SF=1 , Figure 6 show watermarking image in different bands and we use SNR to
compare between them, Figure 7 show extracted watermark from each band also we use SF to
compare between them. Applying different type of attacks on watermarking image embedding on
the LL band we record the result in Figure 8 and note the effect of each type, LL band more
robust to JPEG compression and intensity adjustment.
In chapter three and four we discuss watermarking process in two frequency domain DCT and
FFT we notice that the process is the same but we apply different transformation, also we can
note that the two method have the same robust for all types of attack except blurring we can note
that FFT more robust than DCT.
DWT code
% loading cover image
X=imread('cameraman.tif');
X=im2double(X);
[F1,F2]= wfilters('db1', 'd');
[LL,LH,HL,HH] = dwt2(X,'db1','d');
%Watermark image
b=imread('message_copyright.bmp');
level=graythresh(b);
w=im2bw(b,level);
w=double(w);
alpha=0.09;
k=w*alpha;
LL_1=LL+k;
Y = idwt2(LL_1,LH,HL,HH,'db1','d');
% Storing the image to lossy file formats.jpeg
q=input('Quality Factor q = ');
imwrite(Y,'xyz.jpg','jpg','quality',q);
Y=imread('xyz.jpg');
imshow((Y)); % Stego image
title ('watermarked Image');
w1= (HL1-HL)./alpha ; % extracted the watermark
level1=graythresh(w1);
w2=im2bw(w1,level1);
w2=im2double(w2);
imshow((w2));
title ('Extrected Watermark');
%SNR measurement
z1=double(Y);
snr_num=0;
snr_den=0;
for i=1:256
for j=1:256
snr_num=snr_num+(z1(i,j)*z1(i,j));
snr_den=snr_den+((X(i,j)-z1(i,j))*(X(i,j)-z1(i,j)));
end
end
snr=10*log10(snr_num/snr_den)
%Similarity Factor (SF) Measurement
sf_num=0; sf_den=0;a=0; b=0;
for i=1:512
for j=1:512
sf_num=sf_num+(w1(i,j)*o(i,j));
a=a+(o(i,j)*o(i,j));
b=b+(w1(i,j)*w1(i,j));
sf_den=sqrt(sf_den+a*b);
end
end
sf=(sf_num/sf_den)
I = im2double(imread('bb.bmp'));
alpha=10;
X = dct2(I);
o=im2double(imread('ba.bmp'));
imshow (o),
r=dct2(o);
K2=r*alpha;
X=X+K2;
a = idct2(X);
w1=(a-I)./alpha;
%Storing the image to lossy file formats.jpeg
q=input('Quality Factor q = ');
imwrite(a,'xyz.jpg','jpg','quality',q);
a=imread('xyz.jpg');
imshow((a));
title ('Watermarking Image');
imshow((w1));
title('detected Embedded Watermark');
% %SNR measurement
z1=double(a);
snr_num=0;
snr_den=0;
for i=1:512
for j=1:512
snr_num=snr_num+(z1(i,j)*z1(i,j));
snr_den=snr_den+((I(i,j)-z1(i,j))*(I(i,j)-z1(i,j)));
end
end
snr=10*(log10(snr_num/snr_den))
%Similarity Factor (SF) Measurement
sf_num=0;
sf_den=0;
a=0;
b=0;
for i=1:512
for j=1:512
sf_num=sf_num+(w1(i,j)*o(i,j));
a=a+(o(i,j)*o(i,j));
b=b+(w1(i,j)*w1(i,j));
sf_den=sqrt(sf_den+a*b);
end
end
sf=(sf_num/sf_den)
imshow((a));
title ('Watermarking Image');
imshow((w1));
title('detected Embedded Watermark');
%SNR measurement
z1=double(a);
snr_num=0;
snr_den=0;
for i=1:512
for j=1:512
snr_num=snr_num+(z1(i,j)*z1(i,j));
snr_den=snr_den+((I(i,j)-z1(i,j))*(I(i,j)-z1(i,j)));
end
end
snr=10*log10(snr_num/snr_den)
%Similarity Factor (SF) Measurement
sf_num=0;
sf_den=0;
a=0;
b=0;
for i=1:512
for j=1:512
sf_num=sf_num+(w1(i,j)*o(i,j));
a=a+(o(i,j)*o(i,j));
b=b+(w1(i,j)*w1(i,j));
sf_den=sqrt(sf_den+a*b);
end
end
sf=(sf_num/sf_den)
[3]. http://homepages.vub.ac.be/~andooms/research.html
[4]. http://www.alpvision.com/watermarking.html
[5]. Edin Muharemagic and Borko Furht, “Survey Of Watermarking Techniques And
Applications”, Department of Computer Science and Engineering, Florida Atlantic
University.
[7]. Peining Taoa and Ahmet M. Eskicioglub, “A robust multiple watermarking scheme in the
Discrete Wavelet Transform domain ”, The Graduate Center, The City University of New York.