## 3 Proposed Method
### Data Embedding Procedure  
The process involves two cover images, \(I_{1}\) and \(I_{2}\), in Figure 3 as duplicates of the original image \(I\). Applying the modified EMD method to pixels \(x_{i}^{1}\in I_{1}\) and \(x_{i}^{2}\in I_{2}\), the 5-ary stream data are concealed. This process is presented in detail in the following steps:  
**Input**: Two cover images \(I_{1}\) and \(I_{2}\); 5-ary secret data \(m=(m_{1},m_{2},\dots,m_{n})\). **Output**: Two stego images, \(\Delta I_{1}\) and \(\Delta I_{2}\). **Step 1:**: For cover images \(I_{1}\) and \(I_{2}\) of size \(N\times N\), comprising pixels \(x_{i}^{1}\in I_{1}\) and \(x_{i}^{2}\in I_{2}\), respectively. The index \(i\) indicates the sequence of each pixel;
**Step 2:**: Select a pixel \(x_{i}^{1}\) from the first cover image \(I_{1}\), and its counterpart \(x_{i}^{2}\) from the second cover image \(I_{2}\). Furthermore, determine the crucial data represented by \(m_{i}\);
**Step 3:**: Compute the extraction function \(f\) (using Equation (5)) with the pixel pairs \(x_{i}^{1}\) and \(x_{i}^{2}\). If the 5-ary number \(m_{i}\) aligns with the function's outcome, no modification is needed. Otherwise, adjust the pixel values of the two pixels to embed the 5-ary number;  
\[f(x_{1},x_{2})=\sum_{i=1}^{N\times N}([x_{i}^{1}\cdot 1+x_{i}^{2}\cdot 2])\ mod\ 5 \tag{5}\]
**Step 4:**: Call Algorithm 1's function \(\text{Embed}(x_{i}^{1},x_{i}^{2},m_{i})\). The Embed receives \(x_{i}^{1}\), \(x_{i}^{2}\), and \(m_{i}\) as parameters and performs the data hiding process. When data hiding is complete, \(y_{i}^{1}\) and \(y_{i}^{2}\) are returned;
**Step 5:**: Replace the original pixel values in \(I_{1}\) and \(I_{2}\) with the new stego pixel values \(y_{i}^{1}\) and \(y_{i}^{2}\) from the embedding function in Algorithm 1. Increment the index variable \(i\) after this substitution;
**Step 6:**: Proceed with the embedding process by increasing the index \(i\). If \(i\) is less than the total number of pixels \((N\times N)\), repeat the previous steps until the full image is processed, resulting in the creation of the stego images \(\Delta I_{1}\) and \(\Delta I_{2}\). Algorithm 1 provides a detailed description of the key process in our proposed RDH method using pseudocode. Lines 3-4 present the key steps used in the algorithm, while lines 5-17 present our proposed approach, which is simple to implement yet highly effective. Our method provides an efficient way to hide data within the cover image while ensuring data integrity. To eliminate ambiguity in image decoding, it is assumed that the order information of two stego images is specified in the header of the image. The header of each stego image contains metadata pertaining to the image. This metadata encompasses not only basic details like the image's size, format, and color depth but also supports the inclusion of additional information for specific application requirements. In this study, the sequence information of stego images is captured as an extra field within the image header's metadata, ensuring these images are processed and interpreted in their intended order. Consequently, algorithms or systems utilizing stego images can consult the image header to determine the sequence of images, which is critical for accurately performing data extraction and restoration processes. The methods introduced by [PERSON] et al. (2015) [14] and [PERSON] et al. (2022) [23] start by altering a single pixel within each pair as part of the data hiding process. However, there are cases where extracting the hidden bit from the altered pixel pair is unfeasible, necessitating a subsequent modification of the pixel pair. This approach can introduce increased distortion in pixel pairs and elevate time complexity. In contrast, our proposed method seeks to address these challenges head-on, striving to reduce image distortion attributable to the modification of additional pixels. Through the application of EMD and optimal LSB techniques, our method achieves noteworthy enhancements in the algorithm's efficiency.