An unsupervised video object segmentation method based on generalizable fourier augmentation
By using an end-to-end Transformer model and Fourier transform technology, diverse scene-aware features are generated and phase features are updated online, solving the performance degradation problem caused by out-of-distribution samples in UVOS and improving the model's generalization ability.
Patent Information
- Application Number
- CN202410271796.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-11
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-03-11
AI Technical Summary
Existing unsupervised video object segmentation methods (UVOS) cannot effectively handle scene and semantic offsets when faced with out-of-distribution test samples, resulting in performance degradation and a lack of generalization ability.
An end-to-end Transformer model is adopted, which combines Fourier transform and EMA strategies to enhance the generalization ability of the model by generating diverse scene-aware features and updating phase features online during the encoder stage.
It effectively improves the model's adaptability to scene and semantic shifts, and enhances the generalization performance of unsupervised video object segmentation.
Smart Images

Figure CN117994706B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing, and in particular relates to an unsupervised video target segmentation method based on generalizable Fourier enhancement. Background Technology
[0002] Existing UVOS methods are trained and tested under the implicit assumption of independent and identically distributed (i.i.d.) data (i.e., training and testing data are samples with the same distribution). While achieving some success, in practical applications, the presence of out-of-distribution (OOD) test samples in zero-shot task settings leads to performance degradation in UVOS models. In UVOS, two main scenarios can cause distributional variations in test samples. The first is called "scene shift," where, for example, a target in the test video matches a target of the same semantic category in the training data, but its appearance changes significantly due to different scene styles in terms of texture, color, and contrast. The second is called "semantic shift," where, for example, a target in the test video might belong to a category not present in the training data. Without considering these OOD challenges, existing UVOS methods fail to achieve satisfactory generalization. Summary of the Invention
[0003] Purpose of the invention: In order to solve the problems existing in the prior art, the present invention provides an unsupervised video target segmentation method based on generalizable Fourier enhancement.
[0004] Technical solution: This invention provides an unsupervised video target segmentation method based on generalizable Fourier enhancement, specifically: an end-to-end Transformer model is used for unsupervised video target segmentation, the end-to-end Transformer model includes a Transformer layer encoder and decoder;
[0005] In the encoder stage, the input RGB image and optical flow map are first divided into a set of 4×4 pixel symbols. Then, these symbols are input into an overlapping map layer to generate embedding vectors. Subsequently, these vectors are input into four Transformer layers, each containing N Transformer blocks. Each block includes an efficient self-attention module and a Mix-FFN module. After that, the features output from the Transformer layers are input into an overlapping merging layer to reconstruct the entire feature map. The feature map is transformed by 2-DFFT to generate corresponding amplitude and phase frequency domain feature representations. The amplitude features are sampled to generate diverse scene-aware features. The sampled amplitude and online-updated phase features are combined and input into an iFFT layer to reconstruct enhanced spatial features.
[0006] The decoder stage includes several Transformer layers. The enhanced spatial features in each Transformer layer are input into an upsampling layer, which consists of a 1×1 convolutional layer and an interpolation layer to generate features with the same resolution. The features output from the upsampling layer are then concatenated and sequentially input into a 1×1 convolutional layer and an activation parameter layer to produce the final predicted segmentation mask.
[0007] Furthermore, the loss function of the end-to-end Transformer model for:
[0008]
[0009] in, For cross-entropy loss, The crossover ratio loss is λ, where λ is the weighting coefficient.
[0010] Furthermore, the phase features are updated online during the encoder stage using an EMA strategy.
[0011] Beneficial Effects: This invention designs a novel general Fourier enhancement framework for learning powerful domain-invariant features, effectively improving the generalization ability of the UVOS model. This invention proposes a sampling method for uncertainty modeling on amplitude features, which can generate diverse scene-aware style features to address the "scene shift" problem. This invention designs an online update strategy for phase features to better learn cross-domain invariant features, mitigating the "semantic shift" problem and further improving the model's generalization ability. Attached Figure Description
[0012] Figure 1 This is the network structure diagram of the present invention.
[0013] Figure 2 This is a diagram of the amplitude sampling and phase update process proposed in this invention.
[0014] Figure 3 This is a visualization of the phase update features proposed in this invention.
[0015] Figure 4 This invention presents a visualization of the distribution of amplitude feature statistics between the training and test sets, where (a) is the mean of the amplitude feature of the baseline in the training and test sets, (b) is the mean of the amplitude feature of the method of this invention in the training and test sets, (c) is the amplitude feature method of the baseline in the training and test sets, and (d) is the variance of the amplitude feature of the method of this invention in the training and test sets.
[0016] Figure 5 This is a segmentation result diagram of Example 1 proposed in this invention.
[0017] Figure 6 This is a segmentation result diagram of Example 2 proposed in this invention. Detailed Implementation
[0018] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0019] like Figure 1 The diagram shown illustrates the network structure of the unsupervised video object segmentation method based on generalizable Fourier enhancement provided by this invention. The specific steps are as follows:
[0020] The model employs an end-to-end Transformer architecture, consisting of a specially designed Transformer layer encoder and a decoder containing two simple 1×1 convolutional layers and an upsampling layer.
[0021] In the encoder stage, the input RGB image and optical flow map are first divided into a set of 4×4 pixel symbols. These symbols are then fed into an overlapping map layer to generate embedding vectors. Subsequently, these vectors are fed into four Transformer layers, each containing N Transformer blocks, each block including an efficient self-attention module and a Mix-FFN module to capture long-range dependency information. These features are then fed into an overlapping merging layer to reconstruct the entire feature set. The feature maps undergo 2D FFT transformation to generate corresponding amplitude and phase frequency domain feature representations. This embodiment then samples the amplitude features to generate diverse scene-aware features, which effectively enhances the training samples. Furthermore, this embodiment employs an EMA strategy to update phase features online, which helps learn cross-domain invariant features, thereby enhancing the model's generalization ability to semantic shifts. Finally, the sampled amplitude and online-updated phase features are combined and fed into an iFFT layer to reconstruct the enhanced spatial features.
[0022] In the decoder stage, the augmented spatial features from each Transformer layer are fed into an upsampling layer, which consists of a 1×1 convolutional layer and an interpolation layer to generate features with the same resolution. The final part of the decoder includes a 1×1 convolutional layer, an upsampling layer, and an activation function layer to produce the final predicted segmentation mask.
[0023] loss Combined with cross-entropy loss And the loss of the intersection loss The definition is as follows:
[0024]
[0025] in, P∈[0,1] H×W Let G represent the predicted segmentation mask, where G∈{0,1} H×W Let λ represent the true segmentation mask, and λ is a weighting coefficient.
[0026] Given feature map Among them W i H represents the width of the feature map at layer i. i C represents the height of the feature map at layer i. i This represents the number of channels in the i-th layer feature map. Each channel of feature X is transformed using FFT to obtain the corresponding frequency representation. The formula is defined as follows:
[0027]
[0028] in, This indicates the FFT operation. Then, It can be decomposed into amplitude components. and phase components The formula is defined as follows:
[0029]
[0030]
[0031] in, and Representing frequency characteristics respectively The real and imaginary parts. Furthermore, the amplitude is combined. and phase Features can be converted to spatial domain features using IFFT operations. The formula is defined as follows:
[0032]
[0033] in, Represents IFFT operation, j represents imaginary number.
[0034] Amplitude characteristics It contains rich scene-aware style information about scene texture, color, and contrast. An intuitive way to improve the model's ability to generalize to different scenes is to allow it to see diverse scene styles. To this end, scene-aware samples are augmented by manipulating amplitude statistics (mean and standard deviation). Amplitude statistics are randomly sampled from a Gaussian distribution to generate various samples with different styles, reducing the model's dependence on the training data. Figure 2As shown, given the spatial domain features in the i-th Transformer layer By decomposing the formula Decomposed into amplitude components and phase components These represent style content and semantic information, respectively. Then, in a small batch, the amplitude statistics (mean and standard deviation) of all channels are obtained, defined by the formula:
[0035]
[0036]
[0037] in, and They are amplitudes The mean and standard deviation of the values, where x and y represent the positions of the pixels.
[0038] The variance of probabilistic feature statistics can model uncertainty; as the variance increases, it becomes more likely to sample amplitude features characteristic of OOD scene style from the distribution. A mini-batch nonparametric estimation method is used to obtain... and The variance is used to characterize the sampling amplitude. The formula is defined as follows:
[0039]
[0040]
[0041] Where B represents the batch size. It is a small-batch expectation. and They represent and The variance. When a new characteristic statistic is obtained, namely the mean. and standard deviation Rich scene-aware style features can be randomly sampled from a new distribution to reduce overfitting of the model to the training set. However, direct sampling is non-differentiable; therefore, a reparameterization technique is employed to make it differentiable. The formula is defined as follows:
[0042]
[0043]
[0044] in, and They are all random noise sampled from a standard normal distribution.
[0045] Finally, AdaIN, similar to style transfer, is used to generate enhanced amplitude features with rich scene style. The formula is defined as follows:
[0046]
[0047] Phase features contain rich semantic information that is domain-invariant, which helps improve the model's generalization ability when no semantic shift occurs. However, in UVOS, targets with different semantic categories need to be projected into the same foreground label space, thus requiring further learning of cross-domain invariant features.
[0048] To learn cross-domain invariant features, we first define the phase features of the n domains as follows: Then, a network f with learnable parameters θ is learned. θ (·),Will Projected onto the same foreground label space satisfy Finally, the n output features are averaged to construct more robust cross-domain invariant features, as defined by the following formula:
[0049]
[0050] Wherein, parameter ρ = 1 / n.
[0051] The online update process described above is an EMA operation, which effectively smooths out noise information that varies across domains while maintaining consistency in foreground features across different semantic categories. Specifically, as shown below... Figure 3 As shown, this helps to address the "semantic offset" problem in UVOS and further improves the generalization of the model.
[0052] Figure 4 The statistical distribution of amplitude features between the training and test sets is shown. It can be seen that the mean and variance distributions of the feature statistics of the GFA method in this embodiment are closer to the baseline. All of this validates that amplitude feature enhancement in GFA can generate diverse style features, thereby reducing model overfitting and improving generalization ability.
[0053] Figure 5 The segmentation results are shown on five test sets. This embodiment demonstrates that the bicycle, airplane, frog, surfer, and snow leopard are in a distribution-shifted scene, and the GFA in this embodiment can perfectly segment them. This verifies that the GFA in this embodiment can effectively handle the distribution shift between training and test data.
[0054] like Figure 6As shown in the figure, this embodiment demonstrates that medical devices not seen in the training process at all in the test video can be perfectly extracted. This also verifies that the method proposed in this embodiment can learn various scene-aware patterns and powerful cross-domain invariant features, further improving the model's generalization ability.
[0055] It should be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
Claims
1. An unsupervised video target segmentation method based on generalizable Fourier enhancement, characterized in that, Specifically, an end-to-end Transformer model was used for unsupervised video object segmentation. The end-to-end Transformer model includes a Transformer layer encoder and decoder. In the encoder stage, the input RGB image and optical flow map are first divided into a set of 4×4 pixel symbols. Then, these symbols are input into an overlapping map layer to generate embedding vectors. Subsequently, these vectors are input into four Transformer layers, each containing N Transformer blocks. Each block includes an efficient self-attention module and a Mix-FFN module. Afterward, the features output from the Transformer layers are input into an overlapping merging layer to reconstruct the entire feature map. The feature map undergoes 2D-FFT transformation to generate corresponding amplitude and phase frequency domain feature representations. The amplitude features are sampled to generate diverse scene-aware features. The sampled amplitude and online-updated phase features are combined and input into an iFFT layer to reconstruct enhanced spatial features. The amplitude feature sampling is based on Gaussian distribution sampling of mini-batch amplitude statistics, and after reparameterization, enhanced amplitude features are generated using the AdaIN method. The phase characteristics are updated online during the encoder stage using the EMA strategy. The decoder stage includes several Transformer layers. The enhanced spatial features in each Transformer layer are input into an upsampling layer, which consists of a 1×1 convolutional layer and an interpolation layer to generate features with the same resolution. The features output from the upsampling layer are then concatenated and sequentially input into a 1×1 convolutional layer and an activation function layer to produce the final predicted segmentation mask.
2. The unsupervised video target segmentation method based on generalizable Fourier enhancement according to claim 1, characterized in that, The loss function of the end-to-end Transformer model for: ; in, For cross-entropy loss, To compare the losses, These are the weighting coefficients.
