A 3D image generation method based on GAN with neural radiance field optimization

By introducing cone sampling and integral position coding into GAN, combined with the adversarial generation network, the three-dimensional image generation process is optimized, solving the problems of high computational resource consumption and insufficient expression ability in traditional methods, and achieving high-precision and efficient three-dimensional images. generate.

CN117392314BInactive Publication Date: 2024-10-01TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311320895.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-12
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional generative adversarial networks and neural renderers require more computing resources and longer training time when processing 3D data, and lack the expressive capabilities required to synthesize high-fidelity images, resulting in 3D model generation that takes too long and details insufficient.

Method used

Using the GAN method based on neural radiation field optimization, through the cone sampling module, shape encoding module, splicing module, color encoding module and density encoding module, combined with the adversarial generation network, the generator network uses the camera matrix, camera pose, shape encoding and appearance Encoded as input, a three-dimensional image is rendered through cone sampling and integral position encoding. The voxel rendering module uses a multi-layer perceptron to optimize the rendering process.

Benefits of technology

It significantly reduces aliasing artifacts, improves the model's ability to represent fine details, reduces the amount of calculations, and provides an automated generation model suitable for complex three-dimensional scene generation tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117392314B_ABST
    Figure CN117392314B_ABST
Patent Text Reader

Abstract

The present invention relates to a three-dimensional image generation method based on a neural radiation field optimized GAN, comprising: obtaining a synthetic data set; inputting the synthetic data set into a three-dimensional image automatic generation model to obtain a three-dimensional image; wherein the three-dimensional image automatic generation model comprises: a generator network, the generator network is based on a camera matrix K, a camera posture ξ, a two-dimensional sampling mode v, a shape code z s And the appearance code z a As input, a discrete pixel region P′ in an image is predicted in combination with a cone sampling method; a discriminator network compares the discrete pixel region P′ predicted by the generator network with the pixel region P extracted from the real image I. The present invention improves the model's ability to represent fine details and reduces the amount of computation of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a three-dimensional image generation method based on GAN optimized by neural radiation field. Background Technology

[0002] In recent years, with the development of artificial intelligence and the widespread application of deep learning technology, deep learning-based image generation technology has made great progress, and can well complete image generation tasks in the two-dimensional field, including face generation and style transfer. However, in real life, people's perception of real objects is often three-dimensional. With the rapid innovation of technology and the continuous improvement of computing power, three-dimensional models are gradually gaining application and popularity because they can contain more information, display more details, and provide more viewing angles, thus providing users with a more realistic and intuitive experience. Since traditional image generation technology cannot provide the internal details of three-dimensional shapes and achieve multi-angle observation of objects, many researchers have also shifted their research focus to the three-dimensional field. Currently, automatic three-dimensional image generation has become an important research direction in the fields of computer vision, computer graphics, and machine learning, and has broad application prospects in virtual reality, augmented reality, film special effects, game development, and medical image processing.

[0003] In 3D image generation, deep learning methods can be applied in various ways. A common approach is to utilize Generative Adversarial Networks (GANs) for 3D shape generation. By training a generator network and a discriminator network in adversarial learning, the generator can gradually learn to generate realistic 3D shapes. Furthermore, researchers have proposed many improved GAN architectures, such as conditional GANs and variational autoencoders (VAEs), for more refined and controllable 3D shape generation. Another deep learning approach is 3D image generation based on neural rendering. A neural renderer can render a 3D scene as a 2D image and optimize network parameters to make the rendered result as close as possible to the observed image. This method can generate realistic images and allows for scene control by adjusting network parameters, such as changing the viewpoint, materials, and lighting. In addition, some studies have explored how to combine traditional 3D geometry reconstruction techniques with GANs to improve the quality and efficiency of 3D synthesis. For example, fusing texture information generated by GANs with models generated by traditional geometry reconstruction methods can yield more accurate and realistic 3D synthesis results. Although the three models mentioned above perform well in many image generation tasks, traditional generative adversarial networks and neural renderers often require more computational resources and longer training time when processing 3D data due to its high dimensionality. Furthermore, these models lack the expressive power required to synthesize high-fidelity images. Summary of the Invention

[0004] This invention provides a three-dimensional image generation method based on neural radiation field optimization GAN, which can overcome the problems of excessive time consumption in generating high-fidelity three-dimensional models and lack of expressive power required for synthesis in the existing technology.

[0005] The technical solution adopted by this invention to solve its technical problem is: to provide a three-dimensional image generation method based on neural radiation field optimization GAN, including the following steps:

[0006] Obtain synthetic datasets;

[0007] The synthetic dataset is input into an automated 3D image generation model to obtain a 3D image; wherein, the automated 3D image generation model includes:

[0008] A generator network, wherein the generator network uses a camera matrix K, camera pose ξ, two-dimensional sampling mode v, and shape encoding z. s and appearance code z a As input, the cone sampling method is used to predict discrete pixel regions P′ in an image;

[0009] A discriminator network compares the discrete pixel region P′ predicted by the generator network with the pixel region P extracted from the real image I.

[0010] The generator network includes:

[0011] The cone sampling module is used to perform cone sampling based on the camera matrix K, camera pose ξ, and two-dimensional sampling mode v to obtain the position code X of the cone sampling point;

[0012] A shape encoding module is used to encode the position X and the shape encoding z. s Calculate the new shape code h;

[0013] The stitching module is used to stitch together the new shape code h, view code d, and appearance code z. a This yields the concatenated encoding;

[0014] The color encoding module is used to generate color code c based on the splicing encoding;

[0015] The density encoding module is used to generate density encoding σ based on the new shape encoding h;

[0016] The voxel rendering module is used to render pixels according to color encoding c and density encoding σ to form voxel information of discrete pixel point regions P′.

[0017] The cone sampling module projects a cone from the camera's projection center along a direction passing through the pixel center during cone sampling. The cone's vertex is located at o, and its radius on the image plane is o+D. The set F of positions within the truncated cone between [t0, t1] is represented as: Where 1{·} is the index function, and t0 and t1 represent two sampling points on the conical propagation ray, where t0 is the near sampling point and t1 is the far sampling point; The width of a pixel in world coordinates is represented by the superscript T, which indicates matrix transpose, and x represents the position within the truncated cone between [t0, t1], i.e., the position of the cone sampling point.

[0018] The cone sampling module uses position coding with integration to encode the position of the cone sampling points, where the position coding with integration is expressed as: Where x represents the position of the cone-shaped sampling point, μ represents the mean of the Gaussian distribution that x follows, and σ 2 Let x represent the variance of the Gaussian distribution that x follows.

[0019] The voxel rendering module renders each pixel according to the following formula: Where C(r; Θ,t) represents the rendered voxel information, r represents a ray emitted from the camera, Θ represents the parameters of the multilayer perceptron used, t represents the distance of the emitted ray sampling point relative to the camera, k and k′ represent the sampling points, and T k τ represents the cumulative transmittance along the ray from k′ to k, that is, the probability that the ray travels from k′ to k without hitting any other particles. k t represents the voxel density value. k Sampling point on the cone-shaped propagating ray, c k Indicates pixel color.

[0020] The voxel rendering module uses a single multilayer perceptron with parameter Θ, and the optimization problem of the single multilayer perceptron is expressed as: Where λ is the weight, which is a hyperparameter, and C * (r) represents the actual pixel value, t c and t f This represents the distance between two sampling points on the conical propagation ray and the camera.

[0021] Beneficial effects

[0022] By adopting the above-mentioned technical solution, this invention has the following advantages and positive effects compared with the prior art: This invention generates and renders each pixel in a 3D image by introducing cone sampling rendering and combining it with a generative adversarial network. After replacing the light rays with the introduced cone sampling rendering, the sampled area is no longer a discrete set of points, but a continuous frustum region. This can solve the problem of ignoring the volume and size of the light observation range in the prior art, thereby reducing jagged artifacts and significantly improving the model's ability to represent fine details. Furthermore, it reduces the computational load of the model, providing an automated generation model for complex 3D scene generation tasks in the subsequent media and entertainment industries. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating the construction process of the automated three-dimensional image generation model in an embodiment of the present invention.

[0024] Figure 2 This is a network structure diagram of the automated three-dimensional image generation model in an embodiment of the present invention;

[0025] Figure 3 This is a structural diagram of the generator network in an embodiment of the present invention. Detailed Implementation

[0026] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0027] The present invention relates to a three-dimensional image generation method based on neural radiation field optimization GAN. The method includes the following steps: acquiring a synthetic dataset; inputting the synthetic dataset into an automated three-dimensional image generation model to obtain a three-dimensional image, wherein the automated three-dimensional image generation model includes a generator network, the generator network using a camera matrix K, camera pose ξ, two-dimensional sampling mode v, and shape encoding z. s and appearance code z a As input, a discrete pixel region P′ in an image is predicted using a cone sampling method; a discriminator network compares the discrete pixel region P′ predicted by the generator network with the pixel region P extracted from the real image I.

[0028] The construction of the automated 3D image generation model includes a training phase and a testing phase, such as... Figure 1 As shown, the training phase includes the following steps:

[0029] 1. Acquire training data. The training data used in this embodiment is the CARLA synthetic dataset. The CARLA dataset was collected by Schwarz et al. in the autonomous driving simulator Carla. It contains 10,000 images, including 18 different car models. These images have randomly sampled colors and realistic texture and reflectivity properties.

[0030] 2. Preprocess the training data, including reading the training data and performing data augmentation operations such as cropping and shifting;

[0031] 3. Obtain a pre-established 3D image automatic generation network model, load the training data into the network model for training, first use the generator network to generate a 3D image, then input the 3D image generated by the generator network into the discriminator network, and use the discriminator network to provide feedback to the generator network.

[0032] 4. Follow the above process to conduct multiple rounds of training to continuously improve the quality of the 3D images generated by the model.

[0033] The testing phase includes the following steps:

[0034] 1. Obtain test data, which consists of the CARLA synthetic dataset and the real face datasets celebA and celebA-hq.

[0035] 2. Load the test data into the trained 3D image automatic generation model, obtain the generation result, and compare the generation result with the real data. When the requirements are met, it means that the 3D image automatic generation model has been trained. When the requirements are not met, the training phase is repeated until the requirements are met.

[0036] like Figure 2 As shown, the automated 3D image generation model in this embodiment includes a generator network and a discriminator network. The generator network uses the camera matrix K, camera pose ξ, 2D sampling mode v, and shape encoding z. s and appearance code z a As input, a discrete pixel region P′ in an image is predicted using a cone sampling method. The discriminator network compares the discrete pixel region P′ predicted by the generator network with the pixel region P extracted from the real image I.

[0037] The generator network in this embodiment includes: a cone sampling module, used to perform cone sampling based on the camera matrix K, camera pose ξ, and two-dimensional sampling mode v to obtain the position code X of the cone sampling points; and a shape encoding module, used to perform cone sampling based on the position code X and the shape code z. sCalculate the new shape code h; a stitching module is used to stitch the new shape code h, the view code d, and the appearance code z. a The concatenation code is obtained; the color encoding module is used to generate color code c according to the concatenation code; the density encoding module is used to generate density code σ according to the new shape code h; the voxel rendering module is used to render the pixels according to the color code c and the density code σ to form the voxel information of the discrete pixel point region P′.

[0038] like Figure 3 As shown, firstly, the position code X of the cone sampling point is obtained through the cone sampling module, and then the shape header h is used. θ Based on the position code X of the cone sampling point and the input shape code z s A new shape code h is calculated, and then, in order to predict the color at position x, the new shape code h, the view code d, and the appearance code z are combined. a Perform concatenation, and pass the concatenated encoding to a color header c. θ The color code c is obtained, and then a density header σ is used. θ The new shape code h is converted into a density code σ, since the density code σ is composed of the position code X of the cone sampling points and the input shape code z. s The results were calculated independently, without considering the view encoding d and appearance encoding z. a This helps the model generate images with a consistent appearance across different viewpoints, thereby enhancing the consistency of multi-view observation. The generator network in this implementation uses shape encoding z... s and appearance code z a To model the shape and appearance, and to perform separate operations on them during the derivation process, the entire operation process satisfies the following mapping:

[0039]

[0040]

[0041]

[0042] Among them, L x L d M s M a These are the dimensions of position encoding, viewpoint encoding, shape encoding, and appearance encoding.

[0043] The cone sampling module in this embodiment introduces a cone sampling method. During rendering and featureization, a cone is cast, and the cone is featured along this cone. The image in the model is rendered one pixel at a time, so the process can be described based on the individual pixel of interest being rendered. For that pixel, a cone is projected from the camera's projection center o along a direction D passing through the center of that pixel. The vertex of the cone is located at o, and the radius of the cone on the image plane is o+D, parameterized as follows: Will Set as the width in pixels in world coordinates, according to Scaling is performed to obtain a cone whose cross-section on the image plane has variances in x and y that match the variance of the pixel footprint. The set F of positions within the truncated cone between two t values ​​[t0, t1] is represented as:

[0044]

[0045] Where 1{·} is the index function, and t0 and t1 represent two sampling points on the conical propagation ray, respectively. This represents the width of a pixel in world coordinates, and the superscript T indicates matrix transpose.

[0046] Furthermore, the cone sampling module in this embodiment also introduces integral position coding (IPE). This position coding can filter out high-frequency signals even at low image resolutions, thereby achieving an anti-aliasing effect. The existing position coding formula is:

[0047] γ(p)=(sin(2 0 πp),cos(2 0 πp),…,sin(2 L-1 πp),cos(2 L-1 πp))

[0048] Rewrite the position encoding formula as Fourier features:

[0049]

[0050] This yields the closed form of IPE (Integral Position Encoding). Since a linear transformation of a variable also transforms its covariance matrix, the mean and covariance of the position encoding function P can be calculated by projecting the Gaussian function of the fitted frustum region distribution onto the high-frequency space.

[0051] μ γ =Pμ,Σ γ =PΣP T

[0052] Then the positional encoding of the final integral can be deduced from the expectation of this multivariate Gaussian function. These two expectations can be expressed in a simple closed-form expression:

[0053]

[0054]

[0055] Where x represents the position of the cone-shaped sampling point, μ represents the mean of the Gaussian distribution that x follows, and σ 2 Let x represent the variance of the Gaussian distribution that x follows.

[0056] In this embodiment, the voxel rendering module follows the following formula when rendering each pixel:

[0057]

[0058]

[0059] Where C(r; Θ,t) represents the rendered voxel information, r represents a ray emitted from the camera, Θ represents the parameters of the multilayer perceptron used, t represents the distance of the emitted ray sampling point relative to the camera, k and k′ represent the sampling points, and T k τ represents the cumulative transmittance along the ray from k′ to k, that is, the probability that the ray travels from k′ to k without hitting any other particles. k t represents the voxel density value. k Sampling point on the cone-shaped propagating ray, c k Indicates pixel color.

[0060] Tapered sampling rendering and IPE (Integral Position Encoding) features allow for explicit scaling into input features, enabling the multilayer perceptron to learn multiscale representations of the scene. Therefore, a single multilayer perceptron with parameter Θ can be used, repeatedly querying it within a hierarchical sampling strategy. The benefits of this include splitting the model size in half, more accurate rendering, higher sampling efficiency, and a simpler overall algorithm. The optimization problem for this approach is:

[0061]

[0062] Where λ is the weight, which is a hyperparameter, and C * (r) Actual pixel value, t c and t f This represents the distance between two sampling points on the conical propagation ray and the camera.

[0063] The automated 3D image generation model of this embodiment predicts a color value for an image patch of size K×K during inference and provides the gradient of the entire brightness field by randomly scaling and rotating it.

[0064] In the generator network, the cone sampling method mentioned above is used to sample each image block, which is then integrated with position encoding and input into the generator network to generate (c, 0), and then integrated to obtain the color C of the pixel. The structure of the generator network in this embodiment is shown in Table 1.

[0065] Table 1. Specific structure of the generator network

[0066]

[0067]

[0068] The entire network uses a fully connected layer, h θ c θ σ θ They are all implemented using ReLU-activated fully connected networks.

[0069] In the discriminator network, implemented as a convolutional neural network, it compares the predicted image patch P0 with the image patch P extracted from the real image I extracted from the data distribution pD. To extract a K×K image patch from the real image I, v = (u, s) is first plotted from the same distribution pν used to plot the patch in the generator network above. Then, the real patch P is sampled using bilinear interpolation by querying I at the two-dimensional image coordinates P(u, s). This bilinear sampling operation is denoted by Γ(I, ν).

[0070] It is easy to see that this invention generates and renders each pixel in a 3D image by introducing cone sampling rendering and combining it with a generative adversarial network. After replacing light rays with the introduced cone sampling rendering, the sampled area is no longer a discrete set of points, but a continuous frustum region. This can solve the problem of ignoring the volume and size of the light observation range in the prior art, thereby reducing jagged artifacts and significantly improving the model's ability to represent fine details. Furthermore, it reduces the computational load of the model, providing an automated generation model for complex 3D scene generation tasks in the media and entertainment industries.

Claims

1. A three-dimensional image generation method based on GAN optimized by neural radiation field, characterized in that: The following steps are involved: Get a synthetic dataset; The synthetic data set is input into a three-dimensional image automatic generation model to obtain a three-dimensional image; wherein the three-dimensional image automatic generation model includes: The generator network is a camera matrix K, a camera pose ξ, a two-dimensional sampling pattern v, and a shape code z. s And the appearance code z a As input, a discrete pixel area P′ in an image is predicted in combination with a cone sampling method; the generator network includes: A cone sampling module is used to perform cone sampling according to the camera matrix K, the camera posture ξ, and the two-dimensional sampling mode v to obtain the position code X of the cone sampling point; A shape encoding module is used to encode the position x and the shape z according to the position x and the shape z. s Calculate the new shape code h; A splicing module, used to splice the new shape code h, the view code d and the appearance code z a , get the concatenated code; A color coding module, used for generating a color code c according to the splicing code; A density encoding module, used to generate a density encoding σ′ according to the new shape encoding h; A voxel rendering module, used for rendering pixels according to the color code c and the density code σ′ to form voxel information of a discrete pixel point area P′; A discriminator network that compares the discrete pixel region P′ predicted by the generator network with the pixel region P extracted from the real image I.

2. The three-dimensional image generation method based on GAN optimized by neural radiation field according to claim 1 is characterized in that: The cone sampling module projects a cone from the projection center of the camera in the direction passing through the pixel center during cone sampling, wherein the vertex of the cone is located at o, the radius of the cone on the image plane is o+D, and the set F of positions within the cone frustum between [t0, t1] is expressed as: Among them, 1{·} is the index function, t0 and t1 represent two sampling points on the cone propagation light, where t0 is the near sampling point and t1 is the far sampling point; Represents the width of the pixel in world coordinates, the superscript T represents the matrix transpose, and x represents the position within the conical frustum between [t0, t1], that is, the position of the conical sampling point.

3. The three-dimensional image generation method based on GAN optimized by neural radiation field according to claim 1 is characterized in that: The cone sampling module uses position coding with an integral introduced to perform position coding on the positions of the cone sampling points, wherein the position coding with an integral introduced is expressed as: Where x represents the location of the conical sampling point, μ represents the mean of the Gaussian distribution that x obeys, and σ 2 Represents the variance of the Gaussian distribution that x follows.

4. The three-dimensional image generation method based on GAN optimized by neural radiation field according to claim 1 is characterized in that: The voxel rendering module follows the following formula when rendering each pixel: Where C(r; Θ, t) is the rendered voxel information, r represents a ray emitted from the camera, Θ represents the parameters of the multi-layer perceptron used, t represents the distance of the ray sampling point relative to the camera, k and k′ represent the sampling points, and T k represents the cumulative transmittance along the ray from k′ to k, that is, the probability that the ray propagates from k′ to k without hitting any other particles, τ k represents the voxel density value, t k The sampling points on the cone propagation ray, c k Indicates the pixel color.

5. The three-dimensional image generation method based on GAN optimized by neural radiation field according to claim 4 is characterized in that: The voxel rendering module uses a single multilayer perceptron with parameter Θ. The optimization problem of the single multilayer perceptron is expressed as Among them, λ is the weight, which is a hyperparameter, C * (r) represents the actual pixel value, t c and t f Indicates the distance between two sampling points on the cone propagation ray relative to the camera.