Next Article in Journal
Semantic Divergence in AI-Generated and Human Influencer Product Recommendations: A Computational Analysis of Dual-Agent Communication in Social Commerce
Previous Article in Journal
SMART Strategies in Surface Engineering: A Narrative Review of Technologies and Coatings in Dental Industry
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

High-Capacity Dual-Image Reversible Data Hiding in AMBTC Using Difference Expansion with Block-Wise HMAC Authentication

1
Department of Computer Engineering, Sejong University, Seoul 05006, Republic of Korea
2
Department of Computer Science and Information Engineering, National Dong Hwa University, Hualien 97401, Taiwan
3
School of Software, Nanchang Hangkong University, Nanchang 330063, China
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2026, 16(6), 2815; https://doi.org/10.3390/app16062815
Submission received: 2 February 2026 / Revised: 23 February 2026 / Accepted: 12 March 2026 / Published: 15 March 2026

Abstract

Reversible data hiding (RDH) is a key technique in secure multimedia applications, enabling the exact recovery of both embedded data and the original cover content. To further enhance security and embedding capacity, this paper proposes a dual-image reversible data hiding (DIRDH) method based on absolute moment block truncation coding (AMBTC). In the proposed scheme, two identical AMBTC-decoded images are exploited as twin covers, and secret bits are adaptively embedded into paired pixels using a variable embedding rate. To ensure data integrity, a lightweight Hash-based Message Authentication Code (HMAC) mechanism is integrated, allowing reliable detection of tampering without additional side information. Experimental results demonstrate that the proposed method achieves high embedding capacity while preserving good visual quality and provides effective authentication against representative tampering cases, including pixel modification, noise addition, and cropping. These contributions highlight the advantages of combining DIRDH with AMBTC, offering a practical and secure solution for high-capacity reversible data hiding.

1. Introduction

With the rapid expansion of digital communication networks, the secure and reliable transmission of multimedia data has become a fundamental concern in numerous applications, including military surveillance, medical imaging, legal forensics, and remote sensing [1,2]. While cryptographic methods convert data into unintelligible ciphertext, thereby ensuring confidentiality [3], they are prone to arousing suspicion and becoming targets for interception. In contrast, data hiding techniques embed secret information into an innocuous cover medium such as an image, audio, or video file, enabling covert communication over public channels without noticeably altering the appearance of the cover [4,5].
Data hiding techniques can be broadly classified into irreversible data hiding (IRDH) and reversible data hiding (RDH). In IRDH, the embedded message can be perfectly extracted, but the cover object cannot be restored to its original state [6,7]. RDH techniques, on the other hand, enable the lossless recovery of both the secret message and the original cover image [8,9,10,11]. Over the past two decades, various RDH approaches have been proposed, including difference expansion (DE) [8], histogram shifting (HS) [9,12,13], and pixel value ordering (PVO) [11], each offering different trade-offs in terms of payload capacity, image fidelity, and algorithmic complexity.
While single-image RDH has been extensively studied, it is inherently constrained by the available modification space in a single cover image. To overcome this limitation, dual-image reversible data hiding (DIRDH) has emerged as a promising framework that combines the perfect reversibility of RDH with the security enhancement of secret sharing. In DIRDH, the cover image is processed to produce two correlated stego images, each carrying part of the secret payload and the recovery information. Only when both stego images are available can the embedded data and original cover be perfectly recovered, thereby improving confidentiality and robustness [14,15,16,17,18,19,20,21,22]. Recent DIRDH enhancements include numeral-system encoding [23], translocation-and-switching strategies [24].
Absolute Moment Block Truncation Coding (AMBTC) [25] is a block-based image compression technique that stores two representative values—high (H) and low (L)—and a bitmap for each block, offering a balance between compression efficiency and visual quality. Due to its structure, AMBTC provides a natural platform for RDH, as modifications can be selectively applied to the H and L values or reconstructed pixel values without significantly affecting image fidelity [26,27,28,29]. AMBTC has also been adopted in dual-image settings, as in Kim’s Hamming-code/LSB scheme [30] and Chang et al.’s dual prediction with reduced code length [31], demonstrating that AMBTC’s compression characteristics can be effectively leveraged to improve payload and efficiency in DIRDH.
Despite these advances, two key issues remain underexplored: (1) most AMBTC-based DIRDH methods use a fixed embedding rate per pixel pair, limiting adaptability and potential payload; and (2) authentication mechanisms are rarely integrated into the embedding framework. In security-critical applications, the ability to verify the integrity of the stego images after transmission is crucial. Although the Hash-based Message Authentication Code (HMAC) [32,33] is a well-established cryptographic primitive for integrity verification, its application within a dual-image AMBTC-based RDH system remains limited [34].
In this paper, we propose a high-capacity dual-image reversible data hiding method based on AMBTC and difference expansion, enhanced with an adaptive multi-bit embedding strategy and an optional HMAC-based authentication mechanism. Two identical AMBTC-decoded images are generated from the original cover, and secret bits are embedded into corresponding pixel pairs across the two images. The number of embedded bits per pair (k) is adaptively determined (2–4 bits) according to the pixel values to prevent overflow and underflow. Reserved blocks are allocated to store the HMAC tag, enabling post-extraction verification of image integrity.
The main contributions of this work are as follows:
  • An adaptive k-bit embedding rule within a dual-image AMBTC-DE framework, significantly increasing embedding capacity compared to fixed-bit approaches.
  • A robust overflow/underflow avoidance mechanism ensuring perfect reversibility even under multi-bit embedding conditions.
  • Integration of a lightweight HMAC-based authentication process that provides integrity verification without affecting reversibility or requiring auxiliary metadata.
  • Comprehensive experimental evaluation on ten standard 512 × 512 grayscale test images, demonstrating superior performance to existing DIRDH methods in payload capacity, PSNR, SSIM, and authentication accuracy.
Section 2 reviews AMBTC, difference expansion, and dual-image RDH. Section 3 describes the proposed scheme and HMAC-based authentication. Section 4 reports experimental results and comparisons. Section 5 discusses limitations and extensions, and Section 6 concludes the paper.

2. Preliminary

This section outlines the foundational concepts upon which the proposed dual-image reversible data hiding scheme is built. We first review Absolute Moment Block Truncation Coding (AMBTC), a block-based image quantization method well-suited for compression. Then, we briefly introduce the core idea of difference expansion, a classical reversible data hiding technique. Finally, we explain the conceptual framework of dual-image data hiding and motivate our proposed use of AMBTC to enhance its capacity and robustness.

2.1. Absolute Moment Block Truncation Coding (AMBTC)

Absolute Moment Block Truncation Coding (AMBTC) is a block-wise image compression technique that efficiently reduces data size while maintaining acceptable visual quality. It operates by partitioning the input grayscale image into non-overlapping blocks, typically of size 4 × 4 or 8 × 8 . Each block is approximated using only two quantization values: a low value L and a high value H, together with a binary bitmap that indicates which value is assigned to each pixel.
Let a block B consist of m pixels denoted as { x i } i = 1 m . The block mean μ (Equation (1)) is computed as:
μ = 1 m i = 1 m x i .
Each pixel is then assigned a binary value based on a threshold comparison with μ :
BM [ i ] = 1 , if x i μ , 0 , otherwise .
Let q denote the number of pixels such that BM [ i ] = 1 . The two representative quantization values (Equation (3)) are calculated as:
H = 1 q x i μ x i , L = 1 m q x i < μ x i .
During decoding, each pixel in the block is reconstructed as either H or L according to the bitmap:
x i = H , if BM [ i ] = 1 , L , if BM [ i ] = 0 .
The effectiveness of AMBTC lies in its structural simplicity, low computational cost, and predictable reconstruction process. In particular, the use of only two quantization levels per block ensures that embedded data can be managed with high precision and minimal distortion. This makes AMBTC a suitable candidate for integration with reversible data hiding techniques, as proposed in this work.

2.2. Difference Expansion (DE)

Difference Expansion (DE) is a well-established reversible data hiding technique that embeds secret information by manipulating the difference between two correlated pixel values. The method was originally proposed to exploit spatial redundancy in grayscale images while ensuring perfect reversibility of the cover data.
Given two neighboring pixels x and y, the difference d and average s are computed as:
d = x y , s = x + y 2 .
To embed a single bit b { 0 , 1 } , the expanded difference d is defined as:
d = 2 d + b .
The modified pixel pair ( x , y ) is then obtained by solving:
x = s + d 2 , y = s d 2 .
At the receiver side, the original bit b and the original values ( x ,   y ) can be recovered from the modified pair ( x ,   y ) by reversing the above steps, provided that no overflow or underflow occurs during embedding:
0 x ,   y 255 .
While DE offers high embedding capacity and exact recovery, its applicability to compressed or block-based image formats such as AMBTC is limited. Most DE-based schemes operate directly in the spatial domain and require sophisticated prediction mechanisms, sorting, or location maps to ensure accurate recovery.
In this work, we reinterpret the principle of DE within the AMBTC domain, leveraging the fixed quantization structure of AMBTC blocks. By applying controlled difference modifications to quantized pixel pairs ( L ,   L ) and ( H ,   H ) across two identical AMBTC-decoded images, we achieve a simplified yet reversible embedding scheme. The use of DE in this transformed domain eliminates the need for auxiliary data structures, while maintaining visual fidelity and decoding determinism.

2.3. HMAC Authentication

A Hash-based Message Authentication Code (HMAC) is a cryptographic mechanism used to verify both the integrity and authenticity of data. The hash-based message authentication code (HMAC) used in this work is defined as
HMAC K ( M ) = H ( K opad ) H ( K ipad ) M
where K denotes the secret key, M is the message (in our case, the serialized content of the two stego images I 1 and I 2 ), and  H ( · ) is a cryptographic hash function (SHA-256 in our experiments). The symbols ipad and opad represent the standard inner and outer padding constants defined in RFC 2104, “⊕” denotes the bitwise XOR operator, and “‖” denotes concatenation. This standard HMAC construction ensures that any modification of the stego images results in a different authentication code, enabling reliable integrity verification without auxiliary side information.

2.4. Conception of Dual Data Hiding

Reversible data hiding (RDH) has traditionally been conducted within a single cover image, where the embedded data must coexist with the constraint of full reversibility. However, as the demand for higher embedding capacity and robustness has grown, researchers have explored the concept of dual-image reversible data hiding. In this paradigm, two correlated images are jointly utilized to distribute the embedding payload, thereby increasing capacity and reducing perceptual distortion in each stego image.
Conventional dual RDH schemes typically adopt one of the following strategies: symmetric embedding, where each image carries a portion of the payload; or asymmetric embedding, where one image carries the primary data and the other carries auxiliary information such as location maps or prediction errors. While these approaches have demonstrated improvements over single-image methods, they often rely on complex predictive models, require large overhead for reversibility, or exhibit compatibility issues with compressed image representations.
To address these challenges, we propose a novel framework that integrates dual-image data hiding into the structure of Absolute Moment Block Truncation Coding (AMBTC). AMBTC naturally produces a two-level quantized representation per block, making it a promising platform for simplified and structurally aligned data embedding.
In our proposed scheme, two identical AMBTC-decoded images are used as cover images. Since the pixel values in each block are restricted to either L j or H j , we identify pairs of pixels across the two images that share the same quantized value–either ( L j ,   L j ) or ( H j ,   H j ) . Data is embedded by modifying only one of the two pixels in each pair, creating a controlled difference that encodes secret information. Importantly, the other pixel in the pair remains unchanged, serving as a reference during extraction.
This asymmetric pairing mechanism provides several advantages:
  • It eliminates the need for prediction-based embedding or sorting, simplifying the encoding process.
  • It ensures reversibility by construction, as the reference pixel allows exact reconstruction of the original value.
  • It enables overflow- and underflow-safe embedding, as quantization boundaries are known in advance.
  • It allows for block-wise authentication, such as HMAC-based verification, without compromising reversibility.
By embedding within the AMBTC domain, the proposed method combines the benefits of dual-image RDH with the simplicity and regularity of block quantization. This design not only achieves high-capacity and low-distortion embedding, but also lays the groundwork for secure and efficient image authentication in compressed domains.

3. Proposed Method

Figure 1 illustrates the overall workflow of the proposed dual-image reversible data hiding scheme using AMBTC and a modified difference expansion strategy. Starting from a grayscale image, AMBTC encoding is applied block-wise to generate quantized blocks characterized by two representative levels. These blocks are decoded into an image I 1 and duplicated to form I 2 . Secret bits are then embedded block-by-block into corresponding pixel pairs across I 1 and I 2 , where only one pixel in each pair is modified. At the receiver side, the secret data is extracted using simple difference computation, and the original pixel values are fully recovered by copying the unmodified reference pixel. The process guarantees reversibility and low distortion without auxiliary data. Optional HMAC authentication can be incorporated to verify the integrity of the restored images.

3.1. System Overview

Let I 1 and I 2 be two identical grayscale cover images obtained by decoding the original image’s AMBTC representation. These images are partitioned into non-overlapping blocks of size m (e.g., 4 × 4 ). Each block j has two quantization levels L j and H j (low and high mean values) and a bitmap identifying which pixels are L j or H j . We pair corresponding pixels from I 1 and I 2 that share the same quantization value. In other words, for each pixel position i in block j, we form a pair ( x j , i ,   y j , i ) where initially x j , i = y j , i L j ,   H j . Data is embedded by modifying only one pixel in each pair while keeping the other pixel unchanged as a reference. This controlled difference expansion encodes secret bits into the pixel pair’s difference while guaranteeing one pixel remains the original value for accurate recovery.
In contrast to conventional DE that directly operates on spatial-domain pixel pairs, the proposed scheme performs a “quantized-domain” difference expansion on twin AMBTC-decoded images. For each 4 × 4 block, all reconstructed pixels take either the low quantization level L j or the high quantization level H j , as defined in Section 2.1.
We construct a twin pixel pair ( p 1 ,   p 2 ) by taking two pixels at the same spatial position from the two AMBTC-decoded images I 1 and I 2 . If both pixels in the pair are equal to H j , the pair is classified as an H-type pair; similarly, if both are equal to L j , it is classified as an L-type pair.
For each valid twin pair, only one pixel is modified according to the assigned bit-length k and the corresponding k-bit payload segment, while the other pixel remains unchanged and serves as a reference. In this sense, the effective “difference” between p 1 and p 2 represents the embedded value, even though the modification is carried out on a single pixel. During extraction, the decoder first identifies the pair type (H-type or L-type) using the quantization levels H j and L j , then recovers the embedded integer from the known reference value and restores the modified pixel by copying the reference. This procedure guarantees perfect reversibility without requiring any auxiliary location map, because at least one pixel in each used pair always retains its original quantized value.
Moreover, overflow and underflow conditions are checked directly against the quantization levels: for H-type pairs, embedding is allowed only if the modified value does not exceed 255, whereas for L-type pairs, embedding is allowed only if the modified value does not fall below 0. If these safety conditions are not satisfied for a given pair and bit-length k, that pair is skipped by both the encoder and decoder using the same decision rule. As a result, the difference expansion within the AMBTC domain is implemented in a structurally simple yet strictly reversible manner.
In summary, the proposed scheme can be regarded as a reinterpretation of classical difference expansion within the AMBTC domain. Instead of operating on spatial-domain pixel pairs using the average difference formulation in Equations (5)–(8), we exploit the binary quantization structure ( L j ,   H j ) of AMBTC blocks. For each twin pixel pair, the embedded integer δ plays the role of an expanded difference, and the unchanged reference pixel guarantees that this difference can be perfectly removed during extraction, without any auxiliary location map.

3.2. Data Embedding Model

The proposed reversible data hiding method is designed for a pair of AMBTC-decoded grayscale images, denoted as I 1 and I 2 , each of size M × N . The two images are assumed to be visually identical at the beginning, as both are generated from the same compressed source. In this structure, each pixel at position ( x ,   y ) in I 1 and its counterpart in I 2 form a twin pixel pair, which serves as the basic unit for data embedding.
Each AMBTC block is decoded using two quantization values: a high value H j and a low value L j , depending on the pixel pattern of the original block. As a result, every pixel in the decoded image is either H j or L j . Thus, any twin pixel pair ( p ( 1 ) , p ( 2 ) ) can be one of two types:
  • H-type: p ( 1 ) = p ( 2 ) = H j
  • L-type: p ( 1 ) = p ( 2 ) = L j

3.2.1. User-Directed Bit-Length Allocation

A key feature of the proposed model is that the number of secret bits embedded into each twin pixel pair is not fixed. Instead, the bit-length k to be embedded is externally specified by the encoder on a per-pair basis. That is, for each pixel pair, the encoder determines whether to embed 1, 2, 3, or 4 bits, depending on the desired balance between embedding capacity and image quality.
Let k be the number of bits to embed in a given twin pixel. Then the k-bit segment b k is converted into a decimal number Δ as follows:
Δ = dec ( b k ) , where b k { 0 , 1 } k , Δ [ 0 ,   2 k 1 ]

3.2.2. Embedding Rule Based on Difference Expansion

The computed Δ is then used to modify one of the pixels in the twin pair according to the following rule:
( p ( 1 ) , p ( 2 ) ) = ( H j + Δ , H j ) , if the pair is of type H j ( L j , L j Δ ) , if the pair is of type L j
Only one pixel in the twin pair is modified. The unmodified pixel serves as a reference during the extraction and recovery process. This ensures that the embedding is reversible and the original value of the modified pixel can be restored precisely.
To make the above embedding rule more concrete, consider an H-type twin pair ( p 1 ,   p 2 ) = ( H j ,   H j ) and a 2-bit payload segment b k = 01 , which is converted to δ = dec ( b k ) = 1 . According to the embedding rule, we modify only the first pixel and obtain ( p 1 ,   p 2 ) = ( H j + 1 ,   H j ) . During extraction, the decoder again identifies an H-type pair and computes δ from the difference between the modified pixel p 1 and the reference value H j , then recovers the original bit segment b k from δ and restores the cover pixels by resetting the pair to ( H j ,   H j ) . A similar procedure applies to L-type pairs, where δ is obtained from the difference between the reference value L j and the modified pixel. This example illustrates how the embedded integer δ acts as a reversible difference in the AMBTC domain.

3.2.3. Safety Condition for Overflow and Underflow

In order to prevent pixel overflow (i.e., values exceeding 255) and underflow (i.e., values below 0), the embedding of the Δ value is allowed only if the following condition is satisfied:
H j + Δ 255 for H-type pairs L j Δ 0 for L-type pairs
If the pixel pair does not satisfy this condition for the given k, the embedding is skipped and the pair is left unchanged. No location map is required, as both the encoder and decoder share the same logic and will automatically skip the same positions during extraction.

3.2.4. Advantages of User-Controlled k

The ability to assign k manually per pixel pair provides fine-grained control over the trade-off between embedding capacity and visual distortion. For instance, embedding 1 or 2 bits per pair results in minimal distortion and higher PSNR, whereas 3 or 4 bits allow more payload at the cost of slightly higher pixel deviation.
This approach is particularly useful in applications where certain regions of the image require stricter quality preservation, such as facial features or medical regions, while other regions can tolerate more embedded data.
In practical applications, the proposed scheme does not automatically detect semantic regions such as faces or clinically important tissues. Instead, it assumes that a region-of-interest (ROI) mask or importance map is provided externally by the user or by an application-specific module. This ROI mask is then converted into a per-pixel bit-length map k x , y , where pixels inside the ROI are assigned a small k (e.g., k = 1 ) to minimize distortion, and pixels in non-ROI regions can adopt larger k values (e.g., k = 3 or 4) to increase payload. In this way, the user-controlled k mechanism enables the embedding process to adapt to diverse quality requirements while keeping the core embedding algorithm unchanged.

3.2.5. Theoretical Embedding Capacity

Each twin pixel consists of two physical pixels, one from each image. If all pixel pairs are used and all are assigned k = 4 bits, the maximum number of embedded bits is:
Maximum embedded bits = 4 · M · N
Given that the total number of physical pixels in the two images is 2 · M · N , the theoretical upper bound on embedding capacity in terms of bits per pixel (bpp) is:
Max bpp = 4 · M N 2 · M N = 2.0
In practice, however, the average bpp will depend on the k distribution and the number of skipped pairs due to overflow or underflow conditions.

3.2.6. Data Embedding Algorithm

Algorithm 1 describes the complete embedding procedure for the proposed twin-image-based reversible data hiding scheme. Initially, the algorithm processes each 4 × 4 block pair of the AMBTC-decoded images I 1 and I 2 . For every block, the quantization values H j and L j are computed from the pixels of the first image block B j ( 1 ) and serve as reference values for embedding.
The algorithm then traverses each pixel position within the current block, examining the corresponding twin pixel pair ( p ( 1 ) , p ( 2 ) ) . If both pixels match the quantization value H j , the pair is classified as H-type; similarly, if both pixels match L j , it is classified as L-type. Based on the predetermined bit-length k assigned to that pixel position, a segment of k bits is taken from the secret bitstream, transformed into a decimal difference value Δ , and embedded into the pair following Equation (11). Prior to embedding, overflow and underflow conditions (Equation (12)) are strictly verified. If these conditions are not met, embedding at that position is skipped to maintain reversibility and prevent distortion.
After embedding secret data into all blocks (except for the last two reserved blocks), the algorithm computes a 64-bit hash code using an HMAC (Hash-based Message Authentication Code). Specifically, the HMAC is generated over the entire contents of the modified images ( I 1     I 2 ) , using a secret key K shared between sender and receiver. The resulting 64-bit HMAC value serves as an integrity verification code.
This hash code is embedded into the last two blocks ( B n 1 and B n ) of image I 1 . Embedding of the HMAC employs a fixed 2-bit per pixel approach, thereby precisely fitting into the reserved 64-pixel space (2 blocks × 16 pixels each). These reserved blocks are exclusively dedicated to integrity verification and contain no user data. This approach ensures that any modification of the stego images can be reliably detected at the receiver, strengthening the robustness and security of the embedding scheme.
Algorithm 1 Block-Wise Twin-Pixel Data Embedding with HMAC Integration
Require: AMBTC-decoded images I 1 , I 2 of size M × N ; bitstream b ; per-pixel bit-length map { k x , y } ; secret key K
Ensure: Stego images I 1 , I 2 with embedded data and embedded hash code
1:Initialize I 1 I 1 , I 2 I 2
2: s 1                                                                                                        ▹ bitstream index
3:Reserve last two blocks ( B n 1 ,   B n ) for hash code embedding
4:for each 4 × 4 block B j at position ( x 0 ,   y 0 ) , excluding B n 1 ,   B n  do
5:     Extract B j ( 1 ) and B j ( 2 ) from I 1 , I 2
6:     Compute quantization values H j and L j from B j ( 1 )
7:     for  i = 0 to 3 do
8:           for  k = 0 to 3 do
9:                ( x ,   y ) ( x 0 + i , y 0 + k )
10:                ( p ( 1 ) , p ( 2 ) ) ( I 1 [ x , y ] , I 2 [ x , y ] )
11:                k x y k x , y
12:               if  s + k x y 1 > len ( b )  then
13:                    break
14:               end if
15:                b k b [ s : s + k x y 1 ] ;    Δ dec ( b k )
16:                s s + k x y
17:               if  p ( 1 ) = p ( 2 ) = H j  and  H j + Δ 255  then
18:                    I 1 [ x ,   y ] H j + Δ
19:                    I 2 [ x ,   y ] H j
20:               else if  p ( 1 ) = p ( 2 ) = L j  and  L j Δ 0  then
21:                    I 1 [ x ,   y ] L j
22:                    I 2 [ x ,   y ] L j Δ
23:               else
24:                   skip embedding at  ( x , y )
25:               end if
26:         end for
27:    end for
28:end for
29:Compute hash code h HMAC K ( I 1 I 2 ) (64 bits)
30:Let B n 1 ( 1 ) , B n ( 1 ) be the last two blocks of I 1
31:Embed h (64 bits) into these blocks using fixed 2-bit embedding per pixel (row-major)

3.3. Data Extraction and Cover Image Recovery

At the receiver side, the embedded secret data must be precisely extracted from the twin stego-images ( I 1 ,   I 2 ) , and the original AMBTC-decoded cover images ( I 1 ,   I 2 ) should be completely recovered without distortion. This extraction and recovery process strictly follows the reverse operations of the embedding procedure described in Section 3.2.
First, the stego images are partitioned into non-overlapping 4 × 4 blocks. For each block, the decoder recomputes the AMBTC quantization levels H j and L j from the pixels of I 1 , which serve as references for classifying twin pixel pairs and for reconstructing the cover images.
Next, for every pixel position ( x ,   y ) , the twin pair ( p 1 ,   p 2 ) is examined. If both pixels are equal to H j , the pair is classified as H-type; if both are equal to L j , it is classified as L-type. For an H-type pair, the embedded integer is inferred from the difference between the modified pixel and the reference value H j as
δ = p 1 H j ,
whereas for an L-type pair it is inferred from the difference between L j and the modified pixel:
δ = L j p 2 .
These two cases can be summarized in a unified extraction rule of the form
δ = p 1 H j , H-type pair , L j p 2 , L-type pair ,
which directly corresponds to the embedding operation in Section 3.2. The inferred value δ is accepted only when it satisfies the overflow/underflow constraints in Equation (12); otherwise, the pair is treated as non-embedded and skipped. For each valid pair, δ is converted back into its k-bit payload segment, which is appended to the reconstructed bitstream in the correct order.
After all bits have been extracted, each used twin pair is restored to its original AMBTC-decoded values by copying the reference level. The recovered pair ( p ^ 1 ,   p ^ 2 ) is thus given by
( p ^ 1 ,   p ^ 2 ) = ( H j ,   H j ) , H-type pair , ( L j ,   L j ) , L-type pair ,
which guarantees that the reconstructed images I 1 and I 2 are identical to the original AMBTC-decoded covers.
Finally, the 64-bit HMAC embedded in the reserved blocks is extracted and compared with a newly computed HMAC of the recovered image content. A match indicates that no tampering has occurred, whereas a mismatch flags the stego images as modified.

Data Extraction and Recovery Algorithm

Algorithm 2 illustrates the precise process used by the receiver for extracting the hidden bitstream, fully recovering the original cover images, and verifying image integrity. The extraction process is strictly performed on a block-wise basis, mirroring the embedding operation described in Algorithm 1.
Initially, the stego images I 1 and I 2 are partitioned into non-overlapping 4 × 4 blocks, identical to those used during embedding. For each block, the quantization values H j and L j are recomputed from the corresponding block pixels in image I 1 . These values are essential for correctly classifying twin pixel pairs as either H-type or L-type, and thus ensure accurate data extraction.
Within each block, the algorithm examines each twin pixel pair ( p ( 1 ) ,   p ( 2 ) ) . If the pair matches the embedding conditions (i.e., an H-type pair with p ( 2 ) = H j , or an L-type pair with p ( 1 ) = L j ), the embedded difference value Δ is extracted using the unified formula given in Equation (17). Crucially, before finalizing the extraction, the algorithm validates each computed difference Δ using the overflow and underflow safety constraints described in Equation (12). Any pixel pair that violates these conditions is skipped, as it indicates that no embedding occurred at that location during encoding.
Upon successfully extracting Δ , the algorithm utilizes the known, pre-assigned bit-length k to decode Δ back into its original k-bit binary segment. These recovered bit segments are sequentially appended to reconstruct the original secret bitstream b without ambiguity.
After extracting the embedded data bits, the algorithm recovers the original pixel values by restoring each twin pixel pair to its initial quantization levels ( H j ,   H j ) for H-type pairs or ( L j ,   L j ) for L-type pairs. This step perfectly reverses the embedding operation, thus ensuring exact recovery of the original cover images.
Finally, to guarantee data integrity and detect potential modifications, the algorithm extracts the embedded 64-bit HMAC hash code from the reserved blocks ( B n 1 ,   B n ). It then recalculates the HMAC from the fully restored images using the shared secret key K. If the extracted HMAC matches the recalculated value, the integrity of both the extracted data and recovered images is confirmed. Any mismatch indicates potential tampering or transmission errors.
In conclusion, Algorithm 2 systematically ensures perfect reversibility, accurate bit extraction, and robust integrity verification, thereby achieving reliable data recovery and tamper-proof protection of the embedded information. The extraction and recovery algorithm is summarized in Algorithm 2 below.
Algorithm 2 Data Extraction, Cover Image Recovery, and Integrity Verification
Require: Stego images I 1 , I 2 of size M × N ; per-pixel bit-length map { k x , y } ; shared secret key K
Ensure: Extracted bitstream b ; recovered images I ^ 1 , I ^ 2 ; integrity status
1:Initialize I ^ 1 I 1 , I ^ 2 I 2
2:Initialize empty bitstream b Ø
3:for each 4 × 4 block B j at position ( x 0 ,   y 0 ) , excluding reserved blocks B n 1 ,   B n  do
4:      Compute quantization levels H j , L j from block B j in I 1
5:      for  i = 0 to 3 do
6:            for  k = 0 to 3 do
7:                   ( x , y ) ( x 0 + i , y 0 + k )
8:                   ( p ( 1 ) ,   p ( 2 ) ) ( I 1 [ x ,   y ] , I 2 [ x ,   y ] )
9:                   k x y k x , y
10:                  if  p ( 2 ) = H j and p ( 1 ) H j  then
11:                        Δ p ( 1 ) H j
12:                       if  H j + Δ 255  then
13:                             Append k x y -bit binary form of Δ to b
14:                              ( I ^ 1 [ x ,   y ] , I ^ 2 [ x ,   y ] ) ( H j , H j )
15:                       else
16:                            skip extraction at ( x , y )
17:                       end if
18:                 else if  p ( 1 ) = L j and p ( 2 ) L j  then
19:                        Δ L j p ( 2 )
20:                       if  L j Δ 0  then
21:                             Append k x y -bit binary form of Δ to b
22:                              ( I ^ 1 [ x ,   y ] , I ^ 2 [ x ,   y ] ) ( L j , L j )
23:                       else
24:                            skip extraction at  ( x ,   y )
25:                       end if
26:                else
27:                     skip extraction at  ( x ,   y )
28:                end if
29:          end for
30:      end for
31:end for
32:Extract 64-bit embedded HMAC code h from reserved blocks B n 1 ,   B n
33:Compute verification HMAC h HMAC K ( I ^ 1 I ^ 2 ) (64 bits)
34:if  h = h  then
35:      Integrity status ← “Verified”
36:else
37:      Integrity status ← “Verification Failed”
38:end if
39:return  ( b , I ^ 1 , I ^ 2 , Integrity status )

3.4. Authentication Extension

To enable integrity verification of the stego images, the proposed method integrates a lightweight HMAC-based authentication mechanism. This ensures that any tampering with the embedded content can be detected without requiring auxiliary metadata.
After embedding the secret bitstream, a 64-bit HMAC value is computed over the modified content M = I 1 I 2 , as defined in Section 2.3 (see Equation (9)). This hash is then embedded into the final two blocks B n 1 and B n using the reversible embedding logic outlined in Section 3.2.
During extraction, the embedded HMAC is retrieved from the reserved blocks, and a new hash is computed from the restored image content. If the two hashes match, the image is verified as authentic; otherwise, it is considered tampered.
Authentication Result = Success if h = h Failure otherwise
This authentication extension enhances the reliability of the system while preserving reversibility, high capacity, and visual quality. This authentication extension reinforces the robustness of the proposed scheme by enabling tamper detection without compromising reversibility or relying on external signatures or location maps.

Limitation

While the authentication extension enhances robustness against tampering, it cannot localize modifications. It serves only as a global integrity check and does not indicate where changes may have occurred.

3.5. Example

To illustrate the proposed method, we consider one pair of identical AMBTC-decoded blocks B j ( 1 ) and B j ( 2 ) from I 1 and I 2 , respectively. Each 4 × 4 block consists of 16 pixels, all taking either the high quantization value H j = 210 or the low value L j = 40 .
The original blocks are as follows:
B j ( 1 ) = B j ( 2 ) = 210 210 40 40 210 210 40 40 210 210 40 40 210 210 40 40
Let the 32-bit secret message be:
b = [ 01101100000101111000100100110100 ] 2
We traverse the pixels in row-major order and process each twin pixel ( p i ( 1 ) ,   p i ( 2 ) ) as follows:
  • For H-type pixels: ( 210 ,   210 ) Embed Δ = dec ( 2 -bit segment ) , e.g., for ‘01’, Δ = 1 Result: ( 211 ,   210 )
  • For L-type pixels: ( 40 ,   40 ) Embed Δ = dec ( 2 -bit segment ) , e.g., for ‘10’, Δ = 2 Result: ( 40 ,   38 )
Table 1 summarizes the embedding results for each twin pixel:
After embedding, the stego blocks B j ( 1 ) and B j ( 2 ) are modified accordingly.
During extraction, the absolute difference Δ   =   | p ( 1 ) p ( 2 ) | is computed for each twin pixel. Based on the quantization type and safety condition ( H j 252 or L j 3 ), the 2-bit segment is reconstructed. The modified pixel is restored to its original value using the reference pixel, guaranteeing full reversibility.
Example : ( 211 ,   210 ) Δ = 1 01 , Recover : ( 210 ,   210 )
The final reconstructed blocks are identical to the original blocks, and the full bitstream is successfully recovered.

4. Experimental Results

This section presents the experimental evaluation of the proposed reversible data hiding scheme using twin AMBTC-decoded images. The performance is assessed in terms of embedding capacity (bits per pixel), visual quality (PSNR), and the effectiveness of the optional HMAC-based authentication mechanism.

4.1. Experimental Setup

The proposed reversible data hiding scheme was implemented in Python 3.13.7 (Python Software Foundation, Wilmington, DE, USA) and executed on a MacBook equipped with an Apple M3 pro processor (Apple Inc., Cupertino, CA, USA) and 16 GB of unified memory. All computations, including AMBTC encoding/decoding, data embedding and extraction, and HMAC authentication, were performed in this environment without hardware acceleration.
A set of ten standard 512 × 512 grayscale test images was used for evaluation: Peppers, Airplane, Boat, Goldhill, Baboon, Barbara, Zelda, Elaine, Tiffany, and Lena. Figure 2 displays nine representative examples (excluding Tiffany due to space), whereas all ten images are included in Table 2, Table 3 and Table 4 and Figure 3. These images are widely adopted in the image processing literature and provide a balanced range of smooth, textured, and complex patterns for assessing visual quality and robustness.
Each image was first encoded and decoded using the AMBTC (Absolute Moment Block Truncation Coding) method to generate two visually identical images ( I 1 ,   I 2 ) composed of 4 × 4 non-overlapping blocks. The reversible data embedding process was then applied to these twin images, embedding a randomly generated binary bitstream with varying bit-lengths k { 2 ,   3 ,   4 } or adaptively assigned based on distortion constraints.
During the embedding process, pixel overflow and underflow conditions (see Equation (12)) were strictly enforced to ensure lossless reversibility. The final two blocks of I 1 were reserved for embedding a 64-bit HMAC computed using SHA-256, following the procedure described in Section 3.4. At the receiver side, data extraction, image recovery, and authentication were performed as detailed in Algorithm 1.

4.2. Performance Metrics

The performance of the proposed AMBTC-based dual-image reversible data hiding method was evaluated using the following standard metrics:
  • Peak Signal-to-Noise Ratio (PSNR): PSNR was used to quantify the distortion introduced by the embedding process. Specifically, each stego image ( I 1 , I 2 ) was compared with its corresponding cover image ( I 1 , I 2 ). PSNR is defined as
    PSNR = 10 · log 10 255 2 MSE ,
    where MSE denotes the mean squared error between a cover image and its corresponding stego image. Higher PSNR values indicate less visual distortion; values above 40 dB ( k 2 ) are generally considered visually imperceptible.
  • Structural Similarity Index Measure (SSIM): In addition to PSNR, the Structural Similarity Index Measure (SSIM) was used to assess the perceptual similarity between each cover image and its corresponding stego image. Given a cover image X and a stego image Y, the SSIM value is defined as
    SSIM ( X , Y ) = ( 2 μ X μ Y + C 1 ) ( 2 σ X Y + C 2 ) ( μ X 2 + μ Y 2 + C 1 ) ( σ X 2 + σ Y 2 + C 2 ) ,
    where μ X and μ Y denote the mean intensities of X and Y, σ X 2 and σ Y 2 are their variances, and σ X Y is the covariance between them. The constants C 1 and C 2 are used to stabilize the division when the denominators are small, and are set to C 1 = ( 0.01 × 255 ) 2 and C 2 = ( 0.03 × 255 ) 2 in our experiments. The SSIM values range from 0 to 1, with values closer to 1 indicating higher structural similarity and better visual quality.
  • Embedding Rate (bits per pixel, bpp): Embedding capacity was measured in terms of bits per pixel. Since two stego images are generated, the embedding rate was computed as
    bpp = Total embedded bits 2 · M · N ,
    where M × N is the size of each cover image. This definition reflects the effective payload per pixel across the dual-image framework.
  • Authentication Accuracy: The reliability of integrity verification was evaluated using the proposed HMAC-based authentication mechanism. During extraction, the embedded HMAC is compared against a recomputed HMAC from the recovered stego images. A match indicates that the images were not tampered with, while a mismatch signifies tampering.
Table 2 presents a comparison of the maximum embedding ratio (MER, in bpp) between the proposed method and six representative schemes from the literature: Lee and Huang [16], Liu and Chang [20], Lin et al. [21], Chen and Hong [22], Lee and Chan [24], and Kim [30]. For all ten standard 512 × 512 grayscale test images, the proposed method consistently achieves a MER of 2.00 bpp, which is the highest among all compared approaches. The second-highest MER is reported by Lee and Chan [24] at 1.56 bpp, followed by Chen and Hong [22] with 1.14 bpp, Lee and Huang [16] with 1.09 bpp, Lin et al. [21] with 1.07 bpp, and Liu and Chang [20] with 1.00 bpp (0.99 bpp for Elaine). The lowest MER is observed in Kim [30] at 0.56 bpp. The results demonstrate that the proposed dual-image AMBTC-based embedding strategy not only increases the payload significantly but also maintains consistent capacity regardless of image texture complexity, owing to its systematic use of ( H ,   L ) pixel pair structures and overflow/underflow avoidance.
Table 3 presents the objective quality evaluation of the proposed adaptive dual-image reversible data hiding scheme for ten standard 512 × 512 grayscale test images. Four embedding orders k { 1 , 2 , 3 , 4 } were examined, corresponding to payload capacities ranging from 0.5 bpp to approximately 1.9 bpp. For each configuration, both the structural similarity index (SSIM) and peak signal-to-noise ratio (PSNR) were computed separately for the two marked images I 1 and I 2 .
As expected, increasing k increases the embedding capacity but also leads to a gradual degradation in visual quality. At k = 1 (0.5 bpp), the proposed method achieves extremely high fidelity, with mean SSIM exceeding 0.999 for both images and PSNR values above 54 dB. This indicates that the distortion introduced is imperceptible to the human visual system. When k is increased to 2 (1.0 bpp), visual quality remains very high, with mean SSIM above 0.994 and PSNR above 45 dB, a range generally considered visually lossless under typical viewing conditions. These two configurations therefore offer the best balance between capacity and visual fidelity for applications where imperceptibility is critical.
At higher embedding orders, quality degradation becomes more apparent. For k = 3 (approximately 1.5 bpp), mean SSIM decreases to about 0.976 and PSNR to 38.8 dB, where some degradation can be detected in highly textured regions. At k = 4 (about 1.9 bpp), SSIM drops to roughly 0.92 and PSNR to 32.3 dB, making the changes visually noticeable in texture-rich areas such as Baboon and Airplane. Conversely, smooth images such as Barbara, Lena, and Elaine maintain relatively higher quality under the same payload due to the reduced impact of pixel modifications in low-frequency regions.
An important observation is the near-identical performance between I 1 and I 2 across all configurations: the differences in SSIM and PSNR values are negligible. This symmetry confirms that the embedding process affects both marked images uniformly, which is essential for fairness and robustness in dual-image reversible data hiding systems. The consistency in quality between the two images also ensures that either can be used independently for data extraction and image recovery without introducing bias.
In summary, Table 3 demonstrates that the proposed method provides scalable control over the trade-off between capacity and quality via the parameter k. For scenarios prioritizing imperceptibility, k = 1 or k = 2 is recommended. For applications where maximum embedding capacity is required, k = 4 can be used at the cost of some visible degradation. These results confirm the flexibility and robustness of the proposed approach in balancing payload size and visual quality.
Figure 3 illustrates the effect of varying the embedding order k on the visual quality and payload capacity of the proposed AMBTC-based dual-image reversible data hiding scheme. Subfigure (a) shows that the mean PSNR of both marked images, I 1 and I 2 , remains above 45 dB when k 2 , indicating near-lossless quality. When k = 3 , PSNR drops to around 38.7 dB, which is still acceptable for many applications, but a more noticeable degradation can be observed at k = 4 where PSNR is close to 32 dB. A similar trend is observed in Subfigure (b), where the SSIM metric remains above 0.99 for k 2 , decreases slightly at k = 3 , and drops more significantly at k = 4 . These results confirm that small k values preserve higher visual fidelity, while larger k values trade quality for increased embedding capacity. Finally, Subfigure (c) demonstrates the expected growth of embedding capacity with k. For instance, k = 1 yields an average payload of 0.5 bpp, whereas k = 4 achieves nearly 2.0 bpp. This highlights the flexibility of the proposed method, allowing users to balance between capacity and quality according to application requirements.
As shown in Figure 3, the PSNR and SSIM values decrease gradually as the embedding order k increases, whereas the payload capacity increases almost linearly with k. This clearly illustrates the trade-off between image quality and embedding capacity in the proposed scheme.
Table 4 compares the maximum embedding capacity (in bpp) and reconstruction quality (PSNR) of several representative dual-image reversible data hiding (DIRDH) methods and the proposed scheme. Overall, the proposed method achieves two distinct operating modes depending on the embedding factor k.
For k = 1 , the proposed scheme provides a payload of 0.5 bpp, which is lower than most existing methods. However, the corresponding image quality is remarkably high, reaching an average PSNR of approximately 54.15 dB across the four test images. This demonstrates that the scheme can achieve near-lossless stego-image quality while maintaining reversibility.
For k = 2 , the embedding capacity increases to 1.0 bpp, comparable to many conventional dual-image schemes such as Chang et al. [14], Chang et al. [17], and Kim et al. [35]. However, the PSNR decreases to about 45.7 dB, reflecting the trade-off between capacity and quality.
It is worth noting that Kim (2022) [30], which is the only existing AMBTC-based dual reversible data hiding method, achieves a payload of only 0.47 0.51 bpp, but with relatively high image quality (PSNR 53.5 dB). Therefore, in terms of fair comparison, the proposed method at k = 1 offers a similar PSNR to Kim (2022) [30] while slightly improving embedding efficiency to 0.5 bpp. Moreover, by allowing flexible control via the parameter k, the proposed scheme extends beyond Kim’s method by supporting higher payloads ( 1.0 bpp) at acceptable visual quality.
These results highlight the adaptability of the proposed AMBTC-based DIRDH framework: it can operate either in a high-quality, low-capacity mode or in a high-capacity, moderate-quality mode. Among AMBTC-based schemes, the proposed method represents a more versatile and tunable design, making it well-suited for applications where trade-offs between capacity and image fidelity must be carefully balanced.

4.3. Authentication Experiment

To further evaluate the reliability of the proposed dual-image AMBTC-based RDH scheme, we conducted an authentication experiment using an HMAC-based integrity check. The HMAC value was generated over the stego images after data embedding, following the procedure described in Section 3.4. During extraction, the embedded HMAC was retrieved and compared against a newly computed HMAC from the received image.
For the experiment, the Lena image was selected as the cover image. We considered four cases: (i) no tampering, (ii) pixel modification in 10% of the image, (iii) Gaussian noise addition, and (iv) cropping attack. Figure 4 illustrates the tampered Lena images used in the simulation.
Table 5 shows the authentication results. When the image was not tampered, the retrieved HMAC matched the recomputed one, and the result was “Pass”. For all tampered cases, the HMAC values did not match, leading to a “Fail” result.
The results confirm that the proposed scheme can reliably detect tampering of the stego image. It should be noted that the HMAC-based authentication only indicates whether tampering has occurred, without localizing the exact regions of modification.
Table 6 summarizes the authentication results and quality degradation under several representative tampering scenarios on the Lena stego images. In the absence of any modification, the HMAC values computed at the receiver perfectly match the embedded HMAC, and the PSNR and SSIM between the original and received stego images are ideal ( PSNR = , SSIM = 1.000 ), indicating lossless reversibility. In contrast, random pixel modification and additive Gaussian noise significantly reduce both PSNR and SSIM, and the corresponding HMAC comparison consistently fails, which allows the proposed method to reliably detect such tampering. The cropping case causes the most severe degradation (PSNR 5.55 dB, SSIM 0.254 ) and is likewise flagged as “Verification failed”.
These results confirm that the proposed HMAC-based authentication mechanism is highly sensitive to various types of distortions, including sparse pixel changes, noise addition, and geometric cropping. Once tampering occurs, however, the original cover images and embedded payload can no longer be recovered exactly; in this situation, the framework is designed to provide tampering detection only, rather than approximate data reconstruction. Extending the system with redundancy or error-correcting codes to enable partial recovery under such attacks is left as an interesting direction for future work.

5. Discussion

5.1. Security Aspects

Unlike prior DIRDH works [16,20,21,22,24,30], which focused primarily on embedding capacity and visual fidelity, the proposed scheme integrates a lightweight Hash-based Message Authentication Code (HMAC) mechanism. This ensures that any tampering of the stego images can be detected with strong cryptographic guarantees. While HMAC cannot localize the tampered regions, it provides a practical and efficient layer of integrity verification, enhancing the reliability of dual-image RDH for secure multimedia communication.
Because the HMAC is computed over the exact serialized content of the stego images, even benign processing such as lossy recompression or format conversion in messaging or email systems will be detected as tampering. Consequently, the proposed authentication mechanism is intended for scenarios where the image bitstream is preserved, or where automatic recompression can be disabled for protected content.

5.2. Extension to Color Images

A natural direction for extending the proposed AMBTC-based DIRDH scheme is to consider color images. However, applying the current framework to color data is not straightforward and raises several technical challenges. A naive strategy is to perform AMBTC encoding and reversible embedding independently on each channel of an RGB or YCbCr image. While this approach can increase the overall payload by exploiting all channels, it may also aggravate visible artifacts if the three channels are modified in an unbalanced manner, especially in highly saturated or textured regions. In particular, small but inconsistent changes across channels can lead to noticeable color shifts even when the per-channel distortion remains low.
Another issue is the design of overflow/underflow control and HMAC-based authentication in a multi-channel setting. In the grayscale case, the embedding constraints are enforced on a single intensity value per pixel, and the global HMAC is computed over the concatenated stego images ( I 1 I 2 ) . For color images, one must ensure that the embedding operations in different channels jointly satisfy the reversibility constraints, and that the authentication mechanism remains robust to channel-dependent distortions. For example, tampering that selectively alters only one channel may still cause a global HMAC mismatch, even if the other channels are visually preserved, which complicates the interpretation of authentication results.
A more principled solution would be to design color-aware quantization and embedding rules that operate in a perceptually meaningful color space (e.g., YCbCr) and explicitly account for inter-channel correlation. This may involve assigning different bit-lengths k to luminance and chrominance components, or jointly optimizing the embedding pattern across channels to minimize perceptual color distortion under AMBTC constraints. Investigating such color-specific designs, and their impact on payload, visual quality, and authentication reliability is an important topic for future research.
A practical starting point would be to perform AMBTC and embedding in the luminance (Y) channel only, while keeping the chrominance (Cb/Cr) channels unmodified, which preserves color information while still enabling reversible data hiding in a perceptually important component.

5.3. Tamper Localization Beyond Global HMAC

In its current form, the proposed framework relies on a single HMAC value computed over the entire pair of stego images ( I 1 I 2 ) to verify integrity. This global authentication strategy has the advantage of simplicity and strong sensitivity to any modification, but it can only indicate whether tampering has occurred; it does not provide information about where the image has been altered. For many practical applications, such as medical forensics or legal evidence analysis, it is highly desirable to localize the regions affected by tampering rather than merely detect its presence.
One straightforward extension is to divide the image into non-overlapping blocks and compute a separate authentication code for each block or group of blocks. During verification, the blocks whose codes fail to match would be flagged as suspicious, thereby providing coarse-to-fine spatial localization of the tampered regions. However, such a block-wise or hierarchical HMAC design introduces additional overhead in terms of payload since multiple authentication tags must be embedded, and it may also complicate the reversible embedding process if the tags need to be updated after local modifications.
Another promising direction is to incorporate fragile watermarking techniques that embed local authentication bits directly into each block while preserving the global reversibility of the host images. In this setting, the reversible AMBTC-based DIRDH component would primarily handle payload and lossless recovery, whereas a fragile watermark would serve as a fine-grained integrity map. The main challenge is to jointly design these two components so that the watermark remains sensitive to tampering yet does not significantly reduce embedding capacity or degrade image quality. Systematically exploring block-wise HMAC, hierarchical authentication, and reversible fragile watermarking as complementary mechanisms for tamper localization is therefore an important direction for future work.
Another possible direction is to incorporate an additional error-correction or redundancy layer on top of the proposed reversible embedding so that a subset of the secret bits could still be recovered under mild attacks; however, the design of such hybrid RDH–ECC schemes lies beyond the scope of the present framework and is left as future work.

5.4. Prospects of Machine Learning Integration

The present AMBTC-based DIRDH framework is entirely model-driven and does not employ any machine learning (ML) components. Nevertheless, ML techniques offer several opportunities to further enhance the flexibility and performance of the proposed scheme. One promising direction is to use learning-based models to predict distortion-sensitive or semantically important regions, providing a data-driven region-of-interest map that can be translated into the bit-length map k x , y for user- or application-controlled embedding. In this way, the allocation of small and large k values could be guided not only by manually defined rules but also by learned perceptual or task-specific criteria.
Another potential application of ML is to design embedding patterns or distortion constraints that are optimized for AMBTC-encoded images. For example, a neural network could be trained to suggest modifications on H j and L j or on twin pixels that minimize perceptual artifacts while meeting a target payload and reversibility constraint. Similarly, ML-based detectors could be developed to analyze subtle statistical traces in stego images, providing a more sensitive or robust tampering detector than a purely analytic test.
Finally, ML can be considered in the context of tamper localization and authentication. Data-driven models may learn to infer likely tampered regions from inconsistencies across blocks, channels, or successive transmissions, thereby complementing the cryptographic guarantees provided by HMAC. Systematically integrating such ML-assisted components with the reversible AMBTC-based DIRDH core, while preserving strict reversibility and security, is an interesting avenue for future research.

6. Conclusions

In this paper, we proposed a novel dual-image reversible data hiding (DIRDH) method based on Absolute Moment Block Truncation Coding (AMBTC). By exploiting the block-wise structure of AMBTC and the twin-image embedding framework, the scheme achieved both high embedding capacity and full reversibility. An adaptive embedding model controlled by parameter k was introduced, allowing 1–4 bits to be hidden per pixel pair depending on distortion tolerance. To enhance system robustness, a lightweight HMAC-based authentication mechanism was integrated, enabling reliable integrity verification of stego images without external metadata.
Experimental results on ten standard 512 × 512 grayscale images demonstrated that the proposed method consistently outperformed existing DIRDH schemes in terms of embedding rate (up to 2.0 bpp) while preserving acceptable image quality (PSNR above 32 dB and SSIM close to 1). Comparisons with state-of-the-art works confirmed that our approach provides a better trade-off between capacity and fidelity, particularly when compared to AMBTC-based schemes such as Kim (2022) [30]. Furthermore, the authentication experiments showed that any image tampering, including pixel modifications, noise addition, and cropping, can be detected reliably through HMAC verification.
Nevertheless, some limitations remain. First, although authentication can confirm whether an image has been tampered with, it cannot localize the specific tampered regions. Second, the use of twin images inherently doubles storage and transmission costs, which may not be suitable for all practical applications.
Future work will explore lightweight localization strategies for tampering detection, possibly by combining block-level checksums or fragile watermarking with the current HMAC framework. In addition, extending the method to color images, video streams, and encrypted-domain data hiding will be investigated to broaden applicability in multimedia security and copyright protection scenarios.
Overall, the proposed method provides a promising framework for high-capacity, reversible, and authenticated data hiding in AMBTC-compressed images, and may serve as a foundation for future secure multimedia systems.

Author Contributions

Each author discussed the details of the manuscript. C.K. designed and wrote the manuscript. C.K. implemented the proposed technique and provided the experimental results. C.-N.Y., L.L. and C.K. reviewed and revised the article. C.K. drafted and revised the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported in part by the National Science and Technology Council (NSTC), under Grant No. 112-2221-E-259-007-MY2 (C.Y.), the National Natural Science Foundation of China (No. 62466038), and the Open Foundation of Jiangxi Provincial Key Laboratory of Image Processing and Pattern Recognition (ET202404437) (L.L.).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The study used standard publicly available grayscale images of size 512 × 512, including commonly used test images (e.g., Lena, Barbara, Baboon). These images are available from the USC-SIPI Image Database (http://sipi.usc.edu/database/, accessed on 20 January 2026). No new data were created.

Acknowledgments

We thank the anonymous reviewers for their valuable suggestions that improved the quality of this article.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
HHigh quantization level in AMBTC block
LLow quantization level in AMBTC block
kNumber of secret bits embedded per pixel pair
δ Difference value determined by the embedded bits
I 1 First cover/stego image
I 2 Second cover/stego image
B j j-th 4 × 4 block in AMBTC coding
MMessage (bitstream) to be embedded
hExtracted HMAC hash value
h Recomputed HMAC hash for authentication
P S N R Peak Signal-to-Noise Ratio
S S I M Structural Similarity Index Measure
b p p Bits per pixel (embedding capacity measure)
R D H Reversible Data Hiding
A M B T C Absolute Moment Block Truncation Coding
H M A C Hash-based Message Authentication Code
D I R D H Dual-Image Reversible Data Hiding

References

  1. Petitcolas, F.A.P.; Anderson, R.J.; Kuhn, M.G. Information hiding—A survey. Proc. IEEE 1999, 87, 1062–1078. [Google Scholar] [CrossRef]
  2. Cheddad, A.; Condell, J.; Curran, K.; McKevitt, P. Digital image steganography: Survey and analysis of current methods. Signal Process. 2010, 90, 727–752. [Google Scholar] [CrossRef]
  3. Menezes, A.J.; van Oorschot, P.C.; Vanstone, S.A. Handbook of Applied Cryptography; CRC Press: Boca Raton, FL, USA, 1996. [Google Scholar]
  4. Johnson, N.F.; Duric, Z.; Jajodia, S. Information Hiding: Steganography and Watermarking—Attacks and Countermeasures; Springer: Berlin/Heidelberg, Germany, 2001. [Google Scholar]
  5. Bender, W.; Gruhl, D.; Morimoto, N.; Lu, A. Techniques for data hiding. IBM Syst. J. 1996, 35, 313–336. [Google Scholar] [CrossRef]
  6. Chan, C.K.; Cheng, L.M. Hiding data in images by simple LSB substitution. Pattern Recognit. 2004, 37, 469–474. [Google Scholar] [CrossRef]
  7. Fridrich, J.; Goljan, M.; Du, R. Reliable detection of LSB steganography in color and grayscale images. In Proceedings of the ACM Workshop on Multimedia and Security, Ottawa, ON, Canada, 5 October 2001; pp. 27–30. [Google Scholar]
  8. Tian, J. Reversible data embedding using difference expansion. IEEE Trans. Circuits Syst. Video Technol. 2003, 13, 890–896. [Google Scholar] [CrossRef]
  9. Ni, Z.; Shi, Y.Q.; Ansari, N.; Su, W. Reversible data hiding. IEEE Trans. Circuits Syst. Video Technol. 2006, 16, 354–362. [Google Scholar] [PubMed]
  10. Coltuc, D.; Chassery, J.M. Very fast watermarking by reversible contrast mapping. IEEE Signal Process. Lett. 2007, 14, 255–258. [Google Scholar] [CrossRef]
  11. Sachnev, V.; Kim, H.J.; Nam, J.; Suresh, S.; Shi, Y.Q. Reversible watermarking algorithm using sorting and prediction. IEEE Trans. Circuits Syst. Video Technol. 2009, 19, 989–999. [Google Scholar] [CrossRef]
  12. Li, X.; Li, B.; Yang, B.; Zeng, T. General framework to histogram-shifting-based reversible data hiding. IEEE Trans. Image Process. 2013, 22, 2181–2191. [Google Scholar] [CrossRef] [PubMed]
  13. Li, X.; Zhang, W.; Gui, X.; Yang, B. Efficient reversible data hiding based on multiple histograms modification. IEEE Trans. Image Process. 2011, 20, 3546–3551. [Google Scholar]
  14. Chang, C.C.; Kieu, T.D.; Chou, Y.C. Reversible data hiding using two steganographic images. In Proceedings of the IEEE TENCON, Taipei, Taiwan, 30 October–2 November 2007; pp. 1–4. [Google Scholar]
  15. Chang, C.C.; Chou, Y.C.; Kieu, T.D. Information hiding in dual images with reversibility. In Proceedings of the 3rd International Conference on Multimedia and Ubiquitous Engineering (ICMUE), Qingdao, China, 4–6 June 2009; IEEE: Piscataway, NJ, USA; pp. 145–152.
  16. Lee, C.F.; Huang, Y.L. Reversible data hiding scheme based on dual stego-images using orientation combinations. Telecommun. Syst. 2013, 52, 2237–2247. [Google Scholar] [CrossRef]
  17. Chang, C.C.; Lu, T.C.; Horng, G.; Huang, Y.H.; Hsu, Y.M. A high payload data embedding scheme using dual stego-images with reversibility. In Proceedings of the 9th International Conference on Information, Communications & Signal Processing, Tainan, Taiwan, 10–13 December 2013; IEEE: Piscataway, NJ, USA; pp. 1–5.
  18. Qin, C.; Chang, C.C.; Hsu, T.J. Reversible data hiding scheme based on exploiting modification direction with two steganographic images. Multimed. Tools Appl. 2015, 74, 5861–5872. [Google Scholar] [CrossRef]
  19. Lu, T.C.; Wu, J.H.; Huang, C.C. Dual-image-based reversible data hiding method using center folding strategy. Signal Process. 2015, 115, 195–213. [Google Scholar] [CrossRef]
  20. Liu, Y.; Chang, C.C. A turtle shell-based visual secret sharing scheme with reversibility and authentication. Multimed. Tools Appl. 2018, 77, 25295–25310. [Google Scholar] [CrossRef]
  21. Lin, J.Y.; Chen, Y.; Chang, C.C.; Hu, Y.C. Dual-image with integrity verification using exploiting modification direction. Multimed. Tools Appl. 2019, 78, 25855–25872. [Google Scholar] [CrossRef]
  22. Chen, X.; Hong, C. An efficient dual-image reversible data hiding scheme based on exploiting modification direction. J. Inf. Secur. Appl. 2021, 58, 102702. [Google Scholar] [CrossRef]
  23. Lu, T.C.; Vo, T.N.; Jana, B. Dual-image reversible data hiding based on encoding the numeral system of concealed information. In Proceedings of the 2023 15th International Conference on Advanced Computational Intelligence (ICACI), Seoul, Republic of Korea, 6–9 May 2023; pp. 1–7. [Google Scholar]
  24. Lee, C.F.; Chan, K.C. Improved dual-image quality with reversible data hiding using translocation and switching strategy. Comput. Syst. Sci. Eng. 2023, 44, 1551–1561. [Google Scholar] [CrossRef]
  25. Lema, M.; Mitchell, O.R. Absolute moment block truncation coding and its application to medical image compression. IEEE Trans. Med. Imaging 1984, 3, 145–153. [Google Scholar]
  26. Kim, C.; Shin, D.; Yang, C.; Leng, L. Data Hiding Method for Color AMBTC Compressed Images Using Color Difference. Appl. Sci. 2021, 11, 3418. [Google Scholar] [CrossRef]
  27. Chang, C.C.; Wu, H.L.; Chung, T.F. Applying Histogram Modification to Embed Secret Message in AMBTC. In Proceedings of the 2014 Tenth International Conference on Intelligent Information Hiding and Multimedia Signal Processing, Kitakyushu, Japan, 27–29 August 2014; pp. 489–492. [Google Scholar] [CrossRef]
  28. Wang, X.; Chang, C.C.; Lin, C.C. Adaptive reversible data hiding scheme for AMBTC compressed images. Multimed. Tools Appl. 2020, 79, 6547–6568. [Google Scholar] [CrossRef]
  29. Lin, C.-C.; Nguyen, T.-S.; Chang, C.-C.; Chang, W.-C. Efficient Reversible Data Hiding Scheme for AMBTC-Compressed Images. Appl. Sci. 2021, 11, 6741. [Google Scholar] [CrossRef]
  30. Kim, C. Dual reversible data hiding based on AMBTC using Hamming code and LSB replacement. Electronics 2022, 11, 3210. [Google Scholar] [CrossRef]
  31. Chang, C.C.; Wang, X.; Lin, C.C. An efficient dual prediction-based reversible data hiding and reduced code method for AMBTC-compressed images. Multimed. Tools Appl. 2021, 80, 13137–13160. [Google Scholar]
  32. Bellare, M.; Canetti, R.; Krawczyk, H. Keying hash functions for message authentication. In Advances in Cryptology—CRYPTO ’96; Springer: Berlin/Heidelberg, Germany, 1996; pp. 1–15. [Google Scholar]
  33. Krawczyk, H.; Bellare, M.; Canetti, R. HMAC: Keyed-Hashing Message Authentication; RFC 2104; IETF: Fremont, CA, USA, 1997. [Google Scholar]
  34. Hussan, M.; Parah, S.A.; Qureshi, G.J. Reversible data hiding framework with content authentication capability for e-health. Multimed. Tools Appl. 2024, 83, 35335–35353. [Google Scholar] [CrossRef]
  35. Kim, C.; Yang, C.N.; Zhou, Z.; Jung, K.H. Dual efficient reversible data hiding using Hamming code and OPAP. J. Inf. Secur. Appl. 2023, 73, 103480. [Google Scholar] [CrossRef]
Figure 1. Diagram of embedding & extraction procedure.
Figure 1. Diagram of embedding & extraction procedure.
Applsci 16 02815 g001
Figure 2. Nine representative 512 × 512 grayscale test images used in the experiments: (a) Peppers, (b) Airplane, (c) Boat, (d) Goldhill, (e) Baboon, (f) Barbara, (g) Zelda, (h) Elaine, and (i) Lena.
Figure 2. Nine representative 512 × 512 grayscale test images used in the experiments: (a) Peppers, (b) Airplane, (c) Boat, (d) Goldhill, (e) Baboon, (f) Barbara, (g) Zelda, (h) Elaine, and (i) Lena.
Applsci 16 02815 g002
Figure 3. Average performance metrics over ten 512 × 512 grayscale test images (Baboon, Barbara, Boat, Goldhill, Airplane, Peppers, Zelda, Elaine, Tiffany, and Lena) for different embedding orders k { 1 , 2 , 3 , 4 } . (a) Mean PSNR of I 1 and I 2 , (b) Mean SSIM of I 1 and I 2 , and (c) Mean embedding capacity in bpp.
Figure 3. Average performance metrics over ten 512 × 512 grayscale test images (Baboon, Barbara, Boat, Goldhill, Airplane, Peppers, Zelda, Elaine, Tiffany, and Lena) for different embedding orders k { 1 , 2 , 3 , 4 } . (a) Mean PSNR of I 1 and I 2 , (b) Mean SSIM of I 1 and I 2 , and (c) Mean embedding capacity in bpp.
Applsci 16 02815 g003
Figure 4. Authentication experiment on Lena stego image. From left to right: (a) stego Lena (untampered), (b) pixel modification, (c) Gaussian noise, (d) cropped image.
Figure 4. Authentication experiment on Lena stego image. From left to right: (a) stego Lena (untampered), (b) pixel modification, (c) Gaussian noise, (d) cropped image.
Applsci 16 02815 g004
Table 1. Example of Twin-Pixel Embedding and Recovery.
Table 1. Example of Twin-Pixel Embedding and Recovery.
IndexTypeInput ( p ( 1 ) , p ( 2 ) ) Bits Δ Output
1H(210, 210)011(211, 210)
2H(210, 210)102(212, 210)
3L(40, 40)113(40, 37)
4L(40, 40)000(40, 40)
5H(210, 210)000(210, 210)
6H(210, 210)011(211, 210)
7L(40, 40)011(40, 39)
8L(40, 40)113(40, 37)
9H(210, 210)102(212, 210)
10H(210, 210)000(210, 210)
11L(40, 40)102(40, 38)
12L(40, 40)011(40, 39)
13H(210, 210)000(210, 210)
14H(210, 210)113(213, 210)
15L(40, 40)011(40, 39)
16L(40, 40)000(40, 40)
Table 2. Comparison of maximum embedding ratio with different schemes.
Table 2. Comparison of maximum embedding ratio with different schemes.
Images[16][20][21][22][24][30]Proposed
Baboon1.091.001.071.141.560.562.00
Barbara1.091.001.071.141.560.562.00
Lena1.091.001.071.141.560.562.00
Pepper1.091.001.071.141.560.562.00
Elaine1.090.991.071.141.560.562.00
Goldhill1.091.001.071.141.560.562.00
Airplane1.091.001.071.141.560.562.00
Boat1.091.001.071.141.560.562.00
Tiffany1.091.001.071.141.560.562.00
Zelda1.091.001.071.141.560.562.00
Table 3. Objective quality (SSIM, PSNR in dB) of the two marked images I 1 ,   I 2 for different embedding orders k and resulting payload (bpp).
Table 3. Objective quality (SSIM, PSNR in dB) of the two marked images I 1 ,   I 2 for different embedding orders k and resulting payload (bpp).
ImageskbppSSIM1SSIM2PSNR1PSNR2
Baboon10.50.99980.999854.1854.12
21.00.99860.998645.7445.67
31.50.99390.993838.7638.67
41.90.97690.976832.2732.25
Barbara10.50.99930.999354.1154.19
21.00.99600.995945.6745.74
31.50.98240.982038.7138.74
42.00.93870.940532.3232.43
Boat10.50.99900.999054.0454.26
21.00.99370.993845.5945.82
31.50.97250.973338.5938.86
42.00.90570.913432.0732.57
Goldhill10.50.99940.999454.1954.12
21.00.99630.996345.7445.66
31.50.98390.984038.7338.69
42.00.94210.941932.2732.23
Airplane10.50.99870.998853.9854.33
21.00.99200.992445.5345.90
31.50.96550.967338.5338.93
42.00.88430.889332.0732.49
Peppers10.50.99910.999154.1054.20
21.00.99430.994445.6645.75
31.50.97530.975738.6538.77
42.00.91390.914432.2032.30
Zelda10.50.99890.998954.1654.15
21.00.99340.993545.7145.71
31.50.97130.971838.7138.75
42.00.89920.903832.2132.41
Elaine10.50.99940.999454.0754.23
21.00.99620.996445.6145.79
31.50.98320.983938.6438.79
42.00.93960.941432.1832.33
Tiffany10.50.99890.998954.2154.32
20.950.99370.993245.9545.82
31.40.97480.970239.3638.74
41.70.92470.896633.6432.17
Lena10.50.99890.998954.1854.12
21.00.99310.993245.7345.67
31.50.97050.970638.7438.68
42.00.89850.899232.2732.23
Mean (k = 1)0.500.99920.999254.1154.20
Mean (k = 2)1.000.99460.994645.6845.76
Mean (k = 3)1.480.97590.975638.7738.80
Mean (k = 4)1.900.92040.918932.3632.33
Table 4. Comparison of maximum bpp and PSNR of existing methods and the proposed methods.
Table 4. Comparison of maximum bpp and PSNR of existing methods and the proposed methods.
MethodMeasureLenaPeppersBarbaraGoldhill
Chang et al. (2007) [14]bpp1.001.001.001.00
PSNR#145.1245.1445.1345.13
PSNR#245.1345.1545.1145.14
PSNR AVG45.1345.1545.1245.14
Lee & Huang (2013) [16]bpp1.531.531.531.53
PSNR#139.8939.9439.8939.92
PSNR#239.8939.9439.8939.91
PSNR AVG39.8939.9439.8939.92
Chang et al. (2013) [17]bpp1.001.001.001.00
PSNR#152.1151.2552.1252.12
PSNR#241.5841.5241.5841.58
PSNR AVG46.8546.3946.8546.85
Qin et al. (2015) [18]bpp1.071.071.071.07
PSNR#149.7649.7549.7549.77
PSNR#250.4250.3450.4450.54
PSNR AVG50.0950.0550.1050.54
Lu et al. (2015) [19]bpp1.001.001.001.00
PSNR#151.1351.1549.2249.23
PSNR#251.1551.1449.2049.18
PSNR AVG51.1451.1549.2149.21
Chen et al. (2021) [22]bpp1.141.141.141.14
PSNR#149.9149.9149.9149.91
PSNR#249.9249.9249.9249.92
PSNR AVG49.9249.9249.9249.92
Kim et al. (2023) [35]bpp1.001.001.001.00
PSNR#154.1454.1554.1254.16
PSNR#248.1348.1248.1448.11
PSNR AVG51.1451.1451.1351.14
Kim (2022) [30]bpp0.470.480.510.43
PSNR#153.2353.0652.9153.63
PSNR#254.0453.8753.6254.53
PSNR AVG53.6453.4753.2754.08
Proposed (k = 1)bpp0.500.500.500.50
PSNR#154.1854.1054.1154.19
PSNR#254.1254.2054.1954.12
PSNR AVG54.1554.1554.1554.16
Proposed (k = 2)bpp1.001.001.001.00
PSNR#145.7345.6645.6745.74
PSNR#245.6745.7545.7445.66
PSNR AVG45.7045.7145.7145.70
Table 5. Authentication results using HMAC verification on Lena image.
Table 5. Authentication results using HMAC verification on Lena image.
Tampering CaseHMAC MatchResult
No tamperingYesPass
Pixel modification (10%)NoFail
Gaussian noise additionNoFail
Cropping attackNoFail
Table 6. Authentication and quality metrics under different tampering scenarios on the Lena stego images.
Table 6. Authentication and quality metrics under different tampering scenarios on the Lena stego images.
Tampering ScenarioHMAC MatchIntegrity ResultPSNR (dB)SSIM
No tamperingYesVerified1.000
Random pixel modificationNoVerification failed17.810.291
Gaussian noiseNoVerification failed34.020.828
Cropping + zero paddingNoVerification failed5.550.254
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kim, C.; Yang, C.-N.; Leng, L. High-Capacity Dual-Image Reversible Data Hiding in AMBTC Using Difference Expansion with Block-Wise HMAC Authentication. Appl. Sci. 2026, 16, 2815. https://doi.org/10.3390/app16062815

AMA Style

Kim C, Yang C-N, Leng L. High-Capacity Dual-Image Reversible Data Hiding in AMBTC Using Difference Expansion with Block-Wise HMAC Authentication. Applied Sciences. 2026; 16(6):2815. https://doi.org/10.3390/app16062815

Chicago/Turabian Style

Kim, Cheonshik, Ching-Nung Yang, and Lu Leng. 2026. "High-Capacity Dual-Image Reversible Data Hiding in AMBTC Using Difference Expansion with Block-Wise HMAC Authentication" Applied Sciences 16, no. 6: 2815. https://doi.org/10.3390/app16062815

APA Style

Kim, C., Yang, C.-N., & Leng, L. (2026). High-Capacity Dual-Image Reversible Data Hiding in AMBTC Using Difference Expansion with Block-Wise HMAC Authentication. Applied Sciences, 16(6), 2815. https://doi.org/10.3390/app16062815

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop