## 3 The Proposed Method
### AMED Prediction and Recoding
#### 3.1.2 Calculating the Load Capacity for Secret Data of Pixel Blocks  
We utilize Huffman coding to compress the labeled value \(w\). There are nine potential values of \(w\), thus necessitating nine distinct Huffman codes to represent these variations. Specifically, the codes 00, 01, 100, 101, 1100, 1101, 1110, 11110, 11111 are assigned to represent the nine encodings. The frequency of each label value within the pixel block is calculated, allowing for the use of shorter codes for labels with higher occurrence probabilities and longer codes for those with lower probabilities. Consequently, \"0\" is assigned to the label with the highest frequency, while \"11111\" corresponds to the least frequent label. For example, in a \(64\times 64\) pixel block of a MAN image, following the successful prediction of pixel values, each pixel's label is determined and encoded using Huffman coding. The statistical results illustrating the frequency distribution of label values within the block are provided in Table 2 below.  
Taking label \(w=5\) as an illustration, based on the predicted pixel, we can deduce the highest six bits of the target pixel, enabling the substitution of these six bits with secret data for embedding. However, it remains imperative to record the label \(w\) utilizing the encoding  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Label** & **Capacity (bits)** & **Distribution** & **Code** & **Code Length (bits)** & **Load (bits)** \\ \hline
0 & 1 & 147 & 11111 & 5 & \(-4\) \\
1 & 2 & 148 & 11110 & 5 & \(-3\) \\
2 & 3 & 231 & 1110 & 4 & \(-1\) \\
3 & 4 & 504 & 101 & 3 & 1 \\
4 & 5 & 809 & 00 & 2 & 3 \\
5 & 6 & 674 & 01 & 2 & 4 \\
6 & 7 & 633 & 100 & 3 & 4 \\
7 & 8 & 369 & 1101 & 4 & 4 \\
8 & 8 & 454 & 1100 & 4 & 4 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Pixel coding and load capacity statistics.  
Figure 4: An example of calculating the label value of a pixel.  
\"01\". Thus, for a solitary pixel possessing a label value of 5, its capacity to accommodate payload information can be expressed as \(load(i,j)=5+1-2=4\). The load capacity of all pixels is computed according to Equation (8), yielding the data in column 6 of Table 2.  
\[load(i,j)=\left\{\begin{array}{l}w+1-long(code(x(i,j))),w\
eq 8\\ w-long(code(x(i,j)))\end{array}\right.,w=8 \tag{8}\]  
Next, the load capacity of all pixels within the pixel block, excluding the first row and the first column, is computed to determine the pixel block's load capacity, denoted as \(load(z)\).  
During the pixel prediction process, with the adaptive parameters fixed as \(p_{1}=p_{10}\), \(p_{2}=p_{20}\), and \(p_{3}=p_{30}\), the load capacity of the pixel block, represented as \(load_{p10,p20,p30}(z)\), is determined. The optimal parameter combination is identified through adaptive training. By traversing through all feasible values of \(p_{1}\), \(p_{2}\), and \(p_{3}\), where the parameter values are constrained to integers from \(-3\) to 4 (i.e., \(p_{i}\in\mathbb{Z}\), \(-3\leq p_{i}\leq 4\), resulting in a total of 24 potential combinations for the adaptive parameters \(p_{1}\), \(p_{2}\), and \(p_{3}\) (i.e., \(3\times 8=24\) possibilities). Consequently, there are 24 distinct values of \(load_{p1,p2,p3}(z)\) for a pixel. Once these data reach their maximum value, the corresponding adaptive parameters are recorded as \(p_{1}=p_{1 nr}\), \(p_{2}=p_{2 nr}\), and \(p_{3}=p_{3 nr}\). At this stage, the accuracy of the AMED median predictor is optimized, thereby maximizing the loading capacity of the image pixel block. The label value \(w(i,j)\) is then designated as the final label for the pixels within the pixel block.  
The method described above is applied to dynamically predict each pixel block of the original image, resulting in the derivation of labels for all pixels in the original image except those in the first row and column. This dataset is referred to as \(W\). Subsequently, we document the optimal adaptive parameters that maximize the loading capacity.