Three-dimensional model generation method, system and equipment based on text driving and medium
Diffusion in low-dimensional latent space through hash coding and improved diffusion models, combined with LSTM and CNN, optimizes 3D model generation, solves the problems of low model accuracy and long time consumption in the existing technology, and achieves efficient and creative 3D Model generation.
Patent Information
- Application Number
- CN202410736661.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-11
AI Technical Summary
When the existing technology generates a three-dimensional model, the model accuracy is too low and the process takes too long. The generation accuracy of non-deep learning methods is insufficient, and the deep learning methods have a large amount of calculation and are difficult to run in real time.
Use hash coding technology to optimize image generation, improve the diffusion model to perform the diffusion process in low-dimensional latent space, combine LSTM and CNN to build image and point cloud generation models, optimize the sampling process and point cloud meshing through hash coding, and improve image generation efficiency and quality.
It significantly improves the accuracy and realism of 3D model generation, reduces the amount of calculation and storage, and improves the efficiency and creativity of image generation.
Smart Images

Figure CN118762142A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a text-driven three-dimensional model generation method, a text-driven three-dimensional model generation system, an electronic device, and a computer-readable storage medium. Background Art
[0002] Traditionally, creating 3D models requires manual modeling by professionals or the use of specific software tools. However, with the development of technology, the demand for automatically generating 3D models has gradually increased. In order to simplify the creation process of 3D models and improve the accessibility and efficiency of models, early attempts were made to use non-deep learning graphics processing to first manually create 3D models, then use libraries for data storage, and then match text with 3D models. The corresponding model can be called by entering text. Most of the current popular technologies use deep learning combined with semantic and geometric information, use diffusion models to identify text information, and connect to the corresponding model conversion module to achieve the purpose of directly driving the generation of 3D models with text.
[0003] However, for the current creation of three-dimensional models, non-deep learning methods are limited by generation accuracy and cannot be implemented in real time, so they are rarely used; and the existing deep learning-based methods have large computational complexity and require large computing resources. At the same time, they are very challenging to run in real time, and their use is also limited. In addition, the generated model accuracy is too low and the process takes too long. Summary of the invention
[0004] In order to at least solve the problems in the prior art of generating a three-dimensional model from text, the generated model has low accuracy and the process takes too long, the present invention provides a text-driven three-dimensional model generation method, a text-driven three-dimensional model generation system, an electronic device and a computer-readable storage medium, which use hash coding technology to improve the image generation speed; and improve the image quality and realism by improving the diffusion model.
[0005] In a first aspect, the present disclosure provides a text-driven 3D model generation method, the method comprising:
[0006] Extract text information from the text;
[0007] The extracted text information is input into a pre-trained image generation model for image generation. The image generation model adopts an improved diffusion model to perform a diffusion process in a low-dimensional latent space to reduce training and reasoning costs.
[0008] Inferring the generated image using a trained point cloud generation model to generate a corresponding point cloud, wherein the point cloud generation model uses hash coding to optimize the sampling process during training and inference;
[0009] The point cloud is meshed to obtain a three-dimensional model.
[0010] Furthermore, the method further comprises:
[0011] Use LSTM (Long Short-Term Memory) to build an image generation model;
[0012] Obtain an image generation training set, use the preprocessed text data in the training set as input and the image data as the target output to train the image generation model. During the training process, compare the corresponding image generated by the image generation model based on the input text with the target image in the training set to calculate the loss, and update the model weights through the back-propagation algorithm.
[0013] Furthermore, the method further comprises:
[0014] Preprocess the training set images containing images and corresponding point cloud data;
[0015] Select GAN (Generative Adversarial Networks) based on CNN (Convolutional Neural Networks), and build a point cloud generation model by defining the network structure and loss function;
[0016] The cloud generation model is trained using the preprocessed training set images, including taking the images as input to generate point cloud data, and comparing the generated point cloud data with the corresponding point cloud data to optimize the model parameters.
[0017] Furthermore, the step of meshing the point cloud to obtain a three-dimensional model includes:
[0018] Data cleaning and preprocessing: Clean and preprocess point cloud data, including removing outliers, filling missing data or reducing noise;
[0019] Point cloud triangulation: By using the triangulation algorithm to connect the points in the point cloud into triangular patches, a continuous and non-overlapping triangular mesh is generated;
[0020] Surface reconstruction: Use surface reconstruction algorithms to estimate the continuity of point cloud surfaces and generate smoother and more accurate meshes;
[0021] Mesh optimization: Apply mesh optimization algorithms to improve the quality and topology of the mesh;
[0022] Post-processing and optimization: Post-process and optimize the generated mesh that meets the requirements, including smoothing the mesh surface, removing unnecessary details, optimizing the mesh topology, or applying texture mapping.
[0023] Furthermore, the sampling process using hash coding optimization includes:
[0024] During the sampling process, the original position encoding is changed to hashencoding, so that the changed neural network obtains trainable encoding parameters θ in addition to the trainable weight parameters Φ. The encoding parameters θ have a total of L resolution levels, each level contains T feature vectors F with dimensions, each level is independent of each other, and conceptually stores the feature vectors at the vertices of the grid, and its resolution is selected as a geometric series between the coarsest and finest resolutions.
[0025] Furthermore, the diffusion process in the low-dimensional latent space reduces the training and reasoning costs, including:
[0026] Based on the initial diffusion model, VAE (Variational Auto-Encoder) is used to convert the image into a low-dimensional representation, so that the diffusion process is carried out in the low-dimensional representation. After the diffusion is completed, it is decoded into a picture through the VAE decoder;
[0027] The improved diffusion model uses the U-Net network as the backbone network to predict noise, thereby realizing the reverse denoising process, and uses the text encoder CLIP (Contrastive Language-Image Pre-Training) to convert the text into a representation form that can be understood by U-Net, thereby guiding U-Net to diffuse.
[0028] Furthermore, the method further comprises:
[0029] We propose a method to search for the best sequence of time steps and compress the model architecture to achieve efficient image generation for the improved diffusion model.
[0030] The method of searching for the best sequence of time steps and compressed model architecture includes:
[0031] Design a unified search space covering all possible time steps and various architectures;
[0032] A two-stage evolutionary algorithm is introduced to find the best solution in the designed search space;
[0033] The performance of sampled examples is estimated using the FID (Fréchet Inception Distance) score between generated and real samples.
[0034] In a second aspect, the present disclosure provides a text-driven three-dimensional model generation system, the system comprising:
[0035] A text processing module configured to extract text information from the text;
[0036] A first generation module is configured to input the extracted text information into a pre-trained image generation model for image generation, wherein the image generation model adopts an improved diffusion model to perform a diffusion process in a low-dimensional latent space to reduce training and reasoning costs;
[0037] A second generation module is configured to use a trained point cloud generation model to infer the generated image to generate a corresponding point cloud, wherein the point cloud generation model uses hash coding to optimize the sampling process during training and inference;
[0038] The third generation module is configured to mesh the point cloud to obtain a three-dimensional model.
[0039] In a third aspect, the present disclosure provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the text-driven three-dimensional model generation method as described in any one of the first aspects.
[0040] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the text-driven three-dimensional model generation method described in any one of the first aspects above is implemented.
[0041] Beneficial effects:
[0042] The text-driven 3D model generation method, text-driven 3D model generation system, electronic device and storage medium provided by the present disclosure, on the one hand, use hash coding to optimize the sampling process of Nerf, accelerate the process of scene reconstruction and image generation; on the other hand, during the training process, use the improved diffusion model to perform the diffusion process in the potential space of lower dimensions, reduce the amount of calculation and storage for image generation, and improve the efficiency of image generation. And the two improvement strategies are independent of each other and gradually progress in logic, not only using hash coding to improve the accuracy and realism of scene reconstruction, but also improving the quality and fidelity of image generation. And use the improved diffusion model to improve the quality and diversity of image generation, and improve the creativity and flexibility of image generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flowchart of a text-driven 3D model generation method provided in Embodiment 1 of the present disclosure;
[0044] Figure 2 A schematic diagram of different levels of trainable encoding parameters in a hash coding optimization sampling process provided by an embodiment of the present disclosure;
[0045] Figure 3 A schematic diagram of an improved model-guided sampling process provided by an embodiment of the present disclosure;
[0046] Figure 4 A schematic diagram of an improved model diffusion process provided by an embodiment of the present disclosure;
[0047] Figure 5 A structural diagram of a text-driven three-dimensional model generation system provided in Embodiment 2 of the present disclosure;
[0048] Figure 6 This is an architecture diagram of an electronic device provided in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the present disclosure is further described in detail below in conjunction with the drawings and embodiments. It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention, rather than to limit the present invention.
[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence; and, in the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be arbitrarily combined with each other.
[0051] The terms used in the embodiments of the present disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. The singular forms of "a", "said" and "the" used in the embodiments of the present disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings.
[0052] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present disclosure, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0053] The technical terms and corresponding technical descriptions of the components mentioned in the embodiments of the present disclosure are as follows:
[0054] 1) Nerf (Neural radiance field) technology
[0055] ①Overview: Nerf is a neural network-based method for recovering the 3D shape and appearance of an object from multiple 2D images. This method combines the light propagation model and deep learning technology to generate high-quality realistic 3D reconstruction results. Compared with traditional geometry- or point cloud-based methods, it can better capture the texture and subtle changes of the object surface and provide a more realistic appearance.
[0056] ② Principle: Traditional 3D reconstruction methods have a great impact on the quality of generation due to errors in feature extraction and feature matching. Nerf uses a neural network to train input images and camera parameters to learn the radiation intensity of each point in the scene. By sampling and predicting the scene from a new perspective, high-quality 3D reconstruction results can be generated.
[0057] ③Existing technology: The existing technology is mainly completed by some mapping software. The existing mainstream normal mapping software includes Sprite Illuminator, Sprite Lamp, Photo Shop, Crazy Bump, Normal Map Online, etc., which use normal textures to increase the lighting details of the model surface.
[0058] 2) Text-to-image algorithm
[0059] ①Overview: The text-to-image algorithm is a method that uses machine learning and deep learning techniques to convert text descriptions into images. It can generate images that match the description content based on a given text description.
[0060] ② Principle: The generator network is a deep neural network that accepts a text description as input and tries to generate an image that matches the description. The structure of the generator network can be a convolutional neural network CNN or a recurrent neural network RNN, and its output is an image.
[0061] The discriminator network is also a deep neural network whose goal is to distinguish between images generated by the generator network and real images. The discriminator network accepts two types of input: real images and images generated by the generator network, and outputs a probability value representing the probability that the input image is a real image.
[0062] During the training process, the generator network and the discriminator network compete and collaborate with each other. First, given a text description, the generator network generates an image and passes it to the discriminator network for evaluation. The discriminator network gives corresponding judgment results based on the generated image and the real image. The generator network adjusts its own parameters based on the evaluation results of the discriminator network to make the generated image closer to the real image. At the same time, the discriminator network will also update its own parameters based on the performance of the generator network to better distinguish the generated image from the real image.
[0063] ③ Existing technologies: Existing technologies are mainly completed by some model conversion algorithms and related software. The existing mainstream model conversion methods include a variety of text-to-image technologies, some of which include:
[0064] Generative Adversarial Networks (GANs): Generative Adversarial Networks are a commonly used technique for generating images from text. It consists of two neural networks, a generator network and a discriminator network. The generator network is responsible for generating images based on the input text, while the discriminator network tries to distinguish the difference between the generated images and real images. By repeatedly training these two networks, GANs are able to generate realistic images.
[0065] Transformer models: Transformer models, such as the Transformer model using self-attention mechanism, have been widely used in natural language processing tasks such as machine translation and text summarization. These models can be extended to the field of text-to-image generation by taking a text description as input and converting it into a corresponding image representation.
[0066] Convolutional Neural Networks (CNNs): Convolutional neural networks are widely used in computer vision, but can also be used to generate images from text. By encoding a text description into a vector representation and passing it as input to a convolutional neural network, an image matching the description can be generated. This approach usually requires a pre-trained image feature extractor to assist the generation process.
[0067] Rule-based methods: In addition to neural network models, rule-based methods can also be used to generate images. These methods use predefined rules and templates to map key information in the text description to corresponding image components and attributes. Although this approach is less flexible, it may still be effective in certain specific tasks and domains.
[0068] 3) Diffusion model
[0069] ①Overview: Diffusion models are generative models, which means that they are used to generate data that is similar to the training data. Fundamentally, diffusion models work by corrupting the training data by continuously adding Gaussian noise, and then recovering the data by learning to invert this noise process. After training, we can use the diffusion model to generate data by simply passing randomly sampled noise through the learned denoising process.
[0070] ② Principle: Diffusion process (gradually noise-free data (usually images)):
[0071] When the noise level is low enough, the sampling chain transitions in the forward process can be set to conditional Gaussian, and combined with Markov to obtain a simple parameterization of the forward process:
[0072]
[0073] Back diffusion process (converting noise from the target distribution back into samples)
[0074] Based on the Markov assumption, starting from pure Gaussian noise, the model learns the joint distribution as:
[0075]
[0076] train
[0077] The diffusion model is trained by finding an inverse Markov transformation that maximizes the likelihood of the training data. Training is equivalent to minimizing a variational upper bound on the negative log-likelihood.
[0078] Loss Function
[0079]
[0080] In order to realize the three-dimensional model generated by text, the conventional approach is to use the GAN network model to generate two-dimensional images from text, and then Figure 3 The problem with using the dimensional reconstruction algorithm to build the model is that the accuracy of the generated model is too low and the process takes too long.
[0081] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems existing in the prior art are described in detail below with specific embodiments. It is understandable that in the embodiments of the present application, the execution subject can perform some or all of the steps in the embodiments of the present application, and these steps or operations are only examples. The embodiments of the present application can also perform other operations or deformations of various operations. In addition, each step can be performed in a different order presented in the embodiments of the present application, and it is possible not to perform all the operations in the embodiments of the present application. And, the following several specific embodiments can be combined with each other, and may not be repeated in some embodiments for the same or similar concepts or processes.
[0082] Figure 1 A flowchart of a text-driven 3D model generation method provided in the first embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes:
[0083] Step S101: extracting text information from the text;
[0084] Step S102: inputting the extracted text information into a pre-trained image generation model for image generation, wherein the image generation model adopts an improved diffusion model to perform a diffusion process in a low-dimensional latent space, thereby reducing training and reasoning costs;
[0085] Step S103: using the trained point cloud generation model to infer the generated image to generate a corresponding point cloud, wherein the point cloud generation model uses hash coding to optimize the sampling process during training and inference;
[0086] Step S104: mesh the point cloud to obtain a three-dimensional model.
[0087] By converting text data into 3D models, complex data sets, statistical information or scientific concepts can be better presented and understood. By creating virtual objects, scenes and environments, people can experience and interact with the virtual world more deeply. By scanning the objects described in the text, a 3D model of the object can be displayed in the real world to help people better understand and identify the objects, facilitating creative design and modeling.
[0088] However, the existing technologies have corresponding shortcomings in each process of converting text data into a three-dimensional model, such as:
[0089] 1) Nerf Technology
[0090] ① Disadvantages of the prior art:
[0091] Long running time: The inference process of NERF is relatively slow because it requires multiple sampling and reconstruction of each pixel. This makes NERF limited in its effectiveness in real-time applications and cannot meet the needs of real-time rendering.
[0092] Restrictions on scenes: NERF has many constraints on scenes. It is suitable for processing static and stationary scenes, but for dynamic or irregular scenes, such as moving objects or rapidly changing lighting conditions, NERF may not provide accurate reconstruction results.
[0093] Requires high-resolution input images: In order to obtain high-quality 3D reconstruction results, NERF requires high-resolution input images. This may lead to higher storage requirements and computational costs.
[0094] Text to image generation algorithm:
[0095] ① Disadvantages of the prior art:
[0096] Lack of authenticity: Current text-to-image algorithms often have difficulty producing realistic, authentic images. The generated images are often blurry, distorted, and incomparable to real-world images.
[0097] Semantic understanding limitations: Text-to-image algorithms have limited semantic understanding of the input text. Although they can generate relevant images based on keywords or descriptions, the algorithm has difficulty capturing the subtle differences and contextual information between texts, resulting in the generated images being inconsistent with user expectations.
[0098] Insufficient content creation capabilities: Existing algorithms still need to be improved in creating novel and diverse images. The generated images are often limited to the patterns and styles in the existing training data, and it is difficult to show unique creativity and imagination.
[0099] Diffusion Model:
[0100] ① Disadvantages of the prior art:
[0101] Data requirements: Diffusion models require a large amount of input data to estimate model parameters and initial conditions. However, obtaining accurate data can be difficult in some cases, especially when it comes to hard-to-measure factors such as individual behavior and attitudes.
[0102] Uncertainty: There is uncertainty in the diffusion model. Even if sufficient data and parameters are provided, the output of the model may still be affected by random factors. This uncertainty makes the prediction results have certain risks and need to be interpreted and used with caution.
[0103] Parameter selection: Diffusion models usually require assumptions about some parameter values, such as transmission rate, contact rate, etc. However, the selection of these parameters can be subjective and may vary from case to case. Incorrect parameter selection may lead to inaccurate model output.
[0104] In response to the above problems, the embodiments of the present disclosure address the problem of long Nerf running time. Hash coding technology is used to improve speed, and deep priors are used to improve the accuracy of the generation model. In response to problems in the image generation process, the deep learning model with the best processing effect currently (improved diffusion model) is used to improve image quality and realism. Collect larger and more diverse image data sets and combine them with data enhancement technology to achieve this. As for the shortcomings in the diffusion model, a more accurate network model is used to capture the complexity of the network and better describe the path of information propagation. Use more available data sources to optimize parameter estimation and model fitting processes. Use techniques such as Monte Carlo simulation to model uncertainty and provide prediction ranges under different scenarios.
[0105] In the specific process of realizing text-driven 3D model generation, text information extraction is first required, including:
[0106] 1) Data preprocessing: preparing and cleaning text data. This includes removing unnecessary characters, punctuation marks, and special symbols, performing word segmentation (dividing sentences into words or subwords), and performing operations such as case conversion and stop word removal as needed.
[0107] 2) Feature representation: Convert text into a vector representation that computers can understand. Word embedding is used. Word embedding is a technique that maps words to a continuous vector space, such as Word2Vec, GloVe, and BERT.
[0108] 3) Use deep learning models to process text data. Use convolutional neural networks (CNN) for processing, such as tokenization and vector encoding.
[0109] Then, the image generation stage is performed, and the extracted text information is input into a pre-trained image generation model for image generation. The image generation model adopts an improved diffusion model. The diffusion model is characterized by a slow reverse denoising process. The diffusion process is performed in the pixel space. When the image resolution increases, the speed becomes very slow. The embodiment of the present disclosure adopts an improved diffusion model to consider the diffusion process in a lower-dimensional latent space, which can greatly reduce the training and reasoning costs.
[0110] After the image is generated, the trained point cloud generation model is used to infer the generated image to generate the corresponding point cloud. The point cloud generation model uses hash coding to optimize the sampling process during training and inference. Using hash coding to optimize the sampling process: In NERF, a large number of light samples are required to estimate the color and depth values of each pixel. Hash coding can be used to optimize the sampling process. In the position encoding stage of Nerf, the traditional position encoding is changed to hash encoding. By mapping specific light directions to the hash table, unnecessary sampling operations can be effectively reduced.
[0111] In addition, the network structure of the initial Nerf model is lightweight, and the network depth and width are both reduced to half of the initial value. This method can accelerate the training and inference process of NERF. In addition, hash coding can also optimize storage and compression: the scene representation generated by NERF usually takes up a lot of storage space. Hash coding can be used to optimize the storage and compression of scene representation. By mapping the geometric information, texture information, etc. in the scene into a hash table and using a compact hash coding representation, the storage space occupied can be effectively reduced and the data transmission efficiency can be improved. After obtaining the point cloud data, the point cloud is meshed to obtain a three-dimensional model.
[0112] The disclosed embodiment complements each other through two methods. On the one hand, the algorithm uses hash coding to optimize the sampling process of Nerf and accelerate the process of scene reconstruction and image generation. On the other hand, during the training process, the improved diffusion model is used to perform the diffusion process in a low-dimensional latent space, reducing the amount of calculation and storage for image generation, and improving the efficiency of image generation. In addition, the improvement strategies of the two algorithms are independent of each other and gradually progress in logic. Not only does hash coding improve the accuracy and realism of scene reconstruction, but also improves the quality and fidelity of image generation. In addition, the improved diffusion model is used to improve the quality and diversity of image generation, and improve the creativity and flexibility of image generation.
[0113] Furthermore, the method further comprises:
[0114] The image generation model is constructed using the long short-term memory network LSTM;
[0115] Obtain an image generation training set, use the preprocessed text data in the training set as input and the image data as the target output to train the image generation model. During the training process, compare the corresponding image generated by the image generation model based on the input text with the target image in the training set to calculate the loss, and update the model weights through the back-propagation algorithm.
[0116] In the image generation stage, image generation is performed in the image generation model based on the text, including:
[0117] Building the model: The model is built using Long Short-Term Memory Network (LSTM), which has memory capability and can maintain contextual information while generating text.
[0118] Training model: Use preprocessed text data as input and image data as target output to train the model. During the training process, the model will generate corresponding images based on the input text, compare them with the target image to calculate the loss, and update the model weights through the back-propagation algorithm.
[0119] Generate images: After the model is fully trained, the text from which the text information is extracted is input into the trained model and the output of the model is used as the generated image.
[0120] Furthermore, the method further comprises:
[0121] Preprocess the training set images containing images and corresponding point cloud data;
[0122] Select the generative adversarial network (GAN) based on the convolutional neural network (CNN), and build a point cloud generation model by defining the network structure and loss function;
[0123] The cloud generation model is trained using the preprocessed training set images, including taking the images as input to generate point cloud data, and comparing the generated point cloud data with the corresponding point cloud data to optimize the model parameters.
[0124] In the point cloud generation stage, the generated image is inferred through the point cloud generation model to generate the corresponding point cloud, which specifically includes model training and point cloud generation processes, including:
[0125] 1) Data preprocessing: Preprocess the training set images containing images and corresponding point cloud data by resizing, normalizing, and other operations so that they can be input into the deep learning model.
[0126] 2) Build a deep learning model: Select a generative adversarial network (GAN) based on a convolutional neural network (CNN). Build a model by defining the network structure, loss function, etc.
[0127] 3) Training model: Use the training set to train the deep learning model. By taking the image as input and comparing it with the corresponding point cloud data, the model parameters are optimized so that it can generate a point cloud similar to the real point cloud data.
[0128] 4) Point cloud generation: Use the trained model to infer the new image and generate the corresponding point cloud. Input the image into the model and get the generated point cloud data through the output of the model.
[0129] Furthermore, the step of meshing the point cloud to obtain a three-dimensional model includes:
[0130] Data cleaning and preprocessing: Clean and preprocess point cloud data, including removing outliers, filling missing data or reducing noise;
[0131] Point cloud triangulation: By using the triangulation algorithm to connect the points in the point cloud into triangular patches, a continuous and non-overlapping triangular mesh is generated;
[0132] Surface reconstruction: Use surface reconstruction algorithms to estimate the continuity of point cloud surfaces and generate smoother and more accurate meshes;
[0133] Mesh optimization: Apply mesh optimization algorithms to improve the quality and topology of the mesh;
[0134] Post-processing and optimization: Post-process and optimize the generated mesh that meets the requirements, including smoothing the mesh surface, removing unnecessary details, optimizing the mesh topology, or applying texture mapping.
[0135] A point cloud is a data set of points in space that can represent a three-dimensional shape or object. By meshing the point cloud, a three-dimensional model can be obtained.
[0136] The point cloud meshing stage specifically includes:
[0137] Data cleaning and preprocessing: Point cloud data may contain noise, outliers, or missing data. Before meshing, data usually needs to be cleaned and preprocessed, including removing outliers, filling missing data, or reducing noise.
[0138] Point cloud triangulation: The points in the point cloud are connected into triangular patches using a triangulation algorithm (such as the Delaunay triangulation algorithm) to generate a continuous and non-overlapping triangular mesh.
[0139] Surface reconstruction: In general, point cloud data may not be sufficient for direct triangulation, or the quality of the triangulated mesh may be poor. In this case, a surface reconstruction algorithm can be used to estimate the continuity of the point cloud surface and generate a smoother and more accurate mesh. Commonly used surface reconstruction algorithms include Poisson reconstruction, Marching Cubes, etc.
[0140] Mesh optimization: The initial mesh generated usually has too many vertices, poor face quality, or unnecessary details. Apply mesh optimization algorithms to improve the quality and topology of the mesh. Mesh optimization algorithms can optimize the mesh by adjusting vertex positions, merging facets, or performing local refinement.
[0141] Post-processing and optimization: Once a satisfactory mesh is generated, some post-processing and optimization can be performed. For example, the mesh surface can be smoothed, unnecessary details can be removed, the mesh topology can be optimized, or texture mapping can be applied to obtain better visual effects or meet specific requirements.
[0142] Furthermore, the sampling process using hash coding optimization includes:
[0143] During the sampling process, the original position encoding is changed to hashencoding, so that the changed neural network obtains trainable encoding parameters θ in addition to the trainable weight parameters Φ. The encoding parameters θ have a total of L resolution levels, each level contains T feature vectors F with dimensions, each level is independent of each other, and conceptually stores the feature vectors at the vertices of the grid, and its resolution is selected as a geometric series between the coarsest and finest resolutions.
[0144] In NERF, a large number of light samplings are required to estimate the color and depth values of each pixel. Hash encoding can be used to optimize the sampling process. By mapping specific light directions into a hash table, unnecessary sampling operations can be effectively reduced. By changing the original position encoding to hash encoding, new encoding parameters can be obtained, where L, T, and F are set according to actual conditions. For example, L is 16 for the number of resolution levels, and T represents the number of feature vectors 2. 14 To 2 24 , F represents the dimension of the feature vector, which is 2. The resolution is the exponential power of 2, and the geometric series in the middle represents the exponential power of 2 between the two, such as Figure 2 As shown in the figure, two different boxes represent two different resolution levels. Avoid too small a resolution resulting in inaccurate point positions, and avoid too large a resolution resulting in no points in certain ranges, thus wasting computing resources.
[0145] This encoding method can skip a large number of blank areas, greatly reducing the computational complexity. At the same time, the depth and width of the fully connected network are halved, which also greatly reduces the number of parameters.
[0146] The disclosed embodiment can also introduce depth prior to supervise the Nerf reconstruction process, use the COLMAP algorithm to obtain a multi-view fused point cloud, and project the point cloud to each view to obtain the sparse depth of each view. In order to improve the sampling accuracy, the depth prior can be used to guide the sampling process of Nerf. First, the error map of the depth prior of each view is calculated based on the geometric consistency check. Specifically, the depth of each view is projected to other viewpoints and the relative error is calculated with the depth of other viewpoints. The sampling center point of each ray at each viewpoint in Nerf is the depth prior at the corresponding position, and the sampling range is determined by the error map. The smaller the error, the higher the confidence of the depth prior, and the smaller the sampling range; conversely, the larger the error, the lower the confidence of the depth prior, and the larger the sampling range.
[0147] To avoid scale ambiguity, a scale-invariant loss function is used:
[0148]
[0149] Furthermore, the diffusion process in the low-dimensional latent space reduces the training and reasoning costs, including:
[0150] Based on the initial diffusion model, VAE is used to convert the image into a low-dimensional representation, so that the diffusion process is carried out in the low-dimensional representation. After the diffusion is completed, it is decoded into a picture through the VAE decoder;
[0151] The improved diffusion model uses the U-Net network as the backbone network to predict the noise, thereby realizing the reverse denoising process, and uses the text encoder CLIP to convert the text into a representation form that can be understood by the U-Net, thereby guiding the U-Net to diffuse.
[0152] In the text-to-image algorithm, the BART model (a Sequence-to-Sequence model) is used to learn the mapping from text to image and convert text into discrete image representations. In the image generation step, the text can be directly input into BART to obtain the discrete representation of the image. Then, the VQ-GAN Decoder module is used to decode the discrete image representation into a complete image. After that, the image is screened using CLIP to obtain the final generation result.
[0153] When generating images, the diffusion model can generate data similar to the training data, but the characteristic of the diffusion model is that the reverse denoising process is slow. The diffusion process is carried out in the pixel space. When the image resolution increases, the speed will become very slow. The improved model guides sampling, such as Figure 3As shown in the figure, VAE is used to convert the image into a low-dimensional representation based on the initial diffusion model. As a result, the diffusion process is carried out in this low-dimensional representation, which can greatly reduce the training and reasoning costs.
[0154] Furthermore, the method further comprises:
[0155] We propose a method to search for the best sequence of time steps and compress the model architecture to achieve efficient image generation for the improved diffusion model.
[0156] The method of searching for the best sequence of time steps and compressed model architecture includes:
[0157] Design a unified search space covering all possible time steps and various architectures;
[0158] A two-stage evolutionary algorithm is introduced to find the best solution in the designed search space;
[0159] The performance on the sampled examples is estimated using the FID score between generated and real samples.
[0160] When performing image generation, we propose a method to search for the best sequence of time steps and compressed model architecture to achieve efficient image generation for diffusion models without further training. Specifically, we first design a unified search space containing all possible time steps and various architectures. Then, we introduce a two-stage evolutionary algorithm to find the best solution in the designed search space. To further accelerate the search process, the FID score between generated and real samples is used to estimate the performance of sampled examples.
[0161] The two-stage evolutionary algorithm divides the problem-solving process into two stages. In the first stage, the algorithm generates a series of possible solutions, which are screened and optimized in the second stage. The main purpose of this method is to improve search efficiency and optimization effect. Specifically, the network is divided into blocks and searches are performed within the blocks or units. Then, the identified units are used as building blocks to assemble large networks. This two-stage search strategy greatly reduces the size of the search space, thereby significantly accelerating the search algorithm.
[0162] A unified search space containing all possible time steps and various architectures is designed; during the evolutionary search process, given a trained diffusion model, candidates are randomly drawn from the search space to form the initial population. For each candidate, samples are generated using the candidate's time steps and the corresponding architecture. Afterwards, the FID score is calculated based on the generated samples. In each iteration, the top k candidates with the lowest FID scores are selected as parents, and crossover and mutation are applied to generate a new population. To perform crossover, time steps and model layers are randomly exchanged between two parent candidates. To implement mutation, a parent candidate is selected and its time steps and model layers are modified with probability p.
[0163] Improve the model algorithm such as Figure 4 As shown, the unified search space containing all possible time steps and various architectures is a search space composed of two orthogonal components: 1) a time search space with time steps as the search object; 2) a spatial search space with noise prediction network structure ∈ θ as the search object.
[0164] The search space is represented as {T = [T' 1 , T' 2 ,···,T' K ]; L = [l 1 i , l 2 i ,···,ln i i ]},0 <t i+1 '-t i ' <t T -t 1 , t i '∈[t 1 , t 2 ,···,t T ], i = 1, 2, ..., K}, T is the time step sequence after sampling, [T' 1 , T' 2 ,···,T' K ] is the original time step sequence [t 1 , t 2 ,···,t T ] is a subsequence of . L is the sampling architecture, where Li = [l 1 i , l 2 i ,···,ln i i ] is the time step t' i The architecture of the noise prediction model at time step t'i. ni is the number of layers of the architecture at time step t'i, which must not be greater than the number of layers ∈θ. Each lj i ∈L i Indicates that the time step is t′ i A layer of the noise prediction network ∈ θ, so L i It can be regarded as a subnetwork of ∈θ. In practice, we constrain the sum of the model layers at each time step to be no greater than N max , N max Determined based on expected generation rate from diffusion model.
[0165] The improved model has the following advantages: (1) it is orthogonal to most advanced diffusion samplers and can be integrated to obtain better sample quality; (2) it does not require training and can obtain the optimal time step and model architecture without any training process; (3) it is highly universal and the searched time step and architecture can be directly applied to different diffusion models with the same guidance scale.
[0166] The advantages are achieved in the following ways. First, uniform sampling or using a fixed function to sample time steps is suboptimal for diffusion models. Instead, it is proposed that there is an optimal sequence of time steps and the corresponding noise prediction network structure for each diffusion model. To facilitate this, a search space containing time steps and network architectures is proposed. The optimal candidates from this search space can effectively improve the sampling speed of diffusion models and complement the state-of-the-art samplers to improve sample quality. Then, a training-free framework is proposed to search the time steps and architectures of any given diffusion model in the search space. A two-stage evolutionary algorithm is used as the search strategy, and the FID score is used as the performance estimate of the candidates in the search space, thereby achieving an efficient search process. Moreover, experiments show that the method implemented by the present disclosure does not require training, is orthogonal to the state-of-the-art diffusion samplers, and has generalization, where the searched time steps and architectures can be directly applied to different diffusion models with the same guidance scale. The method achieves excellent performance using only a small number of time steps. By the above method, the sampler shows a significant enhancement in generation speed, achieving a 2-fold speedup compared to the sampler without the present method.
[0167] The two algorithms of the disclosed embodiments have their own advantages in their respective parts. First, hash coding can be used to optimize the sampling process of Nerf, reduce unnecessary sampling operations, and accelerate the training and inference process. Hash coding can also be used to optimize the storage and compression of scene representation, reduce the storage space occupied, and improve the efficiency of data transmission. The effects of hash coding on improving Nerf are as follows: 1. Improved the accuracy of scene reconstruction: Hash coding can better capture the details and textures in the scene, improve the accuracy and realism of scene reconstruction. 2. Reduced the cost of scene reconstruction: Hash coding can reduce the number of network parameters and the amount of calculation, and reduce the time and space cost of scene reconstruction.
[0168] Furthermore, the improved diffusion model considers the diffusion process in a lower-dimensional latent space, greatly reducing the training and inference costs. The improved diffusion model also proposes a method for searching the optimal time step sequence and compression model architecture to achieve effective image generation of the diffusion model without further training. The effects of the improved diffusion model are as follows: 1. Improved image generation quality: The improved diffusion model can perform more refined control in the latent space, improving the quality and diversity of image generation. 2. Reduced image generation cost: The improved diffusion model can perform the diffusion process in a lower-dimensional latent space, reducing the time and space cost of image generation. The improved diffusion model can also directly search for the optimal time step and model architecture without training, reducing the complexity and overhead of image generation.
[0169] The two improved algorithms are not simply superimposed, but complement each other. On the one hand, the algorithm uses hash coding to optimize the sampling process of Nerf and accelerate the process of scene reconstruction and image generation. On the other hand, during the training process, the improved diffusion model is used to perform the diffusion process in a lower-dimensional latent space, reducing the amount of calculation and storage for image generation, and improving the efficiency of image generation. In addition, the improvement strategies of the two algorithms are independent of each other and gradually progress in logic. Not only does hash coding improve the accuracy and realism of scene reconstruction, but also improves the quality and fidelity of image generation. In addition, the improved diffusion model is used to improve the quality and diversity of image generation, and improve the creativity and flexibility of image generation.
[0170] The application of the two algorithms alone can only bring limited improvements in specific areas, but cannot fully optimize the problem. The two improved algorithms focus on and improve different aspects of the problem. On the one hand, the use of hash coding only has an improvement effect on efficiency and training time, but the use of hash coding alone cannot improve the reconstruction effect in terms of precision and accuracy, and cannot produce complementary effects in input data processing, feature extraction, algorithm optimization and other links. The use of the improved diffusion model alone will introduce a large number of additional parameters, greatly increase the training time, and also have great limitations or deficiencies in the impact on the convergence speed, and the overall effect and performance cannot be fully improved. In addition, the use of the improved algorithm alone cannot further improve the effect of the improved algorithm through iterative optimization and mutual influence. In summary, the effect of the two algorithms complementing each other is better than the use of the two algorithms alone.
[0171] Figure 4 A text-driven 3D model generation system is provided in the second embodiment of the present disclosure, such as Figure 4 As shown, the system comprises:
[0172] A text processing module 11, which is configured to extract text information from the text;
[0173] A first generation module 12 is configured to input the extracted text information into a pre-trained image generation model for image generation, wherein the image generation model adopts an improved diffusion model to perform a diffusion process in a low-dimensional latent space to reduce training and reasoning costs;
[0174] A second generation module 13 is configured to use a trained point cloud generation model to infer the generated image to generate a corresponding point cloud, wherein the point cloud generation model uses hash coding to optimize the sampling process during training and inference;
[0175] The third generation module 14 is configured to perform point cloud meshing to obtain a three-dimensional model.
[0176] Furthermore, the first generating module 12 is further configured to:
[0177] The image generation model is constructed using the long short-term memory network LSTM;
[0178] Obtain an image generation training set, use the preprocessed text data in the training set as input and the image data as the target output to train the image generation model. During the training process, compare the corresponding image generated by the image generation model based on the input text with the target image in the training set to calculate the loss, and update the model weights through the back-propagation algorithm.
[0179] Furthermore, the second generating module 13 is further configured to:
[0180] Preprocess the training set images containing images and corresponding point cloud data;
[0181] Select the generative adversarial network (GAN) based on the convolutional neural network (CNN), and build a point cloud generation model by defining the network structure and loss function;
[0182] The cloud generation model is trained using the preprocessed training set images, including taking the images as input to generate point cloud data, and comparing the generated point cloud data with the corresponding point cloud data to optimize the model parameters.
[0183] Furthermore, the third generating module 14 is specifically configured as follows:
[0184] Data cleaning and preprocessing: Clean and preprocess point cloud data, including removing outliers, filling missing data or reducing noise;
[0185] Point cloud triangulation: By using the triangulation algorithm to connect the points in the point cloud into triangular patches, a continuous and non-overlapping triangular mesh is generated;
[0186] Surface reconstruction: Use surface reconstruction algorithms to estimate the continuity of point cloud surfaces and generate smoother and more accurate meshes;
[0187] Mesh optimization: Apply mesh optimization algorithms to improve the quality and topology of the mesh;
[0188] Post-processing and optimization: Post-process and optimize the generated mesh that meets the requirements, including smoothing the mesh surface, removing unnecessary details, optimizing the mesh topology, or applying texture mapping.
[0189] Furthermore, the sampling process using hash coding optimization includes:
[0190] During the sampling process, the original position encoding is changed to hashencoding, so that the changed neural network obtains trainable encoding parameters θ in addition to the trainable weight parameters Φ. The encoding parameters θ have a total of L resolution levels, each level contains T feature vectors F with dimensions, each level is independent of each other, and conceptually stores the feature vectors at the vertices of the grid, and its resolution is selected as a geometric series between the coarsest and finest resolutions.
[0191] Furthermore, the diffusion process in the low-dimensional latent space reduces the training and reasoning costs, including:
[0192] Based on the initial diffusion model, VAE is used to convert the image into a low-dimensional representation, so that the diffusion process is carried out in the low-dimensional representation. After the diffusion is completed, it is decoded into a picture through the VAE decoder;
[0193] The improved diffusion model uses the U-Net network as the backbone network to predict the noise, thereby realizing the reverse denoising process, and uses the text encoder CLIP to convert the text into a representation form that can be understood by the U-Net, thereby guiding the U-Net to diffuse.
[0194] Furthermore, the first generating module 12 is further configured to:
[0195] We propose a method to search for the best sequence of time steps and compress the model architecture to achieve efficient image generation for the improved diffusion model.
[0196] The method of searching for the best sequence of time steps and compressed model architecture includes:
[0197] Design a unified search space covering all possible time steps and various architectures;
[0198] A two-stage evolutionary algorithm is introduced to find the best solution in the designed search space;
[0199] The performance on the sampled examples is estimated using the FID score between generated and real samples.
[0200] The text-driven 3D model generation system of the disclosed embodiment is used to implement the text-driven 3D model generation method in method embodiment 1, so the description is relatively simple. For details, please refer to the relevant description in the previous method embodiment 1, which will not be repeated here.
[0201] In addition, if Figure 6 As shown, the third embodiment of the present disclosure further provides an electronic device, including a memory 100 and a processor 200, wherein the memory 100 stores a computer program, and when the processor 200 runs the computer program stored in the memory 100, the processor 200 executes the above-mentioned various possible methods.
[0202] The memory 100 is connected to the processor 200. The memory 100 may be a flash memory, a read-only memory or other memory, and the processor 200 may be a central processing unit or a single-chip microcomputer.
[0203] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the above-mentioned various possible methods.
[0204] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), Digital Video Disc (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0205] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A text-driven 3D model generation method. It is characterized in that The method comprises: Extract text information from the text; The extracted text information is input into a pre-trained image generation model for image generation. The image generation model adopts an improved diffusion model to perform a diffusion process in a low-dimensional latent space to reduce training and reasoning costs. Inferring the generated image using a trained point cloud generation model to generate a corresponding point cloud, wherein the point cloud generation model uses hash coding to optimize the sampling process during training and inference; The point cloud is meshed to obtain a three-dimensional model.
2. The method according to claim 1, It is characterized in that The method further comprises: The image generation model is constructed using the long short-term memory network LSTM; Obtain an image generation training set, use the preprocessed text data in the training set as input and the image data as the target output to train the image generation model. During the training process, compare the corresponding image generated by the image generation model based on the input text with the target image in the training set to calculate the loss, and update the model weights through the back-propagation algorithm.
3. The method according to claim 1, It is characterized in that The method further comprises: Preprocess the training set images containing images and corresponding point cloud data; Select the generative adversarial network (GAN) based on the convolutional neural network (CNN), and build a point cloud generation model by defining the network structure and loss function; The cloud generation model is trained using the preprocessed training set images, including taking the images as input to generate point cloud data, and comparing the generated point cloud data with the corresponding point cloud data to optimize the model parameters.
4. The method according to claim 1, It is characterized in that The step of meshing the point cloud to obtain a three-dimensional model includes: Data cleaning and preprocessing: Clean and preprocess point cloud data, including removing outliers, filling missing data or reducing noise; Point cloud triangulation: By using the triangulation algorithm to connect the points in the point cloud into triangular patches, a continuous and non-overlapping triangular mesh is generated; Surface reconstruction: Use surface reconstruction algorithms to estimate the continuity of point cloud surfaces and generate smoother and more accurate meshes; Mesh optimization: Apply mesh optimization algorithms to improve the quality and topology of the mesh; Post-processing and optimization: Post-process and optimize the generated mesh that meets the requirements, including smoothing the mesh surface, removing unnecessary details, optimizing the mesh topology, or applying texture mapping.
5. The method according to claim 1, It is characterized in that The sampling process using hash coding optimization includes: During the sampling process, the original position encoding is changed to hashencoding, so that the changed neural network obtains trainable encoding parameters θ in addition to the trainable weight parameters Φ. The encoding parameters θ have a total of L resolution levels, each level contains T feature vectors F with dimensions, each level is independent of each other, and conceptually stores the feature vectors at the vertices of the grid, and its resolution is selected as a geometric series between the coarsest and finest resolutions.
6. The method according to claim 1, It is characterized in that The diffusion process in the low-dimensional latent space reduces the training and reasoning costs, including: Based on the initial diffusion model, the variational autoencoder VAE is used to convert the image into a low-dimensional representation, so that the diffusion process is carried out in the low-dimensional representation. After the diffusion is completed, it is decoded into a picture through the VAE decoder; The improved diffusion model uses the U-Net network as the backbone network to predict the noise, thereby realizing the reverse denoising process, and uses the text encoder CLIP to convert the text into a representation form that can be understood by the U-Net, thereby guiding the U-Net to diffuse.
7. The method according to claim 6, It is characterized in that The method further comprises: We propose a method to search for the best sequence of time steps and compress the model architecture to achieve efficient image generation for the improved diffusion model. The method of searching for the best sequence of time steps and compressed model architecture includes: Design a unified search space covering all possible time steps and various architectures; A two-stage evolutionary algorithm is introduced to find the best solution in the designed search space; The performance on the sampled examples is estimated using the FID score between generated and real samples.
8. A text-driven 3D model generation system. It is characterized in that The system comprises: A text processing module configured to extract text information from the text; A first generation module is configured to input the extracted text information into a pre-trained image generation model for image generation, wherein the image generation model adopts an improved diffusion model to perform a diffusion process in a low-dimensional latent space to reduce training and reasoning costs; A second generation module is configured to use a trained point cloud generation model to infer the generated image to generate a corresponding point cloud, wherein the point cloud generation model uses hash coding to optimize the sampling process during training and inference; The third generation module is configured to mesh the point cloud to obtain a three-dimensional model.
9. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor runs the computer program stored in the memory, the processor executes the text-driven three-dimensional model generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the text-driven three-dimensional model generation method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Three-dimensional model driving method and device and electronic equipment
CN119722880A
Cryoelectron microscope density map data compression and decompression method and system
CN120416496A
