High-quality reversible data hiding scheme using sorting and enhanced pairwise PEE

This paper proposes a novel reversible data hiding (RDH) technique using sorting and pairwise prediction error expansion (PEE) to improve embedding capacity (EC) while retaining the quality of cover image. The proposed scheme traverses alternate pixels of the cover image in a zig-zag order to construct two independent sets for sequential embedding. The pixels of each set are sorted in an increasing order of their rhombus mean followed by a two-pass data embedding by dividing the sets into 1 × 3 size blocks based on some pre-deﬁned criteria. In pass 1, two prediction errors are calculated for the ﬁrst and the last pixels using their rhombus means; and pairwise mapping is modiﬁed and exploited to embed the secret data in such a way that the value of the ﬁrst pixel is either increased or remains unchanged, and the value of the last pixel is either decreased or remains unchanged. In pass-2, the middle pixel is utilised to predict the ﬁrst and last pixels and the values of the ﬁrst pixel and the last pixel are either decreased or remains unchanged and either increased or remains unchanged, respectively. In contrast to some existing recovery-based methods, the proposed pass-2 guarantees to complement the changes made in pass-1, thereby boosting the quality along with increased EC. The experimental results show that the proposed method achieves better embedding performance than the state-of-the-art


INTRODUCTION
The rapid development in computers and network technology has made it possible to instantly transmit multimedia data over the internet. However, this facility of instant communication comes at a cost of compromising the security of transmitted data. So, to protect the multimedia data from being compromised, additional security mechanisms need to be incorporated into the existing data communication protocols. Information hiding (or data hiding) is one such security mechanism in which the secret data is embedded into a host medium so that the presence of hidden data is imperceptible to everyone. Despite having a strong security edge, the conventional data hiding methods cause permanent damages to the cover media. Due to this reason, these methods are not the best choices for some of the media-sensitive domains such as law enforcement, medical imagery, military, etc. Since these application domains deal with sensitive image operations, an alternative to the conventional data hiding approach is required. To address this concern, the use of reversible data hiding (RDH) seems to be an appropriate option. In RDH, lossless recovery of the cover image is ensured along with the complete extraction of the hidden data. It implies that RDH preserves the integrity of both the cover image and the embedded data. The idea of RDH was pioneered in a US patent [1]. Since then, the growth of research in the field of RDH is increasing monotonically and a broad spectrum of RDH techniques have been proposed in this domain. Various RDH schemes have been devised, paving way for well-known methods, including lossless compression [2,3], difference expansion (DE) [4,5], prediction error expansion (PEE) [6][7][8][9] and histogram shifting [10,11]. Among these methods, PEE is one of the most effective methods due to its embedding performance. The method of PEE was first introduced by Thodi et al. [6] in which the three-pixel neighbourhood context of a pixel is used to compute its predicted value. The prediction error, calculated using the difference between the original pixel and its predicted value is then expanded to embed the secret data. The PEE method proves to be better than the earliest known variation of expansion-based embedding, that is, the DE method proposed by Tian [4]. The DE technique uses a pair of consecutive pixels and their corresponding difference is expanded to embed the data, which means a pixel pair is treated as a single embedding unit. On the contrary, PEE treats individual pixel as an embedding unit, hence providing scope of increased embedding capacity (EC). Moreover, a high number of small prediction errors are produced by PEE, that construct a sharp prediction error histogram, ultimately enhancing embedding performance. To further stimulate the capacity and quality of the traditional PEEbased RDH, Sachnev et al. [7] introduced a novel PEE scheme by incorporating the sorting of pixels according to their local complexities. They also proposed a new predictor, i.e. 'rhombus predictor' to predict the value of a pixel from its four-pixel neighbourhood that led to significantly increase the embeddable prediction errors. Ou et al. [8] introduced pairwise PEE in which a pair of prediction errors is modified simultaneously using 2D prediction error histogram modification strategy. The pairwise PEE exploits the inherent correlation between the pair of prediction errors for a pixel to improve the performance. In pairwise PEE, the expansion of prediction error pair (0,0) is done, such that it becomes (0,0), (0,1) and (1,0) to accommodate log 2 3 data bits into a single pair. Moreover, pairwise PEE expands the error pair (1,1) to (2,2) and itself for additional one bit embedding, whereas this error pair is simply shifted to traditional PEE. Therefore, an increase in EC without disturbing the quality of image is achieved. To further improve the PEE schemes, various improvements have been proposed in [9,12].
Li et al. [13] proposed pixel value ordering (PVO), one of the recent advancements of PEE, has gained much popularity and all credit goes to its impressive performance at low and moderate payload capacities. PVO computes the prediction errors using second-minimum and second-maximum pixels in a sorted block and embeds the data into the minimum-valued pixel if the minimum PE is '-1′, and maximum-valued pixel if the maximum PE is '1′ in a block-wise manner. All other PEs are shifted to guarantee reversibility at the receiver end. Moreover, PVO changes the pixel values only by one at the most, therefore it is able to generate high quality images even in worst case modifications. Peng et al. [14] proposed an extended version of PVO [13] called Improved PVO (I-PVO) and advocated the benefit of considering relative locations of pixels in the original block during error calculation. I-PVO utilises the prediction errors '0′ and '1′ instead of '-1′ or '1′as used in [13]. It resulted in increasing the number of embeddable prediction errors, ultimately leading to enhanced performance. Extending the work of [13,14], a variety of other similar PVO-based methods [15][16][17][18][19][20][21][22][23][24] have come into the picture. The fact of capacity-dependence on the block size is recognised and it is observed that decreasing the block size would increase the capacity. As the PVO-based methods follow a block-wise data hiding approach, a block selection strategy is required to achieve better capacity-distortion ratio. In PVO embedding, the selection of a block is restricted by its complexity value (a measure of roughness/smoothness), where the complexity value is calculated as the difference of middle pixels. As the middle pixels remain unmodified, the receiver also calculates the same complexity during data retrieval. The comparison of complexity value is done with a user-defined threshold to categorise the blocks as embeddable or non-embeddable. Generally, the block is embeddable if its complexity is below a certain value of threshold. Otherwise, the block is named as non-embeddable and skipped. The categorisation of blocks in terms of their complexity is important because non-embeddable blocks could lead to more shifting, hence deteriorating image quality. Thus, block categorisation helps in preventing unnecessary shifting of pixels. However, these methods are more suitable for low to moderate EC as opposed to high capacity.
Recently, Kumar et al. [25] proposed an enhanced pairwise IPVO scheme for attaining high capacity while maintaining a high quality of stego-images. They exploited every pixel of the cover image in a two-phase embedding using rhombus context and pairwise IPVO. They also used a block selection approach based on the rhombus context for three-pixel blocks. In the first pass, the pairwise IPVO for data embedding is used while in the second pass, a recovery-based pairwise embedding is implemented. Although the method achieved almost double the EC than the other PVO based methods, it posed low-quality concerns at smaller payloads. To address the concerns related to increasing the embedding while simultaneously maintaining the image quality, an RDH technique is proposed using the sorting of pixels based on their rhombus context. The proposed scheme utilises a local variance measure to construct blocks of size 1 × 3. Also, a novel local complexity measure is used for block selection to prevent unnecessary distortion. The proposed scheme uses the pairwise embedding introduced by Kumar et al. [25] for first-pass embedding, followed by a PEE based embedding in the second pass. The following points highlight the major contributions of the proposed work: • The proposed scheme uses a zig-zag order traversal of the cover image to construct two independent pixel sets -the plus set and the dot set. Afterwards, a two-pass data embedding is implemented for each of the sets, such that the plus set pixels act as rhombus context for the dot set pixels and vice versa. • The sorting of pixels is performed in an increasing order of their rhombus means and then 1 × 3 size blocks are formed. Reordering of pixels by sorting plays a key role in increasing the EC and minimizing visual degradation as it helps in generating smaller prediction errors. The proposed method is proven to be an effective method for improving the embedding performance as compared to previous methods that do not incorporate sorting. Since the rhombus mean values of the pixels remain unchanged for each set, the same sorting order is generated at the receiver's side.
• The proposed scheme exploits the local complexity of individual pixels to determine their inclusion into the embedding block. This step ensures that the pixels belonging to a single block come from a common local complexity range that aids in preventing unwanted shifting. • A two-pass embedding strategy is performed on three-pixel blocks. In pass 1, two prediction errors for the first pixel and the last pixel are computed using their rhombus means.
Here, a pairwise embedding is used in which the first pixel is unmodified/increased by 1, and the last pixel is unmodified/decreased by 1. In pass 2, two prediction errors are computed for the first pixel and the last pixel using the middle pixel and PEH is modified for data embedding. Thus, the proposed method successfully overcomes the drawback of recovery-based method of Kumar et al. [25] and other PVO-based methods. In their work, pass-2 does not guarantee recovery of the pixel values modified during pass-1 as in the worst case, a pixel can be modified by ±2. So, the pass-2 in the proposed work is designed specifically to reverse the modifications done in pass-1, with worst case modification of just ±1, hence boosting image quality. • The middle pixel is also predicted using its rhombus mean and is used for carrying data. Hence, our technique can embed high payloads while simultaneously retaining the image quality.
The remaining paper is structured as follows. In Section 2, related works are discussed. The proposed scheme is explained in Section 3. For performance evaluation and analysis, results are discussed in Section 4. Finally, the concluding remarks are given in Section 5.

RELATED WORKS
In this section, a comprehensive review of the existing RDHbased schemes are discussed. Sachnev et al. [7] proposed an RDH scheme in which the data embedding is performed in a pixel-by-pixel manner using prediction and sorting. They also introduced a 'rhombus predictor' such that a pixel is predicted using its rhombus context i.e. four neighbouring pixels. The pixels are divided into two independent sets such that one set is used for embedding while the other is used to calculate predictions. They noticed the performance improvement gain by sorting in Kamstra and Heijmans' [26] method. Taking inspiration from [26], Sachnev et al. realised that the ordering of pixels needs to be changed to hide more data with less distortion. So, they decided to re-arrange the pixels according to their correlation. Further, they utilised PEE in a pixel-wise manner and experienced much better capacity versus distortion tradeoff than another sorting [26] and PEE [6] based techniques of that time. However, the visual quality offered by Sachnev et al.
is not at par with today's well known high-fidelity methods. To overcome the quality-related issues as well as taking advantage of sorting and rhombus context, the proposed method sorts the pixels based on their rhombus means. Furthermore, rhombus prediction is utilised in pass-1 embedding, however, instead of conventional PEE, pairwise PEE has been used in the proposed method to enhance the image quality. The inspiration behind pairwise embedding is taken from the work of Ou et al. [8] in which PEE exploits the inherent correlation between the pair of prediction errors. The pairwise embedding exploits the correlation between the two prediction errors corresponding to maximum and minimum sides. According to a 2D histogram modification scheme used in this method, the error pair (0,0) can embed log 2 3 data bits by expanding itself to (0,0), (0,1) and (1,0). However, the PE-pair (1,1) is exploited separately to accommodate 1-bit secret data by expanding itself and (2,2). The distortion level is brought down significantly, hence providing a high-quality way of data hiding. Xiao et al. [27] and He et al. [28] proposed content-dependent pairwise mappings to further stimulate the performance of pairwise PEE. They challenged the fixed 2D-PEH modification and presented the advantages of flexible histogram modifications. Ou et al. [29] proposed another 2D histogram generation method using geodesic path. In this method, the pixels are adaptively paired according to their local similarity in terms of intensity and spatial distance. It helps in generating prediction error pairs that are more correlated to each other, as opposed to fixed pairing mechanism. A further study of the idea of adaptive prediction error pairing has been conducted by Ou et al. [30] in which they proposed adaptive pixel pairing (APP) and adaptive mapping selection. Its objective is to include only smooth pixels in pairing, while the rough ones are ignored. This decision of adaptively selecting pixel pairs based on their local complexity creates sharper 2D prediction error histogram, hence leading to some performance gains over other pairwise embedding methods. Pairwise embedding has been further incorporated with PVO [13], that is itself a high-fidelity mechanism for data hiding. PVO-based methods are block-based RDH methods that modify the pixels by ±1 hence resulting in superior visual quality. The pixels in a block are sorted in increasing order of their intensity values. Then two prediction errors are obtained as the differences between smallest and second-smallest pixels, and the differences between the largest and second-largest pixels. Thus, the PEs in the range of 0 to 255 (for maximum valued pixel) and -255 to 0 (for minimum valued pixel) are obtained. In case of maximum prediction error, the peak bin '1′ is expanded for embedding and other bins > 1 are shifted to ensure reversibility. Similarly, for the smallest prediction error, the peak bin '-1′ is expanded to carry data and other bins < -1 are shifted. Peng et al. [14] proposed an I-PVO-based RDH scheme to consider the relative location of pixels in a block during the prediction error calculation. Li et al.'s PVO always generates non-negative differences for the largest pixel and non-positive differences for the smallest pixel. This is overcome by Peng et al. [14] by producing prediction errors in range of -255 to 255. This range enables the encoder to use both '0′ and '1′ for expansion both for minimum and maximum side predictions. Wang et al. [18] further extended the PVO scheme by experimenting with variable sized blocks. Instead of keeping the block size fixed, they exploited two block sizes i.e. 2 × 2 and 4 × 4 such that smaller blocks are created in smooth regions, and larger size blocks are created in rough regions. This allows an increase in embedding in highly correlated regions and prevents unnecessary shifting operations in textured areas. The idea of dynamic block partitioning has been studied and further extended in [20,31,32] to show improvement. Some of the PVO-based methods such as [33][34][35] performed partitioning into 1 × 3 blocks for capacity improvement. It is observed that small block size leads to improved EC but the quality of the stego image is compromised to some extent. Therefore, an efficient block partitioning is needed for an acceptable trade-off between capacity and distortion. Apart from PVO, Dragoi and Coltuc [36] further suggested prediction-error ordering-based RDH method for highfidelity data embedding. They investigated the significance of prediction error ordering, replacing the conventional PVO by traversing the image into a chessboard pattern. The inclusion of pairwise embedding in PVO schemes is introduced in [12,22,37,38] to improve performance. Dragoi et al. [39] also proposed an improved pairwise PVO-based method in which the blocks are classified on the basis of a local complexity measure, smooth blocks are processed using pairwise PVO, slightly noisy blocks using standard PVO while complex blocks are kept unchanged. Most of the above mentioned PVO methods have been surveyed in [40]. To increase the EC, Kumar et al. proposed two new reversible data hiding schemes using PVO based methods [41,42]. In [41], Kumar et al. simply reserves a bin of prediction error histogram by initially shifting the pixels so that expansion and contraction can be done to embed additional amount of secret data. Thus, this scheme increases the EC but at the cost of stego-image quality. In [42], Kumar et al. generalised the work of Peng et al. [14] by extending the block size in case of extremely smooth blocks, so that unused pixels such as the middle pixels in [14] are reduced, which in turn increases the EC without much deterioration of the image quality. However, the scope to improve the EC is still there by adopting more efficient block categorization. Also, the regular raster-scan partitioning of the cover image does not promote any improvement. So, the proposed method uses a modified image traversal approach that would calculate the complexity of each pixel based on its neighbouring pixels. The proposed partitioning strategy allows a two-layer embedding in the cover image, ultimately producing improved results.
Kumar et al. [25] recently proposed a high-capacity RDHbased method on enhanced pairwise IPVO using rhombus context. In this method, the cover image is divided into 1 × 3 blocks by traversing in a zig-zag order. In pass-1, IPVO is utilised for prediction and the PE pairs are modified using 2D-PEH shifting, such that the smallest pixel is decreased/unchanged and the largest pixel is increased/unchanged. In pass-2, the pixels in a block are sorted according to an increasing sequence of their rhombus means and the first and last pixel is used for data embedding using recovery based pairwise PEE. In pass-2, the first pixel is increased/unchanged and the last pixel is decreased/unchanged. Moreover, they also introduce an efficient block categorisation strategy based on the rhombus context and consider pixel-wise complexity in addition to blocklevel complexity. Although the payload capacity is significantly increased in comparison to existing PVO-based methods, the image quality is inferior at low ECs. The major drawback of Kumar et al.'s method is that they assume that pass-2 embedding would restore the modified pixel values during pass-1 as they assume that pixel with least/highest rhombus mean is most probably the minimum/maximum valued pixel in the block. However, this assumption that would force the worst-case pixel modification to be ±2 might not hold all the time. To overcome the issues pertaining to image quality in Kumar et al.'s method, it is to be ensured that the pass-2 embedding restores the modified pixels during pass-1, hence promoting better performance. Therefore, the two passes have been modified in the proposed method to achieve this objective. In pass-1 of the proposed method, the first pixel is increased/unchanged and the last pixel is decreased/unchanged, while in pass-2, the first pixel is decreased/unchanged and the last pixel is increased/unchanged. Hence, pass-2 is the complement of pass-1 with worst-case modification to be just ±1 thus mimicking the high-fidelity behaviour offered by PVO.

PROPOSED METHOD
In this section, the working of the proposed method is explained. An abstract step-by-step demonstration of the proposed method is shown in Figure 1 in which the steps in shaded blocks correspond to the pre-processing stage, that are common for both data embedding and data extraction procedures. These pre-processing steps are required to prepare the image for data embedding/extraction. These steps, namely, image partitioning, zig-zag traversal of pixels, rhombus mean calculation, sorting of pixels, block partitioning and block selection are discussed in Section 3.1. The data embedding and data extraction processes are then explained in Sections 3.2 and 3.3, respectively.

Image partitioning
The cover/stego image is partitioned to form a chessboard pattern to obtain two independent pixel sets namely, dot set and plus set, as shown in Figure 2. This alternate-pixel traversal scheme ensures that the changes made to one pixel-set do not affect the other pixel-set during embedding. The data embedding is independently performed in the dot-set pixels, followed by the plus-set pixels. The following procedure applies to dot set pixels and a similar set of steps is repeated for plus set pixels afterwards.

3.1.2
Zig-zag traversal of pixels and rhombus mean calculation The dot set pixels are collected in a sequence according to a zig-zag fashion as depicted by the arrows in Figure 2. For each pixel p i, j in the dot sequence, its rhombus context as shown in Figure 3, is used to calculate its rhombus mean i, j as in Here i, j is the rhombus mean of the pixel p i, j and p i, j −1 , p i−1, j , p i, j +1 , p i+1, j are its neighbours that belong to the plus set (while processing the plus set pixels, the dot pixels will act as their rhombus context). The value of rhombus mean is used for local complexity measurement of the pixels, as well as to rearrange the position of pixels using sorting, discussed in the next subsection.

3.1.3
Sorting of pixels according to rhombus mean The pixels are sorted in increasing sequence of their rhombus mean so that pixels in a single block are correlated and do not diverge as much to create non-embeddable prediction error scenarios. The rhombus means, i, j calculated using Equation (1) is supposed to achieve an appropriate sorting as the value of i, j remains unchanged after data hiding, that would not pose any difficulty at the decoder side.

Block partitioning scheme
The sorted pixel sequence (according to rhombus mean) is segregated into blocks of size 1 × 3. However, the decision to include a pixel into a 1 × 3 block is determined by its noise level. The pixels with smooth neighbourhood are basically chosen for block construction. A local variance measure employed in the Sachnev et al. [7] is used to quantify the noise level in the pixel neighbourhood of the proposed scheme to determine the inclusion of the pixel into an embedding block. According to this method, the noise level NL for pixel p i, j is computed as follows: The pixels with NL less than a threshold value are chosen to be members of blocks, and others are skipped. If t 1 is a user-defined threshold, then a 1 × 3 block is formed as follows: The value of t 1 is initially chosen as a small random number. Small values of threshold means that smoothly textured blocks are created, and the ones with rough texture are not considered initially. However, if the requested EC is not achieved, the value of t 1 is incremented iteratively to increase the number of candidate blocks until the capacity is satisfied. The relationship between the values of the threshold and embedding performance is straightforward. Smaller values of threshold correspond to higher quality but may not be able to embed the required quantity of secret data. On the other side, larger values of threshold can embed relatively large quantity of data but often compromise the image quality. Hence, the smallest possible value of threshold that is able to hide the required payload is considered as the best option.

Block selection scheme
As the proposed scheme uses the rhombus predictor for data embedding, a suitable block-selection strategy is required to generate smaller prediction errors and prevent unnecessary distortion caused by large prediction errors. To accomplish this, another pixel-complexity measure is calculated as shown in Equation (3): Here i, j is the rhombus mean of the pixel p i, j and p i, j −1 , p i−1, j , p i, j +1 , p i+1, j are the rhombus neighbours of the pixel p i, j as shown in Figure 2. The measure l (p i, j ) denotes the average of the sum of absolute differences between the rhombus neighbours and rhombus mean of the pixel p i, j . In other words, l (p i, j ) is the measure of 'average difference' between the current pixel and its rhombus context. Small values of l (p i, j ) would correspond to high correlation (smooth texture) and large values of l (p i, j ) would correspond to low correlation (rough texture).
Thus, the block B = {p 1 , p 2 , p 3 } is either categorised as a smooth block or probably complex block according to the pixelcomplexity measure defined above. The block categorisation is done as follows: Here, S represents a smooth block, C represents a probably complex block, and t 2 is a user-defined threshold. In other words, a smooth block is encountered if the pixel-complexity of the first pixel as well as the last pixel are less than a predefined threshold. A random value is chosen for t 2 in the beginning, and incremented iteratively if the required EC is not achieved. Smooth blocks are only included in data embedding whereas rough ones are skipped. The use of rhombus-context and local variance in the block partitioning and categorisation plays a significant role in improving the capacity-distortion trade-off.

Data embedding
The data is embedded into 1 × 3 size smoothly categorised blocks, according to the above-mentioned block selection criteria. As the pixels in a block are already sorted according to their rhombus mean, the proposed embedding scheme exploits this rearrangement of pixels to efficiently hide the secret data. A two-pass data embedding is employed by the proposed method.
In pass-1, the first pixel and last pixel are predicted using their respective rhombus mean values. A pairwise PEE is put to use in such a way that the first pixel is increased/unchanged and the last pixel is decreased/unchanged. To embed the data, a 2D-PEH mapping shown in Figure 4 is utilised. In pass-2, the first pixel and the last pixel are predicted using the middle pixel, followed by PEE to embed the data. As a result, the first pixel is decreased/unchanged and the last pixel is increased/unchanged. Thus, the pass-2 embedding is intentionally designed to possibly reverse the modifications done in the pass-1, so that the original pixel values are recovered along with providing additional capacity. Moreover, the middle pixel is also predicted using its rhombus mean to further stimulate the EC. This leads to modifying the pixels just by ±1, hence ensuring high image quality. The pass-1 and pass-2 embedding procedures are explained in detail in the subsequent sections.

Pass-1 data embedding using rhombus predictor
In pass-1 embedding, PEE expansion is utilised for data hiding. Consider a block B = {p 1 , p 2 , p 3 } where 1 , 2 , 3 are the rhombus means of the pixels p 1 , p 2 , p 3 respectively, such that 1 ≤ 2 ≤ 3 . Then the first pixel p 1 and the last pixel p 3 are predicted using their rhombus mean 1 and 3 respectively. The prediction errors are calculated as follows: Here, in the prediction error notation E pq , p ∈ {1, 2} represents the embedding pass-number and q ∈ {1, 2, 3} represents the pixel that is being predicted. The prediction errors are treated as a pair (E 11 , E 13 ) and the secret data is embedded according to the pairwise mapping inspired from the work of Kumar et al. [25] as shown in Figure 4.
According to this mapping scheme, one block can accommodate log 2 3 bits if (E 11 , E 13 ) = (0, 0), and 1 bit can be embedded if either E 11 = 0 or E 13 = 0. In this pass, the first pixel p 1 is either increased by 1 or unmodified and the last pixel p 3 is either decreased by 1 or unmodified. The marked block B ′ = {p ′ 1 , p 2 , p ′ 3 } is fed as input to the pass-2 data embedding.

3.2.2
Pass-2 data embedding using middle pixel The marked block obtained from pass-1 is used in an additional layer of embedding in pass-2. In pass-2, the middle pixel p 2 that was left unused earlier is used for predicting the values of the first and the last pixels. The two prediction errors for p ′ 1 and p ′ 3 using p 2 are as follows: Then the secret data is embedded using PEE into the first pixel as well as the last pixel. The goal is to reverse the modifications done in pass-1 so that the original pixel values are recovered, eventually enhancing the stego-image quality. To accomplish this, pass-2 embedding is developed such that the first pixel is either decreased by 1 or unmodified, while the last pixel is either increased or unmodified. In the PEH of E 21 , the peak bin 0 is expanded to hide data, while the prediction errors < 0 are shifted to the left side. This is illustrated in Figure 5(a). If b 1 ∈ {0, 1} is the secret data bit to embed, the first pixel is modified as follows: Thus, the value of the first pixel is either decreased by b 1 /1 or unchanged. In the PEH of E 23 , peak bin of 0 is expanded while the prediction errors > 0 are shifted to the right side. This  Figure 5 is the secret data bit, the last pixel is modified as follows: Thus, the value of the last pixel is either expanded/shifted by b 2 ∕1 or remains unchanged. In addition to the first and third pixels, the second pixel is also utilised for data embedding. The value of p 2 is predicted using its rhombus mean, and the prediction error is calculated as follows: Here, 2 is the rhombus mean of the second pixel p 2 in the block. If b 3 ∈ {0, 1} is the secret data bit, then the second pixel is modified as follows: It means that the value of p 2 would only be updated by ±1. The final marked block obtained after the two-pass embedding would be B ′′ = {p ′′ 1 , p ′ 2 , p ′′ 3 } i.e. the first and third pixels are updated twice, while the second pixel is updated once during the entire embedding procedure. However, the second-update of first and last pixels probably reverses the modifications performed on them, pretty much ensuring that p ′′ 1 = p 1 and p ′′ 3 = p 3 .
The above-mentioned data embedding procedure is also repeated for the plus set pixels while using the marked dot set as the rhombus context.

Auxiliary information and location map embedding
To support image recovery and blind data extraction at the receiver end, some additional information is also embedded into the cover image along with the secret payload. This auxiliary information is embedded in the first (16 + log 2 (L (CLM) ) + (L (CLM) ) + log 2 (L S )) LSBs of the border pixels, which are not incorporated in the actual data embedding process. The original LSBs are recorded in a binary sequence S (LSB) . The details regarding this additional information are given below: • Thresholds: The user-defined thresholds t 1 and t 2 are required for block formation and block selection at the receiver end. So, these values are embedded as auxiliary information. Therefore, a total of 16 bits are required for two threshold values.
Then the compression of LM is done using arithmetic encoding so that the compressed location map (CLM) can be embedded without affecting the true EC. If L (CLM) represents the length of the CLM, then its upper limit for a P × Q size image is calculated as L (CLM) = (P−1) × (Q−1) 3 . Then (log 2 (L (CLM) ) + (L (CLM) )) bits are required to store the length of the CLM as well as the CLM itself. The pseudo-code of the data embedding is given below.

//Block Categorisation and LM construction
Determine the type of block B k using Equation (4) and set the corresponding entry in the LM using Equation (13).
//Data embedding if B k is a smooth block: Step 1: Calculate prediction errors for p 1 and p 3 using Equations (5) and (6).
Step 2: Perform data embedding according to pairwise mappings shown in Figure 4 and obtain the block Step 3: Calculate prediction errors for p ′ 1 and p ′ 3 using Equations (7) and (8) and embed the secret data using Equations (9) and (10)  Step 4: Calculate prediction error for the middle pixel p 2 using Equation (11) and perform secret data embedding according to Equation (12) to obtain the marked value p ′ 2 .
Step 5: Output the stego block B Step 6: Skip the block B k . end

Data extraction
For data extraction and image recovery at the receiver side, first (16 + log 2 (L (CLM) ) + (L (CLM) ) + log 2 L S ) LSBs of border pixels are read and then replaced by the S LSB sequence. The original LM is obtained by decompressing the CLM, using arithmetic decoding. The data extraction is followed in a reverse fashion, i.e., data is first extracted from the plus set pixels, followed by an additional extraction layer from the dot set pixels. It means that pixels in the plus set are sorted according to their rhombus mean and blocks are partitioned as mentioned in the data embedding procedure. Also, the two-passes are followed in a reverse sequence. In pass-1, data is extracted from the middle pixels. Then the restored middle pixels are used to predict first and last pixels. In pass-2, the rhombus predictor is employed for data extraction from first and last pixels using pairwise PEE. For } the data extraction procedure is explained as follows.

3.3.1
Pass-1 data extraction using middle pixel To predict the values of the first and the last pixel, the original value of the middle pixel needs to be restored. To do this, the prediction error for middle pixel p ′ 2 is calculated as follows: Then the data extraction and pixel recovery are done using rules given in Table 1.
The first and the last pixels are now predicted using the restored value of the original middle pixel p 2 as shown in   (15) and (16). The data extraction rules are illustrated in Tables 2 and 3.
The resultant block B ′ = {p ′ 1 , p 2 , p ′ 3 } is passed to the pass-2 extraction for further processing.

3.3.2
Pass-2 data extraction using rhombus predictor In pass-2 data extraction, the first and the last pixels of the block is predicted using their corresponding rhombus mean. Two prediction errors are calculated as follows: Then the pairwise mapping shown in Figure 6 is used to extract secret data from the prediction error-pair (E ′ 11 , E ′ 13 ). The above extraction procedure is then applied to dot set pixels. The data extraction pseudo-code is given as follows:

EXPERIMENTAL RESULTS AND DISCUSSIONS
To evaluate the performance of the proposed method and carry out a comparative analysis, the experimental results are demonstrated in this section. The performance is assessed according to two parameters namely, EC and peak-signal-to-noise ratio (PSNR). The EC is defined as the number of bits that the   (4). if B k is a smooth block: Step 1: Calculate prediction error for the middle pixel p ′ 2 using Equation (14), and perform recovery and data extraction according to Table 1 to obtain its original value p 2 .
Step 2: Calculate prediction errors for p ′′ 1 and p ′′ 3 using Equations (15) and (16), and perform recovery and data extraction as per Tables 2 and 3 Step 3: Calculate prediction errors for p ′ 1 and p ′ 3 using Equations (17) and (18), and extract data according to pairwise mapping shown in Figure 6. Recover the pixel values p 1 and p 3 .

else
Step 5: Skip the block B ′′ k . end end method can hide. On the other side, PSNR is a quality assessment metric measured in decibels (dB). The value of PSNR for a grayscale image is calculated as follows: Here, MSE is the 'Mean Squared Error', i.e., the mean of the sum of squared differences between the original cover image and the marked image. The experiments are performed on six  Figure 7. The experiments are implemented in MATLAB and the secret data is generated using pseudo-random number generators. The results of the proposed method are analysed and compared with some existing state-of-the-art methods including [7,8,14,22,25,27,37,41,42].
The proposed method is inclined towards achieving high ECs but not giving up on image quality. So, for performance validation on both aspects, i.e., EC and visual quality, the results are compared with the existing well-known methods [7,8,14,22,25,27,37,41,42], each of them directed to achieve either higher EC or higher image quality. Pairwise PEE [8], Sachnev et al. [7], Pairwise PEE with optimal expansion path [27], RDHbin reservation [41] and enhanced pairwise IPVO [25] provide high ECs, however [7,8,25] are vulnerable to lower image quality. On the other hand, methods such as [14,22,37,42] using purely PVO predictors are more likely to stand out in terms of image quality, but they struggle to attain higher ECs. Hence, the choice of these methods is practically reasonable to corroborate the performance of the proposed method.
The experimental results for the EC versus image-fidelity trade-off in a graphical representation are shown in Figure 8. These results have been taken by adjusting the pre-defined thresholds i.e. t 1 and t 2 to suitable values. Initially, the value of the threshold is set to 0 and then incremented according to the capacity requirements. This iterative approach of identifying a suitable value of threshold plays a prominent role in maintaining the high quality of stego images. The superior performance of the proposed scheme is evident from the results. It is observed that the proposed method offers the highest image quality, irrespective of the EC . The gain in EC is quite significant when compared to PVO methods such as Improved PVO [14], pairwise PEE based on adaptive embedding [22], RDHblock extension [42] and multi-pass PVO based pairwise PEE [37].
Improved PVO [14] is a direct extension of Li et al.'s PVO that considers relative pixel location during prediction to stimulate the generation of embeddable prediction errors. Both [22] and [37] utilise pairwise embedding style to enhance the performance using PVO prediction. These are block-based schemes consider using 2 × 2 as the minimal block size and use the difference of middle pixels for block selection. This might not be an efficient block-categorisation approach as it ignores the pixel/block neighbourhood. Also, PVO-based methods are only suitable for low to moderate ECs and suffer from visual degradation at higher ECs. So, the proposed scheme partitions the cover image into smaller 1 × 3 blocks and uses rhombus context for block categorisation that acts as a stimulus for improving embedding efficiency.
On another note, although high EC is offered by Enhanced pairwise IPVO using rhombus context [25], it suffers from quality problems at low ECs. This method claims to recover the pixel values during pass-2 embedding, which may not always be the case, hence lead to higher distortion. However, the pass-2 in the proposed method is guaranteed to perform pixel-recovery, owing to better image quality. Pairwise PEE [12] and Sachnev et al. [7], viewed as standard methods, also achieve high ECs but they show low PSNR values. Pairwise PEE and optimal expansion path [27] shows an impressive performance among all other existing methods concerned. In this method, the optimal selection of the expansion bins is responsible for enhanced performance. However, the proposed method also shows an efficient capacity-distortion trade off compared to [27]. The proposed method takes inspiration from sorting and prediction in Sachnev et al. [7] method to sort the pixels based on their rhombus mean values such that highly correlated pixels are brought together. Moreover, the proposed method further takes advantage of pairwise PEE incorporated in the pass-1 embedding, where prediction is done using the rhombus context. The pass-2 embedding is intentionally designed to recover the pixel values modified during pass-1 hence restoring image quality. Additional embedding into the middle pixel also boosts the EC in the proposed method.
Referring to the PSNR values for an EC of 10,000 bits and 20,000 bits as shown in Tables 4 and 5 respectively, it is obvious that the proposed method outperforms the existing methods in terms of visual quality for all test images. Among all test images, the highest PSNR obtained by the proposed method is for F16 which possesses a smooth texture. The proposed scheme also does quite well for a rough image like Baboon with PSNR of 57 dB at EC of 10,000 bits, which is better than existing methods. Pairwise embedding with optimal expansion path [27] is reported to have the best average PSNR among other existing schemes considered for comparison. The proposed method gets an increment by an average of 0.46 dB and 1.01 dB for embedding over 10,000 bits and 20,000 bits respectively [27].
To corroborate the visual quality offered by the proposed method, the stego-images, as well as the image intensity histograms (before and after embedding 15,000 bits) are shown in Figures 9-15, respectively. It is clear from Figure 9 that there is no visible mark of the presence of data in the stegoimages. Embedding capacity (bits)

Elaine
Proposed Method Enhanced Pairwise IPVO using rhombus context [25] RDH-Bin Reservation [41] RDH-Block Extension [42] Multi-pass PVO based pairwise PEE [37] PVO-based Adaptive pairwise embedding [22] Pairwise PEE and optimal expansion path [27] Improved PVO [14] FIGURE 8 Embedding capacity (EC) versus peak-signal-to-noise ratio (PSNR) of proposed method and existing methods [7,8,14,22,25,27,37,41,42] [7,8,14,22,25,27,37] at an EC of 10,000 bits The intensity histogram of an image represents the distribution of discrete pixel intensity levels from 0 to 255. Thus, the histogram of the stego image should be almost identical to that of the original cover image so that the presence of secret data is Boat and (f) Elaine not detected easily. It is quite evident from the comparison of image histograms before and after data embedding, that there are no visible changes to the image. These observations are sufficient to support the fact that the proposed scheme offers a high-quality embedding.

CONCLUSION
In this paper, a high quality RDH method based on sorting and enhanced pairwise PEE is presented. The proposed scheme performs sorting of the pixels according to their rhombus mean for efficient block construction, eventually aiming to generate smaller prediction errors so that the sharpness of PEH is increased. Then, the data embedding is done in two passes on 1 × 3 blocks where each pass exploits a unique predictor. In the first pass, the rhombus predictor is used for a pairwise embedding such that the first/last pixels are increased/decreased. In the second pass, prediction errors are computed using the middle pixel such that the first/last pixels are decreased/increased. Also, the middle pixel is used for data embedding using PEE. The proposed method overcomes the drawbacks of Kumar et al.'s [25] method by designing a recovery-based pass-2. It means that the pass-2 provides guarantee of no further modification to the pixels that are modified in pass-1 instead some of the pixels are recovered and additional data is embedded which in turn guarantees to improve the image quality. Moreover, the proposed block selection strategy efficiently categorises the blocks based on their neighbourhood correlation which further enhances the embedding performance. From the experimental results, it is evident that the proposed scheme has outperformed several well-known RDH methods in terms of capacity-distortion trade-off.