## 3 Proposed Method
### Learning Process
For the purpose of embedding the watermark in the video, the watermarked images of the learning set were also saved as video files in H.265 format, with the video compression ratio \(CRF=7\), and then read as \(\text{ImageFromVideo}_{\text{{{Encoder}}}}\) for the purpose of computing \(MSE_{\text{{{EncVid}}}}\). The hidden images \(\text{Image}_{\text{{{ToHide}}}}\) were randomly generated in such a way that the data storage system imposed by the adjustable subsquares properties algorithm was preserved. The numerical values of the digits shown in Table 1 were drawn as the value of a digit was taken as the median value from the corresponding range of values. The test set, on the other hand, was composed of the individual \(MSE_{DecVid}\) frames of the video, encoded and then read after HEVC recording. The neural network structure described in this work is based in its assumption of the operation presented in the work previously mentioned at the beginning of this section [1]. The autoencoder structure consists of an encoder, which is a network that embeds the hidden watermark in the image, and a decoder, which returns the recovered hidden watermark as an output. Similar to the structure from the work mentioned at the beginning of this paragraph, where the input data is an RGB image which is a three-channel tensor, in the presented method, the input data is a YUV image which is also a three-channel tensor. Tables 3-5 show the parameters of the DNN encoder and decoder structures. As shown in Figure 2, the proposed method includes encoding, decoding, and preliminary networks (which are identical in their structure for the needs of the encoder and decoder, but, of course, each of them has been trained for the needs of the encoder or decoder, respectively). The preliminary networks for the encoder and decoder are identical in their structure, but they have different roles. For the encoder, the preliminary network processes the original image so that the encoding network can embed the watermark with better results, while, for the decoder, the preliminary network prepares the output image for the decoding network. The network structure includes the following layers: Convolution 2D, Batch Normalization, and Concatenate. The LeakyReLU activation function is used for the \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer Number** & **Layer Type** & **Parameters** \\ \hline \multirow{3}{*}{1} & \multirow{3}{*}{BL} & activation function: LeakyReLU \\  & & kernel size: 3 \(\times\) 3 \\  & & filter number: 61 \\  & & activation function: LeakyReLU \\
2 & BL & kernel size: 5 \(\times\) 5 \\  & & filter number: 61 \\  & & activation function: LeakyReLU \\
3 & BL & kernel size: 7 \(\times\) 7 \\  & & filter number: 61 \\
4 & Concatenate ((1, 2, 3), & - \\  & axis = 3) & activation function: LeakyReLU \\
5 & BL & kernel size: 7 \(\times\) 7 \\  & & filter number: 61 \\  & & activation function: LeakyReLU \\
6 & BL & kernel size: 5 \(\times\) 5 \\  & & filter number: 61 \\  & & activation function: LeakyReLU \\
7 & BL & kernel size: 3 \(\times\) 3 \\  & & filter number: 61 \\
8 & Concatenate ((5, 6, 7), & - \\  & axis = 3) & - \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Preliminary, convolutional neural network model (for encoder and decoder). \begin{table}
\begin{tabular}{c c} \hline \hline
**Layer Number** & **Layer Type** \\ \hline \multirow{3}{*}{1} & Convolution 2D layer \\  & 2 & Batch Normalization \\  & 3 & Convolution 2D layer \\  & 4 & Batch Normalization \\  & 5 & Convolution 2D layer \\  & 6 & Batch Normalization \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Basic Layer (BL) processing model. convoluted layers. At the input of the encoding network, a tensor--combined from the image processed by the preliminary network and the watermark--is applied, while the output of the network is expected to be the image with the embedded watermark.