## 3 The Proposed Method
### Extraction and Recovery  
In this section, the method of extracting hidden data and restoring the stego-image to the cover image is explained. Step 1: To begin with extraction, a stego-image is needed, denoted as \(S\), which contains hidden information, as well as the predicted image, denoted as \(P\). To generate \(P\), you need to utilize a CNN-based predictor model. Extract the inner square portion from \(S\) and use it as the input data for the CNN-based predictor. The CNN model predicts the outer square, and \(P\) is generated by combining the inner and outer squares. By using the \(P\) and \(S\) generated in this step, an extraction can be performed. Step 2: Consistent with Equation (14), calculate the difference between \(S\) and \(P\) generated in Step 1, and assign it as \(\widetilde{G}\). \(\widetilde{G}\) contains a hidden secret datum in the difference between \(P\) and \(C\) in the embedding. \[\widetilde{G}_{(i,j)}=P_{(i,j)}-S_{(i,j)} \tag{14}\]  
Step 3: To find the end token in the generated \(\widetilde{G}\), we look for the smallest odd value and its corresponding coordinates. The end token is a datum generated during the embedding phase to indicate the point where the entire secret datum ends. It corresponds to the position that is the secret datum's length \(+1\) when the \(G_{abs}\) is sorted in descending order. It is derived by adding or subtracting 5 from the original size. Therefore, the coordinates with values greater than or equal to the data corresponding to the end token contain hidden secret data of 1 or 0, and the actual \(\widetilde{G}\) value has increased or decreased by 3 or 0 in \(\widetilde{G}\). Therefore, the size and coordinates of the end token are determined to identify the last coordinates where secret data are hidden. The pixel values, incremented or decremented by 5 in the end-token-generation step, are then reverted to their original sizes. As a result, we apply \(-5\) if \(G_{(i,j)}\) is positive, and \(+5\) if it is negative when considering Equation (15). \[ \begin{split} K=\min&\begin{pmatrix}G_{(i,j)}\ mod\ 2=1 \end{pmatrix}\\ \widetilde{G}_{(i,j)}=&\begin{cases}K-5\ if\ K>0\\ K+5\ if\ K<0\end{cases}\end{split}  \tag{15}\]  
Step 4: Extract the secret data from the hidden coordinates identified in Step 3. Apply the absolute value to \(\widetilde{G}\) and sort them in descending order. And following Equation (16), where the absolute value of \(\widetilde{G}_{(i,j)}\) is odd, apply \(-3\) if \(\widetilde{G}_{(i,j)}\) is positive or \(+3\) if \(\widetilde{G}_{(i,j)}\) is negative, and sort them in descending order. During this process, \(\widetilde{G}\) becomes the same as the \(G\) generated in the embedding phase. The coordinates where the absolute value of \(\widetilde{G}\) is greater than the end token are sorted in order. At locations where \(\widetilde{G}\) values are odd, 1 is assigned, while 0 is assigned as secret data at even locations. By arranging Step 4, all of the hidden data can be generated. \[ \begin{split}\widetilde{G}_{(i,j)}=\begin{cases}\widetilde{G}_{( i,j)}-3\ if\ \widetilde{G}_{(i,j)}\ mod\ 2=1\ and\ \widetilde{G}_{(i,j)}>0\\ \widetilde{G}_{(i,j)}+3\ if\ \widetilde{G}_{(i,j)}\ mod\ 2=1\ and\ \widetilde{G}_{(i,j)}<0\end{cases}\end{split}  \tag{16}\]  
Figure 7: The proposed reversible data embedding scheme. Step 5: Once the process of extracting, which is finding secret data, is complete, we move on to the recovery phase, which is the process of converting \(S\) back to \(C\). In the previous step, \(\widetilde{G}_{(i,j)}\) is adjusted by adding or subtracting 3 or 5 to the odd data, so that they match with \(G\) generated by Equation (10) during the embedding phase. Therefore, the method of generating \(C\) using Equations (10) and (11) is defined in Equation (17) by reversing the process. \[C_{(i,j)}=P_{(i,j)}-\frac{\widetilde{G}_{(i,j)}}{2} \tag{17}\]  
By using Equation (17), the proposed method can generate the cover image \(C\), and the recovery process can be complete.