Semi-Fragile Image Authentication based on CFD and 3-Bit Quantization

There is a great adventure of watermarking usage in the context of conventional authentication since it does not require additional storage space for supplementary metadata. However JPEG compression, being a conventional method to compress images, leads to exact authentication breaking. We discuss a semi-fragile watermarking system for digital images tolerant to JPEG/JPEG2000 compression. Recently we have published a selective authentication method based on Zernike moments. But unfortunately it has large computational complexity and not sufficiently good detection of small image modifications. In the current paper it is proposed (in contrast to Zernike moments approach) the usage of image finite differences and 3-bit quantization as the main technique. In order to embed a watermark (WM) into the image, some areas of the Haar wavelet transform coefficients are used. Simulation results show a good resistance of this method to JPEG compression with $\mbox{\rm CR}\leq 30\%$ (Compression Ratio), high probability of small image modification recognition, image quality assessments $\mbox{\rm PSNR}\geq 40$ (Peak signal-to-noise ratio) dB and $\mbox{\rm SSIM}\geq 0.98$ (Structural Similarity Index Measure) after embedding and lower computation complexity of WM embedding and extraction. All these properties qualify this approach as effective.


I. INTRODUCTION
I N the Future Generation Services, it is very important the copyright protection in digital media such as motionless images, videos, audio files and so forth.Several methods are well known for authentication within cryptography, e. g. digital signature (DS) [1].But if DS is appended to the work it can be corrupted or even lost in ordinary usage.If strong authentication is required, it is necessary to add an extra size of about 1,000 bits [1].Moreover, it is quite common to compress digital images by means of the JPEG/JPEG2000 algorithms and then verification of the appended DS can be broken.The way out of this situation is to embed the DS into digital images (DI) using a watermarking technique.The first problem in the design of WM-based authentication is to build the so-called reversible WM where DI can be reversed exactly after correct WM extraction.Such technique has been proposed in many papers [2], [3], [4], [5].But in our scenario with possible JPEG image compression it is required, in addition, that authentication be tolerant to such transform and simultaneously be able to detect any modification of the image content.In contradiction with the exact authentication such one is called semi-fragile watermarking [6].
An attempt to solve this problem by means of such functionals as Zernike moments has been undertaken in [7], and other methods for semi-fragile or selective authentication were considered in [8], [9], [10], [11], [12].Recently, an useful idea of [7] concerning the usage of Zernike moments, adding the theoretical proof of the required properties and confirming the main results by simulation was presented in [13].Unfortunately, last method requires a rather complex calculation of the Zernike moments that increase significantly the time of WM embedding.In the current paper, there are proposed other DI functionals, namely central finite differences (CFD) [14], which are very sensitive to modifications of image content but simultaneously they are tolerant to JPEG compression with joint use of the so called 3-bit quantization.The calculation of CFD is much simpler than the calculation aiming to find Zernike moments, hence a reduction of the WM embedding time is obtained.Moreover, as experiments show that the new method allows to detect even small content modification better than the method considered in [13].
Since any color image can be presented as few gray-scaled channels, the algorithm can be applied either to each of the channels or to both of them independently.Let assume that, for images in the RGBmodel, a WM can be embedded only within the blue-channel component due to peculiar properties of Human Visual System (HVS).Due to these facts, we will examine only grayscale images.
The reminder of the article is organized as follows.Section II of the paper presents the main properties of CFD and the explanation of a hashing with help of 3-bit quantization method.In Section III, the embedding and extraction algorithms are considered.The simulation results are presented in Section IV.We conclude the paper in Section V.

II. THE MAIN PROPERTIES OF CFD AND DESCRIPTION OF HASHING USING 3-BIT QUANTIZATION
Central finite differences (CFD) of the first order is function {0, 1, . . ., n x } × {0, 1, . . ., n y } → Z + that is defined [14] as: In order to decrease the noise at CFD after JPEG/JPEG2000 compression it is proposed a convolution of the image luminance (I(x, y)| (x, y) ∈ {0, 1, . . ., n x } × {0, 1, . . ., n y }) with a two-dimensional Gaussian-wise filter having pulse response: where σ 2 characterizes the filtering parameter and n is the size of the Gaussian-wise window.After the two-dimensional convolution h * * I we get The corresponding CFD's δx (x, y) x,y , δy (x, y) x,y are obtained as in ( 1)-( 2) with replacing I(x, y) by Ĩ(x, y).Let us define δ(x, y) = δx (x, y) 2 + δy (x, y) 2  and let us consider the matrix G = δ(x, y) x,y (It is worth to note that the computation of Ĩ(x, y) by ( 3) can be simplified when the CFD's are presented as a trivial convolution).The elements of the matrix G are changing slightly after JPEG compression but unfortunately the size of this matrix is still very large to be embedded into DI.In order to decrease the size of this matrix it is proposed to perform the so called average downsampling technique [15] with integer parameters s and t, corresponding divisors of n x , n y , for horizontal and vertical directions: We call matrix D = [d(k, m)] k,m the image feature matrix.Then, let us quantize the values d(k, m) with some step ∆ ∈ R as where • is the floor map.For simplicity, we will present these values as a linear array, Now, it would be possible to authenticate the tested image Ĩ(x, y) x,y , given the embedded vector d ∆ and the corresponding vector d∆ calculated for the image Ĩ(x, y) x,y . Then, the following condition has been taken for the authentication rule But the use of the authentication rule ( 6) is inconvenient for two reasons.Firstly, the size of the authenticator d ∆ is rather big to be embedded into the image without significant corruption.Secondly, any adversary might be able to forge the authentication process because no cryptographic technique was used here.In order to avoid these two defects, it is necessary to hash the feature vector d ∆ and to obtain its digital signature.On the other hand, hashing the vector d ∆ after its corruption by JPEG compression results in error expansion.In order to recover d ∆ , after jumps of their coordinates in at most one quantization level, it is possible to use the so called 3-bit quantization technique [16] briefly considered below.Let us introduce an auxiliary perturbation vector p of dimension N = nxny st where the i-th coordinate contains three bits p 1i , p 2i , p 3i computed as follows: with

and [•]
2 the binary representation of the argument integer.Then, the vector d ∆ can be hashed.The obtained hash is signed with the use of cryptographic DS and then this DS is embedded jointly with the auxiliary perturbation vector p into the image.Verification of DS is performed by conventional cryptographic methods, where it is necessary only to recover the feature vector d∆ , corrupted possibly by JPEG/JPEG2000 compression of the original feature vector d ∆ .This can be performed as follows [16]  where otherwise and where [•] 10 is the decimal representation of the binary integer; (p 1i , p2i , p3i ) are the three bits of each entry pi of the perturbation vector p extracted as a WM and (p 1i , p 2i , p 3i ) are obtained from the perturbation vector p calculated by (7), (8) given by the corrupted image Ĩ(x, y) x,y ; d(i) is the i-th element of the feature vector given by ( 5) and the image (I(x, y)) x,y is the original one before recovering.
It has been proven in [16] that the feature vector d∆ can be recovered exactly by ( 9)-( 10) if the extracted auxiliary perturbation vector p is correct and the rule (6) is achieved.This rule will be valid if a corruption of the quantized feature vector entries d∆ (i) have transitions to at the most one neighbor quantization level.Hence, the proposed authentication method will be tolerant to JPEG compression of DI if the quantization step was chosen in such a way that the last requirement holds with the high probability.In the next section the methods of embedding and extraction providing acceptable error probability of both feature vector signature and auxiliary perturbation vector are considered.

III. EMBEDDING AND EXTRACTION ALGORITHMS FOR THE PROPOSED AUTHENTICATION METHOD
In order to embed both the feature vector d and the auxiliary perturbation vector p, the following properties are necessary for the embedding algorithm: • robustness to JPEG/JPEG2000 compression; • sufficient capacity to embed both d and p; • lower computational complexity; and • keeping a good DI quality just after embedding.Taking into account the requirements presented above, the embedding algorithm based on coefficients quantization of 3-level discrete Haar Wavelet Transform (HWT) [17] was selected.It was chosen only LH3 and HL3 submatrices for WM embedding because of their robustness to small noises that can be introduced by JPEG compression.However, as our experiments show, coefficients of LL3 having more evident influence on visual image quality after embedding should be omitted.Let us assume for simplicity that the DI is square, of order 2 m × 2 m .(We note that if the image I is not represented by a square matrix then it can be padded with zero elements).According to [17], two-dimensional forward and inverse HWT of the square image luminance values (2 m × 2 m )-matrix I of the can be found as: where S is the matrix of the HWT coefficients, and the super index T denotes matrix transposition.The recurrent relations [17] )-Haar single level matrices H m .The next level of HWT can be obtained if, instead of the original image I, the (2 m−1 × 2 m−1 )-submatrix of HWT approximation coefficients is used.Figure 1 shows the 3-level HWT coefficients submatrices with conventional notations.
As mentioned above, we chose only LH3 and HL3 coefficients as they represent low-frequency components of the image and have explicit robustness to the distortions introduced by JPEG/JPEG2000 compression, see Figure 1.Such approach allows to minimize DI corruption after embedding.The general schemes of embedding and extraction algorithms are presented in Figure 2 with correspondent notations.The quantized feature vector d ∆ is hashed and signed by some standard cryptographic algorithms [1] giving strong digital signatures s.Next, this DS and perturbation vector p is concatenated into one binary string b.In order to increase efficiency of authentication data transferring in the presence of corrupting noise Low-Density Parity-Check (LDPC) code [18] was applied.Encoded block b e represented by digits b e k is embedded into the coefficients S k belonging to HWT areas HL3 and LH3 (see Figure 1) by the following rule: where γ is a quantization interval of HWT coefficients, [•] is the nearest integer of a real number, and Sk is the coefficient after embedding the bit b e k .
In order to verify that DS is authentic, see Figure 2, it is necessary firstly to take a decision be k regarding the digits of the binary string b e using the decision rule where Sk are the coefficients S k into HWT areas HL3, LH3 that might be corrupted by some DI transforms.Decoding of received code word be was implemented with technique based on iterative belief propagation technique [19].
Next, it is necessary to extract the elements of the perturbation vector p from decoded data using (12) and the vector p calculated directly from the image by ( 7), (8), and then recover d ∆ , given the vectors d∆ , p and p .Then the recovered vector d ∆ is hashed to h and compared with the hash h obtained from the DS s with the use of the corresponding public key.If h = h then DI is recognized as authentic, otherwise it is assumed as fake one.

IV. SIMULATION RESULTS AND OPTIMIZATION OF THE PARAMETERS FOR THE PROPOSED AUTHENTICATION SYSTEM
First of all, it is necessary to investigate the sensitivity of the authentication system to JPEG/JPEG2000 compression.It will be tolerant to such compression if the rule (6) holds.We have selected 50 different 512 × 512 DI having varied content, textures and so forth.Then the HL3 and LH3 areas of HWT contains 2 × (2 6 ) 2 = 2 13 = 8192 coefficients.Every of them allows to embed one bit by the rule (11).
In order to provide some redundancy, the length of the feature vector d was taken as 2 10 = 1024 corresponding to the sizes 2 5 × 2 5 = 32 × 32 of the matrix D. This requires to take parameters s = t = 2 4 = 16 in (4).In such a way, the auxiliary perturbation vector p has 3 × 2 10 = 3072 bits length.As hash function, it was used the standard SHA-2 [1] and the DS algorithm based on RSA cryptosystem with length of modulo 1024 bits.Then, the total size of the embedded bits is 3072 + 1024 = 4096 bits.Given the total number of HWT coefficients in embedding domains it was chosen the (8192, 4096)-LDPC code to achieve appropriate error correction.
After the selection of the main parameters, it was performed an investigation of the authentication system efficiency.Figure 3 shows the dependences of the True Positive Rate (TPR) against space savings S = M c /M 0 , where M 0 , M c are sizes of the image before and after compression by means of: a) -JPEG, b) -JPEG2000, with different quantization steps ∆ used in the formation of d ∆ (k, m) by (5).We can see from Figure 3 that the greater is the Compression Rate, the better is image authentication method resistant to JPEG compression.However, due to the features of JPEG2000 that makes an image more blurred, proposed method has greater robustness to conventional JPEG compression.
The strongest requirements should be formulated for the opportunity to detect all image pixel modifications except for JPEG/JPEG2000 compression, for instance, some random modifications or malicious attacks intended to compromise the original image, for the thing, changing of car plate numbers for DVR systems, or fingerprints and photos of criminals in police offices.It is a trivial problem for exact authentication, provided that the cryptographic components, namely hash function and DS were selected in an appropriate manner.But it is a relevant problem for semi-fragile authentication because in this case some modifications may not be detected.In order to verify such opportunity for the proposed system we arranged the following experiment.It was selected a truly randomly square (a 0 × a 0 )-pixel areas and inside of these areas it was chosen truly random luminance of pixels.The number of these areas was taken at least 50 for each of the images and the number of different typical images as 100.The results of testing are presented at Figure 4, where a dependency of True Negative Rate (TNR) is showed as a function of areas size a 0 depending on quantization step ∆ of the feature vector coordinates.
From Figure 4, it can be seen that, in line with intuition, the less is a quantization step ∆, the more probably to detect small image modifications.
In Figure 5 there is presented a curve showing a dependence of the requested values of quantization steps ∆ against the size of modification area a 0 given a TNR of value at least 0.95.
By summarizing the experimental results, we can conclude that the proposed authentication method is tolerant to JPEG/JPEG2000 compression with parameter CR ≤ 0.3 providing simultaneously TNR≥ 0.95 for modification area size a 0 ≥ 8.
Image quality of DI just after WM embedding is also very important criterion of authentication system efficiency.We evaluate both Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index Measure (SSIM) [20] as they very common in the literature and image quality assessments can be compared with other methods.In Figure 6 it is presented the curves of image quality assessments PSNR and SSIM (in line with proposals [21]) depending on the quantization step ∆.We can see from this figure that the greater is ∆, the worse is the visual comprehension of the images.On the other hand the proposed system requires to keep ∆ to be not very small in order to WM be tolerant to JPEG compression.In Figure 7 it is displayed the visual effect of WM embedding for some chosen WM system parameters.There is no opportunity to find some differences between images (a) and (b).However, it is worth to note that reliable detection of the image modification has a greater importance than false detection after JPEG/JPEG2000 compression, because in the last case an error can easily be recognized, whereas the authenticated image content corruption may lead to fatal consequences.
It is obvious that for valid authentication system operation, the error probability after decoding of WM should be equal to zero even after image compression.problem. Figure 8 (a) shows a dependencies of bit error rates (BER) against quantization step γ for HWT coefficients depending on different values of JPEG compression factor Q. It can be seen that there are values of γ leading to BER= 0 in case when LDPC coding is applied, whereas on the contrary in case of watermarking without error correction code (ECC) BER is mostly non-zero.Figure 8 (b) presents the dependence of the quantization intervals γ on JPEG compression quality factor Q given the condition BER= 0.
From Figure 8 it can be seen that the selection of the quantization interval γ equal to 10 provides a resistant authentication method to JPEG compression with quality factor Q ≥ 4 and quality assessments PSNR ≥ 40, SSIM > 0.98 that can be assumed as acceptable values.
V. CONCLUSION A semi-fragile authentication system has been proposed in this paper that can be considered as an improved selective authentication presented previously [13].The main idea to solve this problem was to use image central finite differences as the property functionals of the image and next to apply 3-bit hash quantization providing a recovering of hash function even after jumps it arguments due to JPEG/JPEG2000 compression.
The 3-level discrete HWT was proposed in order to embed authentication data into DI, namely into massive of HWT coefficients belonging to HL3 and LH3 areas.Experimental investigation showed that proposed authentication method provides a good reliability to verify image quality authenticity even after JPEG/JPEG2000 compression with CR ≤ 0.3 and simultaneously an opportunity to recognize even small content image modifications and image quality assessments PSNR ≥ 40 and SSIM > 0.98 just after WM embedding.The proposed authentication system has an opportunity to trade-off the main criteria, such as BER, Q, PSNR, SSIM, TNR, and TPR, one to another and hence to choose the most important characteristics that are better than other with designer's point of view.With computational point of view the proposed method is simple enough.It requires less than about 0.1 sec for WM embedding and 0.2 sec for WM verification on computer with Intel Quad Core i5, 2.5 GHz processor.
It is worth to note that our method to form the feature vector after small modification is also tolerant to such image transforms as changing of size, luminance and contrast, that can be taken as practically full set of acceptable manipulations for content authentication.
However embedding and extraction algorithms after such transform belong still to open problem.Authors hope to solve them in the nearest future.

Fig. 2 .
Fig.2.The general scheme of embedding and extraction algorithms for the proposed semi-fragile authentication method tolerant to JPEG compression.

Fig. 7 .
Fig. 7. Original (a), and its watermarked version (b) of the image given by quantization interval of HWT coefficients γ = 40.

Fig. 8 .
Fig. 8. (a) Dependencies of bit error rates (BER) against quantization step γ for HWT coefficient depending on different JPEG compression factors Q.(b) Dependence of the quantization intervals γ on JPEG compression quality factor Q given the condition BER= 0.