Three-dimensional scene consistency stylization method and system based on neural radiance field
Through mutual learning and conditional probability modeling of neural radiation field and 2D stylized model, the fuzzy problem of neural radiation field training in 3D scene stylization is solved, and the consistency of stylized results and high-quality 3D scene stylization effect are achieved. .
Patent Information
- Application Number
- CN202210517934.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-05-12
AI Technical Summary
In the three-dimensional scene stylization, the training of neural radiation fields cannot use large tiles to calculate stylization losses and content losses, resulting in fuzzy stylization results and lack of fine geometry and textures, and there is error in reliance on traditional point cloud geometry.
Using a three-dimensional scene consistency stylization method based on neural radiation field, we learn mutually through the 2D stylized model and the 3D neural radiation field, introduce learnable hidden variables of conditional probability modeling, calculate stylization and content loss, and use convolutional nerves. The network trains the neural radiation field to ensure consistency of the stylized results.
The consistency of stylized results from different perspectives is achieved, the fuzzy problem is reduced, the quality and accuracy of stylized results are improved, and the stylized losses and content loss calculations can be performed on consumer-grade GPUs.
Smart Images

Figure CN114926553B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geometric processing of computer graphics, and in particular to modeling and appearance editing of three-dimensional scenes. Background Art
[0002] Modeling and controlling the appearance of complex and realistic three-dimensional scenes has always been a very basic and important frontier hot issue in the field of computer vision and graphics. Among them, the stylization of three-dimensional scenes has great application prospects in games, movies, virtual reality, augmented reality and other fields. One of the research challenges of three-dimensional scene stylization is to control the appearance of the scene while maintaining the consistency of multiple perspectives. The existing technical method can extend stylization to three-dimensional scenes. The method uses feature point clouds to represent the scene and performs feature transformation through a deep network to achieve style transfer. When rendering the stylized image, the features are first projected onto the image plane, and then the stylized colors are regressed through a convolutional neural network. The existing technical method also uses NeRF (neural radiance field) to model and stylize the scene. A variational autoencoder is used to encode the style of a 2D image, and the encoded style is used as the input of NeRF to render the stylized image. Due to the memory limitation of the GPU, it is impossible to sample the entire image or large tiles during the training process. This method uses a subset sampling method to approximate a large tile with a small tile, and calculates the stylization loss and content loss on it. The stylization loss and content loss are obtained by extracting image features through the pre-trained convolutional neural network classifier VGG, and then calculating the distance between the stylization result and the channel-by-channel mean variance of the style image and the content image, as well as the feature distance.
[0003] The method proposed in the above-mentioned prior art requires explicit point cloud geometry as a proxy, but the acquisition of its point cloud relies on the traditional structure from motion (SfM) technology, which has geometric errors. At the same time, since it is difficult to train and optimize the position information of discrete point clouds, there are many geometric damages and inaccuracies in the stylized results. The other prior art mentioned above learns and optimizes the geometry through neural radiation fields. However, the neural radiation field used in this method has huge GPU memory overhead, and relies on small tiles that approximate large tiles to calculate stylization loss and content loss, resulting in a lack of fine geometry and texture in the stylized results. How to use neural radiation fields to optimize the geometric appearance of the scene while ensuring the accurate calculation of stylization loss and content loss to improve the quality of stylized results has become a focus of research. Summary of the invention
[0004] The purpose of the present invention is to overcome the problem that the training of neural radiance field in the three-dimensional scene stylization task cannot use large blocks to calculate the stylization loss and content loss for training, and the ambiguity caused by using 2D stylization methods to assist in training neural radiance field. Specifically, the present invention proposes a three-dimensional scene consistency stylization method based on neural radiance field, which includes
[0005] Step 1: Obtain a style image and a set of content images of the same scene from different perspectives;
[0006] Step 2: Use a feature extraction model to extract features from the content image and the style image respectively, to obtain content features of the content image and style features of the style image; align the mean and variance of the content features with the mean and variance of the style features through linear transformation, and perform a deconvolution operation on the content features after feature alignment through a convolutional network decoder to obtain a first stylized content image;
[0007] Step 3: The first stylized content image is subjected to the feature extraction model to extract intermediate features, and the L2 distance between the mean and variance of the intermediate features and the mean and variance of the style features is used as the stylization loss; the L2 distance between the intermediate features and the content features is used as the content loss, and the convolutional network decoder is trained by optimizing the content loss and the stylization loss to obtain an intermediate decoder with stylization capability;
[0008] Step 4: Render color images and depth images of the scene under multiple viewing angles through the neural radiation field. After extracting the features of each color image in turn through the feature extraction model and aligning them with the mean variance of the style features, use the intermediate decoder to restore the stylized second stylized content image. According to the depth and viewing angle of each second stylized content image, project the pixel points of the second stylized content image within a preset viewing angle range to the same viewing angle to obtain multiple color projection images and their corresponding depth projection images. According to the depth projection image, filter out the pixel points with too large depth difference in the color projection image, calculate the color error between the filtered color projection images as the consistency loss, and train the intermediate decoder through the consistency loss, the stylization loss and the content loss to obtain the final decoder.
[0009] Step 5: A group of content images of the same scene but different perspectives to be stylized are sequentially input into the feature extraction model and the final decoder to obtain a stylized image result.
[0010] The three-dimensional scene consistency stylization method based on neural radiation field, wherein the neural radiation field has a stylized color prediction module, and the training method of the neural radiation field includes:
[0011] The stylized color prediction module receives the spatial coordinate x and the latent vector representing the style, and outputs the radiation color of the spatial position under the style. During the training process, a latent variable l is assigned to each training sample. ij , each training sample consists of a content picture C i And style pictures S j Composition i ,S j};
[0012] The convolutional neural network classifier VGG classifies the content image C i After stylization, we get a stylized image The stylized color prediction module predicts the light R h The color c of each sampling point hk , the opacity σ of each sampling point is obtained through the geometric prediction module of the neural radiation field jk , combined along the direction of the light to obtain the light R h Color Where T k Indicates the occlusion coefficient of the sampling point before the kth sampling point corresponding to its own opacity, and based on the color Get stylized pictures
[0013] right Calculate its loss L mimic To constrain the stylized results of 2D and 3D radiation fields, L mimic For stylized pictures and stylized images The L2 distance between the two; the loss function of the neural radiation field training phase is: L mimic +λ d L d ; The loss function of the convolutional neural network classifier VGG training phase is: λ m L mimic +λ s L s +λ c L c ; where L s , L c is the stylization loss and the content loss, λ d、 λ m , s and λ c All are preset weights.
[0014] The three-dimensional scene consistency stylization method based on neural radiation field, in which a latent variable l is assigned to each training sample ij Specifically include:
[0015] S jThe feature encoding is mapped to the latent distribution For the latent vector l ij , calculate its negative log-likelihood loss during training To constrain the latent vector l ij Comply with the distribution
[0016] The present invention also proposes a three-dimensional scene consistency stylization system based on neural radiation field, which includes:
[0017] The initial module is used to obtain a style image and a set of content images of the same scene from different perspectives;
[0018] A linear transformation module is used to use a feature extraction model to extract features from the content image and the style image respectively, so as to obtain content features of the content image and style features of the style image; the content features are linearly transformed to align their mean and variance with the mean and variance of the style features, and a convolution network decoder is used to perform a deconvolution operation on the content features after feature alignment to obtain a first stylized content image;
[0019] A loss calculation module, configured to extract intermediate features from the first stylized content image through the feature extraction model, and use the L2 distance between the mean and variance of the intermediate features and the mean and variance of the style features as stylization loss; use the L2 distance between the intermediate features and the content features as content loss, and train a convolutional network decoder by optimizing the content loss and the stylization loss to obtain an intermediate decoder with stylization capability;
[0020] A training module is used to render color images and depth images of the scene under multiple viewing angles through a neural radiation field, extract features of each color image in turn through the feature extraction model, and align them with the mean variance of the style feature, and then use the intermediate decoder to restore them to a stylized second stylized content image; according to the depth and viewing angle of each second stylized content image, project the pixel points of the second stylized content image within a preset viewing angle range to the same viewing angle to obtain multiple color projection images and their corresponding depth projection images; according to the depth projection image, filter out pixels with too large depth differences in the color projection image, calculate the color error between the filtered color projection images as the consistency loss, and train the intermediate decoder through the consistency loss, the stylization loss and the content loss to obtain a final decoder;
[0021] The stylization module is used to sequentially input a group of content images of the same scene with different perspectives to be stylized into the feature extraction model and the final decoder to obtain a stylized image result.
[0022] The three-dimensional scene consistency stylization system based on neural radiation field, wherein the neural radiation field has a stylized color prediction module, and the training method of the neural radiation field includes:
[0023] The stylized color prediction module receives the spatial coordinate x and the latent vector representing the style, and outputs the radiation color of the spatial position under the style. During the training process, a latent variable l is assigned to each training sample. ij , each training sample consists of a content picture C i And style pictures S j Composition i , S j};
[0024] The convolutional neural network classifier VGG classifies the content image C i After stylization, we get a stylized image The stylized color prediction module predicts the light R h The color c of each sampling point hk , the opacity σ of each sampling point is obtained through the geometric prediction module of the neural radiation field jk , combined along the direction of the light to obtain the light R h Color Where T k Indicates the occlusion coefficient of the sampling point before the kth sampling point corresponding to its own opacity, and based on the color Get stylized pictures
[0025] right Calculate its loss L mimic To constrain the stylized results of 2D and 3D radiation fields, L mimic For stylized pictures and stylized images The L2 distance between the two; the loss function of the neural radiation field training phase is: L mimic +λ d L d ; The loss function of the convolutional neural network classifier VGG training phase is: λ m L mimic +λ s L s +λ c L c ; where L s , L c is the stylization loss and the content loss, λ d , m , s and λ c All are preset weights.
[0026] The three-dimensional scene consistency stylization system based on neural radiation field, in which a latent variable l is assigned to each training sample ij Specifically include:
[0027] S j The feature encoding is mapped to the latent distribution For the latent vector l ij , calculate its negative log-likelihood loss during training To constrain the latent vector l ij Comply with the distribution
[0028] The present invention also proposes a server for implementing any one of the three-dimensional scene consistency stylization methods based on neural radiation fields.
[0029] The present invention also proposes a storage medium for storing a program for executing the three-dimensional scene consistency stylization based on neural radiation field.
[0030] The present invention also proposes a client, which is used in any one of the three-dimensional scene consistency stylization systems based on neural radiation fields. The client is a mobile phone application APP or a computer application software.
[0031] It can be seen from the above scheme that the advantages of the present invention are:
[0032] The present invention introduces a strategy of mutual learning between a 2D stylized model and a 3D neural radiation field, so that the neural radiation field obtains accurate stylized supervision at the pixel level, while reducing the damage of the inconsistency of the 2D stylized model to the neural radiation field results. The learnable variables of the introduced conditional probability modeling further reduce the blur of the neural radiation field after learning the inconsistency of the 2D stylized results, and at the same time enable the neural radiation field to conditionally render the three-dimensional scene in a stylized manner. The present invention can model the stylized neural radiation field of the scene based on a set of style pictures and a set of pictures of the same scene from different perspectives. Given any new perspective of the scene and a style picture, a scene picture that meets the style effect of the style picture at that perspective can be rendered. The rendering results meet the consistency at different perspectives, and there will be no problem of large differences in rendering colors at the same position. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a framework diagram of the method of the present invention;
[0034] Figure 2 This is a comparison result diagram of the video stylization by the method of the present invention;
[0035] Figure 3 It is a comparison result diagram of the method of the present invention and LSNV;
[0036] Figure 4 This is a comparison diagram of the method of the present invention and SIRP. DETAILED DESCRIPTION
[0037] In view of the various limitations of the existing methods, the present invention improves the three-dimensional scene stylization algorithm from the perspective of accurate modeling and training strategies of three-dimensional scenes. One focus of the present invention is to use neural radiation fields to express three-dimensional scenes in a stylized manner, and at the same time use a 2D convolutional network and a 3D neural radiation field mutual learning method to train the model. The neural radiation field can accurately reconstruct the geometry and appearance of the scene, and has received widespread attention in recent years. However, there are huge technical challenges in the stylization training of neural radiation fields. On the one hand, the calculation of neural radiation fields requires huge video memory overhead. On a single consumer-grade NVIDIA graphics card RTX 2080Ti, at most 2048 rays of color can be accommodated. The stylization loss and content loss widely used in 2D images require larger tiles (512*512 rays) to be accurately calculated. If a strategy of using small tiles to approximate large images is used, it will lead to a loss of accuracy and effect. The present invention adopts a 2D-3D mutual learning strategy, introduces a 2D convolutional network to calculate the stylization loss and content loss on large tiles, and propagates the loss gradient to the neural radiation field through an alignment error. On the other hand, neural radiation fields are very sensitive to inconsistencies in training data, and the stylized results of 2D convolutional networks have serious inconsistencies due to the lack of spatial perception, which can easily cause serious blurring in the rendering results of neural radiation fields. In response to this challenge, the present invention introduces learnable latent variables of conditional probability modeling to represent inconsistencies, and uses a mutual learning mechanism to allow neural radiation fields to regulate the consistency of 2D convolutional networks, thereby avoiding blurring of results and supporting conditional stylization functions. Specifically, this application includes the following core technical points:
[0038] Key point 1: Stylized 3D scenes based on neural radiation field modeling. The geometry and stylized appearance of the radiation field are optimized through learning methods. Technical effect: Based on the modeling of neural radiation field, high-quality stylized pictures of the scene in different styles and different perspectives are calculated, and the consistency of the scene is maintained;
[0039] Key point 2: A mutual learning strategy between the stylized model of the 2D convolutional neural network and the 3D neural radiation field is introduced to propagate the stylized knowledge from the 2D model to the 3D radiation field, and to distill the spatial consistency prior from the 3D radiation field to the 2D stylized model. The technical effect is that the stylized loss and content loss of large tiles can be calculated on a single consumer-grade NVIDIA graphics card (such as RTX 2080Ti). The stylized knowledge contained in the loss function is propagated to the 3D radiation field to guide it to stylize spatial consistency, and a neural radiation field with stylized effects is obtained through training.
[0040] Key point 3: In order to solve the problem that the inconsistency of the stylized knowledge of the 2D stylized model will cause the output of the 3D neural radiation field to be blurred, a learnable latent vector of conditional probability modeling is introduced as the input of the stylized neural radiation field; the technical effect is that the learnable latent variables modeled by the variational autoencoder can learn the inconsistency of 2D stylization methods from different perspectives while ensuring that the 3D neural radiation field has a stylized effect, thereby avoiding the inconsistency being captured by the radiation field parameters and causing blur.
[0041] In order to make the above features and effects of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings.
[0042] The task of the present invention is to obtain a scene graph that satisfies the style effect of any stylized picture under any new perspective given a set of stylized pictures and a set of pictures of the same scene from different perspectives. In order to achieve this goal, the present invention introduces a mutual learning strategy to optimize the stylized neural radiation field and the 2D convolutional stylization model. In order to avoid the blurring of the neural radiation field rendering results caused by the inconsistency of the 2D convolutional model, two targeted strategies are used. One is to use the 3D consistency of the neural radiation field to train the 2D convolutional stylization model to reduce its inconsistency. The other is to introduce a learnable hidden variable of conditional probability modeling to capture the inconsistency, while allowing the neural radiation field to be conditionally rendered in a stylized manner.
[0043] The present invention uses a 2D convolutional neural network as a decoder and performs mutual learning with a neural radiation field NeRF. The 2D stylization model uses a pre-trained convolutional neural network classifier (VGG network) to extract the features of the content image and the style image. The features of the content image are linearly transformed to align their mean and variance with the mean and variance of the style image features. The content image features after feature alignment are input into a convolutional network decoder, and the stylized content image is restored through operations such as deconvolution. The stylized content image is then extracted through the VGG network to extract features, and the L2 distance between the mean and variance of its features and the mean and variance of the style image features is calculated as the stylization loss. The L2 distance between the features extracted by VGG of the stylized content image and the deep features extracted from the content image is used as the content loss. By optimizing these two losses, a decoder with stylization capability is trained. In order to enable the decoder to maintain good consistency to participate in the subsequent mutual learning process, the present invention first pre-trains the decoder for consistency. Through a trained neural radiation field, color images and depth images of the scene under multiple perspectives are rendered. The color images with similar shooting angles are extracted by VGG, and after aligning the mean variance of the style features, the decoder is used to restore the stylized content images. Since the depth and perspective of these images are known, the pixels of these images are reprojected to the same perspective to obtain reprojected color images and depth images. Special cases such as occlusion are filtered out by filtering out pixels with too large a depth difference after reprojection, and the color error between the filtered color images is calculated to obtain the consistency loss. In the consistency pre-training stage, the 2D convolution decoder is trained by combining three losses: consistency loss, stylization loss, and content loss.
[0044] The present invention adds an additional stylized color prediction module to the neural radiance field, which receives the spatial coordinate x and the latent vector l representing the style as input, and outputs the radiance color c of the spatial position under the style. Considering that the stylized images obtained by the 2D stylization method are not consistent, it is easy to cause the results of the neural radiance field to be blurred. Therefore, during the training process, the present invention introduces a learnable latent variable for each training sample. Each training sample consists of a content image C i And a style picture S j Composition i , S j}, the 2D stylized model stylizes the content image to obtain a stylized image Corresponding to the training sample, for each given a trainable latent vector l ij The stylized color prediction module of the neural radiance field predicts the ray R h The color c of each sampling point hkFinally, the opacity σ of the sampling point is predicted using the geometric prediction module of the original neural radiation field jk , combined along the direction of the light to obtain the color of the light in represents the occlusion coefficient of the sampling point before the kth sampling point due to its own opaque nature, c s The color prediction function representing the stylized neural radiance field, r hk represents the coordinates of the kth sampling point on the ray h, σ k Indicates the opacity of the kth sampling point, δ k Represents the distance between the kth sampling point and the next sampling point on the same ray. The training samples come from the 2D stylized model. Since each sample has its own learnable latent vector l ij , so the inconsistency between samples will not be learned by the shared neural radiation field coefficients, but will be more easily expressed in the latent vector l ij In order to make the neural radiation field conditionally stylized, the present invention uses the learnable latent vector l ih Conditional probability modeling is performed. In order to model the latent vector l ij and the condition variable S j The present invention introduces a variational autoencoder to transform the conditional variable S j Mapping to Gaussian distribution For the latent vector l ij , calculate its negative log-likelihood loss during training To constrain it to conform to the distribution Passing by L d Constraints, latent variables of the same style can be clustered into one category, ensuring that μ j As a conditional input to control the neural radiation field stylized rendering, it can achieve close to l at different viewing angles ij Controls the rendering results.
[0045] In the mutual learning stage, the stylized image obtained by the 2D convolutional stylization method Calculate its stylization loss L s and content loss L c , while adding an additional loss L mimic To constrain the stylization results of 2D methods and 3D radiation fields to be close. mimic =||SC 3D -SC 2D || 2 Defined as the L2 distance between the output of the 2D method and the output of the 3D method. This loss allows the 2D method to learn the consistency of the 3D radiation field. The stylized results obtained for the 3D radiation field Also use L mimic Constrain it with The distance is close. For the stylized module and learnable latent vector of the 3D radiation field, the loss function of the mutual learning stage is: L mimic +λ d L d For the 2D convolutional stylization method, the loss function of the mutual learning stage is: m L mimic +λ s L s +λ c L c . Where L s , L c is the stylization and content loss, defined as the feature variance extracted by VGG, the L2 distance of the mean, and the deep feature distance L s =∑ l ||var(VGG(SC 2D ) l )-var(VGG(S) l )|| 2 , L c =||VGG(SC 2D ) l′ -VGG(C) l′ || 2 , l′ represents the deep layer of VGG latent space, λ d ,λ s ,λ c is the weight coefficient of the loss term.
[0046] The framework of the whole method is as follows Figure 1 The process can be summarized as follows:
[0047] 1. Train a neural radiance field NeRF that represents the original scene.
[0048] 2. Render a series of new perspective images based on NeRF, and pre-train the 2D convolution decoder with stylized images. The training loss function uses stylization loss, content loss, and consistency loss.
[0049] 3. For style images, extract the style features using the pre-trained VGG network. Then train a variational autoencoder (VAE) to encode these features into the latent distribution.
[0050] 4. Initialize the stylized color prediction module for each stylized training sample {C i , S j}Give a learnable latent vector l ij , the latent vector is initialized by sampling from the corresponding latent distribution.
[0051] 5. In the training sample {C i , S j}, and the learnable latent variable l ij As the input of the neural radiation field, control the neural radiation field to render the color The 2D stylization result is Use L mimic , L d , L s , L c Optimizations to the 2D decoder and stylized neural radiance fields.
[0052] After training is completed, the trained stylized neural radiance field can be used for stylized rendering. The distribution mean obtained by VAE encoding of the specified style image is input into the stylized neural radiance field as the control vector. Sample the light at the specified angle, calculate the opacity and the color of the stylized radiance light, and then combine them to get the final color of the light. Render each image in this way.
[0053] The training and testing of stylized neural radiance fields are conducted on real 3D scene datasets, including the 360-degree unbounded scene dataset Tanks Templates and the forward-view scene dataset LLFF. Six scenes are tested in Tanks Templates, including: M60, Train, Truck, Playground, Friency, Family. Seven scenes are tested in LLFF.
[0054] Here we compare it with four related works, including two video stylization methods MCCNet and ReReVST, and two 3D scene stylization methods LSNV and SIRP. The comparison results with the video stylization methods are shown in the attached figure. Figure 2 As shown in the figure (the stylized effect display of this application needs to rely on color pictures to clearly reflect the picture style and stylized effect, so color pictures are used), the video stylization method has poor consistency for a long period of time and flickers. The physical rendering-based method of the present invention can fundamentally eliminate the occurrence of inconsistency. The comparison results with LSNV are as follows Figure 3 As shown in the figure, since LSNV uses a point cloud representation method, there will be omissions and inaccuracies in geometry, while the neural radiation field used in the present invention has an accurate modeling of the scene geometry. The comparison results with SIRP are shown in the figure. Figure 4 As shown in FIG. 1 , SIRP uses an approximate sampling method, resulting in a result in which detailed content is missing. The present invention adopts a mutual learning method, using larger blocks to calculate stylization loss and content loss on the 2D stylized result and transmitting them to the neural radiation field, thereby obtaining a more refined stylized result.
[0055] It can be seen from the results of the above stylization experiments that the method of stylized neural radiation field geometry proposed in the present invention can support users in efficiently stylizing scenes while ensuring ideal consistent stylization results, and has higher practical value and better performance than existing methods. The above implementation methods are only used to illustrate the present invention, but not to limit the present invention. Ordinary technicians in the relevant technical field can make various changes and deformations without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the present invention, and the scope of patent protection of the present invention should be defined by the claims.
[0056] The following is a system embodiment corresponding to the above method embodiment. This embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment. In order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.
[0057] The present invention also proposes a three-dimensional scene consistency stylization system based on neural radiation field, which includes:
[0058] The initial module is used to obtain a style image and a set of content images of the same scene from different perspectives;
[0059] A linear transformation module is used to use a feature extraction model to extract features from the content image and the style image respectively, so as to obtain content features of the content image and style features of the style image; the content features are linearly transformed to align their mean and variance with the mean and variance of the style features, and a convolution network decoder is used to perform a deconvolution operation on the content features after feature alignment to obtain a first stylized content image;
[0060] A loss calculation module, configured to extract intermediate features from the first stylized content image through the feature extraction model, and use the L2 distance between the mean and variance of the intermediate features and the mean and variance of the style features as stylization loss; use the L2 distance between the intermediate features and the content features as content loss, and train a convolutional network decoder by optimizing the content loss and the stylization loss to obtain an intermediate decoder with stylization capability;
[0061] A training module is used to render color images and depth images of the scene under multiple viewing angles through a neural radiation field, extract features of each color image in turn through the feature extraction model, and align them with the mean variance of the style feature, and then use the intermediate decoder to restore them to a stylized second stylized content image; according to the depth and viewing angle of each second stylized content image, project the pixel points of the second stylized content image within a preset viewing angle range to the same viewing angle to obtain multiple color projection images and their corresponding depth projection images; according to the depth projection image, filter out pixels with too large depth differences in the color projection image, calculate the color error between the filtered color projection images as the consistency loss, and train the intermediate decoder through the consistency loss, the stylization loss and the content loss to obtain a final decoder;
[0062] The stylization module is used to sequentially input a group of content images of the same scene with different perspectives to be stylized into the feature extraction model and the final decoder to obtain a stylized image result.
[0063] The three-dimensional scene consistency stylization system based on neural radiation field, wherein the neural radiation field has a stylized color prediction module, and the training method of the neural radiation field includes:
[0064] The stylized color prediction module receives the spatial coordinate x and the latent vector representing the style, and outputs the radiation color of the spatial position under the style. During the training process, a latent variable l is assigned to each training sample. ij , each training sample consists of a content picture C i And style pictures S j Composition i , S j};
[0065] The convolutional neural network classifier VGG classifies the content image C i After stylization, we get a stylized image The stylized color prediction module predicts the light R h The color c of each sampling point hk , the opacity σ of each sampling point is obtained through the geometric prediction module of the neural radiation field jk , combined along the direction of the light to obtain the light R h Color Where T k Indicates the occlusion coefficient of the sampling point before the kth sampling point corresponding to its own opacity, and based on the color Get stylized pictures
[0066] right Calculate its loss L mimicTo constrain the stylized results of 2D and 3D radiation fields, L mimic For stylized pictures and stylized images The L2 distance between the two; the loss function of the neural radiation field training phase is: L mimic +λ d L d ; The loss function of the convolutional neural network classifier VGG training phase is: λ m L mimic +λ s L s +λ c L c ; where L s , L c is the stylization loss and the content loss, λ d , m , s and λ c All are preset weights.
[0067] The three-dimensional scene consistency stylization system based on neural radiation field, in which a latent variable l is assigned to each training sample ij Specifically include:
[0068] S j The feature encoding is mapped to the latent distribution For the latent vector l ij , calculate its negative log-likelihood loss during training To constrain the latent vector l ij Comply with the distribution
[0069] The present invention also proposes a server for implementing any one of the three-dimensional scene consistency stylization methods based on neural radiation fields.
[0070] The present invention also proposes a storage medium for storing a program for executing the three-dimensional scene consistency stylization based on neural radiation field.
[0071] The present invention also proposes a client, which is used in any one of the three-dimensional scene consistency stylization systems based on neural radiation fields. The client is a mobile phone application APP or a computer application software.
Claims
1. A 3D scene consistency stylization method based on neural radiance field, characterized in that: include Step 1: Obtain a style image and a set of content images of the same scene from different perspectives; Step 2: Use a feature extraction model to extract features from the content image and the style image respectively, to obtain content features of the content image and style features of the style image; align the mean and variance of the content features with the mean and variance of the style features through linear transformation, and perform a deconvolution operation on the content features after feature alignment through a convolutional network decoder to obtain a first stylized content image; Step 3: The first stylized content image is subjected to the feature extraction model to extract intermediate features, and the L2 distance between the mean and variance of the intermediate features and the mean and variance of the style features is used as the stylization loss; the L2 distance between the intermediate features and the content features is used as the content loss, and the convolutional network decoder is trained by optimizing the content loss and the stylization loss to obtain an intermediate decoder with stylization capability; Step 4: Render color images and depth images of the scene under multiple viewing angles through the neural radiation field. After extracting the features of each color image in turn through the feature extraction model and aligning them with the mean variance of the style features, use the intermediate decoder to restore the stylized second stylized content image. According to the depth and viewing angle of each second stylized content image, project the pixel points of the second stylized content image within a preset viewing angle range to the same viewing angle to obtain multiple color projection images and their corresponding depth projection images. According to the depth projection image, filter out the pixel points with too large depth difference in the color projection image, calculate the color error between the filtered color projection images as the consistency loss, and train the intermediate decoder through the consistency loss, the stylization loss and the content loss to obtain the final decoder. Step 5: A group of content images of the same scene but different perspectives to be stylized are sequentially input into the feature extraction model and the final decoder to obtain a stylized image result.
2. The method for stylizing a three-dimensional scene based on neural radiation field according to claim 1, characterized in that: The neural radiance field has a stylized color prediction module, and the training method of the neural radiance field includes: The stylized color prediction module receives the spatial coordinate x and the latent vector representing the style, and outputs the radiation color of the spatial position under the style. During the training process, a latent variable l is assigned to each training sample. ij , each training sample consists of a content picture C i And style pictures S j Composition i ,S j }; The convolutional neural network classifier VGG classifies the content image C i After stylization, we get a stylized image The stylized color prediction module predicts the light R h The color c of each sampling point hk , the opacity σ of each sampling point is obtained through the geometric prediction module of the neural radiation field jk , combined along the direction of the light to obtain the light R h Color Where T k Indicates the occlusion coefficient of the sampling point before the kth sampling point corresponding to its own opacity, and based on the color Get stylized pictures right Calculate its loss L mimic To constrain the stylized results of 2D and 3D radiation fields, L mimic For stylized pictures and stylized images The L2 distance between the two; the loss function of the neural radiation field training phase is: L mimic +λ d L d ; The loss function of the convolutional neural network classifier VGG training phase is: λ m L mimic +λ s L s +λ c L c ; where L s ,L c is the stylization loss and the content loss, λ d , m , s and λ c All are preset weights.
3. The method for stylizing a three-dimensional scene consistency based on a neural radiation field according to claim 2, characterized in that: Assign a latent variable l to each training sample ij Specifically include: S j The feature encoding is mapped to the latent distribution For the latent vector l ij , calculate its negative log-likelihood loss during training To constrain the latent vector l ij Comply with the distribution 4. A three-dimensional scene consistency stylization system based on neural radiation field, characterized in that: include The initial module is used to obtain a style image and a set of content images of the same scene from different perspectives; A linear transformation module, used to use a feature extraction model to perform feature extraction on the content image and the style image respectively, to obtain content features of the content image and style features of the style image; The content features are linearly transformed to align their mean and variance with the mean and variance of the style features, and the convolutional network decoder is used to perform a deconvolution operation on the aligned content features to obtain a first stylized content image. A loss calculation module, configured to extract intermediate features from the first stylized content image through the feature extraction model, and use the L2 distance between the mean and variance of the intermediate features and the mean and variance of the style features as stylization loss; use the L2 distance between the intermediate features and the content features as content loss, and train a convolutional network decoder by optimizing the content loss and the stylization loss to obtain an intermediate decoder with stylization capability; A training module is used to render color images and depth images of the scene under multiple viewing angles through a neural radiation field, extract features of each color image in turn through the feature extraction model, and align them with the mean variance of the style feature, and then use the intermediate decoder to restore them to a stylized second stylized content image; according to the depth and viewing angle of each second stylized content image, project the pixel points of the second stylized content image within a preset viewing angle range to the same viewing angle to obtain multiple color projection images and their corresponding depth projection images; according to the depth projection image, filter out pixels with too large depth differences in the color projection image, calculate the color error between the filtered color projection images as the consistency loss, and train the intermediate decoder through the consistency loss, the stylization loss and the content loss to obtain a final decoder; The stylization module is used to sequentially input a group of content images of the same scene with different perspectives to be stylized into the feature extraction model and the final decoder to obtain a stylized image result.
5. The three-dimensional scene consistency stylization system based on neural radiation field according to claim 4, characterized in that: The neural radiance field has a stylized color prediction module, and the training method of the neural radiance field includes: The stylized color prediction module receives the spatial coordinate x and the latent vector representing the style, and outputs the radiation color of the spatial position under the style. During the training process, a latent variable l is assigned to each training sample. ij , each training sample consists of a content picture C i And style pictures S j Composition i ,S j }; The convolutional neural network classifier VGG classifies the content image C i After stylization, we get a stylized image The stylized color prediction module predicts the light R h The color c of each sampling point hk , the opacity σ of each sampling point is obtained through the geometric prediction module of the neural radiation field jk , combined along the direction of the light to obtain the light R h Color Where T k Indicates the occlusion coefficient of the sampling point before the kth sampling point corresponding to its own opacity, and based on the color Get stylized pictures right Calculate its loss L mimic To constrain the stylized results of 2D and 3D radiation fields, L mimic For stylized pictures and stylized images The L2 distance between the two; the loss function of the neural radiation field training phase is: L mimic +λ d L d ; The loss function of the convolutional neural network classifier VGG training phase is: λ m L mimic +λ s L s +λ c L c ; where L s ,L c is the stylization loss and the content loss, λ d , m , s and λ c All are preset weights.
6. The three-dimensional scene consistency stylization system based on neural radiation field according to claim 5, characterized in that: Assign a latent variable l to each training sample ij Specifically include: S j The feature encoding is mapped to the latent distribution For the latent vector l ij , calculate its negative log-likelihood loss during training To constrain the latent vector l ij Comply with the distribution 7. A server for implementing any one of the neural radiation field-based three-dimensional scene consistency stylization methods of claims 1 to 3.
8. A storage medium for storing a program for executing any one of the neural radiation field-based three-dimensional scene consistency stylization methods of claims 1 to 3.
9. A client, used to implement any one of the neural radiation field-based three-dimensional scene consistency stylization systems in claims 4 to 6.
10. The client according to claim 9, characterized in that The client is a mobile application APP or computer application software.
