Sophisticated Spatial Domain Watermarking by Bit Inverting Transformation

background and of to of The gamut of watermarking be used to encode The work also presents a wide array of algorithms ranging from intelligent bit replacement to more traditional methods like ICA. The current work is split into two books. Book one is more traditional in its approach dealing mostly with image watermarking applications. Book two deals with audio watermarking and describes an array of chapters on performance analysis of algorithms.


2
Will-be-set-by- IN-TECH to the watermarks involving the bit inverting. Also, the extending of ranges of k and the preserving of visual quality are contradictory subjects.
It is desirable to determine the values of k automatically for given source images to carry out the watermarking efficiently. To choose an appropriate bit k to be inverted in terms of visual quality, a human perceptual model is necessary. The perceptual model means a relationship between quantities representing objective qualities and human subjective qualities of the images being viewed, based on the human visual system (Awrangjeb & Kankanhalli (2004)). In other words, such a perceptual model is a function of objective quality measures that produces a subjective quality measurement as an estimation of human subjective quality. Various kinds of quantities have been proposed for the measurement of objective quality (Wang et al. (2004)). By adaptively determining the embedding parameters such as the values of k by means of the human perceptual model, the watermarking scheme can perform as a perceptually adaptive system (Cox et al. (2002)).
In the next section, the function of inverting signal bits is discussed. There a method for inverting a signal bit with making the resultant level change minimum is presented (Kimoto (2005); Kimoto (2007)). In this method, the inversion of the kth bit (k ≥ 1), where a 0th bit is a least significant bit, results in the change in the signal level by 2 k−1 or under for any input level. Also, randomly varying signals are added to the transformation outputs so as to improve signal quality (Kimoto (2006)). Both the function of inverting bits and that of randomizing levels are given as a single transformation. The performance of the transformation is analyzed in detail and also demonstrated by some experiments.
The next section treats some subjects regarding the implementation of the bit inverting transformation. First, the transformation domains are considered; a principle for defining domains of the transformation in the input dynamic range under limitations on level changes is formulated. Also, a method for dividing the input dynamic range into a union of transformation domains so that the blind watermarking can be achieved is described. Next, a scheme for embedding watermark bits in every image block using the transformation is presented with some experimental results.
In the next section, the subject of determining a kth bit to be inverted, or the value of k in the same sense, is discussed; a scheme for implementing the bit inverting transformation to embed watermark bits so that a required subjective visual quality can be achieved on the resulting image is developed (Kimoto & Kosaka (2010)). To derive an appropriate perceptual model for such images that are watermarked by the bit inverting transformation, first, objective quality measures are defined based on the properties of the transformation. Then, a subjective visual quality measure based on the objective quality measures is established by subjective evaluations of human observers. A perceptually adaptive image watermarking scheme using the perceptual model is presented. This scheme is aimed at embedding watermark bits in every pixel all over the source images in contrast with the block watermarking scheme described in the preceding section. The performance of the scheme is demonstrated by some experiments.

Bit inverting transformation 2.1 Inverting signal bits
Inverting a single bit of a signal can be expressed by a level transformation. Signal levels are supposed to be uniformly quantized to M bits and expressed from the M-bit sequence of 0 ···0tothatof1···1 in natural binary. Each bit in the binary expression is denoted by bit k for k = 0, 1, . . . , M − 1, and bit 0 means the least significant bit. For a given level v ∈ [ 0, 2 M − 1 ] and a specified value of k ∈ [ 0, M − 1 ], inverting the bit k of v transforms v to another level v ′ ; this transformation is described as a function t k of v in the relation where, letting ⌊ x ⌋ denote the integral part of the real number x, n = v/2 k ,a n dm has integers in the interval [ 0, 2 M−k−1 − 1 ] as a result. Each input level thus either increases or decreases just by 2 k .

Minimizing level changes
The amount of level change caused by an inverted bit can be minimized by altering the other bits of the signal appropriately. The principle for transforming the entire bit-pattern of a signal so as to achieve the smallest level change is illustrated in Fig. 1. Let b(v, k) denote a binary value of the bit k of a level v,a n db denotes the 1's complement of a bit value b. Suppose that the kth bit of a level v is to be inverted. Then, the inverting of the bit is performed by changing the level, that is, the entire bit-pattern to one of those patterns of level v ′′ which satisfy b(v ′′ , k)=b (v, k). Furthermore, the one of the v ′′ s that is closest to v can be chosen as v ′ to achieve the smallest level change. For the most of v,suc hv ′′ s exist in both sides of v in the dynamic range as depicted in Fig. 1.
Fig. 1. Changing signal levels for inverting a signal bit: Both inverting a kth bit and minimizing the resultant level change are performed by a single level transformation. Let Δ k = 2 k−1 where k now assumes values in the range 1, 2, . . . , M − 1. For a given k, the transformation of a signal level v can be expressed as a function f k of v, defined by Will-be-set-by-IN-TECH For k = 0, the transformation f 0 (v) has the special relation (1) depicted by the thick dashed lines, where k ≥ 1 (the box of thin dashed lines will be explained later). As shown in this figure, f k (v) possesses the almost staircase relations between input and output levels. The level difference resulting from the level transformation is also a function of the source levels. Figure 3 shows the difference between the transformed level v out = f k (v in ) and the source level v in in the entire source range, comparing with the difference caused by the transformation t k . The absolute magnitude of the difference, | f k (v in ) − v in |,variesintherange from 1 to Δ k , which is less than or equal to the half of the difference caused by t k , for the source levels v in over the interval [ Δ k ,2 M − Δ k − 1 ]. On the contrary, for a level v in in the interval [ 0, Δ k − 1 ], those levels available for bit inversion exist only on the upper side of v in because of the end of M-bit levels. Accordingly, all the source levels in the interval are to be transformed to thesmallestoneamongtheavailablelevels,2Δ k . The resulting level differences consequently get over Δ k in the interval. A similar end effect occurs for the input levels in the interval [ 2 M − Δ k ,2 M − 1 ]. In this paper we refer to these two intervals as the end-effect intervals.

Modifying level transformation
The M-bit end effects can be removed by translating the coordinate system. Both of the axes of the coordinate system are translated by Δ k to the positive direction so as to avoid the lower 94 Watermarking -Volume 2 www.intechopen.com Sophisticated Spatial Domain Watermarking by Bit Inverting Transformation The translated coordinate system is depicted in Fig. 2 Using Eqs. (5) and (6) in Eq. (3), we obtain the relation This equation indicates that the inversion of bit-k holds between v ′ + Δ k and g k (v ′ )+Δ k . By carrying out the above addition of Δ k in modulus of 2 M , we can correspond the interval of v, and thus, the upper end-effect interval no longer exists in the translated coordinate system.
In the new coordinate system, the function g k is defined by a level transformation from an input level v in ,thatis, where and, as described later, k ≥ 1. Thus, this transformation maps 2 M consecutive source levels into 2 M−k+1 discrete output levels. Figure 4 shows the input-output relationship of the transformation g k . The transformation is no longer affected by the M-bit end effects. Hence, the level change has the absolute magnitude in the range [ 1, Δ k ] throughout the entire source range, as shown in Fig. 5. Thus, the function g k yields the smallest difference for each input level while achieving the bit k inversion in terms of Eq. (7). Note that it is the bit (k − 1) of g k (v in ) that is actually inverted compared with v in , and the level change is not the smallest for each input level in the situation of bit (k − 1) inversion. This performance holds for 1 ≤ k ≤ M − 1. Hence, g k has been defined in this range of k.
We extend the range of the transformation outputs within the M-bit dynamic range to improve the resulting image quality. In the pulse code modulation (PCM), dithering signals has effects on improving subjective image quality. Then, we consider distributing the transformed levels in the dynamic range by a stochastic process. A transformation from the outputs v out = g k (v in ) further to v ′ out is developed so that all the following three conditions can be satisfied: (i) The inversion of bit-k holds in terms of   (iii) The amount of level change is limited so as not to increase excessively. Taking into account that the largest change caused by g k is Δ k levels, we determine this limitation The above v ′ out can be obtained by adding an appropriate random level to v out . Generating such v ′ out from input level v in is performed using a single level transformation expressed in the relation where n = ⌊ v in /Δ k ⌋ and r has arbitrary levels in the range Thus, R k (v in ) varies in the range [ 0, Δ k − 1 ].T h ev a l u eo fr is supposed to be determined within the range in a stochastic manner. Thereby, h k (v in ) is a stochastic function whose output range depends on v in as follows: The number of levels composing the output range varies in [ 1, Δ k ].H e n c e , t h e l e v e l randomization is effective for k ≥ 2. Figure 6 illustrates the input-output relationship of v ′ out = h k (v in ) by showing the ranges where the output levels vary by the shaded areas. As seen in the figure, the range of v ′ out spreads all over the M-bit dynamic range, compared with that of v out = g k (v in ).T h e difference |v ′ out − v in |, however, tends to get larger than its smallest value for each v in ,t h a t is, |v out − v in |, according to the stochastic manner being used.

Amount of level change
According to the definition of h k ,theoutputlevelv ′ out = h k (v in ) varies in a stochastic manner, and so do the level differences between v ′ out and v in . Figure 7 illustrates the level differences for input levels v in . We evaluate the amount of level change caused by h k by stochastic analysis. In the analysis, we assume that M-bit levels in the dynamic range [ 0, 2 M − 1 ] are uniformly distributed over the input signals. Also, the values of r in Eq. (11) are assumed to be equally likely in the range assigned for each input level.
For a given k,a ni n p u tl e v e lv in is rewritten as v in = n Δ k + w using w in the case that w h e r er is randomly chosen in [ 0, w ], and hence, it is a stochastic variable of a uniform occurrence probability of 1/(w + 1).
. Transformation function with level randomization, h k : The thick solid lines show the input-output relationship of g k for reference. a certain r.T h u s ,d ′ is also a stochastic variable ranging in [ Δ k − w, Δ k ] for each w. Then, the expected value of the squared d ′ are summed over the range of w from 0 to Δ k − 1intheform

98
Watermarking -Volume 2 www.intechopen.com The same value of sum is obtained in the case that n is odd. Consequently, averaging the above sum over Δ k levels yields the mean of the squared level differences over the entire dynamic range, denoted by E H (k), on the above assumptions. As a result, we have

Change of level occurrences
The difference in width among the ranges where the values v ′ out = h k (v in ) vary for a given v in makes the occurrence probabilities of output levels unequal. We have analyzed the occurrence frequencies of v ′ out on both the assumption that M-bit input levels are uniformly distributed in the dynamic range and the assumption that output levels for a given input level v in are equally probable in the range of h k (v in ). Suppose that any input level has a frequency of 1. Then, for Hence, for input levels of the uniform frequency distribution, the output levels of h k has the frequency distribution as illustrated in Fig. 8. Although the output range of h k spreads over the entire M-bit range, in every two ranges of Δ k -level width the order of two ranges are reversed through the mapping, as shown in Fig. 9. These reversed ranges result in distortions on the picture surface.  Will-be-set-by-IN-TECH Fig. 9. Correspondence of h k between input and output levels.
g k can be evaluated similarly to that caused by h k .F o r a g i v e nk, the mean squared level difference for the signals transformed by g k , denoted by E G (k),isgivenby With regard to the function t k ,f o rag i v e nk, the magnitude of level change caused by the transformation is 2Δ k for any input level. Then, the mean squared level difference, denoted by E T (k), is obviously 4Δ 2 k . For comparison, we consider another method for extending the output levels of g k within the dynamic range in a stochastic manner; that is, for a given k,a l lt h el o w e s t(k − 1) bits of g k (v in ) are replaced with random ones for any v in .W ee x p r e s sg k (v in ) and the following bit replacing operation together as a single function of that is determined from the input interval including v in . The whole range of h ′ k coincides with the M-bit dynamic range. Also, on the assumption that input levels have a uniform frequency distribution in the dynamic range, the frequency distribution of the output levels gets uniform. As a disadvantage, h ′ k tends to increase the resulting level change; the upper bound of the level difference |h ′ k (v in ) − v in | depends on v in and varies in the range [ Δ k ,2 Δ k ). The expected value of MSD is given on the assumption that output levels for each input level are equally probable in Δ k levels by Table 1 lists the MSD values of each transformation for k = 2, 3, 4 and 5. In comparison for agiv e nk, g k reduces substantially the MSD from that of t k ; the ratio E G /E T is, for example, 0.12 for k = 3, and approaches approximately to 1/12 for large k's. The transformation h k increases the MSD from that of g k due to the level randomizing; the ratio E H /E G is 1.52 for k = 3, and about 11/6 for large k's. On the other hand, the MSD of h k is smaller than that of h ′ k ; we find the ratio E H /E L to be 0.62 for k = 3 and about 11/21 for large k's.

Experiments of transformation
To visualize the input-output relationship, we have conducted each transformation of t k , g k , h k and h ′ k on an 8-bit grayscale ramp image where the pixel level increases at one per pixel from 0 (black) to 255 (white) along the gradation. Figure 10 shows the transformed results with k = 5. Also, Fig. 11 illustrates a one-dimensional pixel sequence along the ramp of Fig. 10 showing an example of the stochastic output levels of h k . In accordance with Fig. 2, although the results of t 5 has all levels in the dynamic range, there are level gaps every 32 (= 2 5 ) levels as observed in Fig. 10(b). In the gradation transformed by g 5 of Fig. 10(c), we may perceive eight steps while the result actually has 16 different levels.
can reach the utmost 2Δ k − 1 as shown in Fig. 11. Hence, the visible steps in Fig. 10(c) are divided into halves in Fig. 10 Fig. 10(e) looks similar to that of h k (Fig. 10(d)) though the level frequency distributions in the dynamic range are different. Note that an extremely large value of k has been used in Fig. 10 so that the input-output relationships get evident.  d) and (e) transformed images by t k , g k , h k and h ′ k , respectively. All images are printed at 200 pels/inch. We have also conducted experiments of each transformation on 8-bit monochrome test images. All the pixels in an input image were transformed to evaluate the level changes in terms of visual quality. Figure 12 shows results of the transformations for one of test images, Lena. We can observe a distortion pattern similar to that in Fig. 10, in particular, in smooth image areas such as the shoulder in each image of Fig. 12. Such distortions can be referred to as false contours after those caused by coarsely quantizing pixel levels.
The amount of level change from the source image has been estimated an MSD value for each transformed images. The MSD between a source image f and the transformed image f ′ is 101 Sophisticated Spatial Domain Watermarking by Bit Inverting Transformation www.intechopen.com generally defined by where f (i, j) and f ′ (i, j) are the respective pixel levels in f and f ′ at the coordinates of (i, j), for i = 1, 2, . . . , M and j = 1, 2, . . . , N supposing that both f and f ′ are M × N images.

Limitations on level changes
It is necessary to make level changes caused by a transformation imperceptible both for keeping the embedded watermarks secret and for preserving the image quality. Here, we assume that a range where a pixel level can be changed without being perceived depends only on the own pixel. Then, let us express the upper limit of the range for a source level v as a function only of v, A(v), supposing that A(v) ≥ 0; that is, a source level v is allowed to change within the range On the above assumption, for a pixel of level v, if the amount of level change caused by a transformation is to be under A(v), the transformation can be actually applied to the pixel. We use the function h k as the level transformation for watermarking in the rest of this chapter, and let d k (v)=h k (v) − v. As described in Sec. 2.5.1, for a given v, d k (v) varies in the range that depends on v, and the upper bound of |d k (v)| is fixed to Δ k for any v. Accordingly, we regard |d k (v)| as the constant Δ k to determine if the transformation h k can be applied to a pixel or not. That is, given the function A(v), for a pixel of level v,i fΔ k ≤ A(v) with a certain k, then the level can be changed by h k (v). Otherwise, the level is left unchanged. The function that keeps v unchanged is expressed by the identity transformation, denoted by f I (v) such that f I (v)=v.

Transformation domains
Given the bounding function A of an input level and a value of k, according to the scheme described in the preceding section, each input level v in of the dynamic range is classified into two categories: one that h k can be applied to, and the other that f I is to be applied to.
Consecutive input levels of the same category, then, are collected to compose domains of each transformation. The entire dynamic range of input levels, denoted by U M =[0, 2 M − 1 ],is consequently expressed as a disjoint union of one or more domains. Let U be a sequence of these domains in order, where φ(k) is the number of domains for the k.N o t e that the domains of h k and those of f I alternate in the sequence.
Next, we modify the domains in U M so that a blind watermark can be achieve, that is, so that a watermark can be recovered from the transformed image without referring to its source image. Our approach is to make the transformation output ranges disjoint to each other. Let 2, . . . , φ(k). If these ranges are disjoint mutually, for any output level v out , the range containing it, say, V (k) j ,isdetermined uniquely. This range directly indicates not only the corresponding domain, U (k) j , but also the kind of transformation that is to be applied to the domain. Consequently, it is found whether a pixel is one of those pixels that h k can be applied to or not. Furthermore, with regard to domains of h k and the corresponding regions, say, U then, for pixels of source level v in ∈ U (k) j ,wecanuseeitherh k to have the bit-k inverted or f I to keep the bit-k unchanged.
Based on the input-output relationship of h k , the domains that have the disjoint relationship among the corresponding regions are defined every 2Δ k levels in the dynamic range, that is, the boundaries of each domain must be located at the levels of 2mΔ k (0 ≤ m ≤ 2 M−k ).S u c h domains also satisfy Eq. (19).

Data structure for watermarks
As a data structure for representing watermarks, we use bit-planes of a monochrome image or a color component image composed of M-bit pixels, which was also used by Oka & Matsui (1997). As depicted in Fig. 13, first, a source image is divided into pixel-blocks each consisting of N B pixels. More generally, these blocks can have arbitrary shapes rather than rectangles, and besides, even N B can be varied in the same image. Then, each pixel-block is regarded as ahierarchyofM bit-blocks. Suppose that a pixel is composed of M bits, a bit (M − 1) to a bit 0, that represent the signal level in the natural binary expression. A bit-block k is a set of all the bit k of each pixel in the pixel-block, for k = 0, 1, . . . , M − 1.
A watermark bit is represented by a parity value in one of the bit-blocks. Here, the parity value of a set of bits is defined by the sum of the bits in modulo 2. Suppose that to achieve the watermarking, one bit in each bit-block is to be inverted, if necessary, so that the resultant parity value can agree with the watermark bit. The details of the watermarking procedures will be described in the next section.

Watermarking procedures
The procedures for watermarking in the data structure of bit-blocks by using the function h k are described below. Here, suppose that the domains of h k in the M-bit dynamic range are given for each value of k. Suppose also that a value of k is assigned to each pixel-block of a source image F. A set of these values of k is associated with the watermarked image and it must be kept secret.
(1) Embedding procedure Each pixel-block is processed in order. Let P (i) be the ith pixel-block being processed, which is expressed as a sequence of N B pixels, that is, P (i) = p (i) 1 , p (i) 2 , ..., p (i) N B ,fori = 1, 2 and so on. For the value k i assigned to P (i) , the block is processed by the following procedure: Step 1: Extract from P (i) those pixels whose levels belong to the domains of h k i .L e tP (i) e be a set of these pixels and n e be the number of the pixels.
Step 2: Compare n e with a specified threshold N E (1 ≤ N E ≤ N B ). The result determines how to treat the block with a watermark bit as follows: (a) If n e ≥ N E , we use this block to represent a new watermark bit. Proceed to Step 3.
(b) If n e < N E , we skip this block without using it to represent any watermark bit. Proceed to the next pixel-block.
Step 3: Collect the bits b(v Step 4: Fetch a new watermark bit, ω,andcompareitwithy. (a) If ω = y, choose one pixel from P (i) e , and apply h k i to it.
(b) Otherwise, no operation is done to P (i) e . Proceed to the next pixel-block.
After all the pixel-blocks of F are processed, the watermark image F ′ is obtained.
(2) Extracting procedure . P (i)′ is processed using the same k i and N E as those used for P (i) by the following procedure: Step 1: Extract from P (i)′ those pixels whose levels belong to the ranges of h k i .L e tP (i)′ e be a set of these pixels and n ′ e be the number of the pixels. The disjoint union of the transformation ranges ensures that n ′ e is equal to n e of P (i) .
Step 2: Compare n ′ e with a specified threshold N E . (a) If n ′ e ≥ N E , proceed to Step 3 to find out the watermark bit. (b) If n ′ e < N E , it is found that this block contains no watermark. Proceed to the next pixel-block.
Step 3: Collect the bits b(v .A sar e s u l t ,y ′ gives the watermark bit directly. Proceed to the next pixel-block.
The threshold N E can be altered every pixel-block. Furthermore, being kept secret, N E is expected to improve the concealment of watermarks.

Domains defined by Weber's law
We demonstrate the defining of transformation domains by using a bounding function for level change, A(v), as described in Sec. 3.1. To specify this function, as an example, we here use Weber's law, which is known as a description of human visual properties for luminance contrast (Jain (1989)). This law states the experimental result that ΔL/L is constant where ΔL is the magnitude just noticeably different from the surround luminance L. Assuming that this law holds true in the entire M-bit dynamic range, we can express it for a luminance level v in the fractional form: Δv where v 0 is a fixed level equivalent to a light intensity on human eyes at v = 0, and α is a constant known as Weber's ratio. Letting M = 8, we now consider 8-bit levels in the range [ 0, 255 ]. From a result of our preliminary experiment for measuring contrast sensitivity of human eyes on a liquid crystal display (LCD), we have observed two pairs of approximate values, Δv = 8atv = 192 and Δv = 4atv = 64. By using these values in Eq. (20), then, we obtained v 0 = 64 and α = 0.03, which is comparable to a typical α of 0.02.

Suppose that we can replace Δv with A(v); that is, Eq. (20) is rewritten as
For simplicity, approximating Using A(v) with Eq. (22)  Domains

Examples
We have carried out an experiment of the bit-block watermarking scheme using 8-bit grayscale test images to evaluate visual quality of the resulting images. In the experiment, the location of an isolated pixel to be transformed was fixed at the center of each block. Generally, a pixel to be transformed can be chosen at random among available pixels in each block. Besides, the transformation h k was always performed for each block. Note that, assuming that a watermark bit is a random variable, a half of the pixels being processed in the experiment are expected to be actually transformed by h k . Figure 14 shows an example of the results transformed with pixel-blocks of 3 × 3pixelsand k = 4. Figure 14(b) includes those pixels which were transformed by t 4 and changed by 2 4 levels. These pixels are considerably perceptible. In contrast, those pixels which were transformed by h 4 in Fig. 14  image is reduced. The second phase is caused by the level randomization. In this phase the number of levels appearing in the image increases while the change from the source image increases accordingly. Each phase of distortion affects the image quality in different manners.
(1) Distortion in low-detail image regions The first phase of the distortion affects particularly the quality of low-detail image areas. Visible false contours are likely to appear in such smooth areas due to the effect similar to coarse quantization. As described in Sec. 2.6.2, randomizing output levels can improve visual quality by making the steps of false contours narrow.
(2) Distortion in high-detail image regions We consider a local image area where source levels are bounded in a small range. If the source level range is [2mΔ k ,2 (m + 1)Δ k ), the transformed levels lie in the same range, as Fig. 8 has shown. On the contrary, if the source range of 2Δ k levels is [(2m + 1)Δ k , (2m + 3)Δ k ),t h e transformed levels lie outside the range and no levels appear inside the original range as shown in Fig. 15(a). If the source range of 3Δ k levels is [(2m + 1)Δ k ,2 (m + 2)Δ k ),therealso exists an empty range where no transformed levels appear (Fig. 15(b)). Both the replacement of ranges and the missing of ranges cause distortions in the texture of the local areas. Fig. 15. Transformation h k from bounded source ranges: Source levels are assumed to occur uniformly in the range.

Objective quality measures
The level transformation h k causes distortion in the source image, and thus, degrades the image quality. According to the performance analysis of h k ,w eh a v ed e fi n e dt w ok i n d so f objective measures to evaluate the distortion.
(1) Change of signal levels 109 Sophisticated Spatial Domain Watermarking by Bit Inverting Transformation

www.intechopen.com
The first measure is the mean squared difference (MSD) between two images, defined by Eq. (18). The MSD value, D msd , of a watermarked image (or an image region) evaluates the mean distortion over the entire area of measurement.
(2) Change of level occurrence distributions By h k in every interval of 2Δ k levels in the input dynamic range, the upper half and the lower half are mapped inversely into the output dynamic range, as already shown in Fig. 9. To evaluate the change in the level occurrence distribution, we define the square variation of level occurrence between a source image X and the transformed image X ′ , denoted by D dst , by where λ i and λ ′ i are the relative occurrence frequencies of a signal level i in the picture X and X ′ , respectively, for i = 0, 1, . . . , 2 M − 1, satisfying

Subjective testing
To find a correlation between the objective qualities and the subjective quality of the transformed images, we have carried out the subjective evaluations by human observers (Kimoto (2008)). In the measurement of image quality, we used a rating-scale method (Netravali & Haskell (1988)) where the observers viewed the test images and assigned each image to one of the given ratings. The results were presented by computing a mean value from the numerical values corresponding to the ratings, which is referred to as a Mean Opinion Score (MOS).
The testing materials were prepared in the following way: Here, assuming that M = 8, that is, we have only considered 8-bit images.
-The function h k was implemented with a pseudo-random number generator of a computer in the stochastic process.
-The test images were printed on photographic papers in 200 pels per inch with an image printer, which has a printing resolution of 400 dots per inch.
All the observers, who were all in their twenties, were unfamiliar with the performance of h k .
They were asked to look at the materials sitting at a desk under ceiling lights inside a room.
Two kinds of source images were used in the testing. The first one is a 256-grayscale ramp image where the pixel levels vary linearly from 0 to 255 extending from the top side to the bottom side. Thus, the ramp image represents a low-detail region. The transformation h k makes the linear gradation of levels distorted in the output image. Accordingly, transforming the source ramp with varying both the value of k and the ratio of pixels chosen to transform in the image, which is referred to as the transformation ratio τ, yields the distorted images of various values of D msd . In the measurement of subjective quality each test image was not compared with the source image, but evaluated from a viewpoint of the appearance of level gradation and assigned one of the five ratings of the absolute rating scale listed in Table 4(b).
The other kind of source image was a granular image representing a high-detail region. The source images used in the measurement were composed of pixels of (pseudo-)random levels ranging uniformly in bounded intervals of a width of a multiple of Δ k levels for a given k. According to the stochastic analysis of the mapping characteristics, the transformed images have the same D msd (more strictly, almost same D msd with a small difference due to the pseudo-random numbers) and the different D dst depending on the source intervals. Each transformed image was compared with the source image just printed beside on the same paper and then, evaluated according to the degree of perceptible difference with the impairment rating scale listed in Table 4(a). Thus, eleven scores were collected for each test image, and the MOS was calculated from them.
(a) (b) Value Rating 5 Imperceptible 4 Perceptible but not annoying 3 Slightly annoying 2 Annoying 1 Very annoying Value Rating 5 Excellent 4 Good 3F a i r 2 Poor 1B a d Table 4. Ratings used in the subjective testing.

Subjective quality measure
In the evaluation of the ramp images, a subjective quality of each test image of a different D msd value was measured in MOS. The result has indicated an approximately linear correlation between the subjective quality and the logarithms of D msd . Consequently, we have observed that D msd has the primary effect on the estimation of MOS for the images transformed by h k .
In the evaluation of the granular images, those test images transformed with the same k have the same D msd and the different D dst . The result has demonstrated that, for a given k,t h e MOS values S mos decrease as the D dst increases. Accordingly, we suppose that the correlation between S mos and D dst can be considered approximately linear, while the gradient of linearity varies with the value k.
For a transformed image region, let us consider a subjective quality measure as a function of two parameters, D msd and D dst , that can estimate a subjective quality of the distortion, where D msd and D dst are measured by comparing the distorted image with the source image. According to the above analysis of the measurements, we suppose that a subjective quality measure S mos can be expressed as a linear combination of the logarithm of D msd and D dst : That is, where α, β and γ are parameters to be estimated by multiple linear regression analysis.
To carry out the regression analysis, we used the triplets of {S mos , D msd , D dst } measured from the test granular images described above. Thus, 54 measurements of the dependent variable S mos at 12 different values of the independent variable vector (D msd , D dst ) were obtained and used in the multiple linear regression analysis. As a result, the values of α, β and γ are determined asα = −0.46,β = −0.70 andγ = 6.4, (25) respectively. Here, the resulting coefficient of determination, which is commonly denoted by R 2 , is 0.86. Let S e be a predicted value of S mos by Eq. (24)  To evaluate the effect of D dst on the modeling of S mos , we have also used a simple linear regression model of one independent variable of D msd .I nt h ismodel,S mos is expressed in the form where α ′ and γ ′ are the model parameters. By using the same data as those used in the above multiple regression analysis, these two parameters were estimated from 54 measurements of S mos at four different values of D msd in simple linear regression analysis. As a result, we obtained the estimated values of α ′ and γ ′ aŝ respectively. Here, the resulting value of R 2 was 0.55. The values of S mos predicted by this model have been compared with the measured values. The relation between the measured and predicted values of S mos of Eq. (24) has higher correlation than that of Eq. (26) as a result. Thus, D dst improves the linear model of S mos as one of independent variables.

Block processing procedures
The subjective quality measure S e gives an estimate of subjective quality for each image region on the assumption that the entire region is transformed with a given value of k.L e tS e (k) denote the value of S e resulting from the transformation with the parameter k.
By using the subjective quality measure S e , we can examine whether the transformation of an image region with a value of k satisfies a given condition of subjective quality. Accordingly, the measure can determine the values of k to transform an image region with so that the desired subjective quality can be achieved. To enhance the difficulty of detecting the values of k in use, the largest one of the available k's is to be chosen. Furthermore, the value of k to use can be changed for each image region.
To implement the above adaptive watermarking, we determine both a threshold value S T comparable to the subjective quality measure and an upper limit of available k,w h i c hi ss e t equal to M − 1 here for simplicity. The S T can be determined from the ratings listed in Table 4.
Here, let us assume the transformation ratio is 1. Then, the value of k for each image region, The region is actually transformed with k B . Thereby, the subjective image quality of S e (k B ) is achieved in the transformed region.
The procedure for implementing Eq. (28) is carried out in each image region, starting from k = 1 as follows: Step 1: Transform the region with the value of k.
Step 2: Calculate D msd by Eq. (18) and D dst by Eq. (23) within the region.
Step 3: Calculate S e (k) as S e of Eq. (24) with the specified coefficients of Eq. (25).
Step 4: Compare S e (k) with the given S T .I fS e (k) < S T , then, k B = k − 1. Otherwise, increase k by one, and repeat from Step 1.

Examples
Simulations of the adaptive watermarking were carried out. The test images of 256 × 256 8-bit pixels, which are well known as Lena, Peppers, Cameraman and so on, were used as the source images. The adaptively watermarking procedure was implemented in each block of 4 × 4 pixels in the simulation with various threshold value S T . Fig. 16 shows an example of the values of the parameter k B that were determined for each block by the adaptive scheme. From this figure it is observed that the adaptive scheme performs such that in the low-detail regions such as the sky, where the human visual system is sensitive to distortion (Netravali & Haskell (1988)), k B 's of small values are assigned, and in the high-detail regions such as the lower half area of the image, k B 's of large values can be used.  Table 5 shows for the source image Peppers the distribution of the values of k B that were determined by the adaptive scheme for various S T . With increasing S T the ratios of large k B 's decreases, and the average of k B decreases accordingly. Table 5 also shows the value of S e averaged over all the blocks in the image. As this result indicates, the averaged value of S e was achieved at about 0.5 greater than the given threshold for each of the images in the simulation. The reason why this difference is likely to occur is considered that only integers are available for k.
Examples of the images resulting from the same source image for S T = 3.0, 4.0 and 5.0 are shown in Fig. 17. From these images it is observed that the better visual quality is certainly achieved as the threshold quality S T is set larger.

Validity of subjective quality measure
We consider the validity of the subjective quality measure in this section. When we look at an image, we usually evaluate the quality of the whole image. Taking account of this fact, we compare the subjective quality measure to human evaluations in terms of the whole image quality.
Using various images produced in the simulation of the adaptive scheme, first, we have carried out the subjective evaluations of visual quality by use of the impairment rating scale listed in people for each image, who were given no information about the making of the images. Note that these S mos 's are the human evaluation of the whole image quality. Next, to estimate subjective quality of the whole image from a collection of the calculated values of block quality, the block values S e were averaged over all the blocks in each image, and the mean value S e is obtained. Fig. 18(a)-(c) shows the relationship between the mean value S e and the measured S mos in each of the three test images. A linear correlation between S mos and S e is clearly observed from either result in this figure. However, the slope of the linear regression line is 1.9, 1.8 and 2.2 in Fig. 18(a), (b) and (c), respectively.
This inclined linear correlation results in the incorrect prediction of subjective quality by the developed measure; for example, as Fig. 18 shows, viewers evaluated the quality of the image at the worst MOS of 1, while the mean value of block quality indicates that the image possesses the quality of MOS of 3.
The value S e can be corrected using the corresponding value of S mos by linear regression analysis. The linear regression model is expressed in the form where μ and ν are to be estimated by simple linear regression analysis. To carry out the analysis, we collected the pairs of {S e , S mos },w h e r e1 ≤ S e ≤ 5, from the results of three images shown in Fig. 18(a)-(c). As a result, the parameters μ and ν are estimated aŝ μ = 1.9, andν = −4.4, respectively.
Using Eq. (30), the values of S e in Fig. 18(a)-(c) were modified to S e ′ . The resulting relationships between S mos and S e ′ are shown in Fig. 18(a)'-(c)'. In this figure, each value of S mos is shown with its 95% confidence interval. The slope of any linear regression line in the figure is about 1.1. Furthermore, from the viewpoint of the confidence intervals of MOS, the linear correlation looks almost valid. Consequently, S e ′ canbeusedtopredicttheevaluation of subjective quality for at least these three images.

Conclusion
The first result of this chapter is the bit inverting transformation, h k . This level transformation performs all the three functions simultaneously: (a) It represents the inversion of a specified bit; (b) it reduces the level change caused by the bit inversion to the minimum; and (c) it adds a random variation to the output levels under limitations on level changes. The transformed level that has both the specified, say, kth bit inverted and the level change minimized includes the lowest (k − 1) bits either of all 1's or all 0's. In contrast, for most of the input levels, some of these bits or all of them are replaced with random bits by randomly varying the transformed levels. Accordingly, the transformed pixels are hard to discriminate without any information regarding the locations in the watermarked images.
The properties of the subjective quality measure, which is the second result of this chapter, are summarized below: -The subjective quality measure is the function of two objective quality measures, D msd and D dst , which are both obtained from each image region. Consequently, the subjective quality measure is essentially to be carried out in block processing.
-The subjective quality measure estimates a value of MOS in the impairment rating scale. Hence, a threshold value for the measurements can be given in terms of subjective evaluation.
-The values of the subjective quality measure are dependent both on the bit position to be inverted and on the image texture. This property enables the bit position to be altered according to the image texture so as to achieve the adaptive scheme.
The subjective quality measure was derived from the measurements of the computer synthesized test patterns. The validity of the measure for images of natural scenery was examined in terms of the whole image quality. We obtained the whole image quality value by averaging the block quality values over the image. In the experiment using three test images, a highly but inclined linear correlation was observed between the mean value and the actually measured MOS. Although the inclined gradient was successfully corrected by simple linear regression analysis for the images used in this experiment, the cause of the difference between the estimated values and measured values may be related to human eye's characteristics (Netravali & Haskell (1988)). Accordingly, we have to consider a method for estimating the whole image quality from block qualities in more detail.
Another remaining subject is related to the block size of the subjective quality measure. The block size of 4 × 4 has been used in the experiment. The block size is related to the resolution of quality measure. Besides, because a bit position to be inverted is decided at each block in the adaptive scheme, as many bit positions as the blocks must be stored in a secure manner. From these viewpoints, the appropriate block size should be considered.