A High Fidelity Authentication Scheme for AMBTC Compressed Image Using Reference Table Encoding

: In this paper, we propose a high-quality image authentication method based on absolute moment block truncation coding (AMBTC) compressed images. The existing AMBTC authentication methods may not be able to detect certain malicious tampering due to the way that the authentication codes are generated. In addition, these methods also suffer from their embedding technique, which limits the improvement of marked image quality. In our method, each block is classified as either a smooth block or a complex one based on its smoothness. To enhance the image quality, we toggle bits in bitmap of smooth block to generate a set of authentication codes. The pixel pair matching (PPM) technique is used to embed the code that causes the least error into the quantization values. To reduce the computation cost, we only use the original and flipped bitmaps to generate authentication codes for complex blocks, and select the one that causes the least error for embedment. The experimental results show that the proposed method not only obtains higher marked image quality but also achieves better detection performance compared with prior works.


Introduction
With the rapid development of the Internet, image editing softwares, such as Photoshop, Snapseed and Mix, have been rapidly developed. These software programs allow people to edit images easily, which means that digital images are vulnerable to be tampered during transmission. Under this trend of Internet development, authenticating the integrity of digital images is gradually becoming an important issue. Fragile watermarking method is a commonly used authentication technique by embedding the authentication code into the image in order to provide protection [1][2][3][4]. If the image is tampered during transmission, then the authentication code embedded in the image will also be changed. Therefore, it is possible to know whether an image has been tampered with by determining whether the embedded authentication code has been changed.
AMBTC [23], proposed by Lema and Mitchell in 1984, is an improved version of block truncation coding (BTC) [24]. It compresses the image blocks into trios, each trio consisting of two quantization values and a bitmap. The existing AMBTC authentication methods typically embed the authentication codes into the quantized values or bitmaps. Based on the AMBTC compression method, [15] uses a pseudo random number generator (PRNG) to generate the authentication codes and embeds them into the quantized values. Their method is effective in protecting the image to some extent, but the authentication codes can only in base 7. Ref. [16] also proposes a method for AMBTC image authentication based on a special designed reference table, and this method outperforms previous works in terms of marked image quality. However, their approach does not utilize bitmaps to generate authentication codes, resulting in the inability to detect bitmap tampering. Ref. [17] proposes an authentication method with higher security based on the weaknesses of [16]. Ref. [17] generates the authentication code by performing exclusive-or operation of the bitmap with random numbers, which not only maintains the same image quality as in [16], but also detects tampering of the bitmap. To obtain a better authentication effect and marked image quality, [18] uses quantized values of most significant bites (MSB) and bitmaps to generate authentication codes and embeds them into quantized values of least significant bits (LSB). Their method also perturbs the MSB of the quantized values to reduce the error of embedding. Thus, [18] not only preserves the image effectively, but the image quality is also comparable to the method of [17]. To detect the splice tampering, [20] utilizes the block location information in addition to the bitmap to generate the authentication code. They generate different authentication codes by toggling the bitmap and select the authentication code that causes the least error to embed into the quantized values. However, their method does not considered the flipped bitmap may result in a better embedding performance, thus limiting the image quality improvement.
Ref. [19] combines the bitmap with a pseudo-random sequence to generate a 3-bit authentication code, which is embedded into the quantized values by surveying the reference table. Also, this method uses an iterative embedding mechanism to solve the problem that the high quantized values might be smaller than the low ones after embedding. Due to the relatively compact arrangement of the numbers inside reference table, their method achieves a better marked image quality. However, based on the limitations of the searching method, this method can only embed an octal (3 bits) authentication code for each pixel pair. In addition, their searching approach may not find the best marked quantized values to reduce the embedding error. Finally, the authentication code of this method is generated independently of the location information, which makes the swapping of image blocks undetectable.
The existing methods [15][16][17][18][19][20] can achieve most of the tampering detection and a good image quality. However, due to the design of the embedding technique, the authentication code in [15] can only be digits of base 7, [16,17] can only be digits of bases 2, 4, 8 and 16, while [19] can only be digit of base 8. Furthermore, the authentication code generation of [15,16], [18,19] is independent of the bitmaps or block location information, causing these methods unable to detect some specific malicious tampering. Compared to [15][16][17][18], the image quality obtained by [19] is the highest, but the searching approach of this method limits the enhancement of image quality. In contrast to [19], the method of [20] uses a filtering mechanism to reduce the error and obtains a better marked image quality. Nevertheless, the filtering mechanism in [20] does not take into account some characteristics of AMBTC codes, which means that the image quality can be further improved.
For an AMBTC code, if the quantized values are swapped and the bitmap is flipped, the decompressed block will be exactly the same as the one decompressed from the original code [25]. Based on this attractive property, the proposed method toggles one bit of the original and flipped bitmaps in sequence to generate a set of authentication codes. By surveying the reference table, the authentication code that causes the least error is embedded in quantized values using the PPM technique. Experimental results show that our method not only embeds authentication codes of arbitrary length and obtains the highest image quality, but also achieves a satisfactory detection results compared with the aforementioned methods.
The rest of the paper is structured as follows. Section 2 will introduce the AMBTC compression and the reference table based (RT-based) technique. Section 3 will introduce the proposed method, and experimental results and conclusions will be given in Sections 4 and 5, respectively.

Related Works
This section will briefly introduce the basic concepts of AMBTC and the RT-based embedding techniques required by [19] and the proposed method. The details will be presented in the following two subsections.

AMBTC Compression Method
To encode the image I using the AMBTC compression method, firstly we divide I into N non-overlapping blocks { } Here we briefly introduce the encoding and decoding procedures of AMBTC using a block. Assume a block of size 4

The Embedding Techniques Based on Reference Table
The RT-based embedding techniques embed a digit of base 2 α into each pixel pair by surveying a reference table. The reference table is a matrix of size 256 256 × with numbers in the range from 0 to 2 1 α − . The RT-based techniques to be introduced in this section are the turtle shell embedding (TSE) [26] and the pixel pair matching (PPM) techniques [27]. Figure 1a,b show partial reference tables for TSE and PPM, both of which can be used to embed digits of base 3 2 8 = . The TSE embedding method embeds a digit ranging from 0 to 3 2 1=7 − into a pixel pair ( , ) can be generated by the following equation [28].
where i a and i b are ranging from 0 to 255. After the reference  .
In the second case, ( , ) i i a b is located in the edge of at least one hexagon, (e.g., (1,4) or (2,2) in Figure 1a), then we find a location .
In the third case, if ( , ) i i a b is within a hexagon (e.g., (4,6) in Figure 1a), then we find a location (1, 2) (3, 5) 4 R R = = , and (1, 2) is closer to (1,4) , we obtain the embedded pixel pair Obviously, (0, 4) is a better solution for this problem because it is closer to (1,4)  In contrast to the TSE technique, the PPM embedding method also adopts a reference table PPM R α to embed a digit of base 2 α into each pixel pair, and the base of digit is not limited to 8. The reference table PPM R α can be generated by using the formula ( ) where c α is a constant. Some commonly used constants are 2 2 c = , 3  Since the PPM method is more flexible and provides a satisfactory embedding performance, the PPM will be used as the embedding technique in our method.
Here is a simple example to illustrate the PPM. Let

The Proposed Method
The authentication codes generated by [15,16,18] are independent of bitmaps or location information; therefore, these methods cannot detect tampering of bitmaps or swapping of image blocks. Ref. [17] can detect some tampering missed by the above methods, but based on the design of the embedding method, the length of the authentication code and the quality of the marked image are limited. Among these methods, only [18] can embed authentication code of arbitrary length. Moreover, the methods of [15][16][17] are not designed with a selection mechanism to reduce the embedding error. In [18], although the embedding error is reduced by perturbing the MSB of the quantized values, this method uses the LSB replacement which creates a large error, and therefore also limits the quality improvement. To enhance the image quality, [19] employs the TSE to embed the authentication codes. The quality of marked images obtained by [19] is higher than that of [15][16][17][18], due to the compact arrangement of digits in the reference table used by TSE. However, according to the analysis in Section 2.2, it can be known that the best marked quantized values may not be found by using the search method of TSE. Moreover, due to the search method, TSE can only work with a 3-bit reference table to embed an authentication code of base 8. As in [18], the generation of authentication codes in [19] is independent of the location information, so the swapping of blocks cannot be detected.
In this paper, we use different approaches to embed authentication codes into smooth and complex blocks. Given a trio { , , } where T is a pre-defined threshold, the block is classified as a smooth one; otherwise, it is a complex one. It is known that if the quantized values are swapped and the bitmap is flipped, the decompressed block will be exactly the same as the one decompressed from the original trio [25]. Based on this property, the proposed method toggles a bit in the original and flipped bitmaps of a smooth block to generate a set of authentication codes. These codes are embedded into the quantized values using the PPM, and the trio of the least distorted block after embedding the authentication code is selected as the marked trio. For a complex block, instead of using the toggling technique, only the original and flipped bitmaps are used to generate two authentication codes to reduce the computation cost.

Embedment of Smooth Blocks
be the bitmap of f i B with -th k bit toggled. Using MD5 [29] to hash and position information i , and folding each result into α bits, we obtain 2( 1) n n × + candidates of authentication codes The PPM method described in Section 2.2 is then applied to embed these authentication codes into pixel pairs can be decoded to obtain image blocks and i D are calculated, and the one that has the shortest distance is found and is denoted by , is the marked trio of our method. The procedures of finding the marked trio can be formulated as an optimization problem described below: Minimize: Subject to: , where de() is the decode function of AMBTC, and hash ( ) x α is the function to acquire -bit α authentication code.
Here is an example to illustrate the process of generating authentication codes using MD5. Let =4 α ,

Embedment of Complex Blocks
It is noted that toggling bits in the bitmaps often causes large errors when the difference between high and low quantized values is large. Thus, for complex blocks, most of the bitmaps of the solutions to Equations (8)

The Authentication Procedures
This sub-section describes the authentication procedures of the proposed method. Assume that the to-be-authenticated trios are , then this block has not been tampered with; otherwise, it has been tampered with. The detailed procedures can be found in Figure 4. The above authentication procedures are called the first stage authentication. To refine the detection result, the second stage authentication is adopted in the proposed method. Since collisions may occur during authentication, the smaller the length of the embedded authentication code, the higher the probability of collision. It means that more blocks are tampered with but not detected in the first stage authentication. We know that most of the tampering is clustered in a certain area. Thus, if an untampered block surrounded by blocks that have been tampered with, then the block may has been tampered with as well. Therefore, in the second stage authentication, if a block is detected as untampered in the first stage, but the blocks above and below or left and right of this block have been judged as tampered, the detection result of this block will be modified to be tampered. All blocks are processed using the procedures described above, and the final detection results are obtained.

Experimental Results
In order to evaluate the effectiveness of the proposed method, we perform different experiments on a set of grayscale images. Eight grayscale images of size 512 512 × , including Lena, Tiffany, House, Jet, Peppers, Splash, Boat and Baboon, will be used as test images, as shown in Figure 5. These images can be obtained from the USC-SIPI image database [30]. We also compare the image quality as well as detection results of the proposed method with [17][18][19]. Image quality is measured using the peak signal-to-noise ratio (PSNR), which is defined as: where W and H represent the width and height of a test image, and i x and i x′ represent the -th i pixel of the AMBTC compressed image and the marked image, respectively. Higher PSNR means better quality of the image. In the following experiments, the block size used is 4 4 × .

Quality Evaluation of the Proposed Method
In the proposed method, the computation cost and the marked image quality increase with the increase of threshold T . However, when T exceeds the critical value * T , it only increases the computational effort and may not contribute to the image quality. Table  1 shows the relationship between threshold value and image quality for embedding authentication code of lengths 2, 4 and 6. It can be found from the table that regardless of α , the image quality is the highest when 255 T = . The reason is that when 255 T = , all blocks are treated as smooth ones. On the contrary, when 1 T = − , all blocks are treated as complex ones, so the obtained quality is the lowest among all thresholds, but less computation is required. Interestingly, when 2 α = , the quality of the test image is the same at   Table 2 lists the suggested threshold * T in our method with various α . From the table, we can find that as α increases, the threshold value also increases. This is because the more authentication codes a trio embeds, the more damage is done to the quantized values. In this case, a block is more likely needed to toggle a bit in the bitmap to reduce the embedding error. As a result, * T also becomes larger.

Detectability of the Proposed Method
This section shows the detectability of the proposed method for the tampered Lena images when α is 2, 4 and 6. First of all, the different lengths of authentication codes are embedded into trios of the Lena image codes to obtain marked images. Figure 2a   To further evaluate the detection performance of the proposed method, different measures will be used to show the detection effectiveness of our method, as shown in Table 3. In the table, true positive rate (TPR) is the probability of a tampered trio also reported as a tampered one, and false negative rate (FNR) is the probability of a tampered trio but reported untampered. As can be seen from the table, the FNRs of the first stage are 25.28%, 5.45% and 1.32% when 2, 4 and 6 α = , respectively, which are well consistent with the theoretical values of 25%, 6.25% and 1.56%. TPR 100% FNR = − also agrees with the theoretical value. Interestingly, the second stage detection effectively increased the TPR while decreasing the FNR. For example, when 2 α = , the probability of TPR in the first stage is 74.72%, which rises to 95.62% in the second stage. Meanwhile, the probability of FNR dropped from 25.28% to 4.38%. Therefore, it is desirable to use the second stage of detection.

Quality Comparisons with Other Works
To show the superiority of our method, we compare the image quality of the proposed method with [17][18][19] for 2, 3, 4, 6 α = , as shown in Table 4. In this table, 'n/a' indicates that the method is not applicable. From the table, we can observe that the method of [17] can embed authentication code of lengths 2, 3 and 4, whereas it cannot embed 6 bits. This is because their method can only embed up to 4 bits. By improving this shortcoming of [17], the method of [18] can embed authentication code of arbitrary length. The image quality obtained by [17] is the lowest among the compared methods when 2 and 3 α = . In contrast, the image quality of [18] is the lowest when 4 α = , which is due to the design of their embedding method. As for [19], their method can only embed a 3-bit authentication code into each trio based on a reference table TSE 3 R . Nevertheless, due to the compact arrangement of digits in TSE 3 R , the image quality obtained by [19] is better than that of [17,18]. For example, when 3 α = , the Lena image quality of [19] is 49.79 dB, while the quality of [17,18] are 46.40 and 48.56 dB, respectively. However, the Lena image quality of the proposed method is 51.68 at 3 α = , which is higher than that of [19]. In addition, the proposed method can achieve the best image quality regardless of α . For example, when 2 the Lena image quality of our method is 54.07 dB, which is B 54.07 49.9 d 0 4.17 − = higher than [17] and B 54.07 51.7 d 5 2.32 − = higher than [18]. From the above analysis, it is clear that our method can not only embed arbitrary length of authentication code, but also obtain the best image quality.  [19] n/a n/a n/a n/a n/a n/a n/a n/a  [19] n/a n/a n/a n/a n/a n/a n/a n/a  [17] n/a n/a n/a n/a n/a n/a n/a n/a  [19] n/a n/a n/a n/a n/a n/a n/a n/a In addition to comparing the PSNR of images, we also compared the structural similarity (SSIM) [31] for different methods using 3 α = . The results are shown in Table 5.
SSIM is a metric for measuring the similarity of images. A larger SSIM means that the two images are more similar. The maximum value of SSIM is 1. As can be seen from the table, the SSIMs of different methods are all greater than 0.980, meaning that a satisfactory visual effect can be obtained by these methods. However, among the compared methods, the proposed method obtains the highest SSIM. Taking the test image Lena as an example, the SSIMs obtained in [17][18][19] are 0.990, 0.994 and 0.995, respectively, while the SSIM obtained by our method is 0.997. Note that thought the experiments are conducted using 3 α = , other α also reveals similar results. Therefore, compared with other methods, our method can obtain better visual effects. It is worth noting that the proposed method uses MD5 to generate the authentication codes, which will take longer time for code generation compared to the approach used in [17]. However, the MD5 (and other hash function) is sensitive to the input. That is, small alterations in pixel values will generate different codes. The proposed method subtly takes advantage of this feature to generate a set of codes, and the one that causes the least distortion is selected as the final authentication code. Therefore, the image quality of the proposed method outperforms other works.

Detectability Comparisons with Other Works
This section shows the detectability of [17][18][19] and the proposed method for various tamperings. Figure 8 shows the tampering of the marked Jet image with three lifting bodies clipped from another image. The marked and tampered images are shown in Figure  8a, b, whereas the corresponding tampered regions are given in Figure 8c. Since the method of [19] can only embed authentication code of length 3, we set  Figure 9 shows the first and second stage detection results of [17][18][19] and the proposed method. In these figures, the white dots in the tampered regions represent undetected tampered blocks. Since 3 α = , the probability of collision rate is approximately 3 5 1/2 = .12 0 , meaning that around 12.50% tampered blocks are undetected, as shown in Figure 9a-d. However, the white dots are significantly reduced (see Figure 9e-h) if the second stage detection is applied, indicating the effectiveness of using this stage.  (f) nd 2 stage, [18] (g) nd 2 stage, [19] (h) nd 2 stage, proposed  To further evaluate the detection performance of various methods, we use different metrics to measure their effectiveness, as shown in Table 6. In this table, TPR = TP/(TP+FN), FNR = FN/(TP+FN) and PR = TP/(TP+FP). TP indicates the number of blocks that are tampered with and detected as tampered. FN is the number of blocks that are tampered but detected as not tampered, whereas FP represents the number of blocks that are not tampered but detected as tampered. Since 3 α = , the collision rate should be 3 5 1/2 = .12 0 , which is consistent with the results shown in Table 6. Since TPR 1 FNR = − , the theoretical TPR is 87.5%. In the first stage detection, the TPR of [17][18][19] and the proposed method are 89.83%, 87.66%, 88.60% and 87.83%, respectively, which are in accordance with the theoretical value. In the secondary detection, the TPR of all methods are up to 99.00%. In the first detection, the PRs are all 100%, which is because these methods do not misjudge untampered blocks as being tampered. However, in the secondary detection, some untampered blocks are mistakenly judged to have been tampered with. Therefore, the PR is slightly reduced. To further compare the detectability of the proposed method with related works, we conduct additional experiments using two types of tampering. Firstly, these methods are used to embed authentication codes into the Splash image. Then we tamper the marked images by splicing bottles and a cow. The marked image, tampered image, and tampered regions are shown in Figure 10a-c, respectively. In Figure 10b, we obtain the AMBTC trios of bottles firstly, and then splice the decompressed trios onto the marked image. This type of tampering is referred to as Type A. The tampering of cow is done by replacing blocks with other ones of the marked image that have the shortest Euclidian distance to the corresponding blocks of the cow image. This type of tampering is referred to as Type B. Since the method of [19] can only embed authentication code of length 3, we set  Figure 11 shows the results of the second-stage detection with different methods. For the tampering of bottles, [17][18][19] and the proposed method can all obtain a better detection result with 99.99% detection rate. However, the methods of [18,19] do not detect the tampering of cow image, as shown in Figure 9b,c. This is because the generation of authentication codes for their methods is independent of the location information. Yet, both [17] and the proposed method are able to detect both types of tampering with better results, as shown in Figure 9a,d.
(a) Detection result of [17] (b) Detection result of [18] (c) Detection result of [19] (d) Detection result of the proposed method In addition to comparing with [17][18][19], we also compare with the existing methods [15,16], as shown in Table 7. In this table, 'Type A' and 'Type B' represent the tampering approaches of bottles and cow in Figure 10, respectively. As can be seen from the table, all compared methods can detect the tampering of bottles, but only [17] and the proposed method can detect the tampering of cow. This is because these two methods take both bitmaps and location information into account when generating authentication codes. Besides, for each trio, we can find that [15] can only embed 2.8 bits (a digit of base 7), [16,17] can only embed at most 4 bits, and [19] can only embed 3 bits (a digit of base 8). As for [18] and our method, it is possible to embed an authentication code of arbitrary length. In addition, the proposed method uses a better embedding and selection mechanisms than other methods, and thus the image quality is also better, as shown in the above experiments.

Conclusions
In this paper, we propose a high quality image authentication method with AMBTCbased authentication. Based on the characteristics of AMBTC, The proposed method generate the authentication codes by using both the original and flipped bitmaps. To improve the image quality, we toggle the bits in the original and flipped bitmaps to generate a series of authentication codes for smooth blocks, and then select the authentication code that causes the least error for embedment. To lower the computational cost, we use a reduced selection mechanism for complex blocks. Moreover, our method uses PPM to embed authentication codes to further enhance the image quality. Experimental results show that our method not only achieves a better tampering detection, but also yields a high marked image quality. The focus of this paper is mainly on improving the detectability and marked image quality. Future work could include a recoverability feature so that tampered areas can be recovered.
Author Contributions: T.-S.C., X.Z. and W.H. contributed to the conceptualization, methodology, and writing of this paper. R.-C.C. and K.-S.C. conceived the simulation setup, formal analysis and conducted the investigation. All authors have read and agreed to the published version of the manuscript.