## 3 Proposed Method  
### General Architecture of the Model  
The algorithm proposed in this paper is based on the use of an autoencoder built from convolution layers, combined with a discriminator to improve transparency and robustness metrics. The use of generative models described in [39] mainly determines the innovativeness of the described method and allows for the high performance of the algorithm. The approach is based on the ISGAN architecture for embedding a static image in another static image, described by [PERSON], [PERSON], and [PERSON] [40]. The authors used three convolutional networks--a watermark encoder responsible for embedding a static grayscale image into the cover luminance channel, a watermark decoder to extract the embedded image, and an autoanalyzer acting as a discriminator to verify whether the image in the input is the original image or the embedded watermark image. A diagram of the algorithm is shown in Figure 2.  
As part of the following work, the ISGAN architecture was extended with a mapper module upstream of the encoder and a demapper module downstream of the decoder, allowing a binary symbol with a certain number of bits to be converted into a static grayscale image and embedded in each video frame delivered to the encoder. The demapper performs the reverse operation: it converts the decoded grayscale image into a binary signature, which allows the robustness of the method to be unambiguously determined from the BER metric. In addition, the encoder, decoder, and discriminator architectures were adapted to the video-processing capabilities, i.e., processing 5-dimensional data tensors as video sequences. The block diagram of the proposed model with the modifications made is shown in the following figures: Figures 3-5. Figure 2: Block diagram of the ISGAN model—reprinted from [40]. Figure 4: Block diagram of the encoder. Figure 5: Block diagram of the decoder. Figure 3: Block diagram of the proposed model. When the data enter the encoder, the size of the feature map is verified. A frame with dimensions of less than 1280 \(\times\) 720 pixels is classified as standard definition (SD), while a frame with larger spatial dimensions is classified as high definition (HD). Depending on the dimensions, a transformation matrix is selected to convert the images from RGB space to YUV space. Converting an image from RGB to YUV allows data to be hidden only in the luminance channel, which does not carry any information about color. This makes it necessary to embed the watermark only in shades of gray, but it makes it easier to achieve the high transparency of the algorithm due to the modification of only one channel of the input image. 1. The processing of high-definition video frames is dedicated mainly to television broadcast applications; therefore, conversion to the appropriate color space should be performed in accordance with the International Communication Union (ITU) guidelines, which are described in the BT.709-6 standard. For this reason, there are two variants of the transformation matrix defined below. For standard definition: \[ \begin{array}{ccccc}Y&0.299&0.587&0.114&R\\ U=-0.14713&-0.28886&0.436&\times\ G\\ V&0.615&-0.51499&-0.10001&B\end{array} \] (1)
2. For high definition (according to the BT.709-6 standard): \[ \begin{array}{ccccc}Y&0.2126&0.7152&0.0722&R\\ U=-0.09991&-0.33609&0.436&\times\ G\\ V&0.615&-0.55861&-0.05639&B\end{array} \] (2)  
The watermark prepared using the mapper is concatenated with the Y cover channel, and the resulting image is then processed by the convolutional network so that the encoding of the watermark is performed in an optimal way, i.e., taking into account transparency and robustness requirements. The image with the embedded watermark is again summed with the U and V chrominance components and then converted to RGB space using the appropriate transformation matrix to produce an output image in the standard color space used by end users. 1. For standard definition: \[