Digital Watermark Hamid Reza Mehrabi The Royal Library P.O.Box 2149, Denmark-1016 Copenhagen TEL +45 33474842
[email protected]
Abstract. Cultural institutions have an increasing need for protection of copyright on the internet. Digital images are easily downloaded and thus need to be protected from misuse. This project will develop a method for provision of protection. An invisible signal, known as a digital watermark, is a mark placed on a still image. In a project Culture Net Denmark at The Royal library in Copenhagen a method for copyright protection of digital colour images is analysed and implemented. The signature bits are embedded by modifying the blue channel in the image. A generator that produces random locations in the image, where the signatures bits are embedded, is chosen to prevent any removal of the signature. Specifically, a secret key determines where the signatures bits are embedded in the image. To extract the signature a user needs to know the secret key. Furthermore, a method is implemented to retrieve the signature without reference to the original image. The robustness of the method against possible attacks via geometrical transformation or filtering is analysed.
1 Introduction The usage of digital media has increased tremendously in the last ten years. Great investments have been made in the production of digital images, sound and video. Big companies and libraries are in the process of converting their image and video archives to an electronic form. Already in the early 90s, World Wide Web started its wide- spread popularity. Digital media has numerous advantages over analogue media. The quality of digital sound, image and video is higher than the corresponding analogue. It is easier to manipulate digital media or make copies without loosing data. A copy of a digital media is identical to its original and can be easily transmitted over a network. These advantages create new possibilities. It is possible to hide data (information) in a digital sound, image or video. This hidden information cannot be detected by human senses. Embedding of digital data can be used for numerous purposes, one of which is copyright protection. The electronic representation and transformation of digital media has created possibilities for misuse. Therefore the owners of digital media need to provide a form P. Constantopoulos and I.T. Sølvberg (Eds.): ECDL 2001, LNCS 2163, pp. 49-58, 2001. Springer-Verlag Berlin Heidelberg 2001
50
Hamid Reza Mehrabi
of proof for their ownership in order to protect their ownership rights. Digital watermarks can very well serve this purpose. M. Kutter, F. Jordan, F. Bossen [1] have introduced a watermark technique based on amplitude modulation. The method of embedding a watermark is based on adding or subtracting a fraction of the luminance for a given pixel in its blue channel. The retrieving algorithm retrieves the watermark without reference to the original image. Most methods use the original image to retrieve the watermark, and it is therefore we have chosen this method, in the case of any corruption of the original. At The Royal Library in Denmark we have implemented the method with slight modifications in a prototype available for all culture Net Denmark’s governmental institutions. The prototype works on a JPEG image which is supplied by the true colour space (RGB). The prototype is in use at the library website www.kb.dk . This paper describes the method used and the results obtained.
2 Watermark in General A digital watermark is a digital signal or pattern placed on a digital media. As the watermark is located on every copy of the watermarked media, this signal can be used as a digital signature. This digital signature can be used as an identification for owners, users or both. The signature should be similar and unique on every copy for the owner’s identification. But in any case, the embedding of a digital watermark can be described as a transformation from the original media to the new media which is completely recognizable compared to the original. Figure 1 demonstrates this transformation, and figure 2 shows the retrieving of the watermark. As figure 1 shows, certain elements (i.e. pixels from a digital colour image) are chosen from the original media. These elements are arbitrary and can be chosen by the use of a random generator that gets a secret key ( an integer number) as an input.
Fig. 1. Watermark process
Fig. 2. Retrieving process
These elements will be used to embed the watermark. The length of the watermark and the number of positions are not necessarily the same. The embedding of the
Digital Watermark
51
watermark in the selected positions (pixels) creates new updated positions which will be replaced with the corresponding original positions. This transformation is absolutely different from the transformation that takes place in cryptography, which also transforms the original document to the new document that is completely unrecognisable in comparison to the original document. There are two types of watermarks (visible and invisible). Visible watermarks are basically similar to stamps used on documents. Due to the high contrast between background and foreground in the watermarked image, a visible watermark can be easily observed. The advantage of a visible watermark is that it destroys the commercial value of the digital image. An example is TV stations that use logos. An invisible watermark can be potentially used to identify the owner or user of a digital image or both. The digital signature is hidden in the image in such a way that human eye cannot detect it. Whenever an image is misused, the owner can retrieve the digital signature by the retrieving algorithm in order to prove his ownership.
3 Human Visual System One of the important characteristics of the human visual system is the capacity called masking. Masking occurs when a component in a given visual signal becomes invisible in the presence of another signal. An example is the reduction of the visibility of the pixels around edges with high contrast. There are different models for the description of masking effects. Giord [2] has presented the model spatial masking which is based on threshold vision model. The model is claimed to be able to predict masking effects around edges. B. Zhu, A. Tewfik, O. Gerek [3] have linearized Giord’s model in order to determine the tolerable error level for the coefficients. Further calculations result in the determination of tolerable error level for each pixel.
Fig. 3. Spatial frequency
There is another model based on discrete cosine transformation (DCT). In this model the contrast threshold in frequency f is expressed as a function of f, masking frequency fm, and masking contrast cm [4]. The graph in figure 3 [5] shows the human eye’s sensitivity to luminance intensity. As the graph shows, contrast sensitivity
52
Hamid Reza Mehrabi
appears around 5 cycle/degree, and sensitivity is 0 around 100 cycle/degree. This shortcoming in the human eye can make it possible to embed data (which is hidden to the eye) in the image.
4 Demands on Digital Watermark As digital watermarks serve different purposes, we cannot set up a number of unique demands. Digital watermarks can be used to identify the owner or user of digital media. They can also be used for secret communication, as well as pay per use. Our purpose here, however, is to use the watermark to identify the owner or user of the digital image. Therefore, we can have particular demands as shown in the following: 1. A digital watermark is in fact invisible if the human eye is unable to differentiate between the original image and the watermarked image. However, the quality of the image should not be affected after the watermark is embedded. 2. We do not always have access to the original image to enable us compare it to the watermarked image while retrieving the watermark. Therefore, we need certain methods to retrieve the watermark without any reference to the original image. 3. The length of the watermark cannot be arbitrarily long. The longer the watermark, the more difficult it will be to retrieve it. If the purpose is to identify the user of a particular digital media, a 32-bit-watermark can be long enough to identify 232 users. 4. The robustness of a watermark is another issue to be considered. An opponent tries to destroy the watermark through image processing. The watermark should be robust over following: 1. Linear filter 2. Non-linear filter 3. Compression 4. Quantization 5. Additive Gaussian or Non-Gaussion noise 6.Translation, rotation, and cropping
5 Watermark Technique Three processes are involved in every watermark system: 1. Generating of watermark 2. Embedding of watermark 3. Retrieving of watermark The generating of a watermark is dependant on its purpose. The obvious method is to use a bit pattern of a particular length, if the purpose is to identify the owner or user of digital media.
Digital Watermark
53
The digital watermark can be embedded either in a suitable transform domain like DCT, Wavelet, Fourier, or a spatial domain. In this paper, we have concentrated on the watermark technique used in the spatial domain. The most important part of a watermark system is the retrieving part. This retrieving part may or may not have reference to the original image to retrieve the watermark. The algorithm that has been implemented retrieves the watermark without any reference to the original image.
6 Implementing of the Watermark Technique Suggested by Martin Kutter, F. Jordan, and F. Bossen 6.1 Single Embedding of a m-bit Watermark Consider a m-bit watermark
S = {s1,..., sm } that will be embedded in the image
I ={R,G,B}, where R, G, and B stand for the red, green and blue channels. A random generator starts with a secret key (an integer number) as input and as output obtains a number of arbitrary positions (as shown in figure 4). In this case the number of positions is equal to the length of watermark. Call these positions P(i,j). The first bit s1 from S is embedded in position P(i,j) with modification of the blue channel in position P(i,j) through equation 1 :
Fig. 4. Searching in the image to choose positions
Bij = Bij + (2s − 1) Lij q Where
Lij = 0.299R + 0.587G + 0.114B
and q determines the fraction of luminance that has to be added or subtracted .
(1) (2)
54
Hamid Reza Mehrabi
According to equation (1), if s=0, a fraction of luminance is subtracted from and if s=1, a fraction of luminance is added to the blue channel. The more one adds to or subtracts from the original pixel under modification (according to equation 1), the more robust the watermark becomes, and the greater the difference will be between the original image and the watermarked image (the watermark becomes more visible). It is the value of q that determines the amount of the luminance that should be added or subtracted. We have to find an optimal value for q in equation (1) that gives less difference between the watermarked image and the original image, and gives more robustness to the watermark. 6.1.1 Single Retrieving of a m-bit Watermark As mentioned earlier, the retrieving algorithm retrieves the watermark from the watermarked image without any reference to the original image. It uses a kind of prediction based on the watermarked image to retrieve the watermark. Consider the followings equations:
! c c 1 Bij = ( ∑ Bi + k , j + ∑ Bi, j + k − 2Bij ) k = −c 4c k = −c ! c c 1 Bij = ( ∑ Bi − k , j − k + ∑ Bi + k , j − k − 2 Bij ) k = −c 4c k = −c where
Bij
(3)
(4)
is the value of the blue channel of pixel P(i,j) which has been used to
embed one bit (1 or 0) under the embedding process. Equation (3) makes an average of blue values (which have not been modified under the embedding process) located on the vertical and horizontal lines in figure 6. For example, for c=3 equation (3) makes an average of 12 blue values, 6 on each line.
! Bij
is the prediction of the
original blue value for P(i.j) before the modification. In order to find out whether a 0 or a 1 has been embedded in P(i.j), we consider the following:
! Bij - Bij <0 then 0 has been embedded ! If B - B >0 then 1 has been embedded ij ij
If
(5) (6)
Equation (4) is another model which makes the average of blue values in a different way (Figure 5). We have implemented both models, and come to the conclusion that the model corresponding to equation 3 gives better results as Martin Kutter, F. Jordan, and F. Bossen postulate.
Digital Watermark
Fig. 5
55
Fig. 6
As we can see, the retrieving algorithm is not exactly the inverse of the embedding algorithm. Therefore while retrieving the watermark from the watermarked image we expect possible errors. These errors can be reduced by embedding each single bit in more pixels. 6.2 Multiple Embedding Consider again a m-bit watermark
S = {s1,..., sm } .
The principle of multiple
embedding is the same as single embedding with the only difference that in multiple embedding, one bit is embedded in more pixels to make the watermark more robust. We use two more bits, one of which is always 0, and the other is 1. These are embedded in the same way as the bit from the watermark S is embedded in the image. These will be used for a different purpose that will be discussed later on in the paper. The number of pixels we want to use for embedding one bit is a critical parameter because it interacts with the value of q from equation (1) and the way in which we search to choose the positions (Figure 6). While retrieving the watermark, the more pixels chosen for embedding, the greater the risk of using pixels that have already been updated. Fewer pixels result in less robustness of the watermark, and this results in more error in the retrieving process. A good combination of the number of pixels and the value of q in equation (1) gives suitable robustness and less invisibility to the watermark. There is another parameter to consider. We have implemented a dynamic multiple embedding algorithm which means the watermark is embedded in the image when a user, through a WEB browser on the internet, requests for an image from our image base (Figure 7). Therefore running time of the embedding algorithm is an important parameter to consider. The more pixels chosen, the longer the running time will be.
56
Hamid Reza Mehrabi
6.2.1 Dynamic Embedding of Watermark As a consequent of the current development, it is important for the library to have a model in which images and watermark technology are kept separate, so that the library’s policy with regard to watermarking can be changed or adjusted, should either technological or legal development require it. Therefore we have developed a dynamic watermark system at The Royal Library. An illustration of the system is showed in figure 7.
Fig. 7. Dynamic embedding of watermark
6.2.2 Retrieving of a m-bit Watermark in the Case of Multiple Embedding Here again, the principle is the same as a single retrieving. Each bit is embedded in n pixels under the embedding process. If the length of the watermark is m, then n*m pixels have been updated under the embedding process. All the n*m pixels are accessible through the secret key. Consider the first n pixels where the first bit is embedded. We take an average of blue channels around every pixel which has been updated (exactly the same as the single case, Figure 3) from the n pixels.
!
We take an average ( B ) of all the averages mentioned. We also take an average
ij
(B) of the blue channels for the updated pixels where the first bit is embedded. The sign of
! ( B − Bij ) determines
whether 0 or 1 has been embedded in the first n
positions. We do the same for the next m-1 bit. It has already been mentioned that in addition to the m-bit watermark, two other bits are also embedded, one of which is always 0 and the other is 1. These two bits are used to retrieve the watermark when
Digital Watermark
57
the watermarked image is rotated, translated, or cropped. This results in a repositioning of pixels in the watermarked image. We use these two bits for the detection of translation, cropping, or the degree of rotation. 0 and 1are each embedded in n positions. We call the average of the blue channels of the n updated positions B0 where 0 is embedded, and B1 where 1 is embedded. In the case of rotation, we rotate the watermarked image to a certain degree and measure the difference between B0 and B1. We repeat this a number of times. Where the difference between B0 and B1 is the greatest, the degree of rotation can be detected. We can implement the same technique for translation. The next problem occurs when we apply the blur filter on the watermarked image. To retrieve the watermark from this image, we use again the two additional bits as in the following:
If
! B + B1 ( B − Bij ) > 0 2 !
If ( B − B
)< ij
B 0 + B1
then 1 is embedded
then 0 is embedded
(7)
(8)
2
7 Conclusion We have implemented a watermark technique that is working on a JPEG image, which is supplied with RGB color space. The watermark system is tested on JPEG images with size up to 600x800 DPI. As mentioned, we had to find an optimal value of q in equation (1) and a suitable number of pixels for the embedding process. The system is tested in two different ways: 1. With a fixed number of pixels for embedding, fixed value of q (equation 1), c=3 equation (3) and a watermark of length 32 which gives the following results: Number of pixels for embedding Invisibility of watermark Value of q Robust over rotation Robust over translation Robust over blur filter 5x5 Robust over blur filter 3x3 Robust over JPEG compression 60% Robust over quantization
2.
256 512 1024 2048 16384 16384 Invisible Invisible Invisible Invisible Invisible Invisible 0.4 0.4 0.4 0.5 0.1 0.15 No No No No Yes Yes No Yes Yes Yes Yes Yes No No No No No Yes No No No No Yes Yes No No No No Yes Yes No No Yes Yes Yes Yes
With dynamic size of number of pixels for embedding which is 35 % of the total pixels of the image of size up to 600x800, c= 3 and q=0.2.
58
Hamid Reza Mehrabi
The latter model gave the best result, which means that: • The watermark is completely invisible in the watermarked image • The watermark is robust over blur filter (3x3) • The watermark is robust over rotation • The watermark is robust over translation • The watermark is robust over compression at 60% • The watermark is robust over quantization Limitation in this method. • The algorithm cannot be applied on B/W and greyscale images. The reason is that these types have not RGB colour space. • Applying the dynamic model on a coloured image over 600x800 pixels results in higher running time. In this case the static model should be applied. • Applying the model on an image with white background results in yellow stripes in the watermarked image. If you have many images with white background the parameter q in equation (1) has to be reduced. The system is implemented in Linux operative system and running time in our dynamic model for embedding the watermark is under 2 seconds.
8 Literature [1] Digital Signature of Color Images using Amplitude Modulation, Martin Kutter, Frederic Jordan, Frank Bossen, Signal Processing Laboratory, EPFL 1015 Lausanne Switzerland. [2] The information theoretical significance of spatial and temporal masking in video signals.k in Proc. SPIE Human Vision, Visual Processing, and Digital Display, 1989, vol. 1077, pp 178-187. B. Giord. [3] Low bit rate near-transparent image coding, in Proc. SPIE Int. Conf. Wavelet Appls. For dual Use, 1995, vol, 2491, pp. 173-184. [4] Low bit rate near-transparent image coding, in Proc. SPIE Int. Conf. Wavelet Appls. For dual Use, 1995, vol, 2491, pp. 173-184. [5] JPEG STILL IMAGE DATA COMPRESSION STANDARD. William B. Pennebaker, Joan L. Mitchell.