Construction method and system of three-dimensional model and image rendering method
By obtaining camera parameters and depth map generation models from multiple viewing angles, combining multi-viewing images to generate a diffusion model, and fusing line drawing and text information, the problem of low quality 3D model generation in the existing technology is solved, achieving high quality and realism. Sensitive 3D model construction.
Patent Information
- Application Number
- CN202410835554.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-04-29
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-10
AI Technical Summary
When building a 3D model in the existing technology, the line drafts input to the pre-trained diffusion model are too sparse and the multi-modal information described by images and text is difficult to fuse, resulting in low quality and lack of realism in the 3D model generation.
By obtaining camera parameters from multiple perspectives, using a depth map generation model to generate denser line drawings, and combining text descriptions to input multi-view images to generate a diffusion model, fully integrating the multi-modal information of line drawings and text, and constructing high-quality 3D model and optimize the accuracy of geometry and texture information by adding constraints.
It realizes the construction of high-quality 3D models, improves the realism and rendering quality of the model, and ensures the accuracy and clarity of the geometric shape and texture information of the 3D model at various viewing angles.
Smart Images

Figure CN118628660A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics, and more specifically, to a technology for constructing three-dimensional models based on line drawings, texts, and deep learning methods. More specifically, it relates to a three-dimensional model construction method and system, and an image rendering method. Background Art
[0002] The construction of three-dimensional models is an important research topic in the field of computer graphics. The construction of three-dimensional models with high-quality geometry and texture information has important applications in film and television games, VR / AR, architectural design, simulation and other fields. The existing three-dimensional model construction method requires professional modelers to use professional software such as Maya, ZBrush and 3Ds Max to spend several hours to complete, which is economically and time-consuming.
[0003] Relevant researchers have proposed solutions that can reduce the economic and time costs required to build three-dimensional models. For example, the research work of Li et al. has achieved the generation of three-dimensional models based on line drafts, but this work can only build three-dimensional mesh models and does not predict texture maps, so the result lacks texture information. At the same time, this work directly builds a three-dimensional model globally based on the entire line draft, which makes it difficult to control the local details of the three-dimensional model, resulting in the low quality of the generated three-dimensional model and lack of realism; Zheng et al.'s research work has improved the control of the details of the three-dimensional model, but is limited by the expressive power of the deep learning model and the skilled data set, and can only build three-dimensional models of specific categories of objects (such as tables, chairs, cars, etc.). Therefore, the scheme for building three-dimensional models in the prior art does not require professional modelers to operate, which reduces the economic and time costs required to build three-dimensional models, but the limited categories of the three-dimensional models built by this scheme and the lack of texture information in the final three-dimensional model result in the low quality of the constructed three-dimensional model and lack of realism. With the development of diffusion models (such as Stable Diffusion), the existing technology has emerged in which high-quality three-dimensional models are constructed based on line drawings and / or text descriptions and diffusion models. For example, the research work of Liang et al. generates three-dimensional models of any category based on text descriptions. However, since the constructed three-dimensional model results can only be roughly controlled by using text descriptions, there is a lack of precise control over the global geometry and local details of the three-dimensional model, and it is impossible to meet the controllable creation requirements of the three-dimensional model, resulting in the lack of realism in the constructed three-dimensional model; Poole et al. proposed a three-dimensional model construction method based on SDS reverse optimization, which constructs any category of three-dimensional models with geometry and texture based on text descriptions. However, the line drawings input into the pre-trained diffusion model in this scheme are too sparse (i.e., lack of three-dimensional information), and the constructed three-dimensional model is prone to geometric errors and blurred textures, resulting in the lack of realism in the constructed three-dimensional model, and the generation quality of the three-dimensional model needs to be improved.
[0004] In summary, in the prior art scheme for constructing a three-dimensional model, the line draft input into the pre-trained diffusion model is too sparse (that is, the three-dimensional information provided by the sparse line draft is incomplete, and there is ambiguity in directly mapping the two-dimensional image obtained based on the sparse line draft to the three-dimensional model) and the multimodal information of the image and text description in the input pre-trained diffusion model is difficult to integrate in the model, which makes the constructed three-dimensional model prone to problems such as geometric errors and texture blur, resulting in the constructed three-dimensional model of low quality and lack of realism.
[0005] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention
[0006] Therefore, the purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method and system for constructing a three-dimensional model and an image rendering method.
[0007] According to a first aspect of the present invention, a method for constructing a three-dimensional model is provided, the method comprising: step S1, obtaining a text description, an original line draft, and camera parameters of multiple perspectives obtained based on the original line draft corresponding to a target three-dimensional model, wherein the camera parameters of the multiple perspectives include camera parameters of the original line draft perspective and camera parameters of multiple other perspectives; step S2, using a depth map generation model to obtain an original line draft depth map corresponding to the original line draft based on the text description and the original line draft, and obtaining a new line draft corresponding to the camera parameters of the other perspectives based on the original line draft, the original line draft depth map, the camera parameters of the original line draft perspective and the camera parameters of each other perspective, and constructing a line draft pool based on the original line draft and all the new line drafts; step S3, taking the text description, any one line draft in the line draft pool and the camera parameters corresponding to the line draft as a training sample, and all training samples constitute a data set; step S4, constructing an initial training model, the initial training model comprising a neural radiation field and a multi-perspective image generation diffusion model, Among them, the neural radiation field obtains a two-dimensional rendered image of each perspective based on the camera parameters of the perspective in the data set, and performs step-by-step denoising processing in multiple time steps that conforms to the Gaussian distribution on the image data set composed of the two-dimensional rendered images of all perspectives to obtain a noisy image data set at each time step. The multi-perspective image generation diffusion model reconstructs the denoised two-dimensional rendered image of each perspective based on the two-dimensional rendered image of each perspective after adding noise in the noisy image data set at any time step, the camera parameters of the perspective, the line draft corresponding to the perspective, and the text description; step S5, using the data set to perform multiple iterative training on the initial training model until convergence and use the converged neural radiation field as a three-dimensional model, and in each iterative training process, update the parameters of the neural radiation field according to the preset total loss, wherein the preset total loss includes the reconstruction loss between the two-dimensional rendered image of each perspective obtained by the neural radiation field and the denoised two-dimensional rendered image of each perspective obtained by the multi-perspective image generation diffusion model.
[0008] In some embodiments of the present invention, the method further includes: in step S1, performing background subtraction processing on the original line draft to obtain the original line draft with the background removed; in step S4, the neural radiation field obtains a black and white image of the original line draft perspective based on the camera parameters of the original line draft perspective; in step S5, the preset total loss also includes a contour loss between the original line draft with the background removed and the black and white image of the original line draft perspective.
[0009] In some embodiments of the present invention, the method also includes: in step S4, the neural radiation field obtains a ray set, the direction of each ray in the ray set, the weight of each preset sampling point on each ray, and the normal vector of each preset sampling point based on the camera parameters of all viewing angles; in step S5, the preset total loss also includes a regularization loss obtained based on the ray set, the direction of each ray in the ray set, the weight of each preset sampling point on each ray, and the normal vector of each preset sampling point.
[0010] In some embodiments of the present invention, the method further includes: in step S4, the constructed initial training model also includes a text-to-image diffusion model, wherein the text-to-image diffusion model obtains the predicted noise on the two-dimensional rendered image of each perspective in the noisy image dataset at each time step based on the two-dimensional rendered image and text description at each time after adding noise in the noisy image dataset at any two time steps; in step S5, the preset total loss also includes the interval loss between the predicted noise on the two-dimensional rendered image of each perspective in the noisy image dataset at two time steps.
[0011] In some embodiments of the present invention, in step S2, each new line draft is obtained in the following manner:
[0012] S i =Warp(S,D S ,c S ,c i )
[0013] Where Warp(·) is the image deformation function, S is the original line drawing, and D S represents the original line drawing depth map, c S The camera parameters representing the original line drawing’s viewing angle, c i Represents the camera parameters of the i-th other view.
[0014] In some embodiments of the present invention, the preset total loss is:
[0015]
[0016] Among them, γ1, γ2, γ3 and γ4 are all preset hyperparameters, L SDS is the reconstruction loss, L sil is the contour loss, L orient is the regularization loss, L ISM is the interval loss.
[0017] In some embodiments of the present invention, the reconstruction loss is:
[0018]
[0019] Among them, c is a camera parameter set consisting of camera parameters of n perspectives, It means adding noise ∈ to the two-dimensional rendered images of n perspectives in the noised image dataset based on the camera parameter set c and t time step t The expected value, x i represents a 2D rendered image of the i-th view of the neural radiance field output, represents the denoised 2D rendered image of the i-th perspective output by the multi-view image generation diffusion model;
[0020] The contour loss is:
[0021]
[0022] Among them, M S represents the original line drawing with the background removed, R S Black and white image representing the original line drawing perspective of the neural radiation field output;
[0023] The regularization loss is:
[0024]
[0025] Where R is the set of rays, Represents the weight of the jth preset sampling point on the rth ray in the ray set, represents the normal vector of the jth preset sampling point, Represents the direction of the rth light ray.
[0026] The interval loss is:
[0027]
[0028] ∈={∈ t ,∈ p}
[0029] Where,∈ is the noise∈ t ,∈ p The noise set E t,p,c,∈ represents the expected value based on the camera parameter set c and the noise set ∈, Indicates adding noise ∈ to the noisy image dataset at time step t t The 2D rendered image of the i-th perspective after y is the text description. Indicates that The predicted noise on the 2D rendered image of the i-th perspective in the noisy image dataset at time step t obtained by the text-to-image diffusion model with input parameter α, Indicates adding noise ∈ to the noisy image dataset at p time steps pThe 2D rendered image of the ith perspective after Indicates that and y are the predicted noise on the 2D rendered image of the i-th view in the noisy image dataset at p time steps obtained by the text-to-image diffusion model with input parameter α.
[0030] In some embodiments of the present invention, the depth map generation model is trained in the following manner: multiple first line drafts, text descriptions corresponding to each first line draft, and a real depth map corresponding to each first line draft are obtained; a depth map dataset constructed from the real depth maps corresponding to all first line drafts is subjected to a stepwise noise addition process in multiple time steps conforming to a Gaussian distribution to obtain a noisy depth map dataset at each time step, and any first line draft, the text description corresponding to the first line draft, and the real depth map corresponding to the first line draft after noise is added to the noisy depth map dataset at any time step are used as a training sample, and all training samples constitute a first dataset; the depth map generation model is subjected to multiple rounds of iterative training using the first dataset until convergence, and the parameters of the depth map generation model are updated according to a first preset loss during each round of iterative training.
[0031] In some embodiments of the present invention, the first preset loss is:
[0032]
[0033] Y={y1,y2,…,y n}
[0034] S'={S'1,S'2,...,S' n}
[0035] Where D is the noisy depth map dataset at t time steps, Y is the text description set consisting of the text descriptions corresponding to n first line drafts, S′ is the first line draft set consisting of n first line drafts, It means adding noise ∈ to the depth maps corresponding to the n first line drafts in the noisy image dataset D, the text description set Y, the line draft set S′, and the noisy image dataset at time step t t 'The expected value obtained, Show y i and S i ′The predicted noise on the depth map corresponding to the i-th first line draft obtained by the depth map generation model with input parameter θ.
[0036] In some embodiments of the present invention, in step S4, the multi-view image generation diffusion model is trained and obtained in the following manner: a plurality of second line drafts and their corresponding second text descriptions, second camera parameters and images corresponding to each second line draft are obtained; a second image data set consisting of images corresponding to all second line drafts is subjected to a stepwise noise addition process in a plurality of time steps in accordance with a Gaussian distribution to obtain a second noisy image data set at each time step, and the second text description, any second line draft, and an image corresponding to the second line draft after adding noise in the second noisy image data set at any time step are used as a training sample, and all training samples constitute a second data set; an initial multi-view image generation diffusion model is constructed, wherein the initial multi-view image generation diffusion model comprises: a control network module for constructing an initial multi-view image generation diffusion model based on the second text description, each second line draft, and the second camera parameters and images corresponding to the second line draft. The multi-view module obtains the target fused attention feature corresponding to each second line draft based on the second text description, the image corresponding to each second line draft after adding noise in the second noisy image data set at any time step, and the second camera parameters corresponding to the second line draft. The target fused attention feature corresponding to each second line draft and the intermediate feature of the image corresponding to each second line draft after adding noise are fused to obtain the predicted noise on the image corresponding to each second line draft, and the denoised image corresponding to each second line draft is obtained based on the predicted noise on the image corresponding to each second line draft. The initial multi-view image generation diffusion model is trained for multiple rounds of iterative training using the second data set until convergence, and the parameters of the multi-view image generation diffusion model are updated according to the second preset loss during each round of iterative training.
[0037] In some embodiments of the present invention, the control network module includes multiple attention sub-modules, which are used to obtain the target fused attention features corresponding to each second line draft, wherein the last attention sub-module is used to obtain the target fused attention features corresponding to each second line draft, and the other attention sub-modules are used to obtain the intermediate fused attention features corresponding to each second line draft, and the output of the previous attention sub-module is used as the input of the next attention sub-module, and each attention sub-module includes: a residual sub-unit, which is used to perform feature extraction on each second line draft to obtain the residual features corresponding to each second line draft, or to process the intermediate fused attention features corresponding to each second line draft to obtain the residual features corresponding to each second line draft, wherein the input of the residual sub-unit in the first attention sub-module is each second line draft, the second camera parameters corresponding to the second line draft, and the second text description, and the input of the residual sub-units in the other attention sub-modules is the second camera parameters corresponding to each second line draft, the second text description corresponding to the second line draft Intermediate fused attention features, second text description; a three-dimensional self-attention sub-unit, used to divide the residual features corresponding to each second line draft into query features, key features and value features, and splice the query features, key features and value features of all the second line drafts respectively and obtain the attention features corresponding to all the second line drafts based on the splicing results, and divide the attention features corresponding to all the second line drafts according to preset rules to obtain the attention features corresponding to each second line draft; a cross-attention sub-unit, used to fuse the residual features corresponding to each second line draft and the attention features corresponding to each second line draft to obtain the intermediate fused attention features corresponding to each second line draft or the target fused attention features corresponding to each second line draft, wherein the output of the cross-attention sub-unit in the last attention sub-module is the target fused attention features corresponding to each second line draft, and the output of the cross-attention sub-units in other attention sub-modules is the intermediate fused attention features corresponding to each second line draft.
[0038] In some embodiments of the present invention, the second preset loss is:
[0039]
[0040] c″={c″1,c″2,...,c″ n}
[0041] S″={S″1,S″2,...,S″ n}
[0042] Wherein, x is the second noisy image data set at t time steps, c″ is the second camera parameter set consisting of the second camera parameters corresponding to n line drafts, S″ is the second line draft set consisting of n second line drafts, Indicates adding noise ∈″ to the image corresponding to each line draft in the second noisy image dataset based on the image set x, the second camera parameter set c″, the second line draft set S″, the second text description y″, and the t time step t The expected value obtained, Indicates that y″、c″ i The predicted noise on the image corresponding to the i-th line draft obtained by the multi-view image generation diffusion model with input parameter ω and S″.
[0043] According to a second aspect of the present invention, a three-dimensional model construction system is provided, the system comprising: a data acquisition module, for acquiring a text description, an original line draft, and camera parameters of multiple perspectives obtained based on the original line draft corresponding to a target three-dimensional model, wherein the camera parameters of the multiple perspectives include camera parameters of the original line draft perspective and camera parameters of multiple other perspectives; a line draft generation module, for obtaining an original line draft depth map corresponding to the original line draft based on the text description and the original line draft using a depth map generation model, and obtaining a new line draft corresponding to the camera parameters of the other perspectives based on the original line draft, the original line draft depth map, the camera parameters of the original line draft perspective and the camera parameters of each other perspective, and constructing a line draft pool based on the original line draft and all the new line drafts; a data set construction module, for taking the text description, any one line draft in the line draft pool and the camera parameters corresponding to the line draft as a training sample, and all training samples constitute a data set; a model construction module, for constructing an initial training model, the initial training model comprising a neural radiation field, a multi-perspective image generation model, and a plurality of other perspective image generation models; A diffusion model is formed, wherein the neural radiation field obtains a two-dimensional rendered image of each perspective based on the camera parameters of each perspective in the data set, and the original data set composed of the two-dimensional rendered images of all perspectives is subjected to step-by-step denoising processing in multiple time steps that conforms to the Gaussian distribution to obtain a noisy image data set at each time step, and the multi-perspective image generation diffusion model reconstructs the denoised two-dimensional rendered image of each perspective based on the two-dimensional rendered image of each perspective after adding noise in the noisy image data set at any time step, the camera parameters of the perspective, the line draft corresponding to the perspective, and the text description; a model training module is used to use the data set to perform multiple iterative training on the initial training model until convergence and use the converged neural radiation field as a three-dimensional model, and in each iterative training process, update the parameters of the neural radiation field according to a preset total loss, wherein the preset total loss includes the reconstruction loss between the two-dimensional rendered image of each perspective obtained by the neural radiation field and the denoised two-dimensional rendered image of each perspective obtained by the multi-perspective image generation diffusion model.
[0044] According to a third aspect of the present invention, there is provided an image rendering method, characterized in that the method comprises: obtaining camera parameters of any one or more viewing angles; and obtaining a two-dimensional rendered image corresponding to each viewing angle based on the camera parameters of any one or more viewing angles using a three-dimensional model constructed using the method described in the above embodiment.
[0045] According to a fourth aspect of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the steps of the method described in the first aspect and the third aspect.
[0046] Compared with the prior art, the advantages of the present invention are:
[0047] The present invention utilizes the depth map as three-dimensional information to generate denser and more accurate line drawings, and adopts a multi-view image generation diffusion model to fully fuse the multimodal information of the line drawings and texts input therein to obtain more representative characteristics. Therefore, the three-dimensional model construction scheme of the present invention can construct a high-quality three-dimensional model. At the same time, in the process of constructing the three-dimensional model, the present invention continuously optimizes the accuracy of the geometric shape of the three-dimensional model, the clarity of the texture information, the surface lighting response, the geometric smoothness and the overall rendering quality by continuously adding different constraints, thereby further improving the quality of the three-dimensional model and obtaining a more realistic three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0049] Figure 1 A flow chart of a method for constructing a three-dimensional model according to an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of a scheme for constructing a three-dimensional model of an owl according to an embodiment of the present invention;
[0051] Figure 3 It is a schematic diagram of a multi-view image generation effect obtained by a multi-view image generation diffusion model based on text description and line draft according to an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of a texture control effect based on text description according to an embodiment of the present invention;
[0053] Figure 5 A schematic diagram of the effect of generating a three-dimensional model based on text description and line drawings according to an embodiment of the present invention;
[0054] Figure 6The figure is a schematic diagram comparing the results of the three-dimensional model construction method of the embodiment of the present invention and the prior art. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail by specific embodiments below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0056] As described in the background technology, in the prior art scheme for constructing a three-dimensional model, the line draft input into the pre-trained diffusion model is too sparse (that is, the three-dimensional information provided by the sparse line draft is incomplete, and there is ambiguity in directly mapping the two-dimensional image obtained based on the sparse line draft to the three-dimensional model) and the multimodal information of the image and text description in the input pre-trained diffusion model is difficult to integrate in the model, which makes the constructed three-dimensional model prone to problems such as geometric errors and texture blur, resulting in the constructed three-dimensional model being of low quality and lacking in realism.
[0057] In order to solve the above problems, the inventors have studied the generation model of two-dimensional images and multi-perspective images based on line drafts and text descriptions and found that the lack of realism in three-dimensional models can be solved by first predicting the depth information of the image based on the line draft, that is, obtaining a line draft depth map corresponding to the line draft based on the line draft, and deforming the line draft according to the depth map to transform it to other perspectives, and then using all the obtained line drafts as input conditions to generate multi-perspective image results of the three-dimensional model. Therefore, the present invention proposes a new scheme for constructing a three-dimensional model. In the scheme of the present invention, the depth map is used as three-dimensional information to generate a denser and more accurate line draft, and the generated line draft is input into a pre-trained multi-perspective image generation diffusion model together with the corresponding text description. The multi-perspective diffusion model used can fully fuse the multimodal information of the line draft and the text to obtain more representative characteristics. Therefore, the scheme of the present invention can construct a high-quality three-dimensional model. The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0058] According to one embodiment of the present invention, Figure 1As shown, the present invention proposes a method for constructing a three-dimensional model, the method comprising the following steps: S1, obtaining a text description, an original line draft, and camera parameters of multiple perspectives obtained based on the original line draft corresponding to the target three-dimensional model, wherein the camera parameters of the multiple perspectives include camera parameters of the original line draft perspective and camera parameters of multiple other perspectives; S2, using a depth map generation model to obtain an original line draft depth map corresponding to the original line draft based on the text description and the original line draft, and obtain a new line draft corresponding to the camera parameters of the other perspectives based on the original line draft, the original line draft depth map, the camera parameters of the original line draft perspective and the camera parameters of each other perspective, and construct a line draft pool based on the original line draft and all the new line drafts; S3, taking the text description, any one line draft in the line draft pool and the camera parameters corresponding to the line draft as a training sample, and all training samples constitute a data set; S4, constructing an initial training model, the initial training model comprising a neural radiation field and a multi-perspective image generation diffusion model, wherein the neural radiation field and the multi-perspective image generation diffusion model are used. The radiation field is based on the camera parameters of each perspective in the data set to obtain a two-dimensional rendered image of the perspective, and the image data set composed of the two-dimensional rendered images of all perspectives is subjected to stepwise denoising processing in multiple time steps that conforms to the Gaussian distribution to obtain a noisy image data set at each time step. The multi-perspective image generation diffusion model reconstructs the denoised two-dimensional rendered image of each perspective based on the two-dimensional rendered image of each perspective after adding noise in the noisy image data set at any time step, the camera parameters of the perspective, the line draft corresponding to the perspective, and the text description; step S5, using the data set to perform multiple iterative training on the initial training model until convergence and use the converged neural radiation field as a three-dimensional model, and in each iterative training process, update the parameters of the neural radiation field according to the preset total loss, wherein the preset total loss includes the reconstruction loss between the two-dimensional rendered image of each perspective obtained by the neural radiation field and the denoised two-dimensional rendered image of each perspective obtained by the multi-perspective image generation diffusion model.
[0059] According to one embodiment of the present invention, the new line draft calculation method corresponding to the camera parameters of each other viewing angle in the above embodiment is:
[0060] S i =Warp(S,D S ,c S ,c i )
[0061] Where Warp(·) is the image deformation function, S is the original line drawing, and D S represents the original line drawing depth map, c S The camera parameters representing the original line drawing’s viewing angle, c iRepresents the camera parameters of the i-th other viewing angle. According to one embodiment of the present invention, the camera parameters of multiple other viewing angles include a first preset number of camera parameters of near viewing angles and a second preset number of camera parameters of far viewing angles, wherein the new line draft corresponding to the camera parameters of the other far viewing angle obtained based on the original line draft, the original line draft depth map, the camera parameters of the original line draft viewing angle, and the camera parameters of each other far viewing angle is set as a blank line draft. For example, taking the original line draft viewing angle, a near viewing angle, and three far viewing angles as an example, the camera parameters of the other four viewing angles except the original line draft viewing angle are {c1, c2, c3, c4}, and the new line drafts of the other four viewing angles can be obtained through the image deformation function. It should be noted that here, only four other viewing angles are used as examples to illustrate the solution of the present invention in order to make the technical solution of the present invention easier to understand, and the specific number of other viewing angles is not specifically limited.
[0062] The following is an explanation of the training process of the depth map generation model and the multi-view diffusion model in the above embodiment.
[0063] (1) Training process of the depth map generation model
[0064] According to one embodiment of the present invention, the depth map generation model is trained in the following manner: multiple first line drafts, text descriptions corresponding to each first line draft, and real depth maps corresponding to each first line draft are obtained; a depth map data set constructed from real depth maps corresponding to all first line drafts is subjected to stepwise noise processing in multiple time steps in accordance with Gaussian distribution to obtain a noisy depth map data set at each time step, and any first line draft, the text description corresponding to the first line draft, and the real depth map corresponding to the first line draft after adding noise in the noisy depth map data set at any time step are used as a training sample, and all training samples constitute a first data set; the depth map generation model is subjected to multiple rounds of iterative training until convergence using the first data set, and the parameters of the depth map generation model are updated according to a first preset loss during each round of iterative training. According to one embodiment of the present invention, the first preset loss is:
[0065]
[0066] Y={y1y2,…,y n}
[0067] S′={S′1,S′2,…,S′ n}
[0068] Where D is the noisy depth map dataset at t time steps, Y is the text description set consisting of the text descriptions corresponding to n first line drafts, S′ is the first line draft set consisting of n first line drafts, It means adding noise ∈ to the depth maps corresponding to the n first line drafts in the noisy image dataset D, the text description set Y, the line draft set S′, and the noisy image dataset at time step t t 'The expected value obtained, Show y i and S′ i The predicted noise on the depth map corresponding to the i-th first line draft obtained by the depth map generation model with input parameter θ.
[0069] For example, when the depth map generation model is a ControlNet model, the parameters of the ControlNet model are fine-tuned through the above embodiment. During the training process, the network weights of the VAE and ControlNet branches are fixed, and the network weights of the UNet for text to image are updated during training. The depth map used in training is a color image, and the resolution of the depth map is set to 256×256. It should be noted that the depth map generation model of the present invention can also be other models, and the ControlNet model is just one example, which is not specifically limited here. At the same time, the structure of the ControlNet model is known to those skilled in the art, and the detailed structure of the model will not be described in detail here.
[0070] (2) Training process of the diffusion model for multi-view image generation
[0071] According to an embodiment of the present invention, the multi-view image generation diffusion model is trained and obtained in the following manner: a plurality of second line drafts and their corresponding second text descriptions, second camera parameters and images corresponding to each second line draft are obtained; a second image data set composed of images corresponding to all second line drafts is subjected to a stepwise noise addition process in a plurality of time steps in accordance with a Gaussian distribution to obtain a second noisy image data set at each time step, and the second text description, any second line draft and the image corresponding to the second line draft after adding noise in the second noisy image data set at any time step are used as a training sample, and all training samples constitute the second data set; an initial multi-view image generation diffusion model is constructed, wherein the initial multi-view image generation diffusion model comprises: a control network module for obtaining a second image data set based on the second text description, each second line draft and the second camera parameters corresponding to the second line draft; to the target fused attention features corresponding to each second line draft; a multi-view module, based on the second text description, the image corresponding to each second line draft after adding noise in the second noisy image data set at any time step, and the second camera parameters corresponding to the second line draft, obtain the intermediate features of the image corresponding to each second line draft after adding noise, and fuse the target fused attention features corresponding to each second line draft and the intermediate features of the image corresponding to each second line draft after adding noise to obtain the predicted noise on the image corresponding to each second line draft, and obtain the denoised image corresponding to each second line draft based on the predicted noise on the image corresponding to each second line draft; use the second data set to perform multiple rounds of iterative training on the initial multi-view image generation diffusion model until convergence, and update the parameters of the multi-view image generation diffusion model according to the second preset loss during each round of iterative training.
[0072] In addition, according to an embodiment of the present invention, the control network module includes multiple attention sub-modules, which are used to obtain the target fused attention features corresponding to each second line draft, wherein the last attention sub-module is used to obtain the target fused attention features corresponding to each second line draft, and the other attention sub-modules are used to obtain the intermediate fused attention features corresponding to each second line draft, and the output of the previous attention sub-module is used as the input of the next attention sub-module, and each attention sub-module includes: a residual sub-unit, which is used to perform feature extraction on each second line draft to obtain the residual features corresponding to each second line draft, or to process the intermediate fused attention features corresponding to each second line draft to obtain the residual features corresponding to each second line draft, wherein the input of the residual sub-unit in the first attention sub-module is each second line draft, the second camera parameters corresponding to the second line draft, and the second text description, and the input of the residual sub-units in the other attention sub-modules is the second camera parameters corresponding to each second line draft, the second line draft The corresponding intermediate fused attention features and the second text description; a three-dimensional self-attention sub-unit, which is used to divide the residual features corresponding to each second line draft into query features, key features and value features, and to splice the query features, key features and value features of all the second line drafts and obtain the attention features corresponding to all the second line drafts based on the splicing results, and divide the attention features corresponding to all the second line drafts according to the preset rules to obtain the attention features corresponding to each second line draft; a cross-attention sub-unit, which is used to fuse the residual features corresponding to each second line draft and the attention features corresponding to each second line draft to obtain the intermediate fused attention features corresponding to each second line draft or the target fused attention features corresponding to each second line draft, wherein the output of the cross-attention sub-unit in the last attention sub-module is the target fused attention features corresponding to each second line draft, and the output of the cross-attention sub-units in other attention sub-modules is the intermediate fused attention features corresponding to each second line draft. At the same time, according to one embodiment of the present invention, the second preset loss is:
[0073]
[0074] c″={c″1,c″2,...,C″ n}
[0075] S″={S″1,S″2,…,S″ n}
[0076] Wherein, x is the second noisy image data set at t time steps, c″ is the second camera parameter set consisting of the second camera parameters corresponding to n line drafts, S″ is the second line draft set consisting of n second line drafts, Indicates adding noise ∈″ to each image corresponding to the line draft in the second noisy image dataset based on the image set x, the second camera parameter set c″, the second line draft set S″, the second text description y″″, and the t time step t The expected value obtained, Indicates that y″、c″ i The predicted noise on the image corresponding to the i-th line draft obtained by the multi-view image generation diffusion model with input parameter ω and S″.
[0077] For example, the control network module of the above-mentioned multi-view image generation diffusion model is a ControlNet model, and the multi-view module is an MVDream model, and a three-dimensional self-attention sub-unit is designed in the ControlNet model, which connects the Q (i.e., query feature), K (i.e., key feature), and V (i.e., value feature) features of the sub-attention between different perspectives to achieve information interaction between multiple perspectives, and combines the ControlNet model and the MVDream model to form a new multi-view image generation diffusion model, and uses the training method in the above-mentioned embodiment for training to obtain the multi-view image generation diffusion model of the present invention. It should be noted that the control network module is a ControlNet model and the multi-view module is an MVDream model is only an example of the present invention, and both can adopt other diffusion models that meet the requirements, which are not specifically limited here.
[0078] From the above description, it can be seen that compared with the prior art in which the line drafts input into the pre-trained diffusion model are too sparse, the present invention uses the depth map as three-dimensional information to generate denser and more accurate line drafts, and inputs the generated line drafts together with the corresponding text descriptions into the pre-trained multi-view image generation diffusion model. At the same time, compared with the prior art in which the multi-modal information of the image and text description input into the pre-trained diffusion model is difficult to fuse in the model, the multi-view image generation diffusion model adopted by the present invention can fully fuse the multi-modal information of the line draft and text description input therein to obtain more representative characteristics. Therefore, the above-mentioned embodiments of the present invention can construct a high-quality three-dimensional model, thereby improving the realism of the three-dimensional model.
[0079] In order to further improve the realism of the 3D model, during the process of constructing the 3D model, the present application continuously adds different constraints to improve the accuracy of the geometric shape of the 3D model and the clarity of the texture information, thereby improving the realism of the constructed 3D model. The added constraints are described in detail below.
[0080] (1) Contour constraint
[0081] In the process of constructing a three-dimensional model, an embodiment of the present invention improves the realism of the three-dimensional model by improving the correspondence between the constructed three-dimensional model and the original line draft, that is, adding contour loss based on the perspective of the original line draft to constrain the geometric shape of the three-dimensional model, improving the correspondence between the constructed three-dimensional model and the original line draft so that the geometric shape of the constructed three-dimensional model is more accurate, thereby improving the realism of the constructed three-dimensional model. According to one embodiment of the present invention, the method further includes: in the step S1, background subtraction is performed on the original line draft to obtain the original line draft with the background removed; in the step S4, the neural radiation field obtains a black-and-white image of the original line draft perspective based on the camera parameters of the original line draft perspective; in the step S5, the preset total loss also includes the contour loss between the original line draft with the background removed and the black-and-white image of the original line draft perspective. Wherein, the preset total loss is:
[0082]
[0083] Among them, γ1, γ2, are all preset hyperparameters, L SDS is the reconstruction loss, L sil is the contour loss. In addition, the reconstruction loss and contour loss are respectively:
[0084]
[0085]
[0086] Among them, c is a camera parameter set consisting of camera parameters of n perspectives, It means adding noise ∈ to the two-dimensional rendered images of n perspectives in the noised image dataset based on the camera parameter set c and t time step t The expected value, x i represents a 2D rendered image of the i-th view of the neural radiance field output, represents the denoised 2D rendered image of the i-th view output by the multi-view image generation diffusion model, M S represents the original line drawing with the background removed, R S Black and white image representing the original line drawing perspective of the neural radiation field output.
[0087] (2) Regularization constraints
[0088] In the process of constructing a three-dimensional model, an embodiment of the present invention improves the realism of the three-dimensional model by improving the lighting response, geometric smoothness and overall rendering quality of the surface of the constructed three-dimensional model, that is, the present invention adds a regularization loss to optimize the lighting response, geometric smoothness and overall rendering quality of the surface of the three-dimensional model, thereby improving the realism of the constructed three-dimensional model. According to one embodiment of the present invention, the method also includes: in the step S4, the neural radiation field obtains a light set, the direction of each light ray in the light set, the weight of each preset sampling point on each light ray, and the normal vector of each preset sampling point based on the camera parameters of all viewing angles; in the step S5, the preset total loss also includes a regularization loss obtained based on the light set, the direction of each light ray in the light set, the weight of each preset sampling point on each light ray, and the normal vector of each preset sampling point. Wherein, the preset total loss is:
[0089]
[0090] Among them, γ3 is the preset hyperparameter, L orient is the regularization loss. In addition, the regularization loss is:
[0091]
[0092] Where R is the set of rays, Represents the weight of the jth preset sampling point on the rth ray in the ray set, represents the normal vector of the jth preset sampling point, Represents the direction of the rth light ray.
[0093] (3) Interval Constraint
[0094] In the process of constructing a three-dimensional model, an embodiment of the present invention improves the realism of the constructed three-dimensional model by improving the details of the constructed three-dimensional model, that is, using the interval loss between the denoising results of the interval intervals to further constrain the details of the three-dimensional model. According to an embodiment of the present invention, the method also includes: in the step S4, the constructed initial training model also includes a text-to-image diffusion model, wherein the text-to-image diffusion model obtains the predicted noise on the two-dimensional rendered image of each perspective in the noisy image dataset at each time step based on the two-dimensional rendered image and text description after adding noise in the noisy image dataset at any two time steps.
[0095] The preset total loss may be any one of the following losses:
[0096]
[0097] Among them, γ4 is the preset hyperparameter, LISM is the interval loss. For example, the preset total loss can also be: Etc. In addition, the interval loss is:
[0098]
[0099] ∈={∈ t ,∈ p}
[0100] Where,∈ is the noise∈ t ,∈ p The noise set E t,p,c,∈ represents the expected value based on the camera parameter set c and the noise set ∈, Indicates adding noise ∈ to the noisy image dataset at time step t t The 2D rendered image of the i-th perspective after y is the text description. Indicates that The predicted noise on the 2D rendered image of the i-th perspective in the noisy image dataset at time step t obtained by the text-to-image diffusion model with input parameter α, Indicates adding noise ∈ to the noisy image dataset at p time steps p The 2D rendered image of the ith perspective after Indicates that The predicted noise on the 2D rendered image of the i-th perspective in the noisy image dataset at p time steps obtained by the text-to-image diffusion model with input parameter α. According to one embodiment of the present invention, p = t-δ T , for example T =50. It should be noted that the text description at p time steps can use an empty text description, which is the approximate result of the text description after a relatively complex mathematical derivation. T =50 is only an example of the present invention, and the specific value is not limited. At the same time, the preset total loss used in the process of building a three-dimensional model in the present invention can be selected according to factors such as task requirements, data characteristics, experimental evaluation, and computing resources, and is not specifically limited here.
[0101] like Figure 2 As shown in the figure, it shows a schematic diagram of a scheme for constructing a three-dimensional model of an owl according to an embodiment of the present invention. Figure 2 The following is a summary of the scheme for constructing a three-dimensional model using an embodiment of the present invention. Figure 2 As can be seen in (a), we first obtain the text description y corresponding to the owl 3D model, the owl original line drawing S, and the camera parameters {c S, c1, c2, c3, c4}, and use the depth map generation model (i.e., the diffusion model in the figure) to obtain the original line drawing depth map D of the owl based on S and y. S , based on S, D s 、c s , c1 gets the new line drawing S1 corresponding to c1, and further gets the new line drawings corresponding to other c2, c3, and c4 Secondly, {c s , c1, c2, c3, c4} input neural radiation field to obtain {x s , x1, x2, x3, x4}, and add noise ∈ t After {c S , c1, c2, c3, c4}, y input multi-view image generation diffusion model in the multi-view module (such as MVDream model), {c S , c1, c2, c3, c4}, y input control network module (such as ControlNet model), where, Figure 2 ResBlock in (a) is the residual subunit, 3DSelfAttention is the three-dimensional self-attention subunit, and CrossAttention is the cross-attention subunit. The denoised image is obtained by generating a diffusion model through multi-view images. from Figure 2 As can be seen in (b), the present invention reconstructs the loss L SDS (Right now Figure 2 L in (b) 3D-SDS ), interval loss L ISM (Right now Figure 2 L in (b) 2D-ISM ), contour loss L sil etc. constitute a total loss to update the parameters of the neural radiation field and use the converged neural radiation field as a three-dimensional model.
[0102] The following is a detailed description of the scheme for constructing a three-dimensional model of the present invention from the system side. According to one embodiment of the present invention, the present invention proposes a system for constructing a three-dimensional model, the system comprising: a data acquisition module, for obtaining a text description, an original line draft, and camera parameters of multiple perspectives obtained based on the original line draft corresponding to the target three-dimensional model, wherein the camera parameters of multiple perspectives include the camera parameters of the original line draft perspective and the camera parameters of multiple other perspectives; a line draft generation module, for using a depth map generation model to obtain an original line draft depth map corresponding to the original line draft based on the text description and the original line draft, and based on the original line draft, the original line draft depth map, the camera parameters of the original line draft perspective and the camera parameters of each other perspective, obtain a new line draft corresponding to the camera parameters of the other perspective, and construct a line draft pool based on the original line draft and all new line drafts; a data set construction module, for taking the text description, any line draft in the line draft pool and the camera parameters corresponding to the line draft as a training sample, and all training samples constitute a data set; a model construction module, for constructing an initial training model, the initial training model includes a neural radiation field, a multi-perspective An image generation diffusion model, wherein the neural radiation field obtains a two-dimensional rendered image of each perspective based on the camera parameters of the perspective in the data set, and the original data set composed of the two-dimensional rendered images of all perspectives is subjected to step-by-step denoising processing in multiple time steps in accordance with the Gaussian distribution to obtain a noisy image data set at each time step, and the multi-perspective image generation diffusion model reconstructs the denoised two-dimensional rendered image of each perspective based on the two-dimensional rendered image of each perspective after adding noise in the noisy image data set at any time step, the camera parameters of the perspective, the line drawing corresponding to the perspective, and the text description; a model training module is used to use the data set to perform multiple iterative training on the initial training model until convergence and use the converged neural radiation field as a three-dimensional model, and in each iterative training process, update the parameters of the neural radiation field according to a preset total loss, wherein the preset total loss includes the reconstruction loss between the two-dimensional rendered image of each perspective obtained by the neural radiation field and the denoised two-dimensional rendered image of each perspective obtained by the multi-perspective image generation diffusion model.
[0103] In order to verify that the above embodiment of the present invention can be used to construct a high-quality three-dimensional model, the inventors conducted a series of related experiments, and the exemplary experimental results are as follows:
[0104] like Figure 3 As shown, it shows a schematic diagram of the multi-view image generation effect obtained by the multi-view image generation diffusion model according to an embodiment of the present invention based on text and line drawings, wherein: Figure 3 (a) shows the input line drawing image, and the input text description is above the image; Figure 3 (b) shows the image generation from the line drawing perspective and other perspectives. Figure 3It can be seen that the multi-view image generation diffusion model trained by the above embodiment of the present invention can generate highly realistic images with good three-dimensional consistency, further improving the realism of the constructed three-dimensional model.
[0105] like Figure 4 As shown, it shows a schematic diagram of texture control effect based on text description according to an embodiment of the present invention, wherein: Figure 4 (a) shows the input line drawing image. Figure 4 (b) and Figure 4 (c) shows the generation effect of 3D models under different text descriptions, and the input text description is above the image. Figure 4 It can be seen that the line draft controls the geometric features of the objects in the 3D model, such as the shape and component relationship, while the text description controls the appearance features of the objects in the 3D model, such as the texture and material.
[0106] like Figure 5 As shown, it shows a schematic diagram of the effect of generating a three-dimensional model based on text description and line drawing according to an embodiment of the present invention, wherein: Figure 5 The results of the three-dimensional model generated by the three-dimensional model construction solution of the above embodiment of the present invention under different line drawings and different text descriptions are respectively shown in the figure. The results include the results from the line drawing perspective and the results from the other two perspectives. Figure 5 It can be seen that a three-dimensional model with fine geometric details and highly realistic texture information can be obtained based on line drawings and text.
[0107] like Figure 6 As shown, it shows a schematic diagram comparing the results of the three-dimensional model construction method of the embodiment of the present invention and the prior art. Figure 6 It can be seen that the existing 3D model construction methods (i.e. Magic123, DreamCraft3D, ImageDream in the figure) are relatively realistic in the line draft perspective, but the results of other perspectives (i.e. the side and back of the object, etc.) are obviously blurred and have geometric errors. The 3D model constructed by the 3D model construction method of the above embodiment of the present invention (i.e. Ours in the figure) has a higher sense of reality in all perspectives.
[0108] In summary, compared with the prior art in which the line drawings input into the pre-trained diffusion model are too sparse, the present invention uses depth maps as three-dimensional information to generate denser and more accurate line drawings, and uses multi-view images to generate a diffusion model that can fully fuse the multimodal information of the line drawings and texts input therein to obtain more representative characteristics. Therefore, the three-dimensional model construction scheme of the present invention can construct a high-quality three-dimensional model. At the same time, in the process of constructing the three-dimensional model, the present invention continuously adds different constraints to continuously optimize the accuracy of the geometric shape of the three-dimensional model, the clarity of the texture information, the surface lighting response, the geometric smoothness and the overall rendering quality, thereby further improving the quality of the three-dimensional model and obtaining a more realistic three-dimensional model.
[0109] To this end, according to the three-dimensional model constructed by the above embodiment of the present invention, the present invention proposes an image rendering method, the method comprising: obtaining camera parameters of any one or more viewing angles; using the three-dimensional model constructed by the method described in the above embodiment to obtain a two-dimensional rendered image corresponding to each viewing angle based on the camera parameters of any one or more viewing angles. It can be seen that by using the three-dimensional model of the above embodiment of the present invention, a high-quality rendered image can be obtained.
[0110] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0111] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0112] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0113] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for constructing a three-dimensional model, characterized in that: The method comprises: Step S1, obtaining a text description corresponding to the target three-dimensional model, an original line draft, and camera parameters of multiple viewing angles obtained based on the original line draft, wherein the camera parameters of the multiple viewing angles include camera parameters of the original line draft viewing angle and camera parameters of multiple other viewing angles; Step S2: using the depth map generation model to obtain an original line draft depth map corresponding to the original line draft based on the text description and the original line draft, and obtaining a new line draft corresponding to the camera parameters of the other viewpoints based on the original line draft, the original line draft depth map, the camera parameters of the original line draft viewpoint, and the camera parameters of each other viewpoint, and constructing a line draft pool based on the original line draft and all the new line drafts; Step S3: taking the text description, any line drawing in the line drawing pool, and the camera parameters corresponding to the line drawing as a training sample, and all the training samples constitute a data set; Step S4, constructing an initial training model, wherein the initial training model includes a neural radiation field and a multi-view image generation diffusion model, wherein the neural radiation field obtains a two-dimensional rendered image of each view based on the camera parameters of each view in the data set, and performs a stepwise noise addition process in multiple time steps conforming to a Gaussian distribution on the image data set consisting of the two-dimensional rendered images of all view points to obtain a noisy image data set at each time step, and the multi-view image generation diffusion model reconstructs the denoised two-dimensional rendered image of each view point based on the two-dimensional rendered image of each view point after adding noise in the noisy image data set at any time step, the camera parameters of the view point, the line drawing corresponding to the view point, and the text description; Step S5, using the data set to perform multiple iterative training on the initial training model until convergence and use the converged neural radiation field as a three-dimensional model, and in each iterative training process, update the parameters of the neural radiation field according to a preset total loss, wherein the preset total loss includes the reconstruction loss between the two-dimensional rendered image of each perspective obtained by the neural radiation field and the denoised two-dimensional rendered image of each perspective obtained by the multi-perspective image generation diffusion model.
2. The method according to claim 1, characterized in that The method further comprises: In the step S1, background removal is performed on the original line drawing to obtain the original line drawing with the background removed; In the step S4, the neural radiation field obtains a black and white image of the original line drawing perspective based on the camera parameters of the original line drawing perspective; In the step S5, the preset total loss also includes a contour loss between the original line drawing with the background removed and the black-and-white image of the original line drawing perspective.
3. The method according to claim 2, characterized in that The method further comprises: In step S4, the neural radiation field obtains a light set, a direction of each light in the light set, a weight of each preset sampling point on each light, and a normal vector of each preset sampling point based on camera parameters of all viewing angles; In step S5, the preset total loss also includes a regularization loss obtained based on the light set, the direction of each light in the light set, the weight of each preset sampling point on each light, and the normal vector of each preset sampling point.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: In the step S4, the constructed initial training model also includes a text-to-image diffusion model, wherein the text-to-image diffusion model obtains the predicted noise on the two-dimensional rendered image of each perspective in the noisy image dataset at each time step based on the two-dimensional rendered image and text description at each time after adding noise in the noisy image dataset at any two time steps; In step S5, the preset total loss also includes the interval loss between the predicted noises on the two-dimensional rendered image of each viewing angle in the noisy image dataset at two time steps.
5. The method according to claim 1, characterized in that In step S2, each new line draft is obtained in the following manner: S i =Warp(S,D S ,c S ,c i ) Where Warp(·) is the image deformation function, S is the original line drawing, and D S represents the original line drawing depth map, c S The camera parameters representing the original line drawing’s viewing angle, c i Represents the camera parameters of the i-th other view.
6. The method according to claim 4, characterized in that The preset total loss is: Among them, γ1, γ2, γ3 and γ4 are all preset hyperparameters, L SDS is the reconstruction loss, L sil is the contour loss, L orient is the regularization loss, L ISM is the interval loss.
7. The method according to claim 6, characterized in that The reconstruction loss is: Among them, c is a camera parameter set consisting of camera parameters of n perspectives, It means adding noise ∈ to the two-dimensional rendered images of n perspectives in the noised image dataset based on the camera parameter set c and t time step t The expected value, x i represents a 2D rendered image of the i-th view of the neural radiance field output, represents the denoised 2D rendered image of the i-th perspective output by the multi-view image generation diffusion model; The contour loss is: Among them, M S represents the original line drawing with the background removed, R S Black and white image representing the original line drawing perspective of the neural radiation field output; The regularization loss is: Where R is the set of rays, Represents the weight of the jth preset sampling point on the rth ray in the ray set, represents the normal vector of the jth preset sampling point, Represents the direction of the rth light ray. The interval loss is: ∈={∈ t ,∈ p} Where,∈ is the noise∈ t ,∈ p The noise set E t,p,c,∈ represents the expected value based on the camera parameter set c and the noise set ∈, Indicates adding noise ∈ to the noisy image dataset at time step t t The 2D rendered image of the i-th perspective after y is the text description. Indicates that The predicted noise on the 2D rendered image of the i-th perspective in the noisy image dataset at time step t obtained by the text-to-image diffusion model with input parameter α, Indicates adding noise ∈ to the noisy image dataset at p time steps p The 2D rendered image of the i-th perspective after Indicates that and y are the predicted noise on the 2D rendered image of the i-th view in the noisy image dataset at p time steps obtained by the text-to-image diffusion model with input parameter α.
8. The method according to claim 1, characterized in that: In step S2, the depth map generation model is trained in the following manner: Obtaining a plurality of first line drafts, a text description corresponding to each first line draft, and a real depth map corresponding to each first line draft; A depth map dataset constructed from real depth maps corresponding to all first line drafts is subjected to a stepwise noise addition process in multiple time steps conforming to a Gaussian distribution to obtain a noisy depth map dataset at each time step, and any first line draft, a text description corresponding to the first line draft, and a real depth map corresponding to the first line draft after noise is added in the noisy depth map dataset at any time step are taken as a training sample, and all training samples constitute a first dataset; The depth map generation model is trained for multiple rounds of iterations using the first data set until convergence, and the parameters of the depth map generation model are updated according to the first preset loss during each round of iterative training.
9. The method according to claim 8, characterized in that The first preset loss is: Y={y1,y2,…,y n } S′={S′1,S′2,…,S′ n } Where D is the noisy depth map dataset at t time steps, Y is the text description set consisting of the text descriptions corresponding to n first line drafts, S′ is the first line draft set consisting of n first line drafts, It means adding noise ∈′ to the depth maps corresponding to the n first line drafts in the noisy image dataset D, the text description set Y, the line draft set S′, and the noisy image dataset at time step t. t The expected value obtained, Show y i and S′ i The predicted noise on the depth map corresponding to the i-th first line draft obtained by the depth map generation model with input parameter θ.
10. The method according to claim 1, characterized in that In step S4, the multi-view image generation diffusion model is trained and obtained in the following manner: Acquire multiple second line drafts and their corresponding second text descriptions, and second camera parameters and images corresponding to each second line draft; Performing a stepwise noise adding process in multiple time steps conforming to Gaussian distribution on the second image data set composed of images corresponding to all the second line drafts to obtain a second noisy image data set at each time step, and taking the second text description, any second line draft, and the image corresponding to the second line draft after noise is added in the second noisy image data set at any time step as a training sample, and all the training samples constitute the second data set; Constructing an initial multi-view image generation diffusion model, wherein the initial multi-view image generation diffusion model includes: A control network module is used to obtain a target fusion attention feature corresponding to each second line draft based on the second text description, each second line draft, and a second camera parameter corresponding to the second line draft; a multi-view module, which obtains intermediate features of the image corresponding to each second line draft after adding noise based on the second text description, the image corresponding to each second line draft after adding noise in the second noisy image data set at any time step, and the second camera parameters corresponding to the second line draft, and fuses the target fused attention features corresponding to each second line draft with the intermediate features of the image corresponding to each second line draft after adding noise to obtain the predicted noise on the image corresponding to each second line draft, and obtains the denoised image corresponding to each second line draft based on the predicted noise on the image corresponding to each second line draft; The initial multi-view image generation diffusion model is trained for multiple rounds of iterations using the second data set until convergence, and the parameters of the multi-view image generation diffusion model are updated according to the second preset loss during each round of iterative training.
11. The method according to claim 10, characterized in that The control network module includes multiple attention submodules, which are used to obtain the target fused attention features corresponding to each second line draft, wherein the last attention submodule is used to obtain the target fused attention features corresponding to each second line draft, and the other attention submodules are used to obtain the intermediate fused attention features corresponding to each second line draft. The output of the previous attention submodule is used as the input of the next attention submodule, and each attention submodule includes: A residual sub-unit, used to perform feature extraction on each second line draft to obtain a residual feature corresponding to each second line draft, or to process the intermediate fused attention features corresponding to each second line draft to obtain a residual feature corresponding to each second line draft, wherein the input of the residual sub-unit in the first attention sub-module is each second line draft, the second camera parameter corresponding to the second line draft, and the second text description, and the input of the residual sub-unit in other attention sub-modules is the second camera parameter corresponding to each second line draft, the intermediate fused attention feature corresponding to the second line draft, and the second text description; a three-dimensional self-attention subunit, used to divide the residual features corresponding to each second line draft into query features, key features and value features, respectively, and to concatenate the query features, key features and value features of all the second line drafts and obtain the attention features corresponding to all the second line drafts based on the concatenated results, and to divide the attention features corresponding to all the second line drafts according to a preset rule to obtain the attention features corresponding to each second line draft; The cross-attention sub-unit is used to fuse the residual features corresponding to each second line draft and the attention features corresponding to each second line draft to obtain the intermediate fused attention features corresponding to each second line draft or the target fused attention features corresponding to each second line draft, wherein the output of the cross-attention sub-unit in the last attention sub-module is the target fused attention features corresponding to each second line draft, and the output of the cross-attention sub-units in other attention sub-modules is the intermediate fused attention features corresponding to each second line draft.
12. The method according to claim 10, characterized in that The second preset loss is: c″={{c″1,c″2,…,c″ n }} S″={″S1,S″2,…,S″ n } Wherein, x is the second noisy image data set at t time steps, c″ is the second camera parameter set consisting of the second camera parameters corresponding to n line drafts, S″ is the second line draft set consisting of n second line drafts, Indicates adding noise ∈″ to the image corresponding to each line draft in the second noisy image dataset based on the image set x, the second camera parameter set c″, the second line draft set S″, the second text description y″, and the t time step t The expected value obtained, Indicates that y″、c″ i The predicted noise on the image corresponding to the i-th line draft obtained by the multi-view image generation diffusion model with input parameter ω and S″.
13. A three-dimensional model construction system based on the method according to any one of claims 1 to 12, characterized in that: The system comprises: A data acquisition module, used to acquire a text description corresponding to the target three-dimensional model, an original line draft, and camera parameters of multiple viewing angles obtained based on the original line draft, wherein the camera parameters of the multiple viewing angles include camera parameters of the original line draft viewing angle and camera parameters of multiple other viewing angles; A line draft generation module, for obtaining an original line draft depth map corresponding to the original line draft based on the text description and the original line draft using a depth map generation model, and obtaining a new line draft corresponding to the camera parameters of the other viewpoints based on the original line draft, the original line draft depth map, the camera parameters of the original line draft viewpoint, and the camera parameters of each other viewpoint, and building a line draft pool based on the original line draft and all the new line drafts; The dataset construction module is used to take the text description, any line drawing in the line drawing pool and the camera parameters corresponding to the line drawing as a training sample, and all training samples constitute the dataset; A model building module is used to build an initial training model, wherein the initial training model includes a neural radiation field and a multi-view image generation diffusion model, wherein the neural radiation field obtains a two-dimensional rendered image of each view based on the camera parameters of each view in the data set, and the original data set consisting of the two-dimensional rendered images of all views is subjected to stepwise noise addition processing in multiple time steps conforming to the Gaussian distribution to obtain a noisy image data set at each time step, and the multi-view image generation diffusion model reconstructs the denoised two-dimensional rendered image of each view based on the two-dimensional rendered image of each view after adding noise in the noisy image data set at any time step, the camera parameters of the view, the line drawing corresponding to the view, and the text description; A model training module is used to use the data set to perform multiple iterative training on the initial training model until convergence and use the converged neural radiation field as a three-dimensional model, and in each iterative training process, update the parameters of the neural radiation field according to a preset total loss, wherein the preset total loss includes the reconstruction loss between the two-dimensional rendered image of each perspective obtained by the neural radiation field and the denoised two-dimensional rendered image of each perspective obtained by the multi-perspective image generation diffusion model.
14. An image rendering method, characterized in that: The method comprises: Get the camera parameters of any one or more viewing angles; The three-dimensional model constructed by the method described in any one of claims 1 to 13 obtains a two-dimensional rendering image corresponding to each perspective based on the camera parameters of any one or more perspectives.
15. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of any method described in claims 1-12 and 14.
16. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the steps of any method as claimed in claims 1-12, 14.
Citation Information
Cited By
Three-dimensional model data processing method and system, product, equipment and medium
CN118887348A
Three-dimensional modeling method and device based on multi-source heterogeneous data
CN119202904A
Extreme rainstorm weather rendering method based on generative artificial intelligence
CN119206016A
A method for rendering extreme rainstorm weather based on generative artificial intelligence
CN119206016B
Combined three-dimensional object generation method oriented to product concept innovation design
CN119229058A
