## 3 Proposed Method
### General Architecture of the Model
\begin{array}{ccccc}R&1&0&1.13983&Y\\ G=1&-0.39465&-0.5806\times U\\ B&1&2.03211&0&V\end{array} \] (3)
2. For high definition (according to the BT.709-6 standard): \[ \begin{array}{ccccc}R&1&0&1.28033&Y\\ G=1&-0.21482&-0.38059\times U\\ B&1&2.12798&0&V\end{array} \] (4)  
In the decoder, the signal frame from RGB space is converted to YUV space, and the luminance channel is then processed by a convolutional network terminated by a sigmoid activation function. The resulting single-channel image is a decoded watermark. The input and output data for the neural networks in the form of video sequences were defined as follows:  
1. For the encoder: Input: cover = [N, C = 3, L, H, W], where N--batch size; C--number of channels; L--length of the video sequence (number of frames); H--height; W--width. watermark = [N, C = 1, H, W]Output: watermarked image = [N, C = 3, L, H, W]
2. For the decoder: Input: watermarked image = [N, C = 3, L, H, W] Output: decoded watermark = [N, C = 1, H, W]
3. For the discriminator: Input: cover/watermarked image = [N, C = 3, L, H, W] Output: out = [N, 1]  
The fundamental architecture of the individual neural networks that make up the algorithm has not been changed. Adjustments were only made to adapt the model to work with the mapper and to process 5-dimensional sequences. Diagrams of the individual neural networks presented in symbolic notation according to [41] are shown in Figures 6-8. The module takes two parameters as input--a binary signature of length 1 and a number \(n\) defining how many bits of the binary signature are to be dedicated to encoding one symbol. Based on the value of \(n\), the algorithm divides the sequence of bits into symbols to be encoded. Depending on the number of symbols \(N\), the mosaic area is divided into squares of \(y\times y\) pixels, where \(y\) is the spatial dimension of a single square in the mosaic, \(y=H/x\); \(H\) is the spatial dimension of the image watermark, \(H=256\); and \(x\) is the number of squares along one side of the mosaic, \(x=\sqrt{N}\). An example of the conversion of a binary signature to a mosaic divided into squares is shown in Figure 10.  
Depending on the number \(n\), the number of compartments \(c\) to which each symbol will be assigned is determined, defined as follows:  
\[c=2^{n} \tag{5}\]  
All possible combinations of 0 and 1 for a given value of \(n\) are determined using the Cartesian product and then sorted. For each combination, a pixel value is defined that will be assigned to the symbol in the given mapping. A value of 0 will always be assigned to the first symbol, and a value of 255 will always be assigned to the last symbol, corresponding to black and white pixel values. For more compartments, pixel values are defined according to the algorithm shown in the diagram in Figure 11.  
Figure 9: Diagram of the information mapper. The demapper works in reverse: it converts the decoded mosaic watermark into a binary signature. The next steps performed by the demapper module are described in the diagram in Figure 12.  
The module takes two parameters as input--a watermark and a value defining the number of bits per symbol \(n\). By analogy with the mapper, the \(y\), \(H\), and \(x\) values are determined. Based on the determined parameters, the mosaic is divided into squares, and then each square is separately decoded into a binary symbol. In the decoding process, the average pixel value for the area is determined, and then the nearest pixel value according  
Figure 11: The idea behind the algorithm is that it assigns pixel values to individual bit symbols. Figure 12: Diagram of the information demapper. Figure 10: Conversion of a binary signature to a mosaic divided into squares. to the predefined ranges is searched for based on this value.