## 3 Proposed Method
### Objective Function  
Adversarial learning helps the network learn the features of different domains, which has shown good performance in unsupervised training. We adopted adversarial learning to train the SSIN to remove dynamic objects without knowing the ground-truth label. In addition, other loss functions are added to stabilize the network during adversarial training, which is a weighted summation of three different objective loss functions. The second loss term is a multi-class cross-entropy term that helps the SSIN preserve the input map's static part \(\mathbf{x}\). The third loss function is based on the total variation [31], which performs denoising and smoothing. The fourth loss function, the self-entropy term, helps stabilize the second loss function. Training is performed using the backpropagation method [32]. The crucial part of adversarial training in the SSIN is the GAN loss. This involves changing the standard optimization problem to a minimax optimization problem in which the SSIN and discriminator are jointly updated. The loss function for the SSIN and discriminator is defined as follows:  
\[L_{GAN}=\min_{G}\max_{D}E[\log(D(\overline{\mathbf{y}}_{i}))+\log(1-D(\overline{ \mathbf{x}})), \tag{6}\]  
where \(\overline{\mathbf{y}}\) implies the preprocessed static map, and \(\overline{\mathbf{x}}\) implies the preprocessed SSIN output. \(D(\cdot)\) denotes the discriminator function, and \(G\) denotes the SSIN. The SSIN aims to minimize the loss function to fool the discriminator, whereas the discriminator maximizes the loss function to differentiate the given data. The second objective of the SSIN is to remove only the dynamic labels from the input map \(\mathbf{x}\). In other words, the static labels in \(\mathbf{x}\) should be unchanged in the SSIN output from the given output. Instead of mean squared error [33], which is used in other inpainting methods for RGB data, the cross-entropy term is used to preserve the static label for the segmentation label set, which reveals the probability of each label. The cross-entropy loss term is defined as follows:  
\[L_{CE}(\mathbf{x},\mathbf{\tilde{x}},\mathbf{M})=\sum_{i}^{H\times W}\mathbf{M}_{i}\odot \sum_{c}^{C}(\tau\mathbf{x}_{i\mathbf{c}}\log\widetilde{\mathbf{x}}_{i\mathbf{c}}+(1-\tau\mathbf{ x}_{i\mathbf{c}}\log(1-\widetilde{\mathbf{x}}_{i\mathbf{c}}))), \tag{7}\]  
where \(L_{CE}\) denotes the cross-entropy loss function, \(\mathbf{x}\) denotes the input of the SSIN, and \(\mathbf{\tilde{x}}\) denotes the preprocessed output of the SSIN. Moreover, \(\widetilde{\mathbf{x}}_{i\mathbf{c}}\) targets \(\mathbf{x}_{i\mathbf{c}}\), only learning the static map by multiplying mask \(\mathbf{M}\), which ignores the dynamic label. The \(\tau\) value is multiplied in the target map to help preserve the preprocessing value. Training SSIN is unstable due to the unsupervised learning process, which results in noisy features to the output, as illustrated in Figure 4c. From the idea that the recovered pixels must follow the nearby segmentation, we introduce a cross-entropy-based total variation loss function for the binary data to adopt a smoothing effect for the output. The loss function is used during the training stage, which is defined as follows:  
\[L_{TV}(\widetilde{\mathbf{x}})=\frac{1}{H\times W}\sum_{h,w}^{H\times W}\mathbf{L_{ce }}(\widetilde{\mathbf{x}}_{\mathbf{h+1,w}},\widetilde{\mathbf{x}}_{\mathbf{h,w}},I)+\mathbf{L_{ce}}( \widetilde{\mathbf{x}}_{\mathbf{h,w+1}},\widetilde{\mathbf{x}}_{\mathbf{h,w}},I), \tag{8}\]  
where \(\widetilde{\mathbf{x}}\) denotes the input segmentation map. From the equation, \(\widetilde{\mathbf{x}}_{\mathbf{h,w}}\) targets nearby pixels \(\widetilde{\mathbf{x}}_{\mathbf{h,w+1}}\) and \(\widetilde{\mathbf{x}}_{\mathbf{h+1,w}}\) with the cross-entropy term. Normally, the L2 norm-based total variation loss function is used for the RGB data [23]. Moreover, different from the Sobelbased total variation [34], our loss function applies the cross-entropy term for derivable total variation for the segmentation map.