A method for hole filling of a virtual viewpoint synthesized image

By combining the advantages of Transformer and CNNs, a lightweight network architecture was designed. By combining the extended cross-striped window Transformer module and the global feature aggregation residual layer, the problems of high computational cost and insufficient visual coherence in virtual viewpoint synthesis were solved, and efficient and accurate hole filling effect was achieved.

CN118691507BActive Publication Date: 2026-11-24HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410682107.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2026-11-24
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

Existing Transformer models are computationally expensive in virtual viewpoint synthesis, heavily reliant on training data, and struggle to capture sufficient contextual information, resulting in inadequate visual coherence and content accuracy in hole-filling tasks.

Method used

By combining the global perception capability of the Transformer model with the local feature extraction advantage of the convolutional neural network, a lightweight network architecture is designed. An extended cross-striped window Transformer module and a global feature aggregation residual layer are introduced. Combined with the loss function of the human visual system and adversarial learning, the accuracy and naturalness of hole filling are improved.

Benefits of technology

While reducing computational costs and the need for large-scale training, it improves the accuracy and visual coherence of hole filling, and enhances the generalization and applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691507B_ABST
    Figure CN118691507B_ABST
Patent Text Reader

Abstract

This invention discloses a method for hole filling in virtual viewpoint synthesized images. The method first constructs a generator, which includes a downsampling layer, a DCSW Transformer layer, a feature aggregation residual layer, a global-local fusion module, and an upsampling layer. Then, a discriminator is constructed using a block-based generative adversarial network (PatchGAN) with five convolutional layers. A total loss function is constructed, consisting of L1 loss, edge loss, perceptual loss, HVS total loss, and adversarial loss. The generator and discriminator are trained, and the generator network is used to reconstruct the content and texture of the hole regions. Finally, the trained generator is used to fill the holes in the original image. This invention demonstrates high efficiency and superior performance in virtual viewpoint hole filling tasks, and can be widely applied to various virtual viewpoint synthesis scenarios, exhibiting significant practical value and promotional potential.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically the field of virtual viewpoint synthesis technology, and relates to a method for filling holes in virtual viewpoint synthesized images. Specifically, it is a method for filling holes in virtual viewpoint synthesized images that combines convolutional neural networks and Transformer architecture. Background Technology

[0002] In computer vision tasks, while the Transformer model has demonstrated its powerful capabilities across multiple domains due to its excellent performance, existing Transformer models often suffer from high computational costs due to their large number of parameters. More importantly, these models rely on a large amount of training data to achieve optimal results, but in scenarios involving virtual viewpoint synthesis, the information from the reference viewpoint is often limited, which substantially restricts the application of the model in hole-filling tasks. Furthermore, existing Transformer models struggle to effectively capture sufficient contextual information to accurately fill in holes caused by virtual viewpoint synthesis, resulting in poor performance in terms of visual coherence and content accuracy. Summary of the Invention

[0003] The purpose of this invention is to provide a method for filling holes in synthesized images from a virtual viewpoint, aiming to solve the problems of high computational cost, strong dependence on large amounts of training data, and insufficient visual coherence and content accuracy in existing technologies. This invention integrates the global perception capability of the Transformer model and the local feature extraction advantages of Convolutional Neural Networks (CNNs) to achieve efficient and accurate hole filling in synthesized images from virtual viewpoints. The core design is to improve the accuracy and naturalness of hole filling while reducing computational cost and alleviating the need for large-scale training. It optimizes the core challenges of virtual viewpoint synthesis and demonstrates the superior performance and wide applicability of the model.

[0004] The present invention is as follows:

[0005] Step (1) Construct the generator; the generator includes a downsampling layer, a DCSW Transformer layer, a feature aggregation residual layer, a global-local fusion module, and an upsampling layer. DCSW is an extended cross-striped window.

[0006] (1-1) The original hole image I in and its corresponding mask M in The samples are merged and then fed into the four downsampling convolutional layers of the downsampling layer to obtain the downsampling feature map F1.

[0007] (1-2) The downsampled feature map F1 is processed through the DCSW Transformer layer and the feature aggregation residual layer respectively.

[0008] The DCSW Transformer layer consists of four DCSW Transformer blocks, each of which includes a strip window attention unit, a multi-scale dilation attention unit, and a self-attention unit. The downsampled feature map F1 performs the following operations through the DCSW Transformer layer:

[0009] In the first DCSW Transformer block, the downsampled feature F1 is first processed by Layer Normalization (LN) and then distributed to two branches. The data flow of the first branch passes through a linear layer and enters the strip window attention unit to obtain the strip window attention feature F2. After being processed by layer normalization and a multilayer perceptron (MLP), the strip window attention feature F2 is added to F2 through residual connections to obtain the residual-compensated feature F3. The data flow in the second branch passes through a convolutional layer and then sequentially through a multi-scale dilated attention unit and a self-attention unit to obtain the multi-scale feature F4. The outputs F3 and F4 are fused by addition, processed by layer normalization, and then input into the MLP to obtain the first-level fused feature. Will The process is repeated with the next DCSW Transformer block, and so on, until the fourth DCSW Transformer block; each of the four DCSW Transformer blocks outputs a first-level fused feature. Secondary fusion features Three-level fusion characteristics and Level 4 fusion features

[0010] The feature aggregation residual layer consists of four residual dense blocks RDB and a global average pooling layer; the downsampled feature map F1 performs the following operations through the feature aggregation residual layer:

[0011] In the first residual dense block (RDB), the downsampled feature F1 first passes through the first convolutional layer and ReLU activation function, outputting the first feature. This first feature is then passed to the second convolutional layer and ReLU activation function, outputting the second feature. The two output features are concatenated and passed to the third convolutional layer and ReLU activation function, outputting the third feature. The three output features are then concatenated and passed to the fourth convolutional layer and ReLU activation function, outputting the fourth feature. The four output features are then concatenated and passed through a 1×1 convolutional layer for channel compression, and then added to the downsampled feature F1 via residual connections to form the first-level output feature. First-level output features The next residual dense block RDB is fed in, and the operation is repeated until the fourth residual dense block RDB is reached. The four residual dense blocks RDB each output a first-level output feature. Secondary output characteristics Level 3 output characteristics and Level 4 output characteristics The global average pooling layer receives the output of each residual dense block RDB and obtains the globally average pooled feature F. A , will F A , The F1 and F1 sequences are added together to obtain the final output features of the feature aggregation residual layer.

[0012] (1-3) In the global-local fusion module, the secondary fusion features and secondary output features Perform pixel-by-pixel multiplication to obtain second-level multiplied features. Level 4 fusion characteristics and Level 4 output characteristics Perform pixel-by-pixel multiplication to obtain four-level multiplicative features. Second-order multiplication characteristics Fourth-level multiplication characteristics The final output features of the feature aggregation residual layer are... Perform pixel-by-pixel addition to obtain the first additive feature. Second-order multiplication characteristics Fourth-level multiplication characteristics and Level 4 fusion features Perform pixel-by-pixel addition to obtain the second additive feature. Will and By concatenating the channels, the output feature F of the global-local fusion module is obtained. fusion .

[0013] (1-4) The upsampling layer consists of four convolutional layers, for F fusion Four upsampling convolution operations are performed to obtain the hole-repaired image I. out .

[0014] Step (2) Construct the discriminator; The discriminator uses a block-based generative adversarial network PatchGAN, which includes 5 convolutional layers. The kernel size of each convolutional layer is 4×4, the stride is 2, and the Leaky ReLU activation function is used with a slope k = 0.2.

[0015] Step (3) Construct the total loss function in, Describes the L1 loss function. It is the edge loss function. Represents the perceptual loss function. Represents the total loss function of HVS. Let λ1 and λ2 represent the adversarial loss function. edge , λ perc , λ totalHVS and λ adv These are the loss weights corresponding to the loss function.

[0016] (3-1) Image I after cavity repair out With real image I gt The L1 distance between them is used as the reconstruction loss; ||·||1 represents the L1 distance.

[0017] (3-2) Edge Loss Function n = 1, ..., N; where N represents I out and I gt The number of pixels in the image, ⊙ represents pixel-by-pixel multiplication, ||·|| 2 Represents matrix squaring; edge mask M edge =(1-I edge )+10×I edge I edge This is an edge image obtained by applying the Canny edge detection algorithm.

[0018] (3-3) The perceptual loss function is used to improve the accuracy of perceptual reconstruction, and I out and I gt The data is fed into the VGG-19 model, resulting in five activation maps; the perceptual loss function is used. Where, φ k (I out ) indicates I out The activation map as input, φ k (I gt ) indicates I gt The activation graphs used as input, k = 1, 2, 3, 4, 5 are the activation graph numbers; It expresses expectation.

[0019] (3-4) HVS Total Loss Function in:

[0020] HVS Loss Function

[0021] Marginal HVS Loss Function

[0022] HVS out Visual system diagram after cavity repair, HVS gt For a real-world image vision system diagram, λ HVS and λ HVSedge These are the loss weights corresponding to the loss function.

[0023] (3-5) Adversarial loss function in:

[0024] Generator loss function D(·) represents the output result of the discriminator;

[0025] Discriminator loss function

[0026] Gradient penalty term Let the gradient be represented, and let the gradient penalty weight λ be set. GP =1×10 -3 .

[0027] Step (4) Train the generator and discriminator, and use the generator network to reconstruct the content and texture of the hole region.

[0028] Step (5) Use the trained generator to fill holes in the original image.

[0029] This invention combines the local feature extraction capabilities of CNNs with the global contextual understanding capabilities of the Transformer architecture, proposing a highly efficient hybrid network architecture. Key innovations include designing a lightweight network to reduce computational resource requirements, integrating the advantages of Transformers and CNNs to enhance the accuracy and visual coherence of hole filling, introducing an Extended Cross Stripe Window (DCSW) Transformer module to improve spatial feature extraction efficiency, and utilizing residual layers based on global feature aggregation to strengthen information flow and integration between features. Furthermore, this invention employs a Human Visual System (HVS) loss function to optimize image color stability and utilizes adversarial learning to further enhance image realism. Through enhanced multi-scale and multi-viewpoint processing capabilities, the model of this invention exhibits excellent generalization and applicability. A series of experiments have verified that the efficiency and superior performance of this invention in virtual viewpoint hole filling tasks can be widely applied to various virtual viewpoint synthesis scenarios, demonstrating significant practical value and promotional potential. Attached Figure Description

[0030] Figure 1 This is a simplified flowchart of the present invention. Detailed Implementation

[0031] A method for filling holes in a virtual viewpoint synthesized image, such as Figure 1 As shown:

[0032] Step (1) Construct the generator; the generator includes a downsampling layer, a DCSW Transformer layer, a feature aggregation residual layer, a global-local fusion module, and an upsampling layer.

[0033] (1-1) The original hole image I in and its corresponding mask M in The samples are merged and then fed into the four downsampling convolutional layers of the downsampling layer to obtain the downsampling feature map F1.

[0034] (1-2) The downsampled feature map F1 is processed through the DCSW Transformer layer and the feature aggregation residual layer respectively.

[0035] The DCSW Transformer layer consists of four DCSW Transformer blocks. Each DCSW Transformer block includes a striped window attention unit, a multi-scale dilated attention unit, and a self-attention unit, designed to process global information and enhance spatial feature extraction capabilities. The downsampled feature map F1 performs the following operations through the DCSW Transformer layer:

[0036] In the first DCSW Transformer block, the downsampled feature F1 is first processed by Layer Normalization (LN) and then distributed into two branches. The data flow in the first branch passes through a linear layer and enters a strip window attention unit, resulting in strip window attention feature F2. The strip window attention unit processes features within the strip region, enhancing the model's understanding and continuity of local image regions. After layer normalization and processing by a Multilayer Perceptron (MLP), the strip window attention feature F2 is added to F2 via residual connections to obtain residual-compensated feature F3. In the second branch, the data flow passes through a convolutional layer, then sequentially through a multi-scale dilated attention unit and a self-attention unit, resulting in multi-scale feature F4. This allows the model to extract spatial features at different scales and integrate this information through a self-attention mechanism, thereby capturing the global context of the scene. The design of these two branches provides a keen insight into local details and a broad understanding of the global structure, jointly promoting in-depth analysis of complex data. The outputs F3 and F4 are fused through an addition operation, and after layer normalization, they are input into a multilayer perceptron (MLP) to obtain the first-level fused features. Will The process is repeated with the next DCSW Transformer block, and so on, until the fourth DCSW Transformer block. Each of the four DCSW Transformer blocks outputs a first-level fused feature. Secondary fusion features Three-level fusion characteristics and Level 4 fusion features

[0037] The feature aggregation residual layer consists of four residual dense blocks (RDBs) and a global average pooling layer. The downsampled feature map F1 performs the following operations through the feature aggregation residual layer:

[0038] In the first residual dense block (RDB), the downsampled feature F1 first passes through the first convolutional layer and ReLU activation function, outputting the first feature. This first feature is then passed to the second convolutional layer and ReLU activation function, outputting the second feature. The two output features are concatenated and passed to the third convolutional layer and ReLU activation function, outputting the third feature. The three output features are then concatenated and passed to the fourth convolutional layer and ReLU activation function, outputting the fourth feature. The four output features are then concatenated and passed through a 1×1 convolutional layer for channel compression, and then added to the downsampled feature F1 via residual connections to form the first-level output feature. First-level output features The next residual dense block RDB is fed in, and the operation is repeated until the fourth residual dense block RDB is reached. The four residual dense blocks RDB each output a first-level output feature. Secondary output characteristics Level 3 output characteristics and Level 4 output characteristics The global average pooling layer receives the output of each residual dense block RDB and obtains the globally average pooled feature F. A , will F A , The F1 and F1 sequences are added together to obtain the final output features of the feature aggregation residual layer.

[0039] (1-3) In the global-local fusion module, the secondary fusion features and secondary output features Perform pixel-by-pixel multiplication to obtain second-level multiplied features. Level 4 fusion characteristics and Level 4 output characteristics Perform pixel-by-pixel multiplication to obtain four-level multiplicative features. Second-order multiplication characteristics Fourth-level multiplication characteristics The final output features of the feature aggregation residual layer are... Perform pixel-by-pixel addition to obtain the first additive feature. Second-order multiplication characteristics Fourth-level multiplication characteristics and Level 4 fusion features Perform pixel-by-pixel addition to obtain the second additive feature. Will and By concatenating the channels, the output feature F of the global-local fusion module is obtained. fusion .

[0040] (1-4) The upsampling layer consists of four convolutional layers, for F fusion Four upsampling convolution operations are performed to obtain the hole-repaired image I. out .

[0041] Step (2) Construct the discriminator; The discriminator uses a block-based generative adversarial network PatchGAN, which includes 5 convolutional layers. The kernel size of each convolutional layer is 4×4, the stride is 2, and the Leaky ReLU activation function is used with a slope k = 0.2.

[0042] Step (3) Construct the total loss function in, Describes the L1 loss function. It is the edge loss function. Represents the perceptual loss function. Represents the total loss function of HVS. Let λ1 and λ2 represent the adversarial loss function. edge , λ perc , λ totalHVS and λ adv In this embodiment, the loss weights corresponding to the loss function are set as follows: λ1 = 10, λ edge =10, λ perc =0.1, λ totalHVS =1,λ adv =10.

[0043] (3-1) Image I after cavity repair out With real image I gt The L1 distance between them is used as the reconstruction loss to ensure pixel-level reconstruction accuracy; ||·||1 represents the L1 distance.

[0044] (3-2) Edge Loss Function n = 1, ..., N; where N represents I out and I gt The number of pixels in the image, ⊙ represents pixel-by-pixel multiplication, ||·|| 2 Represents the matrix squaring operation. Edge mask M edge =(1-I edge )+10×I edge To enhance edge information during the cavity filling process, I edge This is an edge image obtained by applying the Canny edge detection algorithm.

[0045] (3-3) The perceptual loss function is used to improve the accuracy of perceptual reconstruction, and I out and I gt The data is fed into the VGG-19 model, resulting in five activation maps; the perceptual loss function is used. Where, φ k (I out ) indicates I out The activation map as input, φ k (I gt ) indicates I gt The activation graphs used as input, k = 1, 2, 3, 4, 5 are the activation graph numbers; It expresses expectation.

[0046] (3-4) HVS Total Loss Function in:

[0047] HVS Loss Function

[0048] Marginal HVS Loss Function

[0049] HVS out Visual system diagram after cavity repair, HVS gt To visualize the real-world image system, an edge HSV loss is introduced, which focuses on edge details in hole-filled regions, capturing and enhancing the color consistency of these key areas. λ HVS and λ HVSedge In this embodiment, λ is the loss weight corresponding to the loss function. HVS =10, λ HVSedge =100.

[0050] (3-5) Adversarial loss function in:

[0051] Generator loss function D(·) represents the output result of the discriminator;

[0052] Discriminator loss function

[0053] Gradient penalty term Let the gradient be represented, and let the gradient penalty weight λ be set. GP =1×10 -3 This strategy aims to enhance model stability and output image quality by adjusting the loss function to control gradient changes during the generation process.

[0054] Step (4) Train the generator and discriminator, and use the generator network to reconstruct the content and texture of the hole region.

[0055] Step (5) Use the trained generator to fill holes in the original image.

Claims

1. A method for filling holes in a virtual viewpoint synthesized image, characterized in that: Step (1) Construct the generator; the generator includes a downsampling layer, a DCSW Transformer layer, a feature aggregation residual layer, a global-local fusion module, and an upsampling layer; (1-1) The original empty image I in and its corresponding mask M in are merged and then input to four down-sampling convolutional layers of the down-sampling layer to obtain a down-sampled feature map F1; (1-2) The downsampled feature map F1 is processed through the DCSW Transformer layer and the feature aggregation residual layer, respectively; The DCSW Transformer layer consists of four DCSW Transformer blocks, each of which includes a strip window attention unit, a multi-scale dilated attention unit, and a self-attention unit. The downsampled feature map F1 performs the following operations through the DCSW Transformer layer: In the first DCSW Transformer block, the downsampled feature F1 is first normalized by layers and then distributed to two branches. The data flow of the first branch passes through a linear layer and enters a strip window attention unit to obtain the strip window attention feature F2. After being normalized by layers and processed by a multilayer perceptron (MLP), the strip window attention feature F2 is added to F2 through residual connections to obtain the residual-compensated feature F3. The data flow in the second branch passes through a convolutional layer and then sequentially through a multi-scale dilated attention unit and a self-attention unit to obtain the multi-scale feature F4. The outputs F3 and F4 are fused by addition, normalized by layers, and then input into the MLP to obtain the first-level fused feature. Will The process is repeated with the next DCSW Transformer block, and so on, until the fourth DCSW Transformer block; each of the four DCSW Transformer blocks outputs a first-level fused feature. Secondary fusion features Three-level fusion characteristics and Level 4 fusion features The feature aggregation residual layer consists of four residual dense blocks RDB and a global average pooling layer; the downsampled feature map F1 performs the following operations through the feature aggregation residual layer: In the first residual dense block RDB, the downsampled feature F1 first passes through the first convolutional layer and ReLU activation function, outputting the first feature, which is then passed to the second convolutional layer and ReLU activation function to output the second output feature. The two output features are concatenated and then passed to the third convolutional layer and ReLU activation function to output the third output feature. The three output features are then concatenated and then passed to the fourth convolutional layer and ReLU activation function to output the fourth output feature. The four output features are concatenated and then compressed through a 1×1 convolutional layer to reduce the number of channels. They are then added to the downsampled feature F1 via residual connections to form the first-level output features. First-level output features The next residual dense block RDB is fed in, and the operation is repeated until the fourth residual dense block RDB is reached. The four residual dense blocks RDB each output a first-level output feature. Secondary output characteristics Level 3 output characteristics and Level 4 output characteristics The global average pooling layer receives the output of each residual dense block RDB and obtains the globally average pooled feature F. A , will F A , The F1 and F1 sequences are added together to obtain the final output features of the feature aggregation residual layer. (1-3) In the global-local fusion module, the secondary fusion features and secondary output features Perform pixel-by-pixel multiplication to obtain second-level multiplied features. Level 4 fusion characteristics and Level 4 output characteristics Perform pixel-by-pixel multiplication to obtain four-level multiplicative features. Second-order multiplication characteristics Fourth-level multiplication characteristics The final output features of the feature aggregation residual layer are... Perform pixel-by-pixel addition to obtain the first additive feature. Second-order multiplication characteristics Fourth-level multiplication characteristics and Level 4 fusion features Perform pixel-by-pixel addition to obtain the second additive feature. Will and By concatenating the channels, the output feature F of the global-local fusion module is obtained. fusion ; (1-4) The upsampling layer consists of four convolutional layers, for F fusion Four upsampling convolution operations are performed to obtain the hole-repaired image I. out ; Step (2) Construct the discriminator; The discriminator uses a block-based generative adversarial network PatchGAN, which includes 5 convolutional layers. The kernel size of each convolutional layer is 4×4, the stride is 2, and the Leaky ReLU activation function is used with a slope k = 0.

2. Step (3) Construct the total loss function in, Describes the L1 loss function. It is the edge loss function. Represents the perceptual loss function. Represents the total loss function of HVS. Let λ1 and λ2 represent the adversarial loss function. edge , λ perc , λ totalHVS and λ adv These are the loss weights corresponding to the loss function; (3-1) Image I after cavity repair out With real image I gt The L1 distance between them is used as the reconstruction loss; ||·||1 represents the L1 distance; (3-2) Edge Loss Function Where N represents I out and I gt The number of pixels in the image, ⊙ represents pixel-by-pixel multiplication, ||·|| 2 Represents matrix squaring; edge mask M edge =(1-I edge )+10′I edge I edge This is an edge image obtained by applying the Canny edge detection algorithm; (3-3) The perceptual loss function is used to improve the accuracy of perceptual reconstruction, and I out and I gt The data is fed into the VGG-19 model, resulting in five activation maps; the perceptual loss function is used. Where, φ k (I out ) represents I out The activation map as input, φ k (I gt ) represents I gt The activation graphs used as input, k = 1, 2, 3, 4, 5 are the activation graph numbers; Expressing expectations; (3-4) HVS Total Loss Function in: HVS Loss Function Marginal HVS Loss Function HVS out Visual system diagram after cavity repair, HVS gt For a real-world image vision system diagram, λ HVS and λ HVSedge These are the loss weights corresponding to the loss function; (3-5) Adversarial loss function in: Generator loss function D(×) represents the output result of the discriminator; Discriminator loss function Gradient penalty term Let the gradient be represented, and let the gradient penalty weight λ be set. GP =1′10 -3 ; Step (4) Train the generator and discriminator, and use the generator network to reconstruct the content and texture of the hole region; Step (5) Use the trained generator to fill holes in the original image.

Citation Information

Patent Citations

  • Brain tumor segmentation data enhancement method based on generative adversarial network

    CN111833359A

  • Global and local multi-scale dynamic virtual viewpoint hole filling method

    CN117372461A