A text-to-3D object generation method based on bimodal latent variable diffusion
Through the dual-mode latent variable diffusion method, joint training and texture optimization of two-dimensional and three-dimensional denoising modes are used to solve the speed and quality problems of existing three-dimensional object generation methods, and achieve fast and efficient three-dimensional object generation.
Patent Information
- Application Number
- CN202410346795.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-03-26
AI Technical Summary
Existing 3D object generation methods have shortcomings such as slow training and inference speed, poor visual quality, multi-head problem and the ability to generate only a single category of objects, making it difficult to be suitable for rapid target generation in open world scenes.
The dual-mode latent variable diffusion method is used to jointly train the dual-mode multi-view latent variable diffusion model through the two-dimensional latent variable diffusion model, and the two-dimensional and three-dimensional denoising modes are combined for inference and texture optimization to generate high-quality three-dimensional objects.
It greatly improves the speed and quality of 3D object generation without sacrificing quality, reduces inference costs through a dual-mode switching strategy, and enhances surface texture details through an efficient texture refinement process.
Smart Images

Figure CN117953180B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method for generating text to three-dimensional objects based on dual-mode latent variable diffusion. Background Art
[0002] 3D object generation is one of the most widely used topics in the intersection of computer vision and graphics, and has great potential in games, movies, robotics, virtual humans, and digital twins. With the development of 2D diffusion models, the SDS (fractional distillation sampling) series of methods introduce open text into 3D object generation, and the zero-sample capability of 2D diffusion models brings great potential. However, limited by the lack of 3D priors in 2D diffusion models and the instability of SDS, these methods have a low success rate and are prone to multi-head problems. At the same time, 3D diffusion models are also being developed. 3D diffusion models often rely on independent 3D reconstruction processes and generative model training, or rely heavily on large-scale 3D data. Their visual quality is often poor, especially in the generated 3D objects, which will have incomplete geometry and blurred textures.
[0003] After searching, the Chinese invention patent with application date of 2023.03.22 and application number CN202310285348.9 discloses a method for generating three-dimensional objects based on diffusion model and semantic guidance. The method uses the text encoder of CLIP (Contrastive Language-Image Pre-training Model) model to generate semantic vectors according to text data; uses the conditional flow model to generate shape vectors according to semantic vectors and first random noise, and splices the shape vector with the time step vector as a guiding condition; uses the second random noise as the initial reverse diffusion vector, and uses the diffusion model to generate low-dimensional point cloud vectors through reverse diffusion based on the guiding condition and the initial reverse diffusion vector; uses the point cloud decoder to decode the low-dimensional point cloud vector to obtain a high-dimensional point cloud, and generates three-dimensional objects based on the high-dimensional point cloud. However, this method has the defects of slow training, slow reasoning, and can only generate a single category of objects, and is not suitable for open world scenes and fast target generation.
[0004] Therefore, how to provide a text-to-3D object generation method based on dual-mode latent variable diffusion to improve the quality and speed of 3D object generation has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a text-to-three-dimensional object generation method based on dual-mode latent variable diffusion, so as to improve the quality and speed of three-dimensional object generation.
[0006] The present invention is implemented as follows: a method for generating text to three-dimensional objects based on dual-mode latent variable diffusion, comprising the following steps:
[0007] Step S10, jointly training a dual-mode multi-view latent variable diffusion model using the two-dimensional latent variable diffusion model;
[0008] Step S20: obtaining text of a to-be-generated three-dimensional object, and based on an efficiency and consistency trade-off strategy, using the dual-mode multi-view latent variable diffusion model to infer the text to generate a first three-dimensional object;
[0009] Step S30: Optimize the surface texture of the first three-dimensional object to generate a second three-dimensional object.
[0010] Furthermore, the step S10 specifically includes:
[0011] Step S11: Acquire multi-view images , , represents sampling from a distribution, represents a multi-view image set, Indicates the number of multi-view images used for each denoising, 3 indicates the RGB three-dimensionality of the image, Indicates the image height, Indicates the image width;
[0012] The multi-view images Input the frozen image encoder E of the two-dimensional latent variable diffusion model to obtain the latent variable , , represents the number of feature channels, represents the feature height, Indicates feature width;
[0013] Step S12: Add the latent variable Add noise to obtain multi-view latent variables :
[0014] ;
[0015] in, represents a monotonically increasing noise progress; Represents a Gaussian distribution The noise sampled in; t represents a random time step;
[0016] Step S13: Initialize three learnable latent variables , , the latent variable As the noise latent variables of the three planes of a three-dimensional object;
[0017] Step S14: Denoising the network through latent variables For the multi-view latent variables and noise latent variables Denoising is performed to obtain the three-plane latent variables :
[0018] ;
[0019] Among them, y represents the control condition;
[0020] Step S15: Transform the three-plane latent variables using a Transformer encoder Encoding to enhance multi-view latent variables and noise latent variables interaction;
[0021] Step S16: The encoded three-plane latent variables Input the latent variable decoder D for decoding, and reinitialize the last convolutional layer of the latent variable decoder D to increase the number of three-plane channels;
[0022] Step S17: decode the three-plane latent variables Rendering
[0023] Step S18, using a combination of MSE loss and LPIPS to reconstruct equal weight loss, and using Eikonal loss and minimum surface loss as constraints on the normal vector and SDF value of the sampling point of the three-dimensional object;
[0024] Step S19: The three-plane latent variables are rendered The pre-created dual-mode multi-view latent variable diffusion model is trained jointly until the equal weight loss converges.
[0025] Furthermore, the step S17 specifically includes:
[0026] Step S171: within the scene bounding box of the three-dimensional object, decode the three-plane latent variables Uniformly sample points of preset resolution, and obtain the first SDF value through bilinear sampling of three planes and two-layer multi-layer perceptron;
[0027] Step S172: obtaining a dense occupied grid based on the relationship between the absolute value of the first SDF value and the square root of three times the side length of the smallest voxel at the preset resolution, determining whether there is a curved surface in the occupied grid according to the second SDF value of the grid center of the occupied grid, and marking the occupied grid with the curved surface as occupied;
[0028] Step S173: for each ray of the camera, ray tracing and sampling are performed on the occupied grid marked as occupied, the sampled depth and the third SDF value are converted into a PDF value, and the PDF value is converted into a CDF value for upsampling by a specific number, and the bilinear sampled and upsampled points are rendered by neural surface volume;
[0029] Step S174: exploring the unoccupied occupied grid by connecting uniform sampling points within the bounding box, and rendering the ray by the color calculated by volume rendering:
[0030] ;
[0031] ;
[0032] Where n represents the number of points sampled along the ray; i represents the number of each sampling point; Represents the product of the opacity of all points on the ray; Indicates the transparency of the sampling point; Indicates the color of the sampling point; j indicates the number of each sampling point; Indicates continuous multiplication.
[0033] Furthermore, in step S20, during the inference process, the two-dimensional denoising mode and the three-dimensional denoising mode are switched at a preset frequency:
[0034] ;
[0035] in, represents the denoised multi-view shallow variant; represents the multi-view shallow variable after denoising of the two-dimensional denoising pattern; represents the multi-view shallow variable after denoising of the 3D denoising pattern; represents the current time step; mod represents the modulo operator; m represents the frequency used by the three-dimensional denoising mode.
[0036] Furthermore, the step S30 specifically includes:
[0037] Step S31, extracting the first three-dimensional object as a surface and performing geometric fixation, and converting the texture of the first three-dimensional object into an Albedo Mipmap;
[0038] Step S32, rendering the extracted surface into a random view image by using differentiable surface rendering, adding noise to the random view image with a certain intensity, and denoising it by using a two-dimensional diffusion model to obtain a denoised image;
[0039] Step S33: construct a reconstruction loss of the original rendered image and the denoised image of the first three-dimensional object, optimize the Albedo Mipmap by the reconstruction loss, and further optimize the surface texture of the first three-dimensional object to generate a second three-dimensional object.
[0040] The advantages of the present invention are:
[0041] A dual-mode multi-view latent variable diffusion model is jointly trained through a two-dimensional latent variable diffusion model; then the text of the three-dimensional object to be generated is obtained, and based on the efficiency and consistency trade-off strategy, the dual-mode multi-view latent variable diffusion model is used to infer the text to generate a first three-dimensional object, and finally the surface texture of the first three-dimensional object is optimized to generate a second three-dimensional object; that is, given a noisy multi-view latent variable, the two-dimensional denoising mode uses a denoising network of a single latent variable to effectively denoise, while the three-dimensional denoising mode generates a three-plane latent variable for denoising based on consistent rendering. Most modules of these two denoising modes are adjusted from the pre-trained text-image latent variable diffusion model to avoid the expensive cost of training from scratch; through the dual-mode switching reasoning strategy of the two-dimensional denoising mode and the three-dimensional denoising mode, only 1 / 10 of the three-dimensional denoising mode is used for denoising operations, so that the three-dimensional object can be quickly generated without sacrificing quality to overcome the high rendering cost in the reasoning process, and the surface texture of the three-dimensional object can be further enhanced in a short time through an efficient texture refinement process, which ultimately greatly improves the quality and speed of three-dimensional object generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0043] Figure 1 It is a flow chart of a method for generating text to three-dimensional objects based on dual-mode latent variable diffusion of the present invention.
[0044] Figure 2 It is a schematic diagram of a three-dimensional object rendered and synthesized by the present invention.
[0045] Figure 3 It is a schematic diagram of the architecture of the dual-mode multi-view latent variable diffusion model of the present invention.
[0046] Figure 4 It is a schematic diagram of a three-dimensional object actually generated by the present invention. DETAILED DESCRIPTION
[0047] The technical solution in the embodiments of the present application has the following overall idea: jointly train a dual-mode multi-view latent variable diffusion model, and both the two-dimensional denoising mode and the three-dimensional denoising mode of the dual-mode multi-view latent variable diffusion model are trained using shared modules, and only multi-view images are used as supervision. During the inference process, it can be switched to the two-dimensional denoising mode to reduce the inference time, or switched to the three-dimensional denoising mode to obtain a noise-free three-dimensional neural surface, thereby achieving consistent multi-view rendering.
[0048] Please refer to Figures 1 to 4 As shown, a preferred embodiment of the method for generating text to three-dimensional objects based on dual-mode latent variable diffusion of the present invention comprises the following steps:
[0049] Step S10, jointly training a dual-mode multi-view latent variable diffusion model using the two-dimensional latent variable diffusion model;
[0050] That is, the powerful priors of the two-dimensional latent variable diffusion model (compression and detail recovery capabilities of the autoencoder and the generation capabilities of the latent denoising network) are used to jointly train a dual-mode multi-view latent variable diffusion model; the dual-mode multi-view latent variable diffusion model has a two-dimensional denoising mode and a three-dimensional denoising mode, and the three-dimensional denoising mode can directly generate a clean three-dimensional representation from the noisy latent variable;
[0051] Step S20, obtaining the text of the three-dimensional object to be generated, and based on the efficiency and consistency trade-off strategy, using the dual-mode multi-view latent variable diffusion model to infer the text to generate a first three-dimensional object, that is, generating a preliminary three-dimensional result;
[0052] Step S30: Optimize the surface texture of the first three-dimensional object to enhance authenticity and details, and generate a second three-dimensional object.
[0053] In order to avoid high training costs, the present invention uses a unified formula of two-dimensional latent variable features and three-dimensional three-plane features to design a novel architecture and training process, so that the dual-mode multi-view latent variable diffusion model can be adjusted from the pre-trained two-dimensional latent variable diffusion model. The key is to replace the single-view latent variable denoising with the synchronous interactive denoising of multi-view latent variables and three-plane representations. The texture of the three-dimensional object generated only by denoising has obvious style differences from the texture of the real world, mainly due to the style deviation in the synthetic multi-view dataset. The present invention proposes an efficient texture refinement process to quickly optimize the texture mapping of the mesh extracted from the three-dimensional neural surface; the efficient and high-quality generation capability of the present invention is very suitable for constructive generation, and all generated three-dimensional objects can be seamlessly integrated into traditional rendering engines.
[0054] The step S10 specifically includes:
[0055] Step S11: Acquire multi-view images , , represents sampling from a distribution, represents a multi-view image set, Indicates the number of multi-view images used for each denoising, 3 indicates the RGB three-dimensionality of the image, Indicates the image height, Indicates the image width;
[0056] The multi-view images Input the frozen image encoder E of the two-dimensional latent variable diffusion model to obtain the latent variable , , represents the number of feature channels, represents the feature height, Indicates feature width;
[0057] Step S12: Add the latent variable Add noise to obtain multi-view latent variables :
[0058] ;
[0059] in, represents a monotonically increasing noise progress; Represents a Gaussian distribution The noise sampled in; t represents a random time step;
[0060] Step S13: The three planes of the three-dimensional object are regarded as the noise latent variables of the output three special two-dimensional latent variable diffusion models. Since there is no true value of the three-plane latent variable, three learnable latent variables are initialized. , , the latent variable As the noise latent variables of the three planes of a three-dimensional object;
[0061] Step S14: Denoising the network through latent variables For the multi-view latent variables and noise latent variables Denoising is performed to obtain the three-plane latent variables :
[0062] ;
[0063] Among them, y represents the control condition;
[0064] Use an intuitive multi-view latent variable diffusion objective to supervise the denoised multi-view latent variables of the 2D denoising model , defined as:
[0065] ;
[0066] in, Indicates the loss of 2d; Indicates expected value;
[0067] Step S15: Transform the three-plane latent variables using a Transformer encoder Encoding to enhance multi-view latent variables and noise latent variables interaction to improve the convergence of three-dimensional representation;
[0068] Step S16: The encoded three-plane latent variables Input the latent variable decoder D for decoding, and reinitialize the last convolutional layer of the latent variable decoder D to increase the number of three-plane channels;
[0069] Step S17: decode the three-plane latent variables Rendering is performed; the present invention follows TextMesh and uses NeuS as the basic rendering method;
[0070] Step S18, using a combination of MSE (mean square error) loss and LPIPS (learned perceptual image patch similarity) to reconstruct equal weight loss, in order to make the surface physically valid and reduce floating geometry, following StyleSDF, using Eikonal loss and minimum surface loss as constraints on the normal vector and SDF (signed distance function) value of the sampling point of the three-dimensional object;
[0071] The formula for the Eikonal loss is:
[0072] ;
[0073] in, Indicates the loss value of Eikonal loss; represents the gradient of SDF to the point position; p represents the sampling point;
[0074] The formula for the minimum surface loss is:
[0075] ;
[0076] in, The loss value representing the minimum surface loss;
[0077] Step S19: The three-plane latent variables are rendered The pre-created dual-mode multi-view latent variable diffusion model is trained jointly until the equal weight loss converges.
[0078] The total loss is as follows:
[0079] ;
[0080] in, They all represent weights, and their values are 1, 1, 0.1, and 0.01 respectively.
[0081] The step S17 specifically includes:
[0082] Step S171: within the scene bounding box of the three-dimensional object, decode the three-plane latent variables Uniformly sample points of preset resolution, and obtain the first SDF value through bilinear sampling of three planes and 2-layer multi-layer perceptron (MLP);
[0083] Step S172: obtaining a dense occupied grid based on the relationship between the absolute value of the first SDF value and the square root of three times the side length of the smallest voxel at the preset resolution, determining whether there is a curved surface in the occupied grid according to the second SDF value of the grid center of the occupied grid, and marking the occupied grid with the curved surface as occupied;
[0084] Step S173, for each ray of the camera, ray tracing and sampling are performed on the occupied grid marked as occupied, the sampled depth and the third SDF value are converted into a PDF (probability density function) value, and the PDF value is converted into a CDF (cumulative distribution function) value for upsampling by a specific number, and the bilinear sampled and upsampled points are subjected to neural surface volume rendering;
[0085] Step S174: exploring the unoccupied occupied grid by connecting uniform sampling points within the bounding box, and rendering the ray by the color calculated by volume rendering:
[0086] ;
[0087] ;
[0088] Where n represents the number of points sampled along the ray (sorted by depth); i represents the number of each sampling point; Represents the product of the opacity of all points on the ray; Indicates the transparency of the sampling point; Indicates the color of the sampling point; j indicates the number of each sampling point; Indicates continuous multiplication.
[0089] The calculation formula of the transparency is:
[0090] ;
[0091] in, represents the Sigmoid function with a learnable inverse standard deviation; p i represents the sampling point; f() represents the SDF value at a specific point.
[0092] In step S20, during the inference process, switching between the two-dimensional denoising mode and the three-dimensional denoising mode is performed at a preset frequency:
[0093] ;
[0094] in, represents the denoised multi-view shallow variant; represents the multi-view shallow variable after denoising of the two-dimensional denoising pattern; represents the multi-view shallow variable after denoising of the 3D denoising pattern; represents the current time step; mod represents the modulo operator; m represents the frequency used by the three-dimensional denoising mode.
[0095] This design also ensures that the last denoising mode is a three-dimensional denoising mode, ensuring that a more refined three-dimensional representation can be produced in the end.
[0096] During training, the 3D denoising model is supervised in image space using the new view camera $c'$ in the following way:
[0097] ;
[0098] Among them, R represents the rendering process; Represents three planes; Represents the image reconstruction loss, which is used to penalize the differences between images; Represents the true value of the new perspective image; Indicates the loss of 3d; Indicates expected value; Represents the new view camera information.
[0099] The step S30 specifically includes:
[0100] Step S31, extracting the first three-dimensional object as a curved surface and performing geometric fixation, and converting the texture of the first three-dimensional object into an Albedo Mipmap (albedo multi-level map);
[0101] Step S32, using differentiable surface rendering to render the extracted surface into a random view image, adding noise to the random view image with a certain intensity, and performing multi-step denoising through a two-dimensional diffusion model to obtain a denoised image; the denoising function is ;
[0102] Step S33: construct a reconstruction loss of the original rendered image and the denoised image of the first three-dimensional object, optimize the Albedo Mipmap by the reconstruction loss, and further optimize the surface texture of the first three-dimensional object to generate a second three-dimensional object.
[0103] The formula for optimizing Albedo Mipmap is:
[0104] ;
[0105] in, Represents the image rendered by the mesh in the previous step; represents the latent variable decoder; Represents multi-step denoising of latent variable diffusion models; represents a latent variable encoder.
[0106] In summary, the advantages of the present invention are:
[0107] A dual-mode multi-view latent variable diffusion model is jointly trained through a two-dimensional latent variable diffusion model; then the text of the three-dimensional object to be generated is obtained, and based on the efficiency and consistency trade-off strategy, the dual-mode multi-view latent variable diffusion model is used to infer the text to generate a first three-dimensional object, and finally the surface texture of the first three-dimensional object is optimized to generate a second three-dimensional object; that is, given a noisy multi-view latent variable, the two-dimensional denoising mode uses a denoising network of a single latent variable to effectively denoise, while the three-dimensional denoising mode generates a three-plane latent variable for denoising based on consistent rendering. Most modules of these two denoising modes are adjusted from the pre-trained text-image latent variable diffusion model to avoid the expensive cost of training from scratch; through the dual-mode switching reasoning strategy of the two-dimensional denoising mode and the three-dimensional denoising mode, only 1 / 10 of the three-dimensional denoising mode is used for denoising operations, so that the three-dimensional object can be quickly generated without sacrificing quality to overcome the high rendering cost in the reasoning process, and the surface texture of the three-dimensional object can be further enhanced in a short time through an efficient texture refinement process, which ultimately greatly improves the quality and speed of three-dimensional object generation.
[0108] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A method for generating three-dimensional objects from text based on dual-mode latent variable diffusion, characterized in that: The steps include: Step S10, jointly training a dual-mode multi-view latent variable diffusion model using the two-dimensional latent variable diffusion model; The step S10 specifically includes: Step S11: Acquire multi-view images , , represents sampling from a distribution, represents a multi-view image set, Indicates the number of multi-view images used for each denoising, 3 indicates the RGB three-dimensionality of the image, Indicates the image height, Indicates the image width; The multi-view image Input the frozen image encoder E of the two-dimensional latent variable diffusion model to obtain the latent variable , , represents the number of feature channels, represents the feature height, Indicates feature width; Step S12: Add the latent variable Add noise to obtain multi-view latent variables : ; in, represents a monotonically increasing noise progress; Represents a Gaussian distribution The noise sampled in; t represents the random time step; Step S13: Initialize three learnable latent variables , , the latent variable As the noise latent variables of the three planes of a three-dimensional object; Step S14: Denoising the network through latent variables For the multi-view latent variables and noise latent variables Denoising is performed to obtain the three-plane latent variables : ; Among them, y represents the control condition; Step S15: Transform the three-plane latent variables using a Transformer encoder Encoding to enhance multi-view latent variables and noise latent variables interaction; Step S16: The encoded three-plane latent variables Input the latent variable decoder D for decoding, and reinitialize the last convolutional layer of the latent variable decoder D to increase the number of three-plane channels; Step S17: decode the three-plane latent variables Rendering Step S18, using a combination of MSE loss and LPIPS to reconstruct equal weight loss, and using Eikonal loss and minimum surface loss as constraints on the normal vector and SDF value of the sampling point of the three-dimensional object; Step S19: The three-plane latent variables are rendered Training a pre-created dual-mode multi-view latent variable diffusion model, jointly training until the equal weight loss converges; Step S20: obtaining text of a to-be-generated three-dimensional object, and based on an efficiency and consistency trade-off strategy, using the dual-mode multi-view latent variable diffusion model to infer the text to generate a first three-dimensional object; In step S20, during the inference process, switching between the two-dimensional denoising mode and the three-dimensional denoising mode is performed at a preset frequency: ; in, represents the multi-view latent variable after denoising; represents the multi-view latent variable after denoising of the two-dimensional denoising pattern; represents the multi-view latent variable after denoising of the 3D denoising pattern; represents the current time step; mod represents the modulus operator; m represents the frequency used by the three-dimensional denoising mode; Step S30: optimizing the surface texture of the first three-dimensional object to generate a second three-dimensional object; The step S30 specifically includes: Step S31, extracting the first three-dimensional object as a surface and performing geometric fixation, and converting the texture of the first three-dimensional object into an Albedo Mipmap; Step S32, rendering the extracted surface into a random view image by using differentiable surface rendering, adding noise to the random view image according to a preset intensity, and denoising the image by using a two-dimensional diffusion model to obtain a denoised image; Step S33: construct a reconstruction loss of the original rendered image and the denoised image of the first three-dimensional object, optimize the Albedo Mipmap by the reconstruction loss, and further optimize the surface texture of the first three-dimensional object to generate a second three-dimensional object.
2. The method for generating a text-to-3D object based on dual-mode latent variable diffusion according to claim 1, characterized in that: The step S17 specifically includes: Step S171: within the scene bounding box of the three-dimensional object, decode the three-plane latent variables Uniformly sample points of preset resolution, and obtain the first SDF value through bilinear sampling of three planes and two-layer multi-layer perceptron; Step S172: obtaining a dense occupied grid based on the relationship between the absolute value of the first SDF value and the square root of three times the side length of the smallest voxel at the preset resolution, determining whether there is a curved surface in the occupied grid according to the second SDF value of the grid center of the occupied grid, and marking the occupied grid with the curved surface as occupied; Step S173: for each ray of the camera, ray tracing and sampling are performed on the occupied grid marked as occupied, the sampled depth and the third SDF value are converted into a PDF value, and the PDF value is converted into a CDF value for upsampling by a specific number, and the bilinear sampled and upsampled points are rendered by neural surface volume; Step S174: exploring the unoccupied occupied grid by connecting uniform sampling points within the bounding box, and rendering the ray by the color calculated by volume rendering: ; ; Where n represents the number of points sampled along the ray; i represents the i-th sampling point; Represents the product of the opacity of all points on the ray; Indicates the transparency of the sampling point; Indicates the color of the sampling point; j indicates the jth sampling point; Indicates continuous multiplication.
