## 3 The Proposed Local-Moment-Driven Robust Reversible Data-Hiding Scheme
### Embedding Method
#### 3.1.4 Embedding Algorithm  
The embedding algorithm of the proposed LM-RRDH scheme for concealing the secret data \((S)\) into a cover image \((I)\) of size \(h\times w\) pixels is outlined below in a step-wise manner: Step 1: Decompose \(I\) into \(I^{LSB}\) and \(I^{MSB}\) using Equations (2) and (3), respectively. The decomposition is performed by segregating \(n\) number of LSBs from each pixel of \(I\) in a pixel-wise manner. Step 2: Scan \(I^{MSB}\) starting from pixel position \((2,\ 2)\) to \((h-1,w-1)\) in a raster scan manner and construct \(LM\) using Equation (14) in which all the pixels are marked. Next, compress the \(LM\) using JBEG/arithmetic encoding to obtain a compressed location map \((CLM)\). The length of the \(CLM\) is denoted by \(LCLM\). Step 3: Divide \(I^{MSB}\) into blocks of \(3\times 3\) pixels, each starting from pixel position \((2,\ 2)\) to \((h-1,w-1)\). Next, group all the \(x-set\) pixels into two groups \((F_{G},\ S_{G})\) using Equation (10). Step 4: Extract least significant bits (LSBs) of pre-defined border pixels of \(I\). Append the extracted bits along with CLM at the end of the secret information. Step 5: Embed the secret information in a pixel group as follows:  
1. If cardinality of \(F_{G}>2\), then calculate prediction errors \(e_{1}^{PVO}\) and \(e_{2}^{IPVO}\) using Equations (12) and (13), respectively, and expand the prediction errors as per the secret data bits as per Figure 2a. Next, modify the minimum and maximum valued pixels using Equations (14) and (15), respectively, to embed the secret data. 2. Otherwise, if cardinality of \(F_{G}\) is equal to 2 then calculate prediction errors \(e_{1}^{PEE}\) and \(e_{2}^{PEE}\) using Equations (16) and (17), respectively, and expand the prediction errors as per the secret data bits as in Figure 2b. Next, modify the first and the second pixels of the group using Equations (18) and (19), respectively, to embed the secret data. 3. Otherwise, calculate prediction error \(E^{PEE}\) and embed the secret data in the pixel using Equation (20). Step 6: Repeat Step 5 for group \(S_{G}\). Step 7: Repeat Steps 5-6 for \(y-set\) pixels. Note the position of last block (\(B_{end}\)) in which embedding is carried out. Step 8: Compose the \(I^{LSB}\) and \(I^{MSB}\) to obtain stego image (\(I^{\prime}\)) and replace the LSBs of pre-defined border pixels of \(I^{\prime}\) from the value of \(n\) and position of last block (\(B_{end}\)) using the LSB substitution method. Therefore, the stego-image (\(I^{\prime}\)) is obtained, which can be shared with the receiver using any open communication channel without worrying about the security of hidden data. _Embedding example_: The proposed embedding process is illustrated using an example in Figure 3. The example considers a cover image (\(I\)) of \(6\times 5\) pixels, which is decomposed into two images (\(I^{MSB}\) and \(I^{LSB}\)) by considering \(n=3\). Then, the \(I^{MSB}\) image is represented in a checkboard pattern and divided into blocks of size \(3\times 3\) pixels, excluding border pixels (shown in blue). Next, embedding is carried out in the pixels of the blocks using adaptive embedding strategy in a phase-wise manner. In the first phase, the pixels shown in orange are used for embedding, followed by white ones in the second phase. Before each phase embedding, the pixels are segregated into two groups (\(F_{G},\ S_{G}\)) using Equation (10). Here, the pixels grouped in the first group (\(F_{G}\)) are tagged and background-colored green (for easy identification to readers), whereas the other pixels are tagged as \(S_{G}\) and background-colored red. Then, the embedding is carried out on the pixels of both the groups using the adaptive embedding strategy. Since the first group (\(F_{G}\)) has only two pixels (e.g., \(x_{1}\) and \(x_{2}\)) of values 18 and 19, respectively, the embedding is done by using EP-PEE scheme.